Live data from Hacker News

Understanding the Power of Lisp (2020)

joshbradley.me

131–140 of 140 posts

Re: Understanding the Power of Lisp (2020)

#131

Earlier quoted context omitted.

The GUI application was particularly elegant because the program would detect the changes in the database, change the class structure and attributes of screens and widgets at runtime with all runtime instances being updated. Note that this was written decades ago, way before people got excited at Swift UI, Qt QML or Javascript web apps. As for "just using AST", it is tedious to me, that's why I don't bother with it i…

Yep nothing that I haven’t done in other languages. I learned Typescript and wrote a 52 page business application from scratch in a few months using the declarative approach. I used JSON to declare everything the same way you would declare it in Lisp and had all the same advantages. Parsing JSON in Typescript is a single line of code. The same as calling read in Lisp. And a college of mine took the application and ea…

That's really cool, but you should then be aware that what you are describing is a subset of what homoiconic languages offer as "data is code".

Some time ago I wrote a sort of DevOps tool in Python (because I know better than to start new projects in Lisp in most settings). This tool had preconfigured tasks defined as point-free style functions that were easily composable. Non programmers were able to define their own pipelines either submitting a YAML file or dragging & dropping these components in a web UI. This was very powerful, but anything remotely complex (if you didn't want to end up reinventing Forth) required dropping down to Python to define these.

JSON and YAML are very good at conveying structure, but fall sort for anything else. It would be like doing any sort of complex programming with Ansible via just using roles and playbooks. It's possible, but no one sane does.

Now the question is if this really matters. Judging at the shape of the industry, the clear answer is no.

Re: Understanding the Power of Lisp (2020)

#132
post #102
post #63

Earlier quoted context omitted.

If I am reading this right, TCL's approach is neither FEXPRs nor Lisp's macros -- instead, it is a very concise "quote" command and "uplevel" command which is something I have not seen widely used in any other language. In the lisp terms, imagine a language with no macros and with immediate evaluation ("applicatives" in the Kernel-speak). And no special forms either, except for syntax-level quote command. This means…

In my opinion, there are two big things that Kernel brings to the table: 1) Arguments are not automatically evaluated before being passed to the underlying "operative" in Kernel-speak. This is important because it obviates the need for the macro machinery. This is fairly similar to Tcl. 2) Environments are first-class in Kernel. This is important because you can now constrain the scope explicitly . Do I want to evalu…

Note that Tcl 8.5 added a mathop package https://www.tcl.tk/man/tcl8.5/TclCmd/mathop.html which means you absolutely can write [+ 1 2] now if you import the relevant procs.

Re: Understanding the Power of Lisp (2020)

#133

Earlier quoted context omitted.

Yep nothing that I haven’t done in other languages. I learned Typescript and wrote a 52 page business application from scratch in a few months using the declarative approach. I used JSON to declare everything the same way you would declare it in Lisp and had all the same advantages. Parsing JSON in Typescript is a single line of code. The same as calling read in Lisp. And a college of mine took the application and ea…

That's really cool, but you should then be aware that what you are describing is a subset of what homoiconic languages offer as "data is code". Some time ago I wrote a sort of DevOps tool in Python (because I know better than to start new projects in Lisp in most settings). This tool had preconfigured tasks defined as point-free style functions that were easily composable. Non programmers were able to define their ow…

[deleted]

Re: Understanding the Power of Lisp (2020)

#134

Earlier quoted context omitted.

Yep nothing that I haven’t done in other languages. I learned Typescript and wrote a 52 page business application from scratch in a few months using the declarative approach. I used JSON to declare everything the same way you would declare it in Lisp and had all the same advantages. Parsing JSON in Typescript is a single line of code. The same as calling read in Lisp. And a college of mine took the application and ea…

That's really cool, but you should then be aware that what you are describing is a subset of what homoiconic languages offer as "data is code". Some time ago I wrote a sort of DevOps tool in Python (because I know better than to start new projects in Lisp in most settings). This tool had preconfigured tasks defined as point-free style functions that were easily composable. Non programmers were able to define their ow…

Yep there are cool things you can do in Lisp that you can’t do in other languages. But, as you say, it doesn’t matter to most developers. What matters to most developers is a large language community, and a great selection of battle proven frameworks/libraries to make their job easy. Look at JavaScript going from the ugly duckling of languages that nobody use, to being absolutely essential to millions of programmers everywhere. Not because of the language, but because of the large community of developers forced to use JavaScript, resulting in a huge supply of frameworks and support/help available to JavaScript developers. If Lisp had been used instead of JavaScript, it might have been equally popular today. I personally would have preferred that actually.

Re: Understanding the Power of Lisp (2020)

#135

