Combining Code Editing With a Command Line
Currently, you are forced to work with JavaScript code in either of two
modes: You can either use a code editor and edit multiple lines or you
can use an interactive command line and work with one line at a time
(editing, evaluating). With jsrepl [GitHub project, live demo], I have prototyped a combination of both modes – no need to chose, any more.
Published at DZone with permission of Axel Rauschmayer, author and DZone MVB. (source)The name is derived from the abbreviation REPL (read-eval-print loop) that is a common synonym for “command line” in the functional world. Node.js uses that term, too [1].
How does jsrepl work?
It is used like a normal text editor, so the Return key inserts line breaks. If you want to evaluate expressions or statements, you have two options:- Multi-line evaluation: select text and hit Shift-Return.
- Single-line evaluation: place the cursor in the line you want to evaluate and hit Shift-Return.
Prior art
jsrepl has been inspired by the Macintosh Programmer’s Workshop, which I have never used, but read about a long time ago (mid 1980s). There must be other prior art, too (Smalltalk, Lisp, ...).
References
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)
Tags:





