Β Ξ Β
π VSCode is itself a JavaScript REPL π
A meta-extension for VSCode that makes VSCode into a living, breathing, JS interpreter: It can execute arbitrary JS that alters VSCode on-the-fly. A gateway into the world of Editor Crafting!
(Inspired by using Emacs and Lisp!) |
1. How do people usually code?
Either you,
- Use a code editor and edit multiple lines, then jump into a console to try out what you wroteβ³, or
- You use an interactive command line, and work with one line at a time —continuously editing & evaluating π
The first approach sucks cause your code and its resulting behaviour occur in different places π’ The second is only realistic for small experimentation —after all, you're in a constrained environment and don't generally have the same features that your code editor provides π§ββοΈ
2. If only we could have our cake, and eat it too! π°
With the VSCode Easy-Extensibility extension, we get both approaches! No need to
switch between the two any more! Just select some code and press Cmd+E
---E for
Evaluate! π
Why the strange name? Why isn't this extension called something more
informative, such as JS-repl-to-the-moon
? π Take another look at the above gif
πΌ Besides plain old JavaScript, this extension let's us alter VSCode itself!!
(It's a meta-extension! π²)
Intro to Easy-Extensibility
3. Technically speaking, how is VSCode itself the REPL?
Let's do what math-nerds call proof by definition-chasing:
- Definition: REPL, an alias for command line, stands for Read-Evaluate-Print-Loop
Cmd+E
will echo the results in the notification area, in the bottom right-corner of VSCode- So it retains each of the read, eval, and print parts of the Read-Evaluate-Print-Loop
- Moreover, since the program doesn't terminate, you're still in the loop part until you close VSCode
Bye! π π₯³
Generated by Emacs and Org-mode (β’Μα΄β’Μ)Ω
Life & Computing Science by Musa Al-hassy is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License