4 ms·
I feel like working in the Unix CLI is absolutely REPL programming with the same workflow, using pipes and filters and small programs. 1. mess around with
by imglorp 6y ago
I feel like working in the Unix CLI is absolutely REPL programming with the same workflow, using pipes and filters and small programs.
1. mess around with some program, echoing things to it and looking at outputs
2. up-arrow in shell, edit previous experiment
3. repeat, adding more onto pipeline, until happy
4. save the good version to a script, eg echo "!!" > foo
5. add a #! line and chmod +x to promote it to a command
- PuercoPop 6y agoThe Unix CLI is most definitely a REPL. But it is a system-level REPL. So instead of running functions you run programs. You can't interactively develop a program in the UNIX CLI. Especially not in Python, JS, Ruby, etc. You can try to establish a REPL like flow in the CLI, by using a watcher like entr and doing something like $ cat test-input.txt | python ./my-script.py but the granularity of this approach is too coarse for the programming _language_. It is the ideal granularity for orchestrating shell scripts and CLI programs.
- pjmlp 6y agoThat is a poor man's REPL. - No graphical display - No support for displaying interactive structure data (Lisp Machines REPL/commercial Common Lisp/modern notebooks) - No debug-break, fix, redo workflow - No partial selection of command statements and "Do this" - No interactivity with running graphical applications and scripting them (via COM, DLLs, OS IPC)