Note that the examples in the "cdr" section are incorrect. (cdr '(x a)) ; does not return a, it returns (a) (cdr '((x a) y)) ; does not return y, it returns (y) (cdr '((x a) (y b))) ; does not return (y b), it returns ((y b))

The author might be new to Lisp, and I hope what I write doesn't discourage him. There are some other mistakes: ((ab . c) . d . nil) isn't a valid s-expression. Maybe it should be ((ab . c) d . nil) Also, (eq '(a b) '(a b)) ; (a b) is a list and cannot be evaluated by eq eq works fine on lists. It returns T iff its arguments are the same object (i.e. are at the same memory location, or are small enough integers or fl…

Author here, thank you for pointing this out! I was a LISP beginner when I wrote this, I'll certainly update this.

Re: Understanding the Power of Lisp (2020)

#136
post #2

The thing is that trying to understand "the power of Lisp" via the toy interpreter from The Roots of Lisp[0] is like trying to understand "the beauty of the sea" after seeing a single five-minute YouTube video explaining it. It will give you the basic idea, but it won't tell you about macros, reader macros, compiler macros, and having the whole language always available to build your abstractions on; it won't tell yo…

Author here, that's an apt analogy. Perhaps it helps to understand where I was coming from; I had never written a line of LISP and was struggling to fully grasp the power that Paul Graham had hinted at. So I started at the beginning, and although it was just the brim of the rabbit hole it certainly opened my eyes. And I hope it can help other beginners open their eyes as well.

I plan to fall down the LISP rabbit hole one day, and continue this series in full detail.

Re: Understanding the Power of Lisp (2020)

#137
post #65

LISPs power is it's problem. Why would I want a powerful language? I want a language that has one and only one obvious way to do things. That doesn't require building my own language features or choosing an addon that might or might not be compatible with others. I don't have any use for the flexibility to customize a language because I want a language that doesn't need to be customized. If I was doing cutting edge A…

> Why would I want a powerful language? You clearly don't, since your aim is to write boring and forgettable code. I don't think there is anything wrong with that -- you can write boring code to solve interesting and worthwhile problems, and overall the tendency is probably to err on the side of getting distracted by hip or shiny tech. But some people enjoy writing interesting code, and sometimes interesting code is…

That's definitely fair, there does seem to still be plenty of worthwhile problems that require interesting code.

It's mostly way above my level though, so for now I'll stick to solving the trivial stuff, so the real geniuses can get back to work.

Nobody might ever say "Wow that's some great code", in fact they'll probably say it's bloated and mediocre... but they'll be glad I thought to put an override button for that one edge case of the super trivial thing they thought was fine!

Re: Understanding the Power of Lisp (2020)

#138
post #130
post #45

Earlier quoted context omitted.

I know a startup that hired a Marxist-collective group of programmers. I was told this story years ago, and they were acquired, so I’ll just name the firm - “White Ops”. This story is so absurd that I’m naming the firm in hopes someone can verify the accuracy of this, although I trust the person that told me the tale. The programmers were based in Canada and only wrote in Haskell. The CTO of White Ops had apparently…

This story is a fabrication. Please tell John that we're worried about him.

John is one of the richest people on earth! True story

Re: Understanding the Power of Lisp (2020)

#139

Earlier quoted context omitted.

That's really cool, but you should then be aware that what you are describing is a subset of what homoiconic languages offer as "data is code". Some time ago I wrote a sort of DevOps tool in Python (because I know better than to start new projects in Lisp in most settings). This tool had preconfigured tasks defined as point-free style functions that were easily composable. Non programmers were able to define their ow…

Yep there are cool things you can do in Lisp that you can’t do in other languages. But, as you say, it doesn’t matter to most developers. What matters to most developers is a large language community, and a great selection of battle proven frameworks/libraries to make their job easy. Look at JavaScript going from the ugly duckling of languages that nobody use, to being absolutely essential to millions of programmers…

> If Lisp had been used instead of JavaScript, it might have been equally popular today. I personally would have preferred that actually.

And how close we came... and yet so far =(

https://brendaneich.com/2008/04/popularity/

Re: Understanding the Power of Lisp (2020)

#140

Earlier quoted context omitted.

Yep there are cool things you can do in Lisp that you can’t do in other languages. But, as you say, it doesn’t matter to most developers. What matters to most developers is a large language community, and a great selection of battle proven frameworks/libraries to make their job easy. Look at JavaScript going from the ugly duckling of languages that nobody use, to being absolutely essential to millions of programmers…

> If Lisp had been used instead of JavaScript, it might have been equally popular today. I personally would have preferred that actually. And how close we came... and yet so far =( https://brendaneich.com/2008/04/popularity/

Yeah it would have been really interesting to have scheme in the position where JS is today.
Post reply on HN