Most active commenters

    ←back to thread

    Hofstadter on Lisp (1983)

    (gist.github.com)
    372 points Eric_WVGG | 12 comments | | HN request time: 1.663s | source | bottom
    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 #
    1. 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 #
    2. AnimalMuppet ◴[] No.41860924[source]
    > The syntax was a bigger problem than Lisp's syntax, though.

    Yeah. XML and S expressions are pretty close to functionally equivalent. But once you've seen S expressions, XML is disgustingly clumsy.

    replies(3): >>41861884 #>>41862032 #>>41862128 #
    3. apex_sloth ◴[] No.41861081[source]
    Thanks for this little flashback to when I had to write XSLT for apache cocoon as my student job
    4. nine_k ◴[] No.41861884[source]
    SGML was intended for sparse markup in mostly plaintext files. From it grew HTML that is markup-heavy, and XML which is often 100% markup. What made sense for rare markup nodes became... suboptimal when applied in a very different role.
    replies(1): >>41862620 #
    5. pfdietz ◴[] No.41862032[source]
    "Any data can be turned into Big Data by encoding it in XML."
    replies(1): >>41867011 #
    6. chubot ◴[] No.41862128[source]
    They have a different model -- one is better for documents, and one is better for programs/data

    XML and HTML are attributed text, while S-expressions are more like a homogeneous tree

    If you have more text than metadata, then they are more natural than S-expressions

    e.g. The closing </p> may seem redundant, until you have big paragraphs of free form text, which you generally don't in programs

    7. jll29 ◴[] No.41862620{3}[source]
    1. GML => SGML => XML

    2. rm *

    3. JSON

    4. rm -rf /

    8. 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 #
    9. fuzztester ◴[] No.41867011{3}[source]
    Wow.

    Also:

    XML: eXtremely Murky Language

    or Mindblowing

    10. medo-bear ◴[] No.41867355[source]
    Possible doesnt mean "requires same ammount of effort"
    replies(1): >>41868875 #
    11. pjmlp ◴[] No.41868000[source]
    For a while that is how I made my Website dynamic, by writing everything in XML and linking XSLT stylesheets, however the future ended up not being XHTML, and eventually I rewrote those stylesheets in PHP.

    Doesn't win any price, or content worth of "I rewrote X in Y" blogpost, but does the job.

    12. pmarreck ◴[] No.41868875{3}[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.