
“Thoughts on Lisp and Racket” on HackerNews: https://news.ycombinator.com/item?id=28179463


Ugh. How can someone write a whole blog post (and leave it up for two years) without noticing that #lang racket
isn’t going away.



Anyone want to take a stab at a Racket solution? https://renato.athaydes.com/posts/how-to-write-slow-rust-code.html

Did the ->fl
contract change? It is only accepting exact-integers, but I’m pretty sure the following had been working for me: (define x-scale (->fl (/ x-axis-length width)))
width in this case will be larger than x-axis-length and the result will not be an integer.


That’s not “silly”. That kind of mistake turns linear time algorithms into quadratic ones.

I guess I should have also linked the original post, which talks a little more about the lisp version. But yes indeed! also comparing cons
O(1) with push
(probably O(n)?) seems wrong, unless push
isn’t append but rather prepend

It’s clone+push so the entire list is copied.

yikes

Can I rely on exact->inexact
instead? I’m using flonum operations later so I need to ensure that x-scale is a flonum.

I’m pretty sure ->fl
has always required an exact integer. You may want real->double-flonum
instead of exact->inexact
since you don’t need to support complex numbers.

It has been a while since I ran this code, so perhaps I am mistaken. I will try real->double-flonum
. Thanks!

I’ll paste my comment on reddit:
I kinda agree with the author’s second point. I think given the size of the community, Racket has a fantastic collection of libraries. However, the motto “language oriented programming” scares some people away, more than s-expressions do. I’ve seen a lot of people claim that Racket is mostly focused on language design, implying that it’s not good for “serious” programming work. Which is not true, but it’s certainly a perception that exists out there.
Just my 2 cents.