Live data from Hacker News

REPL vs CLI: IDE wars

vlaaad.github.io

61–70 of 110 posts

Re: REPL vs CLI: IDE wars

#61

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.

What if you don't know what you want it to do yet? Maybe you have a new API or library you're working with and the documentation is lacking. Maybe you're exploring some dataset trying to figure out what kind of information can be gleaned from it. Maybe it takes 3 minutes to get it into the state where it failed, so instead of starting over every change you just want to modify the one function over and over. Doing it…

A. Then don't submit the exploratory test in your next PR.

B. Then memoize the expensive function to disk. Bonus: Can keep multiple versions on disk, thus can tweak the expensive function while having fast reloads with guaranteed correct version.

Re: REPL vs CLI: IDE wars

#62
post #19
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…

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.

Modern Java (11+) has jshell, which has interactive goodies like tab completion, documentation display, paren/bracket matching, etc.

Re: REPL vs CLI: IDE wars

#63
post #21
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…

You can do this in IDEA's IDEs too, just place a breakpoint and then you can "evaluate expression" in that context to call functions, read values, etc.

Kotlin and IntelliJ IDEA really are a joy to work with in my opinion, they're very much my primary tools at the moment. I'd never really been exposed to functional programming features until I got into Kotlin and now I'm learning Scheme of all things, it's been a bit of a gateway drug for me.

Re: REPL vs CLI: IDE wars

#64

Earlier quoted context omitted.

I am not familiar with how Julia and Elixir work, but form my experience Python’s REPL is not the same at all as REPL in Clojure or other lisps. In Clojure, you literally built your program in memory while you’re writing the source code file, updating the memory representation of your running program part-by-part without ever stopping it. This experience is absolutely magical, and it’s very hard to go back to edit-co…

No, Julia and Elixir are the same as Python in that regard (Python is more annoying because of the indentation problem). I was just talking about interactive evaluation of expressions selected in the editor. Although I’ve messed with Clojure a bit, I admit I don’t fully appreciate what you’re describing. I’m a little afraid to find out, frankly, because it sounds seductive.

Julia is much closer to Clojure than to Python in this regard, which brings back the point from above that homoiconity isn't the key ingredient

Re: REPL vs CLI: IDE wars

#65
post #21
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…

You can do this in IDEA's IDEs too, just place a breakpoint and then you can "evaluate expression" in that context to call functions, read values, etc.

you just have to try to understand the difference. the friction is zero in a proper repl, unlike breakpointing and evaling.

Re: REPL vs CLI: IDE wars

#66
post #64

Earlier quoted context omitted.

No, Julia and Elixir are the same as Python in that regard (Python is more annoying because of the indentation problem). I was just talking about interactive evaluation of expressions selected in the editor. Although I’ve messed with Clojure a bit, I admit I don’t fully appreciate what you’re describing. I’m a little afraid to find out, frankly, because it sounds seductive.

Julia is much closer to Clojure than to Python in this regard, which brings back the point from above that homoiconity isn't the key ingredient

How so? In julia, one problem is that you can’t redefine datatypes in the REPL. You need to restart.

Re: REPL vs CLI: IDE wars

#67

> Don’t forget the set -euo pipefail at the beginning of your script. What does -euo means? I don’t know, I copy-pasted it and man set said there is no manual entry for set. Use "man bash" to find the list of built-in commands. Scroll way down, or search for "SHELL BUILTIN COMMANDS". The "e" command-line switch to the set command tells the script to exit immediately if there is a non-zero return value. The "u" switch…

Off-topic, but Bash's manpage is awful and a great demonstration of the limitation of manpages.

Not that the content is bad (it's great!), but as OP (and you) demonstrated, finding relevant information is close to impossible in the humongous document.

In Bash's defense, its manpage is a concession to people's habits, and its documentation really rests in its Info page. Except that doesn't seem to be popular either (I'll admit to being still inexperienced with its UI, after decades of sparse usage)...

Re: REPL vs CLI: IDE wars

#68

> Don’t forget the set -euo pipefail at the beginning of your script. What does -euo means? I don’t know, I copy-pasted it and man set said there is no manual entry for set. Use "man bash" to find the list of built-in commands. Scroll way down, or search for "SHELL BUILTIN COMMANDS". The "e" command-line switch to the set command tells the script to exit immediately if there is a non-zero return value. The "u" switch…

Off-topic, but Bash's manpage is awful and a great demonstration of the limitation of manpages. Not that the content is bad (it's great!), but as OP (and you) demonstrated, finding relevant information is close to impossible in the humongous document. In Bash's defense, its manpage is a concession to people's habits, and its documentation really rests in its Info page. Except that doesn't seem to be popular either (I…

Perl (and Git and TCL) seem to have found a middle ground, where they broke up their manpages into different ones that refer to each other (via "SEE ALSO" section at the bottom). But it's sad that, in 2021, we still have such a poor terminal documentation system, and the improvement invented 40 years ago (Info) gained no steam...

Re: REPL vs CLI: IDE wars

#69
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 modificatio…

i get the magical aspect of repls in scheme and CL. not in clojure. not sure why. so i don't like clojure, but i feel like i should ?? why is that?
Post reply on HN