3 ms·
I like Racket the language a lot, but can't get to terms with the workflow it imposes on you. When coding in Python I use my editor to write the code and I run
by bjourne 3y ago
I like Racket the language a lot, but can't get to terms with the workflow it imposes on you. When coding in Python I use my editor to write the code and I run it from my shell. Doesn't work with Racket because it takes too long to start. Instead you "should" interact with a long-running vm through a REPL. But that means the code you are working on doesn't start with a "clean slate" and instead starts with whatever state the vm is in at the moment. It's a great workflow for things like Jupyter notebooks but doesn't work well for larger programs imo.
- qwerty456127 3y agoTry Smalltalk :-))
- spdegabrielle 3y agoI *love* Smalltalk. EVERYONE should try Smalltalk !
- em-bee 3y agoagreed. current discussion about the latest pharo release here: https://news.ycombinator.com/item?id=40167742 https://news.ycombinator.com/item?id=40167742
- pjmlp 3y agoWelcome to the world of Smalltalk and Lisp Machines, which modern IDEs still don't fully support everything, like hot-reload, saving work states, control over the whole development stack in a single language.
- igouy 3y ago> doesn't start with a "clean slate" The docs seem to suggest that the user can explicitly decline to save backup files? https://docs.racket-lang.org/drracket/drracket-files.html#(part._drracket-autosave-files) https://docs.racket-lang.org/drracket/drracket-files.html#(p... Presumably offers can be declined? "When DrRacket first starts up, itlooks to see if there are any backup files still present and if so, offers to restore the backup files"
- spdegabrielle 3y agoThat is a DrRacket feature, and nothing to do with staring the REPL in a clean state. https://blog.racket-lang.org/2009/03/the-drscheme-repl-isnt-the-one-in-emacs.html https://blog.racket-lang.org/2009/03/the-drscheme-repl-isnt-...
- shawn_w 3y ago> I use my editor to write the code and I run it from my shell That's a perfectly valid workflow for Racket too. Startup time is pretty comparable to Python in my experience. Slow but not cripplingly so, especially if you compile it ahead of time (useful when you're done working on a file for the moment). Using the racket/base #lang instead of racket makes a big difference too. https://docs.racket-lang.org/style/Language_and_Performance.html https://docs.racket-lang.org/style/Language_and_Performance.... has more on that. >But that means the code you are working on doesn't start with a "clean slate" and instead starts with whatever state the vm is in at the moment. That sounds more like a Common Lisp style repl than Racket's, where you typically do have to restart Racket when reloading files/modules and thus have a fresh environment. People complain about it but I prefer the clean slate style of Racket over CL.
- sschwarzer 3y ago> Startup time is pretty comparable to Python in my experience. In my experience a "Hello world" program with `#lang racket/base` (precompiled) takes around 150 ms on my computer whereas Python takes about 50 ms. > Using the racket/base #lang instead of racket makes a big difference too. My experience has been: As soon as I use `#lang racket/base` with `(require racket/match)` for pattern matching, the startup times are as when using `#lang racket`.
- bjourne 3y agoHmm... perhaps. Last I tried Racket using it as I'm using Python didn't work well. It wasn't just the startup time of Racket, it was also all the libraries I used. Like loading most libraries is almost instant in Python but they weren't in Racket. Sure I could perhaps solve those issues (caching?), but it would be working against the grain of the language's ethos and that just doesn't work out well in my experience. For example, there are excellent REPLs for, say, Rust, but using them is not the same as using a REPL for a language (runtime) intended for interactive use.
- evdubs 3y agoI run a Racket program [1] that uses `racket/gui`, `plot`, `db`, etc. and I don't have long startup times when running the main program in a terminal. Maybe you have an example? [1] https://github.com/evdubs/renegade-way https://github.com/evdubs/renegade-way
- jnxx 3y agoYou might find Guile interesting, I think it is more immersed than Racket, especially when debugging, and more similar to Common Lisp (SBCL).