←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 2 comments | | HN request time: 0s | source
Show context
taeric ◴[] No.41860340[source]
I do think LISP remains the major language that can encompass the strange loop idea he explored in his work. I know LISP is not the only homoiconic language, but it is the biggest that people know how to use where the "eval" function doesn't take in a string that has to be parsed.

I hate that people are convinced LISP == functional programming, writ large. Not that I dislike functional programming, but the symbolic nature of it is far more interesting to me. And it amuses me to no end that I can easily make a section of code that is driven by (go tag) sections, such that I can get GOTO programming in it very easily.

replies(6): >>41860620 #>>41860888 #>>41861136 #>>41861546 #>>41862219 #>>41893256 #
nine_k ◴[] No.41860620[source]
Another (properly functional) homoiconic language that enjoyed mainstream adoption briefly in '00s is XSLT. Its metaprogramming features were rather widely used, that is, producing an XSLT from XSLT and maybe some more XML, instead of hand-coding something repetitive, was rather normal.

The syntax was a bigger problem than Lisp's syntax, though.

It's not easy to produce a language with a syntax that's good as daily use syntax, but is also not unwieldy as an AST. Lisp is one of the few relatively successful examples.

replies(4): >>41860924 #>>41861081 #>>41863504 #>>41868000 #
pmarreck ◴[] No.41863504[source]
I don't know how many other languages use it but I've long admired Elixir's approach to giving devs access to the AST using its basic types in order to write macros:

https://hexdocs.pm/elixir/macros.html

It is certainly possible to implement this sort of thing in other languages, I think, depending on the compilation or preprocessing setup

replies(1): >>41867355 #
1. medo-bear ◴[] No.41867355[source]
Possible doesnt mean "requires same ammount of effort"
replies(1): >>41868875 #
2. pmarreck ◴[] No.41868875[source]
That's fair. I think it's a big win, though. Macros, when the situation calls for it, are amazing. For example, I believe most of the UTF8 handling code in Elixir was done via macros which brought down the amount of code that had to be maintained by quite a bit.