![]() Above, for example, you see “4” to the right of “(square 2)”, which makes sense. And when it makes sense, it shows the result to the right of what you were typing. As soon as you start typing, Clojure is trying to make sense of it. It isn’t like a normal REPL, where the user and the language take turns in a kind of dialog. ![]() The InstaREPL, on the other hand, is not so good. This is very cool, and is Light Table’s best feature in my view. If you look at the screen shot just above, notice that the parens, brackets and braces are colored based on how deeply they are nested. ![]() And they all have to come in nested pairs, which can get confusing. LISP by its nature has lots and lots of parentheses Clojure has fewer, but makes up for it by having many more brackets and braces. Most programmer’s editor’s these days do something called syntax coloring, to make the syntax of the language stand out, and Light Table does it a little differently than most: Light Table is written in a variant of Clojure called ClojureScript, and has built-in support for Clojure editing it also has a built-in “InstaREPL”. Light Table is an attempt to completely rethink the traditional programmer’s IDE, giving instant and immediate feedback about the state of the programmer’s application even as he’s coding it. The first program I tried is the aptly named Light Table. Instead, you get funny control characters which do nothing good for your code. As a programmer, I live at the command line, and my muscle memory expects those things to just work. Almost every program that provides a command prompt these days has some variant of what’s usually called “readline” support: you can use the Left and Right arrow keys to edit the line you’re on, and you can use the Up arrow key to recall previously entered commands. It’s a perfectly good REPL except that it’s perfectly unusable to anyone used to using this kind of terminal interface. For example, I can go the Terminal app on my Mac, switch to a folder that contains the Clojure “.jar” file, and type this at the command line: The easiest way is just to download the Clojure “.jar” file, and use Java to execute it. REPLs went into a decline about the time BASIC lost its line numbers, but have since resurged and most of the new languages I see have something like one.Īnyway, in order to learn Clojure properly, you need a REPL so that you can experiment and see how the language works. (And then they tell you that it isn’t really interpreted, it’s all compiled under the covers.) The first programming language I learned was BASIC on a PDP-11 it was an interpreter, and when you started it up you got a command prompt and developed your program interactively. LISP programmers like to talk as though they invented the REPL, which they did, and they keep using the term “REPL”, which most people don’t they just call it an interpreter. It makes it possible to develop programs interactively, and test your code as you write, and it’s very cool. Then you type something else, and it responds to that, and so on. You type a command at the language interpreter, it reads it, evaluates it, and returns the result. “REPL” stands for “read-eval-print loop”, and it’s a LISP-ism for a terminal-style interface to a language. ![]() A solution that works on both Mac and Windows.An easy way to build a stand-alone application in Clojure.An editor in which to edit Clojure code, integrated with the REPL.A REPL at which to experiment with Clojure code, with good command-line editing and command history.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |