Live data from Hacker News

REPL vs CLI: IDE wars

vlaaad.github.io

81–90 of 110 posts

Re: REPL vs CLI: IDE wars

#81
post #64

Earlier quoted context omitted.

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.

Yes, that restart is painful exactly because it interrupts the "built your program in memory while you’re writing the source code file" OP talks about.

Re: REPL vs CLI: IDE wars

#82
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…

Actually, yes I seem to remember it doing that a while ago. I think my Emacs setup has messed up somehow. Now I just get:

   Debugger entered--Lisp error: (void-variable k)
And then a stack trace. No option for restarts.

It works if I run from the command line though..

Re: REPL vs CLI: IDE wars

#83
post #59
post #36

Earlier quoted context omitted.

It's kinda nonsense that `man set` doesn't provide that information. But it's kinda nonsense that those flags aren't the default, anyway.

"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, but less error prone:

Yep. It's the style I developed 12 years ago, when working at Bazaarvoice, when I was lead of devops team. I created the whole library for bash, to use this pattern consistently. See https://github.com/vlisivka/bash-modules#error-handling

Re: REPL vs CLI: IDE wars

#85
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…

Well, a UNIX REPL (read sh, bash, fish, etc) is pretty much "homoiconic", since everything is just a text stream. Of course the value of ARGV[0] will be some executable, written and possibly compiled, but that's no different than any other language which needs to eventually make it to hardware instructions.

Re: REPL vs CLI: IDE wars

#86

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…

Clojure's sweet spot is very much the "situated program" Hickey likes to talk about. Clojure is a great fit for line of business apps where maps really are the right choice for modeling your domain. We recently evaluated Clojure vs node for an upcoming project and went with Clojure because while most of the work really is just querying a db and writing JSON, we also do a fair amount of heavy reporting and pdf generat…

It comes down to the JVM vs nodejs and which is better for your project. The JS ecosystem is way richer than clojure's though.

Can you share your approach to generating PDFs in Clojure?

Re: REPL vs CLI: IDE wars

#87
post #75
post #58

Earlier quoted context omitted.

Nice. I definitely want to give emacs a solid try at some point.

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 disabling features, plugins, different GC, increased heaps. I may have to fire up J. Mission control at this point.

IDEA and Clion on Win10 are mostly fine.

It would just be cool to have all of these features, but the frontend be a responsive CLI.

Re: REPL vs CLI: IDE wars

#88

> 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…

I always forget about the info command, even though it's mentioned in most man pages. So I typed "info bash", and went looking for the "set" command with my almost null knowledge of the info command. It took me a while, but I eventually found it's description under indexes/built-in index/set. It was surprisingly more difficult to find than just looking in the man page, but did take me much less time since I didn't need to skim the whole document to find it. Typing "info info" was actually really helpful, though. Info has a lot more power than I knew about. Typing "i set" while in info brought me right to the set command description. Guess I should learn the tools a bit better.

Re: REPL vs CLI: IDE wars

#89

> 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…

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

Re: REPL vs CLI: IDE wars

#90
post #44
post #25

Earlier quoted context omitted.

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.

As a hobby I want to learn a lisp. Where should I begin? :)
Post reply on HN