News for hackers. Stuff that matters.
Re:Racket Language by bjourne on Sunday April 21, 2024 @03:31AM (#40103846)
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.
Re:Racket Language by pjmlp on Sunday April 21, 2024 @03:46AM (#40103901)
Welcome 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.
Re:Racket Language by qwerty456127 on Sunday April 21, 2024 @03:42AM (#40103888)
Try Smalltalk :-))
Re:Racket Language by spdegabrielle on Wednesday April 24, 2024 @06:22AM (#40142620)
I *love* Smalltalk. EVERYONE should try Smalltalk !
Re:Racket Language by em-bee on Friday April 26, 2024 @07:35PM (#40175504)
agreed. current discussion about the latest pharo release here: https://news.ycombinator.com/item?id=40167742
Re:Racket Language by igouy on Sunday April 21, 2024 @05:11PM (#40109299)
> 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#(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"

Re:Racket Language by spdegabrielle on Wednesday April 24, 2024 @06:20AM (#40142612)
That 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-...

Re:Racket Language by shawn_w on Sunday April 21, 2024 @05:33PM (#40109432)
> 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.... 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.

Re:Racket Language by bjourne on Monday April 22, 2024 @12:13PM (#40115738)
Hmm... 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.
Re:Racket Language by evdubs on Monday April 22, 2024 @04:46PM (#40120073)
I 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

Re:Racket Language by bjourne on Tuesday April 23, 2024 @06:43PM (#40138206)
Arch Linux with Racket v8.11.1. Starting a REPL takes almost a second and a simple hello world 300 ms. (No use telling me I should do x, y, z. A language that doesn't get it right by default is not for me.)
Re:Racket Language by soegaard on Wednesday April 24, 2024 @04:03PM (#40148900)
A second indicates something is wrong. Most likely the `raco setup` part of the installation was skipped. Try `raco setup` and see if it helps.

[I think, there were a snap at some point that had problems.]

Re:Racket Language by sschwarzer on Saturday April 27, 2024 @12:57PM (#40181500)
> 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`.

Re:Racket Language by jnxx on Monday April 22, 2024 @02:52PM (#40117520)
You might find Guile interesting, I think it is more immersed than Racket, especially when debugging, and more similar to Common Lisp (SBCL).