soegaard2
2021-8-14 14:42:29

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



spdegabrielle
2021-8-14 15:09:46

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.


spdegabrielle
2021-8-14 15:11:00

There has been a a lot of #rhombus activity lately.



ben.knoble
2021-8-14 15:13:48

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


jjsimpso
2021-8-14 15:32:07

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.


soegaard2
2021-8-14 15:33:05

soegaard2
2021-8-14 15:34:36

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


ben.knoble
2021-8-14 15:35:54

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


soegaard2
2021-8-14 15:37:35

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


ben.knoble
2021-8-14 15:37:52

yikes


jjsimpso
2021-8-14 15:44:42

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


mflatt
2021-8-14 15:47:37

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.


jjsimpso
2021-8-14 15:53:34

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


jmhimara
2021-8-14 16:23:29

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.