HACKER Q&A
📣 HexDecOctBin

Do any embedded languages support REPL-driven development?


Languages like Lua are often used for embedded scripting to enable faster turn-around time. Ironically, most of these languages do not support a proper Lisp/Smalltalk-style REPL-driven development that can actually help in making the development process faster.

From what I understand, to enable REPL-driven development, a language (or rather, its implementation) would have to satisfy these conditions:

   1. Allow user to (re)define a function when encountering an error, without unwinding the stack.
   2. Allow user to re-execute the operation that triggered the error.
Most runtimes, whether they belong to compiled or interpreted languages, do not support either of these operations.

On the other hand, to be considered a embedded language, an implementation would haver to satisfy the following:

   1. Light weight: Low memory and CPU usage
   2. Portable: Builds everywhere natively, on each OS and hardware. No Cygwin! Yes C API!
   3. Re-entrant and threadsafe: To allow clean multi-threading in the host app, without any GIL, etc. Allow multiple interpreter contexts, for plug-in systems.
   4. Simple and Comprehensive API: Letting the host manipulate as many execution characteristics as possible, to serve its exact purpose.
Most well-known languages that do support REPL-driven development don't have these characteristics.

So, I wonder, is any any language implementation that is designed to be embedded and also support REPL-driven workflows?


  👤 sargstuff Accepted Answer ✓
Reworking the stated REPL-driven development charactarists a bit: ide/editor can provide an environment for emulating a REPL-driven workflow with support for interpreting a given language. aka zed[0][4] using syntax-aware task spawning with tree-sitter[1][2].

[0] : zed : http://zed.dev/

[1] : zed using syntax-aware tasks spawning with tree-sitter : http://www.youtube.com/watch?v=se3zS2ZVvMo

[2] : ??"execution charactaristics ?? : zed 'tree sitter' usage example : https://zed.dev/blog/syntax-aware-editing

[3] : ?? multiple interpreter contexts/plug-ins?? : webassembly bindings : https://zed.dev/blog/language-extensions-part-1

[4] : between editors and IDE's, where zed falls : https://zed.dev/blog/between-editors-and-ides

[5] : zed supported language REPL's : https://zed.dev/docs/repl


👤 igouy
Maybe some of what you're looking for, maybe not.

https://toitlang.org/