Live data from Hacker News

Racket v9.0

blog.racket-lang.org

121–129 of 129 posts

Re: Racket v9.0

#121
post #116
post #20

Earlier quoted context omitted.

I admit I'm one of those students who never used Racket in a non-academic setting (but mostly because I needed to contribute to already-existing projects written in different languages), and I was taught Racket from one of its main contributors, John Clements at Cal Poly San Luis Obispo. However, learning Racket planted a seed in me that would later grow into a love of programming languages beyond industry-standard i…

C++ is one of my favourite languages, and I got into a few cool jobs because of my C++ knowledge. However, given the option I would mostly reach for managed compiled languages as first choice, and only if really, really required, to something like C++, and even then, probably to a native library that gets consumed, instead of 100% pure C++.

I didn’t know you like C++. I’ve been reading your posts for a few years now and your advocacy of the Xerox PARC way of computing. I’ve found that most Smalltalkers and Lispers are not exactly fond of C++. To be fair, many Unix and Plan 9 people are also not big C++ fans despite C++ also coming from Bell Labs.

Re: Racket v9.0

#122
post #116

Earlier quoted context omitted.

C++ is one of my favourite languages, and I got into a few cool jobs because of my C++ knowledge. However, given the option I would mostly reach for managed compiled languages as first choice, and only if really, really required, to something like C++, and even then, probably to a native library that gets consumed, instead of 100% pure C++.

I didn’t know you like C++. I’ve been reading your posts for a few years now and your advocacy of the Xerox PARC way of computing. I’ve found that most Smalltalkers and Lispers are not exactly fond of C++. To be fair, many Unix and Plan 9 people are also not big C++ fans despite C++ also coming from Bell Labs.

Back when C++ was becoming famous, my favourite programming language was Object Pascal, in the form of Turbo Pascal, having been introduced to it via TP 5.5 OOP mini booklet.

Shortly thereafter Turbo Pascal 6 was released, and I got into Turbo Vision, followed by Turbo Pascal 1.5 for Windows 3.1, the year thereafter.

I was a big Borland fan, thus when you got the whole stuff it was Object Pascal/C++, naturally C was there just because all C++ vendors started as C vendors.

On Windows and OS/2 land, C++ IDEs shared a lot with Smalltalk and Xerox PARC ideas in developer experience, it wasn't the vi + command line + debuggers are for the weak kind of experience.

See Energize C++, as Lucid was pivoting away from Common Lisp, with Cadillac what we would call a LSP nowadays, where you could do incrementatl compilation on method level and hot reload

"Lucid Energize Demo VHS 1993"

https://www.youtube.com/watch?v=pQQTScuApWk

https://dreamsongs.com/Cadillac.html

Or the Visual Age for C++ version 4, which introduced a database, image like system for doing C++ in workflows similar to Smalltalk.

https://www.edm2.com/index.php/A_Review_of_VisualAge_C%2B%2B...

https://www.edm2.com/index.php/VisualAge_C%2B%2B_4.0_Review

Then there is C++ Builder, still going on, even though the way Borland went down spoiled its market mindshare,

https://www.embarcadero.com/products/cbuilder

You're right altougth C++ was born on UNIX at Bell Labs there is that point of view, and also a reason why I always had much more fun with C++ across Mac OS, OS/2, Windows, BeOS, and Symbian, with their full stack frameworks and IDE tooling.

However with time I moved into managed languages, application languages, where it is enough to make use of a couple of native libraries, if really required, which is where I still reach for C++.

Re: Racket v9.0

#123
post #112

https://youtu.be/LXhsutNKhec?si=OTC6sn5GNp1-ZxqU Racket is only hard if it's not your first language. Kids can also learn it.

Very impressive video. This is making me want to start my daughter out on scratch or Racket when the time comes. His keyboard sounds amazing too. Buttery smooth pearls.

After learning to type, he learned vim through https://vim-adventures.com/

Just FYI, if you want to help your daughter as she grows up. Typing skills, VIM and Racket. He doesn't know anything else about computers.

Re: Racket v9.0

#124
post #79

Earlier quoted context omitted.

What kinds of things do you write in Racket? I’m a clojure dev and so I’m a big fan of lisp. I’m just curious what kinds of projects you would use Racket for

i'm also curious.. do you use clojure because of jvm? i want to learn some kinda lisp, but there are so many choices. why not just common lisp or the one with emacs.

I personally use Clojure because I got a job doing it, I hadn’t touched it before my current position. I would pick it now over Common Lisp and Elisp because I prefer the syntax (I like the brackets in addition to parentheses) but also the Java integration and build tooling make things easier to get going.

