←back to thread

The programmers who live in Flatland

(blog.redplanetlabs.com)
107 points winkywooster | 5 comments | | HN request time: 0.194s | source
Show context
nathan_compton ◴[] No.46183965[source]
Big lisp guy here. Have written tens of thousands of lines of scheme, at least, and common lisp.

But I don't get this "Lisp is so much better than everything else," thing. It feels very jejune to me.

Most lisp programmers barely use macros and most programming languages these days have most of the features of Lisp that originally made it useful (automatic memory management, repls, dynamic typing*, and even meta-programming if you really want it).

I do think that most common languages are mediocre but mediocrity is just how humans are.

--

If I had one thing I want fixed about Scheme it would be the dynamic typing, especially since many Schemes compile aggressively. Finding bugs is much harder when your apparently dynamic language has compiled out everything useful for understanding an error condition. Most of those mistakes could be caught at compile time.

replies(1): >>46186616 #
1. antonvs ◴[] No.46186616[source]
> If I had one thing I want fixed about Scheme it would be the dynamic typing

The ML family or Haskell fit that bill. Both OCaml and Haskell also have an equivalent of macro systems. So does e.g. Rust, for that matter.

I agree with your main point. The attitude you’re referring to is largely a relic of a previous era, at this point.

replies(2): >>46187647 #>>46194283 #
2. wild_egg ◴[] No.46187647[source]
None of the macro systems in those languages are really equivalent to lisp macros.

If you really want static typing, Lisp macros are powerful enough to implement a full ML type system in userspace as a library.

See https://coalton-lang.github.io

replies(1): >>46188199 #
3. antonvs ◴[] No.46188199[source]
> None of the macro systems in those languages are really equivalent to lisp macros.

Sure, but we’d hardly expect equivalence in such different languages.

I’ve written macros in all the languages I’ve mentioned, as well as Scheme’s syntax-rules and syntax-case, and in practice I don’t see some big advantage of any of them.

What actual useful macros do you write in Lisp, that would also be useful in one of those other languages, but can’t be expressed by their macro systems? Not saying it’s not possible to come up with theoretical examples, but what’s going to actually impact a programmer in those languages?

> If you really want static typing, Lisp macros are powerful enough to implement a full ML type system in userspace as a library.

On the other side of the fence, using Camlp5 you can implement Lisp or Scheme syntax and have OCaml run it directly. I did a toy implementation of that for Scheme years ago using Camlp4. You could easily implement syntax-rules macros in that environment. I enjoy games like that, but I don’t see much impact for real-world programming.

I think Coalton is cool, but I think you start to run into the limitations of Lisp syntax. I’d rather use Haskell to write that kind of code, it’s more concise. And to quote Paul Graham, succinctness is power. (PG does not endorse this message!)

replies(1): >>46194303 #
4. nathan_compton ◴[] No.46194283[source]
Just want that sweet s-expression syntax, though.
5. nathan_compton ◴[] No.46194303{3}[source]
In recent years the only macro I really find myself writing (if it isn't supported in the base language) is pattern matching. If a language has that then I feel there isn't much else use for macros.