Live data from Hacker News

Why I still reach for Lisp and Scheme instead of Haskell

jointhefreeworld.org

131–140 of 172 posts

Re: Why I still reach for Lisp and Scheme instead of Haskell

#131
post #118

Earlier quoted context omitted.

That's fine for a library or locally run executable, but I've worked on distributed systems in Haskell and you really need logging in place to track what is going on. Of course, you will have IO somewhere in a executable where you can handle logging so just separate pure and IO and make sure you have good tests for the pure functions. Also, linting to catch partial functions and dangerous lazy ones (or use an alterna…

Sure you want logging and tracing (in the RPC sense not Debug.Trace.trace). Most of this can still be done from IO places where the pure functions collect enough error information bubbling up (e.g. content and line/col of parser errors etc.) to not need ad hoc print statements for debugging.

In practice this just doesn't happen because you've composed a bunch of pure functions with various branches within them.

You lose the ability to log "why" some effect is happening.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#132
post #118

Earlier quoted context omitted.

Sure you want logging and tracing (in the RPC sense not Debug.Trace.trace). Most of this can still be done from IO places where the pure functions collect enough error information bubbling up (e.g. content and line/col of parser errors etc.) to not need ad hoc print statements for debugging.

In practice this just doesn't happen because you've composed a bunch of pure functions with various branches within them. You lose the ability to log "why" some effect is happening.

Eh sure. But you can always collect/carry decisions in something like an Either. When using arrows or your own monadic bindings it is even possible to abstract this away from view.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#133
post #64

Earlier quoted context omitted.

it's been my experience that when most people say "Lisp does this that or the other", what they usually mean is "Common Lisp does this that or the other". Often there's an implicit "with SLIME" in there as well

This is doable in Common Lisp, Scheme/Racket, and Clojure. Yes, it might require some tooling.

Can you elaborate on how this is doable (in, say, Racket) and what tooling is needed? I'm afraid your reply doesn't add much information beyond the same assertion that I quoted that was in the article posted to HN. And I haven't been able to find information on this with Racket.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#134
post #117

I think I much prefer Haskell DSLs over Lisp macros as the basis for APIs in foreign code. That might be due to my relative inexperience with Lisps, but macros just seem to make all the bad aspects of dynamically typed langues much worse. Looking at some piece of code in isolation, not only is it often impossible to tell what is the type/shape of data that are coming in (as is common with dynamic type systems) but wi…

I wrote a couple macros that record data transiting through code at runtime (it's in Clojure, so basically almost every function is pure, returning what they produce as if it was water flowing out of a faucet), stores these intermediary results in a file, and finally display these values in the code itself, as comments, just below the call-site that produced them.

You can then, for a given call-site, choose to "load" these recorded computations, which will change the displayed comments, both below this call site and all the other instrumented call-sites that are downstream to it, even for code sitting in other source files.

It's a bit fragile and needs more polishing but it's a lot more convenient than any type system that will always get in the way, be not powerful enough, and it allows me to see what kind of data flows in my program without running it. Because I record everything and display the result not at compile-time but at coding time, in the same window, alongside the rest of the code. I don't understand why this was never done (to the best of my knowledge). Biggest limit I encounter is that Clojure doesn't provide any mean to identify areas in my code that are not pure.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#135

Irrespective of the language, I love the REPL. For this reason, among others, I just cannot get into Agentic Coding. It seems like a step back to batch processing.

Many people here are saying AIs work great with the REPL.

I think it does, but Agentic does not.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#136

Earlier quoted context omitted.

I have written a very large codebase in Scheme (gambit) and in the end I really, really, wanted a type system to catch bugs.

I get where you're coming from but I talked to a few folks working in large Haskell codebases and I'm not sure I would make that trade.

Yeah, its genuinely a case of "software hard."

Re: Why I still reach for Lisp and Scheme instead of Haskell

#137
post #122

Earlier quoted context omitted.

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`.

kawa is unfortunately a somewhat shoddy project. Alot of halfbaked features / abstraction ideas (eg trying to support CL for whatever reason), dubious tooling for a java project (autotools), unclean and inconsistent code formatting. It's missing some features that are expected in a real scheme like multishot continuations; someone wrote research about it as a MSc thesis, but due to mentioned shoddiness its integratio…

Its funny, I can definitely sympathize with wanting multishot continuations, but I can't think of many times where I have wanted them to solve a problem.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#138
post #107

Earlier quoted context omitted.

It's just not good because you need to work around its limitations, whatever its purpose is. Not good for prototyping because it's the red tape you need to cut to get work done. Red tape isn't, in general, a bad thing, but when it comes to prototyping it is.

I think most people misunderstood syntax rules. It was not meant as the macro system for scheme. It was meant as the template macro system everyone could agree on, while leaving the more powerful low level macro systems to the implementations. Syntax case, or explicit/implicit renaming or syntactic closures or what have you.

Agree. It got the ball rolling.

Re: Why I still reach for Lisp and Scheme instead of Haskell

#139
post #34
post #8

> 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 t…

How do Lisp developers deal with XML and JSON? Convert it to s-expressions. As a common lisp developer, that is only very vaguely true for me. The mapping I prefer for json Lisp is: true: t false: nil null: :null [] #() {} (make-hash-table :test #'equal) This falls out of my desire for the mapping to be bijective: - The only built-in type that is unambiguously a mapping type is hash-tabe. - nil is the only value that…

In Clojure

    true: true
    false: false
    null: nil
    []: []
    {}: {}

Re: Why I still reach for Lisp and Scheme instead of Haskell

#140
post #100

Earlier quoted context omitted.

> [...] who thought it was okay to yell at people about [...] That society as a whole accepts this kind of abuse, no matter industry or circumstances, is beyond me. It's an abuse of power. If anybody did this to anyone, the only appropriate response should be to walk and never come back. Nobody would want to accept this kind of crap from family and friends, so why is it ok in a professional setting? Because of the mo…

> Nobody would want to accept this kind of crap from family and friends Hm… I think I have bad news for you.

Yes, often you're the pressure-release valve for urges that friends and family otherwise suppress. Especially family.
Post reply on HN