Live data from Hacker News

Why I still reach for Lisp and Scheme instead of Haskell

jointhefreeworld.org

141–150 of 172 posts

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

#141
post #101
post #43

> You can pause, inspect objects, change values, and even redefine a broken function on the fly to test a fix in any environment (yes even in production, while running). I see this mentioned often, and it sounds amazingly useful (especially the part about fixing in production!). But how truly widespread is it among the Lisp dialects to be able to connect to a running program, debug, and hotfix it? I understand Common…

Yes but I don’t know how someone familiar with a Jetbrains IDE can claim that only Lisp has that feature. I love Common Lisp and SLIME, but most of what it can do, I can also do in Java with the IDE. Change a method definition while it’s running and then restart the method? No problem. Run any code within the context of the running method? Yes, Java can do it. Change local variables values in the middle of a method?…

I can evaluate C++ code in a stack frame in the Visual Studio Debugger these days

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

#142
post #125
post #101

Earlier quoted context omitted.

Yes but I don’t know how someone familiar with a Jetbrains IDE can claim that only Lisp has that feature. I love Common Lisp and SLIME, but most of what it can do, I can also do in Java with the IDE. Change a method definition while it’s running and then restart the method? No problem. Run any code within the context of the running method? Yes, Java can do it. Change local variables values in the middle of a method?…

I've frequently said that Java + JRebel gets the closest to the Common Lisp + slime experience (closer than Python) but as you say the Lisp experience is still superior, the Java ecosystem has yet to close the gap*. The widest part of that gap I'd mention is in not having the condition system built-in to Java (though I'm aware people have tried to make a comparable one as a library), lacking it degrades the debugging…

Thanks for this. Saved: https://gist.github.com/vindarel/3484a4bcc944a5be143e74bfae1...

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

#143
post #43

> You can pause, inspect objects, change values, and even redefine a broken function on the fly to test a fix in any environment (yes even in production, while running). I see this mentioned often, and it sounds amazingly useful (especially the part about fixing in production!). But how truly widespread is it among the Lisp dialects to be able to connect to a running program, debug, and hotfix it? I understand Common…

It’s trivially easy to do in Clojure (literally one line of code to start an nREPL server, after deps/requires), and often very useful in dev and personal, local projects. In practice, I’ve never once used it in a user-facing production system, in 16 years of writing Clojure. Out of the box, there’s zero security or audit trail. Building that properly isn’t trivial and, even with it in place, many corporate infosec t…

Yeah, I mean ... shipping a RCE backdoor gets you some cool hacker war stories but it's still shipping a RCE backdoor.

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

#145
post #128

Earlier quoted context omitted.

I use it a lot for my one man projects; it is really fantastic in that setting. I use SBCL exclusively; it is very fast and robust and has image based development. I have my own versioning toolkit so I don't go insane. It is obvious why it is not really used or recommended as it really falls flat in a team setting, mostly even when 2 people are involved. But fixing bugs live as they happen and then spitting out a new…

What makes you think it falls flat in a team setting? There are plenty of N-pizza-sized teams successfully using Lisp to this day and you're probably aware of many teams successfully using Lisp in the past, too. There's also the success of Clojure. What's required to have a well functioning team is mostly programming language independent; Lisp itself won't save a team lacking those properties anymore than say Java wo…

Did you even read what I said or who I responded to? I am specifically talking about working inside an image, monkey patching functions and structures live in the running image. A practice almost no one uses anymore and of which I said that as a single dev on a project I use and find convenient, but I would not want to use it in a team; for that, modern workflows with versioning, beaming code, ci/cd, dev containers etc are preferred.

I prefer lisp over most other things in life, and so does my team. I was specifically not talking about the language though.

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

#146
post #71
post #34

Earlier quoted context omitted.

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 Kernel I would use something like this: true #t false #f null () [...] (& ...) "k" : v (: k v) {...} (@ ...) Where &, :, @ are defined as: ($define! & ($lambda args (cons list args))) ($define! : ($vau (key value) env (list key (eval value env)))) ($define! @ (wrap ($vau kvpairs env (eval (list* $bindings->environment kvpairs) env)))) Using the "person" example from the JSON/syntax section on Wikipedia: ($define!…

I don't know kernel very well; what will the value of person print as?

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

#147
> 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.

I disagree with this. Lisps are procedural languages like most other programming languages. They can describe procedures in a relatively simple manner (big asterisk on that one, the simplicity of Lisp as a language is greatly overstated and conflated with the simplicity of s-expressions), but procedures aren't really good at expressing complex systems or problem domains. In my experience, relational languages like Prolog are vastly better at this. Lisps are much easier for the average programmer to pick up and write reasonably performant code with, though.

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

#148
post #99
post #89

Earlier quoted context omitted.

Think of macros as what you want when you want to perform computation at compile time rather than run time. An example: building the equivalent of a switch statement, but that compares (via string equality) with a set of strings. The macro would translate this into code that would do something like a decision tree on string length or particular characters at particular positions. Basically anything that's done with a…

The other motivation for me is to drastically reduce boilerplate code. I can’t believe people here are saying they never use macros, they are so good for this that avoiding them sounds to me like a skill issue! Overuse can damage readability, sure, but so can pretending macros are not an option.

In Common Lisp macros can also be used to implement a kind of Aspect-Oriented Programming, using the macroexpand hook. This hook enables macroexpansion to be dynamically modified at compile time without changing the source code.

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

#149
post #71

Earlier quoted context omitted.

In Kernel I would use something like this: true #t false #f null () [...] (& ...) "k" : v (: k v) {...} (@ ...) Where &, :, @ are defined as: ($define! & ($lambda args (cons list args))) ($define! : ($vau (key value) env (list key (eval value env)))) ($define! @ (wrap ($vau kvpairs env (eval (list* $bindings->environment kvpairs) env)))) Using the "person" example from the JSON/syntax section on Wikipedia: ($define!…

I don't know kernel very well; what will the value of person print as?

There's no "external representation" for environments. In klisp it will just print:

    [#environment]
The environment type is encapsulated, so it doesn't give you very useful debug information.

Perhaps having `@` produce an environment is the wrong approach and we should just produce an association list instead - then move `$bindings->environment` into the `?` operative to enable querying.

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

#150

> 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. I disagree with this. Lisps are procedural languages like most other programming languages. They can describe procedures in a relatively simple manner (big asterisk on that one, the simplicity of Lisp as a language is greatly overstated and conflated with the simplic…

I think it all depends on the shape of the problem. I love Prolog for its expressive power, sometimes. Complex simulation problems are really nice to model in OCaml or CLOS, and then again, maybe remodelling in Prolog brings some insights. And often writing a recursive function in Lisp is all you need to understand a complex system. It's all layers. An outer shell to prolog would be a theorem solver for example, because Prolog is a very rudimentary one.
Post reply on HN