Live data from Hacker News

REPL vs CLI: IDE wars

vlaaad.github.io

91–100 of 110 posts

Re: REPL vs CLI: IDE wars

#91
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.

So that you can run your unit test from some unknown state that may not even be reachable from the current text of the code, rather than running it from the start in a reproducible way? Why would that be something you want?

Re: REPL vs CLI: IDE wars

#93
post #72
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…

> 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're pointing at. but that depends on how the environment is looking at the time. during development, in scheme, i just have a function (reset) that reloads all the files of an app. sometimes i creat…

Python can hot-reload an application from scratch, too. The idea here is to not reload everything from scratch, but to redefine functions incrementally/iteratively as you work.

Re: REPL vs CLI: IDE wars

#94
post #83
post #59

Earlier quoted context omitted.

"man set" can't provide that information trivially without knowing your shell; dash/bash/ksh/zsh will all be subtly different. However, if you are running bash, "help set" is fine. FWIW, I really don't like pipefail as a default (e.g. piping to "head" causes random pipefails) and -e also has some confusing semantics. Also either failglob or nullglob are more important than either and -C is useful for some scripts as…

> (set -e; echo hi); echo $? It works in my shell. :-/ It looks like you forgot to insert `false` command. You are pointing to the problem with -e not working in subshell/deep functions, because of POSIX. Right? It's described in bash documentation: http://www.gnu.org/software/bash/manual/html_node/The-Set-Bu... > I think just defining a die() function and using it after any command that must succeed is more verbose,…

If you're using ZSH, this will give you a Python-style backtrace showing the specific line of each failure, even with nested function calls.

https://gist.github.com/zachriggle/8574964d2e3078cdfae84b574...

e.g.

    An error occurred on ./test:18
    Frame 1 (./test:21)
    18           false
    19       }
    20
    21   >>> a

    Frame 2 (./test:6)
    3        source TRAPERR.zsh
    4
    5        a() {
    6    >>>     b
    7        }
    8
    9        b() {

    Frame 3 (./test:10)
    7        }
    8
    9        b() {
    10   >>>     c
    11       }
    12
    13       c() {

    Frame 4 (./test:14)
    11       }
    12
    13       c() {
    14   >>>     d
    15       }
    16
    17       d() {

    Frame 5 (./test:18)
    15       }
    16
    17       d() {
    18   >>>     false
    19       }
    20
    21       a

Re: REPL vs CLI: IDE wars

#95
post #44

Earlier quoted context omitted.

And I recommend trying out Smalltalk.

As a hobby I want to learn a lisp. Where should I begin? :)

MAL. AKA Make A Lisp. Instructions to write a tail recursion lisp interpreter in a weekend in almost any language. It teaches almost anything you want to know about lisp, plus some practical compiler/interpreter knowledge.

Re: REPL vs CLI: IDE wars

#96

Earlier quoted context omitted.

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…

Contrary to typical GNU practice, the bash info manual states that it is intended as a “ brief introduction” and that the man page is the definitive reference on shell behavior: https://www.gnu.org/software/bash/manual/html_node/index.htm...

Oh god yes, I remember being confused and frustrated by that statement.

Re: REPL vs CLI: IDE wars

#97
post #72

Earlier quoted context omitted.

> 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're pointing at. but that depends on how the environment is looking at the time. during development, in scheme, i just have a function (reset) that reloads all the files of an app. sometimes i creat…

Python can hot-reload an application from scratch, too. The idea here is to not reload everything from scratch, but to redefine functions incrementally/iteratively as you work.

if i change anything in filters.scm then i (load "filters.scm") instead of just sending a snippet to the interpreter to eval. i have this happen when i save the file. same thing, except i never have to worry about sending code or a mis-match between editor and repl. it also forces you to be more organized with code so that you don't override global state. i just code, save, code, save. you can have hooks run things after every save etc ...

Re: REPL vs CLI: IDE wars

#98
post #69

Earlier quoted context omitted.

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?

As I said, I think Clojure is significantly iimpacted in how much dynamic reconfiguration it can handle by compiling down to the JVM. Still, personally I have little to no experience with Clojure, so I can't really comment too deeply.

i don't think that's it. i like scheme, and clojure is not scheme. it may just be that.

Re: REPL vs CLI: IDE wars

#99
post #87
post #75

Earlier quoted context omitted.

i've used emacs for 20 years. i still spend 80% of my day in it ... and vscode is vastly superior for development.

The thing that bugs me about the IDEs is how slow they are. I'm super productive in them, but I really don't feel like they need to be so slow. I'm not even talking about the indexing which I get. In fact they weren't always unresponsive, seems Jetbrain's products have regressed in the last year, but mostly Webstorm. I use WS on OSX and Win10, and on both I get all kinds of slowdowns - different projects too. Tried d…

try vscode ;) ~ 5*10^6 java code base, i don't notice any slowness. it would be impossible to do this in emacs.

Re: REPL vs CLI: IDE wars

#100

This post could be summarized as "write as much of your project's tooling as you can in the project's main programming language and the project's main programming language should be Clojure" and I agree wholeheartedly.

I think their point is bigger than that. Historically one of the major points against using Clojure to write your tooling was the slow startup times which are just painful from the CLI. It looks like the clj-exec idea linked to in the article is the secret sauce that makes moving to writing your tooling in Clojure a workable idea, since now you have a unified calling convention for both calling tooling from the REPL…

Does GraalVM work with Clojure? I would assume that would solve the startup time issue for a project like a CLI tool.
Post reply on HN