4 ms·
In VSCode when my cursor is inside an s-exp, i can press Alt+Shift+E and it instantaneously shows the result of that call inline in the editor. If i change the
by CraigJPerry 4y ago
In VSCode when my cursor is inside an s-exp, i can press Alt+Shift+E and it instantaneously shows the result of that call inline in the editor.
If i change the code at all, i just press the same key combo and see the new result. It remembers all the state of what i've done up to that point too so i don't need to mess around setting up the call with data to feed in for example.
The closest i can find to replicating this is the various hot-reload implementations in other languages but they all incur some kind of delay (naturally, because they're all doing a lot more work behind the scenes) which ruins the use of this feature, it stops you using it to evaluate your thought process in realtime. They also don't render the results inline - mostly because the syntax of JS/TS and other languages doesn't really lend itself to this kind of usage.
- darthrupert 4y agoJupyter notebooks manage to replicate a somewhat similar experience.
- CraigJPerry 4y agoHmmm, somewhat but it’s missing the ergonomics to the point that it can’t be used the same way. The best analogue i can come up with is a sql session connected to a live database.
- pjmlp 4y agoIt is a nice approximation, but fails short of the whole experience. Imagine that your shell was like those notebooks, and not only you can interact with the whole OS, you can even change existing notebooks dynamically by reloading code that they depend on, e.g. a displayed image gets a new effect added to it.
- greymalik 4y agoWhat extensions are you using for this?
- CraigJPerry 4y agohttps://github.com/nobody-famous/alive https://github.com/nobody-famous/alive
- kkfx 4y agoIn Emacs you can execute sexps anywhere with C-x C-e (eval-last-sexp) it's common in all classic environment treat code as a live thing, text as a live thing. A feature lost in most modern software.