Re: Racket v9.0

#125
post #68

Earlier quoted context omitted.

I liked it many years ago but when I noticed how slow and heavy my code was I left it. It manages to be slower than Python. Perhaps the Chez Scheme rewrite helped with that but now if I need a Lisp I have Common Lisp which is super fast and lightweight enough.

These are small benchmarks, so don’t over-generalize from this data point alone, but Racket absolutely crushes Python in terms of speed and goes speedily enough against other popular performance-focused languages: https://lambdaland.org/posts/2023-12-20_functional_langauge_... https://lambdaland.org/posts/2024-09-27_threaded_interpreter... Matthew Flatt, the Racket lead, says that Racket’s performance should be fairl…

Nice examples! With a few tricks, I made the Racket program x5 faster. I think you tried to use the simplest program, so I tried to add as few cheats as possible. I added a happy path for fixnums and keep the slow path in case the iterations gets too big:

  (define (count-collatz n [cnt 1])
    (if (fixnum? n)
        (cond
          [(= n 1) cnt]
          #;[(zero? (unsafe-fxremainder n 2)) (count-collatz (unsafe-fxquotient n 2) (+ 1 cnt))]
          [(zero? (fxand n 1)) (count-collatz (unsafe-fxquotient n 2) (+ 1 cnt))]
          [else (count-collatz (+ (* 3 n) 1) (+ 1 cnt))])
        (cond
          [(= n 1) cnt]
          [(even? n) (count-collatz (/ n 2) (+ 1 cnt))]
          [else (count-collatz (+ (* 3 n) 1) (+ 1 cnt))])))
My program has two versions, the version with `fxand` is slightly faster than the versions with `fxremainder`. I have to used two `unsafe-` functions, but a smart enough optimizer should have fixed them. So I'm adding this example to my wishlist.

I think it would be very hard for the optimizer would be to replace `/` with `quotient`, but the rest look possible.

Re: Racket v9.0

#126

I love Racket. Just for fun, I wrote a Racket book, read online: https://leanpub.com/racket-ai/read For Scheme languages I recommend Racket or Gerbil. Racket is great for beginners since the IDE is pretty good and the standard libraries and contributed libraries are good. Gerbil is good for systems programming. network utilities, etc.

I just bought your book. Thanks for writing it. I look forward to reading it!

Re: Racket v9.0

#128

Earlier quoted context omitted.

And all of them agrees to never use it after university, which is quite telling.

I use it professionally. My favorite is its seemingly complete lack of bad behavior: "3" + 1 is neither "4", "31", nor 4. It's illegal. 0 is not false, causing endless confusion on filters and &&s. For loops don't alter the iterated value within a closure to the max value when it's finally called. And some positives: Immutable/functional is the default, but mutability is easy too. Nice optional, keyword, and variable…

> nice struct syntax

I am curious how you would change the struct syntax?

Re: Racket v9.0

#129

Earlier quoted context omitted.

I use it professionally. My favorite is its seemingly complete lack of bad behavior: "3" + 1 is neither "4", "31", nor 4. It's illegal. 0 is not false, causing endless confusion on filters and &&s. For loops don't alter the iterated value within a closure to the max value when it's finally called. And some positives: Immutable/functional is the default, but mutability is easy too. Nice optional, keyword, and variable…

> nice struct syntax I am curious how you would change the struct syntax?

I don't have the creds to give a definitive answer, but I like C structs, JS dicts, Java object access, Haskell lenses, etc -- any kind of dot syntax.

Default Racket: (potato-skin-color apotato)

JS: apotato.skinColor

The extra potato upsets me. Some libraries exist to address this but I believe they all have caveats.

With copying or mutation, it's even worse:

Racket copy: (struct-copy potato apotato [skin-color 'brown])

Racket mutate: (set-potato-skin-color! apotato 'brown)

JS copy: { ...apotato, skinColor: 'brown' }

JS mutate: apotato.skinColor = 'brown'

None of this really ruins the language for me, considering pros vs cons as a whole, but sometimes I'm slowed down in that by the time I finish mentally spelling out and typing the struct accessing I half forget the context I was in, and in general I'm sensitive to "eye bleed". Sometimes Racket looks like:

(define define match-define define define-values define begin cond define define)

when the real meat of the algorithm is more like:

cond

...and where Haskell's "where"s, "|"s, and "="s shine.

I'm sure I've over-answered your question but it's the holidays and I'm bored :)

edit: Since Racket uses dot already, it would probably have to be a different character, or the other way around.

Post reply on HN