You are viewing archived messages.
Go here to search the history.

Stephen De Gabrielle 2024-03-13 11:40:19

Does a ~parametric IDE~ exist?

I’m not sure if this makes sense, but I’m thinking similar to Parametric CAD tools(&sketchpad), but for code?

Maybe making use of type annotations, contracts, interfaces, etc. at ~edit-time~ (instead waiting for ~compile-time~ or ~run-time~ ).

Kirill Chernyshov 2024-03-13 12:37:16

to some degree tools based on web stack offer parametrisation via extensions. For example there are plugins for VSCode to visualise complex data pipelines for enso lang

Another example is Matlab IDE

Ivan Reese 2024-03-13 12:37:21

Does smalltalk count? What about emacs? You might need to expand on what "parametric" means in the context of code, as opposed to CAD tools.

Stephen De Gabrielle 2024-03-13 13:32:03

I’ll have to try matlab I have not looked at in decades

Stephen De Gabrielle 2024-03-13 13:33:41

Ivan Reese I don’t know. I don’t know what has been done and what is possible?

George Campbell 2024-03-13 15:38:55

I’m thinking prolog (or other logic languages). There are a set of facts (these lines are parallel) then the engine solves for the shape that fits

Daniel Sosebee 2024-03-13 17:30:17

I really like this thought and have been thinking about something similar: an IDE that does macro expansion across different files and supports direct manipulation of expanded code.

So I want to view my code side-by-side-by-side at different levels of abstraction - on the left high-level abstractions, on the right “derived” (built?) code. But it doesn’t have to be just one source and one build, there would be arbitrary number of layers. And then I can imagine direct manipulation of expanded/built code. Perhaps when you focus on a line of code, all upstream dependencies are brought into view. This allows you to choose the level of abstraction on which to make the edit. If you choose to edit derived code, then that automatically clones the current function scope.

Something about that feels kinda similar to a CAD function tree. Anyways, just throwing ideas out 🙂

Konrad Hinsen 2024-03-14 08:32:30

Me too! I have been dreaming of managing code at multiple levels of abstraction as well. However, I see the higher levels of abstractions as specifications, not traditional code, and the IDE integrating a model checker.

Tudor Girba 2024-03-14 09:48:09

@Stephen De Gabrielle I am not quite sure what you mean by parametric, but Glamorous Toolkit was built exactly so that it can be molded for every development problem. We literally change the tool while we program. And this leads to a new way of programming.

Kongwei Ying 2024-03-15 11:41:13

@Daniel Sosebee Let me know if this is what you're looking for, but I believe the term is transclusion. This is having code in one place, and then referencing it in another. In that other reference, which is called a transclusion, it's possible to edit the original code. It's a bit like a portal to another location. And this transclusion can be viewed in different ways, for example just as a function name, or as a short preview, or even the entire piece of code. These are different levels of abstractions.

Daniel Sosebee 2024-03-15 14:37:43

Hm cool I’ve come across transclusion with reference to media, but haven’t thought about it with regards to code. Yeah that might be exactly what I’m thinking of, good transclusion tools in an IDE, mixed with some controls for editing transcluded code and forking it in-scope rather than editing the global source of the transcluded code.

Konrad Hinsen 2024-03-15 15:09:58

Glamorous Toolkit has transclusion. For example, you can reference a method of a class in a notebook, and get it shown there in a fully functional editor.

Daniel Sosebee 2024-03-15 15:13:46

Wow yeah glamorous toolkit seems really cool. Do you use it / know of people who use it regularly?

Tudor Girba 2024-03-15 15:19:35

@Daniel Sosebee We use it regularly 🙂. There is a community around it and there are a couple of companies that use it, too. If you are interested, I’d be happy to show you around.

Daniel Sosebee 2024-03-15 15:20:50

Yeah that would be awesome! Will DM you.

Konrad Hinsen 2024-03-16 05:37:16

I use it regularly as well. Be warned that it is addictive.

🕰️ 2024-02-11 07:19:52


Kongwei Ying 2024-03-15 11:59:21

The best way I would describe it is like this. Let's say that reality is like a state computation machine. How would it be possible to create a more accurate model of reality than we have currently? It would have to go beyond words, and would have to include visual, kinaesthetic constructs. It would have to be a higher dimensional representation, to the extent that we as humans can perceive a higher dimensional representation. So this means, higher than the 1D text we have, or its 2D UI, single frame in time representation. This would look like some kind of 4D temporal model, where it's possible to see the execution of a program in its entirety, all at once.

It would not only show semantic relationships in a graph sense, but also model the data structures and their operation over time. So the idea of "stocks" of data, and "flows" of data (from Donella Meadows, Systems Thinking) would apply here. React.useState might be represented as a small orb of energy, and if we setState, then it would visually change. When we assign const a = b, then it would visually indicate a flow of information from b -> a. I think this would be a much clearer representation of what a program is doing, and free up cognitive load to focus on more important tasks, as opposed to the programmer having to hold a mental model in their head. No matter how good a programmer is, if he or she possesses a better more accurate kinesthetic model of what is happening, their brain power is freed up to solve more problematic and relevant abstractions.

I've been mocking up a prototype of how this would work, and the basic idea is overlaying a tool like VSCode with "vibes" as well as flow relations. It's like an annotation layer over existing code, but this is just the basic start of how it would look like. Ultimately, it would look like a mini universe. for a non-programming context demonstration of what I'm talking about.

Kongwei Ying 2024-03-15 12:15:01

Another concept I've been ideating about is how to bring Literate Programming, by Donald Knuth, into my daily work, which involves modern tools and stacks like VSCode and Node.js. I believe inline, rich text snippets which are integrated with some kind of personal knowledge management system is the way to go. This way, instead of having comments like this:

// TODO: Refactor this to use the revised approach

It instead would look like using Notion or Obsidian inside VSCode. So above a function, would be a small window into a single page that describes a single function. You can do anything here, like linking references that are relevant to the design of the function. Or you could even have a lengthy design document that explains why a function was written a certain way. Going even further, you could have a page which describes the evolution of a function over time, why at the beginning it was written a certain way, why changes had to be made, and why it looks the way it looks right now.

And added bonus of this approach is that now it's possible to have a single source of truth for docs and your code. So rather than maintaining a separate Docusaurus that has to be updated to sync it with evolution in code, you can just maintain documentation in line. And then to publish developer docs online, you merely just take all the little snippets above each function and then aggregate them onto a single page.

Shalabh 2024-03-16 00:35:09

To expand on this - can we also use hyperlinks to represent links within the code itself? Eg if you have a type annotation a: TheType , then TheType is not a piece of text but a hypertext link to the type definition. These would be resolved at edit time. Same with method calls that can be resolved. Dynamic dispatch / abstract classes can be represented by a link to the base definition.

Kongwei Ying 2024-03-17 05:50:53

That'd be useful. It'd be a type of transclusion then. Instead of having to refactor the class name, or type name, whenever you edit the name, it's editing all instances all at once.

Kongwei Ying 2024-03-15 12:17:20

Basically, this approach is powerful because instead of 1D strings of text, now you can have the power of rich text in your code. Including diagrams, and even embedding other programs through <iframes> would be possible. And when your code needs to be compiled, all these rich text snippets are simply removed.