5 ms·
How is REPL not a built-in feature of node ? Adding a REPL to any interpreted dynamic language should be trivial.
by rubber_duck 6y ago
How is REPL not a built-in feature of node ? Adding a REPL to any interpreted dynamic language should be trivial.
- p_l 6y agoSemantics of execution can vary wildly. Node is somewhat usable except for the "REPL is not async context" which leads to annoying tricks, but for example Python is very non interactive due to code reload behaviour
- pletnes 6y agoPip install ipython and enable autoreload. Problem solved!
- p_l 6y agoTried that, didn't work. Maybe I'm just too used to Lisps (and Ruby, which also handled it better)
- rubber_duck 6y ago>Node is somewhat usable except for the "REPL is not async context" which leads to annoying tricks What do you mean by this ? It's been a while since I was able to use await in REPL, maybe you are referring to something else ?
- p_l 6y agoWas either Node v10 or v12 (I suspect the latter), as it was in december 2019 or so and I tended to use latest stable. Await in REPL definitely didn't work, maybe there's tooling to fix that? Unfortunately Node is not my main, or even third-line tool, but I had to work with Strapi and it was definitely a common issue that I couldn't use "await" on a function.
- vinceguidry 6y agoWell, for one, Node's REPL is horrible. The big main issue is that Javascript's architecture relying heavily on concurrency will break your workflow in all sorts of ways. Ruby's pry has been around longer than NodeJS. It's rock solid.
- rubber_duck 6y agoI have to admit I don't use node REPL a lot but what issues are you having ? Once they added await to REPL I didn't really have issues with testing async code, but again I only did small projects with node.
- vinceguidry 6y agoIt's been a solid year since I messed with Node, and I refuse to use it again, so don't have anything concrete.
- hardwaregeek 6y agoRails has another degree of REPL in the console, which allows you to execute Ruby with all of the Rails libraries loaded. I can't count the number of times being able to debug on Rails console has saved me.