Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's funny how close your example are to S-expressions, just replace the pointy brackets with round parenthesis and move the closing one to the end:

  (table
    (tr
      (td one)
      (td two)
      (td three))
    (tr
      (td another table)
      (td with more stuff)))


i love s-expressions, but they have closing tags, so to me they are precisely not what the parent example shows. i prefer writing html with closing tags because then i can use any xml parser and my editor can jump from opening to closing tag and back.


Well, sorta. XML style syntax already has open and closing marks for the tags. They just additionally have marks for the end of non-attribute children. s-expressions not having that is still a win.


yes, s-expressions are a win (that's why i love them) but i don't see the xml structure that way. for me the tags themselves are very elaborate opening and closing markers. that's simply how i perceive it. if a closing tag is missing when there should be one, the structure looks broken to me.

the example s-expression matches that structure and i perceive it as the same because the first element in any list has a special meaning (in lisp itself it is the function name, while the rest are arguments)

to replicate the html5 structure in the top comment without closing tags as s-expressions i would come up with something different:

  (table
    (tr)
      (td) one
      (td) two
      (td) three
    (tr)
      (td) another table
      (td) with more stuff)


I think I see your point, but it feels weird to see this form, to me.

To your point, I can see the opening tag as ( and the closing as ), but then that would lead to something more like:

    (table
      (tr
        (td one
        (td two
        (td three
      (tr
        (td ...
Which really just highlights how odd it is to see the opening tags without the closing ones. Which probably goes a long way to explaining why I don't like it. :D

Probably more natural to have something like:

    (html 
      table
        tr
          td "one"
          td "two"
        tr
          td "...")
In this way, you could optionally have the closing tags of /td and such. Still looks very weird to me.


I liked jade/pugjs or other templatong language that allowed similar stuff back then.

Sadly they have fallen out of favour.


I still use Pug with Vue, it has perfect support and it feels just so good to write. Especially combined with Tailwind!


I've seen quite a few HTML templating engines that look just like this (in C#, TS and Python)


Plus by moving the closing bracket to the end, it resolves any ambiguity in nesting.


It also tosses the baby out, as you're in that horrible area of distinction-without-difference.


S expressions with colored braces in ides are amazing


Mthis is the idea with Pollen, a static site generator implemented in Racket.

The markup experience was super nice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: