A shell is a command-line interpreter that interprets what user enters in the command-line interface (CLI). And the CLI per se is a computer program for users to interact with computers with text-based UI.
A computer with Unix-like OS such as Linux, usually uses Unix-shell e.g. Bourne Again SHell (bash), TENEX C shell (tcsh), the Korn shell (ksh), the Z shell (zsh), etc.
A CLI implements read, evaluate, print, and loop (REPL) to make the interface interactive. It will loop until there is a condition that makes the process: read, evaluate, and print terminate.
However, those are some programming languages that have their own shell e.g. Python, Java, Clojure, NodeJS, etc. In Java, we will use java shell (JShell) in our CLI in order to interpret java syntax entered. In general, people call a CLI that uses JShell as Java REPL, it goes the same for other languages.
Actually, I am still figuring out the main purpose of a programming language REPL. We usually use IDE to develop a program with necessary, helpful, and important features inside. Presumably, because it only executes a unit of code, so it will be helpful to test atomically through REPL instead of running the program entirely. Honestly, I prefer to use replit.com for that case.
Popped in my head, if you inspect your browser and go to the console tab, it uses JavaScript. Yeah, I think that’s the best approach for a programming language REPL appearance.
Top comments (0)