[LANGUAGE idea] Add more levels up to systems language; add memory layout diagrams #5036
Replies: 2 comments
-
Thanks for the cool ideas @feefladder! This fits in a bit with some other discussions like #4040 and #4569. While I love this direction at the moment we don't have the bandwidth to support other "Hedy's" with the core team. But if you would want to explore or prototype it, we would be excited and happy to share some brain cycles! |
Beta Was this translation helpful? Give feedback.
-
Whoops, actually I had two ideas here:
Actually, for 1. I think there are actually already great tools out there. Maybe a page at the end with links could be nice? For Rust, there is rustlings, which is similar, but requires a CLI and IDE setup. or Rust by example, which works in-browser. I also don't have that much bandwidth atm, so wouldn't be able to prototype anytime soon, sorry... |
Beta Was this translation helpful? Give feedback.
-
Language idea incl level
First off: Hedy is great! I know it's not the target audience of Hedy, but it would be nice to have some recommendations/tutorials on how to continue. Also, Hedy builds towards Python, but the same concept could be very well used to easily change to other languages that are closer to machine language. The thing is: people learn to script, but they don't necessarily learn how a computer works, compilation, memory layout, etc. I think some concepts here are very important for general scripting. Below is a
In terms of closeness, I would make this (very opinionated) list:
This is of course an pure text representation, but having a funky data layout is also there in e.g. RStudio. What would be cool, would be to change this data layout to a memory layout and then animate what a function (or code) does to that data. Consider the following program:
Now, debugging looks like:
animals: [cat, deer, cow]; animal: cat
This could be made fancier when passing arguments by value like:Or keep it in the same place, but put an animation (the arrows are animated):
Then passing by (immutable) reference would look like:
Then the full memory layout (in Rust, at least) would be:
Now strings are always heap-allocated, so that's not really a good example, but imagine they're not and are copied to animal, then (arrows are animated):
Of course, this may be too in-depth for kids, but high-school students would enjoy it, or at least it'd be a nice debugging tool for devs even.
Additional context
I'm a Python/C++/Javascript programmer learning Rust. I've recently come across Hedy while already thinking of making memory layouts easier to grasp. I'm a huge fan of typeable diagrams and think all diagrams should be on a monospace font grid so there is a one-to-one GUI-text mapping. Ideally, this would also imply a one-to-one program<->diagram mapping, but that is much more difficult.
Beta Was this translation helpful? Give feedback.
All reactions