Why I still reach for Lisp and Scheme instead of Haskell
79 points by jjba23 13 hours ago | 13 comments

evdubs 2 hours ago
> Lisp hackers have been effortlessly reshaping the language for decades using the powerful macro system and extending and bending the language to their will.

I've written a bit of Racket code (https://github.com/evdubs?tab=repositories&q=&type=&language...) and I still haven't written a macro. In only one case did I even think a macro would be useful: merging class member definitions to include both the type and the default value on the same line. It's sort of a shame that Racket, a Scheme with a much larger standard library and many great user-contributed libraries, has to deal with the Scheme/Lisp marketing of "you can build low level tools with macros" when it's more likely that Racket developers won't need to write macros since they're already written and part of the standard library.

> But the success of Parsec has filled Hackage with hundreds of bespoke DSLs for everything. One for parsing, one for XML, one for generating PDFs. Each is completely different, and each demands its own learning curve. Consider parsing XML, mutating it based on some JSON from a web API, and writing it to a PDF.

What a missed opportunity to preach another gospel of Lisp: s-expressions. XML and JSON are forms of data that are likely not native to the programming language you're using (the exception being JSON in JavaScript). What is better than XML or JSON? s-expressions. How do Lisp developers deal with XML and JSON? Convert it to s-expressions. What about defining data? Since you have s-expressions, you aren't limited to XML and JSON and you can instead use sorted maps for your data or use proper dates for your data; you don't need to fit everything into the array, hash, string, and float buckets as you would with JSON.

If you've been hearing about Lisp and you get turned off by all of this "you can build a DSL and use better macros" marketing, Racket has been a much more comfortable environment for a developer used to languages with large standard libraries like Java and C#.

reply
kolme 2 hours ago
> Of course, to be completely fair about my toolkit, standard Scheme can sometimes lack the heavyweight, “batteries-included” ecosystem required for massive enterprise production compared to the JVM.

I was thinking the whole time, "this person would _love_ Clojure".

reply
nathan_compton 57 minutes ago
Kawa is a Scheme which runs on the JVM and is pretty great.

https://www.gnu.org/software/kawa/index.html

I am one of these people who cannot countenance a Lisp that doesn't have `syntax-case`.

reply
packetlost 55 minutes ago
as a part time schemer, I also love Clojure and reach for it more often than Scheme these days.
reply
ggm 12 hours ago
> Actually, in my opinion, Scheme (and Lisp) allows you to express complex systems and problem domains in more simple terms than any other language can.

Short article. Worth reading. But all I swallowed was this one sentence.

Its the sytax. If you like semicolons, thats why you like Pascal-like languages.

reply
reikonomusha 2 hours ago
For all practical purposes, the syntax of Lisp isn't just a cosmetic choice, though.
reply
rauli_ 25 minutes ago
Lisp was meant to be written with M-expressions instead of S-expressions anyway.
reply
wild_egg 2 hours ago
If you know lisp, just reach for Coalton instead of Haskell
reply
anonzzzies 57 minutes ago
Coalton has some evolution to go before that, but it is good and flexible enough.
reply
reikonomusha 46 minutes ago
What evolution in particular do you think? The developers use it for commercial products in quantum computing and defense [1]. That doesn't mean it's done in some complete language ecosystem sense (which is discussed in [1], and one could argue Haskell also never feels "finished"), but it also doesn't seem like an unfinished hobby project. Given that it's embedded in Common Lisp, there's always a way to fill in the library gaps, sort of like how if a "native" library doesn't exist in Clojure, one can always reach for Java.

[1] From Toward Safe, Flexible, and Efficient Software in Common Lisp at the European Lisp Symposium, "[Coalton] has been used for the past 5 or so years [...] first in quantum computing and now a serious defense application." https://youtu.be/xuSrsjqJN4M&t=9m14s

reply
anonzzzies 21 minutes ago
I am an avid sbcl and coalton user (and sponsor of both when I can) and never said it was not a great thing; comparing it to Haskell is, outside the theoretical type system roots, just a bit early type system wise.

I agree with you further and you did an excellent promotional comment for Coalton and CL; keep doing that please. I have said many times here before that I did not like my time away from CL and Coalton makes it even better.

reply
busterarm 2 hours ago
I learned Scheme before Haskell and as much as I enjoyed the experience, I still wouldn't reach for Haskell first. It's pretty much limited to my xmonad configuration.
reply
nathan_compton 53 minutes ago
I have written a very large codebase in Scheme (gambit) and in the end I really, really, wanted a type system to catch bugs.
reply
z3ratul163071 2 hours ago
[flagged]
reply