DEV Community

Dita Larasati
Dita Larasati

Posted on

3 2

Shell and REPL

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay