Live data from Hacker News

The Lisp Curse (2017)

winestockwebdesign.com

71–80 of 93 posts

Re: The Lisp Curse (2017)

#71
post #2

> Real Hackers have also known, for a while, that C and C++ are not appropriate for most programs that don't need to do arbitrary bit-fiddling. Strongly disagree with this statement. I've read it so many places now that it has to be a meme. I actually wish I could use C++ on the web instead of this JS nightmare ecosystem. I don't understand where the idea comes from. I'm never "bit-fiddling" in C++ and almost never n…

[deleted]

Re: The Lisp Curse (2017)

#72
post #47
post #6

OP posted despite the opening paragraph! > Update on October 6, 2017. N.B.: Please stop submitting this to Hacker News! Look at the Hacker News search results for this essay. Check out the note for the first entry: Come on, everyone! Let's beat the dead horse one more time! Past discussions https://hn.algolia.com/?query=The%20Lisp%20Curse&type=story&...

Dunno, I've been on HN since 2007 and this is the first time I've seen this story.

Yes. XKCD 1053 applies here. And this is evergreen content.

I wonder why the author is upset about the posts. Does it generate too much costly traffic? Do they receive a lot of e-mail because of their essay?

Re: The Lisp Curse (2017)

#73
> Dr. Mark Tarver — twice-quoted, above — wrote a dialect of Lisp called Qi. It is less than ten thousand lines of macros running atop Clisp. It implements most of the unique features of Haskell and OCaml. In some respects, Qi surpasses them. For instance, Qi's type inferencing engine is Turing complete. In a world where teams of talented academics were needed to write Haskell, one man, Dr. Tarver wrote Qi all by his lonesome.

Check out https://github.com/factor/factor. Check out how much stuff they have implemented early on, just 2-4 guys tops. I found it really impressive.

Re: The Lisp Curse (2017)

#74
post #58
post #42

Earlier quoted context omitted.

Yeah, I agree. If you're willing to use a garbage collection library [0], you can even have a pleasant syntax for ObjectiveC style OOP in C: var result = call(foo, "bar: %s boo: %f", baz, hoo); The garbage collector will pick up the stray memory and release other resources (files) as needed, and all the standard compilers will check the varargs format string for you. Dynamic typing, arbitrary messages, and no memory…

Why do you need GC to support this syntax? The syntax has nothing to do with whether or not the semantics of the language permit memory leaks.

You don't need the GC of course, but manually tracking and releasing the memory takes all the fun out of this kind of high level programming, particularly when you start to nest expressions. As a hypothetical example:

    call(
        window, "draw: %d %d %p", x, y, 
        alloc("Circle radius: %d color: %u", r, 0xFF0000)
    );
That ignores the return value and loses track of the temporary argument.

This is all in response to the article claiming you "need to be Bjarne Stroustrup to add OOP to C, but it's a sophomore assignment to add it to Lisp". If I hadn't mentioned the GC, someone else would've jumped on the example for how unpleasant manual memory management is in comparison to Lisp.

Re: The Lisp Curse (2017)

#76
post #74
post #58

Earlier quoted context omitted.

Why do you need GC to support this syntax? The syntax has nothing to do with whether or not the semantics of the language permit memory leaks.

You don't need the GC of course, but manually tracking and releasing the memory takes all the fun out of this kind of high level programming, particularly when you start to nest expressions. As a hypothetical example: call( window, "draw: %d %d %p", x, y, alloc("Circle radius: %d color: %u", r, 0xFF0000) ); That ignores the return value and loses track of the temporary argument. This is all in response to the article…

I was responding to this:

> If you're willing to use a garbage collection library [0], you can even have a pleasant syntax for ObjectiveC style OOP in C:

That sounded to me as if you were claiming that GC is a pre-requisite for having a particular syntax. But I gather that's not what you meant. I'm still a little unclear about what you actually meant. You can have memory leaks like the one in your example above in vanilla C without any OOP features at all. GC is completely orthogonal to OOP, and both are completely orthogonal to syntax.

Re: The Lisp Curse (2017)

#78
post #76
post #74

Earlier quoted context omitted.

You don't need the GC of course, but manually tracking and releasing the memory takes all the fun out of this kind of high level programming, particularly when you start to nest expressions. As a hypothetical example: call( window, "draw: %d %d %p", x, y, alloc("Circle radius: %d color: %u", r, 0xFF0000) ); That ignores the return value and loses track of the temporary argument. This is all in response to the article…

I was responding to this: > If you're willing to use a garbage collection library [0], you can even have a pleasant syntax for ObjectiveC style OOP in C: That sounded to me as if you were claiming that GC is a pre-requisite for having a particular syntax . But I gather that's not what you meant. I'm still a little unclear about what you actually meant. You can have memory leaks like the one in your example above in v…

Yeah, I got your point. I don't think we're in disagreement about anything, and I probably shouldn't have conflated multiple topics. It's not really _syntax_, but this would be uglier to me:

    var temp = alloc("Circle radius: %d color: %u", r, 0xFF0000);
    var ignored = call(window, "draw: %d %d %p", x, y, temp);
    drop(ignored);
    drop(temp);
What's a good word for the overall/high level result being less attractive while the low level syntax isn't really the problem? Having a GC does tidy up the code and make it feel high level like Lisp/SmallTalk.

Re: The Lisp Curse (2017)

#79
post #62

I just wish more people understood that something being Turing Complete isn't a feature, it's a flaw.

Turing completeness may be a flaw, but it is nearly impossible to avoid.

Not true at all. It is hard, but not impossible. Technologically it's very challenging because we don't have non-TC programming languages that are able to keep up with modern ones. But, for example, we have (safe) Agda which is not TC (all programs marked --safe should prove to halt) and you can write useful programs. Here, "useful" is a subjective qualifier, but I personally implemented many parsers in Agda (including a json parser) so for my definition of useful, Agda is one such language.

Re: The Lisp Curse (2017)

#80
post #14

I just wish more people understood that something being Turing Complete isn't a feature, it's a flaw.

How so?

E.g. you can require all programs to halt, which makes the language non-TC since the language has a trivial solution to its halting problem. There are other ways too, but this is approach e.g. Agda takes.

Note that you can still build useful programs this way since such languages can still allow certain forms of recursion such as primitive recursion, structural recursion etc... You can also use sized types [1] to allow even a larger set of (halting) programs.

[1] This is a way of compiler statically analyzing the size of each type (i.e. how many recursive constructors necessary) which puts an upper bound on the number of recursions need to be performed.

Post reply on HN