Live data from Hacker News

REPL vs CLI: IDE wars

vlaaad.github.io

41–50 of 110 posts

Re: REPL vs CLI: IDE wars

#41
post #9

Earlier quoted context omitted.

Oh nice. That's one place where Clojure beats Common Lisp then..

Does it? Asking for a value when encountering an unbound variable is a default restart $ sbcl This is SBCL 2.1.1.52.HEAD.321-f8a57bcca, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the di…

Yeah, in fact, Clojure needs special tooling for this, while it’s built into CL’s execution model.

Re: REPL vs CLI: IDE wars

#42
post #25

Earlier quoted context omitted.

Homoiconicity isn't required for that, all you need is to be able to map between source and AST enough to identify expression boundaries. Plenty of development environments for non-homoiconic languages provide the ability to evaluate a selected expression (not just the last one) in a linked REPL on demand. I love the Lisp family, but I don't know why its advocates often sound like they haven't seen a dev environment…

Maybe it's not required. However, I can confidently say Clojure in emacs feels like an entirely different development experience than my daily Python work in PyCharm/VSCode and C# in VS. I recommend trying it out if you haven't already.

[deleted]

Re: REPL vs CLI: IDE wars

#43
post #4

I think you might be missing the main "aha!" of clojure REPLs vs REPLs in non-homoiconic languages: you can very easily execute small parts of the program you're editing without re-typing the code. In emacs, for instance, you often use `eval-last-sexp`, by default bound to C-x C-e. This lets you move your cursor to a particular point in the file, often deep in a function, and get the results of just the form(s) you'r…

Homoiconicity isn't required for that, all you need is to be able to map between source and AST enough to identify expression boundaries. Plenty of development environments for non-homoiconic languages provide the ability to evaluate a selected expression (not just the last one) in a linked REPL on demand. I love the Lisp family, but I don't know why its advocates often sound like they haven't seen a dev environment…

Not only that, Smalltalk, Mesa and Mesa/Cedar workstations, all shared the same interactivity as Interlisp-D at Xerox PARC.

Re: REPL vs CLI: IDE wars

#44
post #25

Earlier quoted context omitted.

Homoiconicity isn't required for that, all you need is to be able to map between source and AST enough to identify expression boundaries. Plenty of development environments for non-homoiconic languages provide the ability to evaluate a selected expression (not just the last one) in a linked REPL on demand. I love the Lisp family, but I don't know why its advocates often sound like they haven't seen a dev environment…

Maybe it's not required. However, I can confidently say Clojure in emacs feels like an entirely different development experience than my daily Python work in PyCharm/VSCode and C# in VS. I recommend trying it out if you haven't already.

And I recommend trying out Smalltalk.

Re: REPL vs CLI: IDE wars

#45
post #19

Earlier quoted context omitted.

This is the draw for Jupyter Notebooks as well. Execute code blocks. I remember when I learned this in Matlab. REPL are super nice for this! I've had a hard time in Java, Fortran, etc. in determining the right development patterns that are used in this space to be productive.

Step1: Write a test. Step2, IDE: Right click + Run. Step2, CLI: $ run Bonus: The test is now part of your automated test suite, and will be ran many times to ensure things don't break.

Now try to fix the code from the unit test when it breaks and redo the unit test, from the point where it broke.

Re: REPL vs CLI: IDE wars

#46
post #45

Earlier quoted context omitted.

Step1: Write a test. Step2, IDE: Right click + Run. Step2, CLI: $ run Bonus: The test is now part of your automated test suite, and will be ran many times to ensure things don't break.

Now try to fix the code from the unit test when it breaks and redo the unit test, from the point where it broke.

Throw a breakpoint in the unit test.

Re: REPL vs CLI: IDE wars

#48
post #45

Earlier quoted context omitted.

Now try to fix the code from the unit test when it breaks and redo the unit test, from the point where it broke.

Throw a breakpoint in the unit test.

It won't work on the CLI version, and unless you are using an IDE with a backtracking debugging it won't help.

Re: REPL vs CLI: IDE wars

#49

Considering its ecosystem, what do most here use Clojure for or what do you think is its sweet spot? I used it in a project with pg/ring/reitit and while some things were nicer it was not better enough to make me switch from pg/nodejs/express for new projects. Used emacs with inf-clojure (found cider too bloated and buggy, was tempted to port some features of cider to a fork of inf-clojure) and macros were helpful in…

Nowadays I use Clojure as my primary general purpose programming language.

As far as sweet spots go, due to pervasive immutability, I think it can be a good choice anytime you're dealing with concurrency.

If you're dealing with relatively straightforward web applications, outside certain specialized scenarios (and certain really bad choices) I don't think language choice matters.

Re: REPL vs CLI: IDE wars

#50
post #4

I think you might be missing the main "aha!" of clojure REPLs vs REPLs in non-homoiconic languages: you can very easily execute small parts of the program you're editing without re-typing the code. In emacs, for instance, you often use `eval-last-sexp`, by default bound to C-x C-e. This lets you move your cursor to a particular point in the file, often deep in a function, and get the results of just the form(s) you'r…

The homoiconicity of Lisp is not what gives it this superpower. It is rather Lisp's dynamic nature that actually allows you to keep running your project while also developing it that is crucial - something that Clojure running on the JVM can actually only approximate.

For example, in a full CL, you can modify a class that is currently being used, and objects of that class will adjust accordingly (for most modifications). This is not possible for the JVM - to modify a class, you would have to unload it, which can only happen if the Class object is garbage collected, which requires all instances of the class to be GCd, and the ClassLoader that loaded that class as well - only then could you add a field with a default value to the class.

Post reply on HN