Why does this even matter? If it can say something more eloquently, in less stilted way something what I wanted to say, adding some interesting nuance on the way, while still sounding close to me - why not? I meanwhile, can learn one-two rhetorical tricks from LLMs reading the result.
A analogy: For the same reason why natural wood is more beautiful than plastic. Natural wood gets its beauty from little faults and irregularities. The process of growing a tree takes a long time and thereby is more valuable. A plastic facsimile can be made to look similar and be cheaper to produce, but it lacks the unique grain and quality of the wood.
It’s not just the end product that matters. The process and intent behind its genesis matters too.
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:
Matthew Flatt, the Racket lead, says that Racket’s performance should be fairly comparable to Java, much faster than Python, slower than Julia/Rust/etc. That’s been a helpful model for me: if Java is fast enough, Racket will do fine.
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.
I watched Typst from afar for many years. I finally took it out for a spin about a month ago after version 0.14 dropped.
In less than an hour I reproduced my résumé—complete with fancy functions to typeset employment entries on a grid system. In under 24 hours I was tinkering with the Typst source code.
Typst is amazing. Syntax is clean and consistent. The compiler is so so fast. Docs are excellent. And it is very close to TeX when it comes to typesetting quality. There are a few tiny rough edges that any \usepackage{microtype} enjoyer will miss, but stuff is improving rapidly.
(Also, XKCD disclaimer: this was not an LLM—I just use em-dashes a lot because TeX made them easy to type and I got used to having them.)
Typst is so stupidly easy to use. It took me an hour to go from zero Typst knowledge to reproducing my résumé perfectly. The docs are easy to read and there’s a guide for making templates. I feel like if you’ve written CSS and are familiar with associating some kind of selector with some properties, then you’ll be able to pick up Typst and make whatever template you want in no time.
I cannot abide any LLM that tries to be friendly. Whenever I use an LLM to do something, I'm careful to include something like "no filler, no tone-matching, no emotional softening," etc. in the system prompt.
Racket really shines in this regard: Racket makes it easy to build little DSLs, but they all play perfectly together because the underlying data model is the same. Example from the Racket home page: https://racket-lang.org/#any-syntax
You can have a module written in the `#racket` language (i.e., regular Racket) and then a separate module written in `#datalog` and the two can talk to each other!