News for hackers. Stuff that matters.
Re:Show HN: HyTags – HTML as a Programming Language by velcrovan on Wednesday January 14, 2026 @01:22PM (#46620111)
HTML (and XMLish syntax in general) is LISP syntax (not semantics) in disguise. A tag can be viewed as function application, with the attributes as named arguments and the elements as variadic arguments.

The example from the link's main page is equivalent to:

    (button "Say something")
    (on_click
      (selection-insert-after
        (div "Hello, World ")))
[apparently HN strips all emoji but you get the idea]
Re:Show HN: HyTags – HTML as a Programming Language by dragonwriter on Wednesday January 14, 2026 @01:26PM (#46620189)
> HTML (and XMLish syntax in general) is LISP syntax (not semantics) in disguise

No, its not. If it was, the attribute vs. child element distinction would not exist. HTML (and HTML-inspired XML) syntax is not a trivial alternative to S-expression syntax, it is more complex with additional distinctions.

A simplified subset of (HT|X)ML that uses only elements and no attributes is pretty much directyl equivalent to S-expressions, sure.

Re:Show HN: HyTags – HTML as a Programming Language by embedding-shape on Wednesday January 14, 2026 @02:47PM (#46621827)
> A simplified subset of (HT|X)ML that uses only elements and no attributes is pretty much directyl equivalent to S-expressions, sure.

Add one more type, like a map, now you have attributes

  (fn btn ()
   (div
    {onClick (fn ())}
    "Click me"))
Re:Show HN: HyTags – HTML as a Programming Language by npn on Wednesday January 14, 2026 @09:47PM (#46627415)
Have you ever tried parsing html in s-expression languages before?

For example, in elixir parsing html is this syntax: `{html_tag, attributes, children}`.

You indeed can include attributes in s expression

Re:Show HN: HyTags – HTML as a Programming Language by shakna on Thursday January 15, 2026 @03:14AM (#46629622)
Every Lisp I know of has SXML either baked in, or as a library because it absolutely can represent the fullness of HTML...

    (parrot (@ (type "African Grey")) (name "Alfie"))
Becomes:

    <parrot type="African Grey"><name>Alfie</name></parrot>
https://www.gnu.org/software/guile/manual/html_node/SXML.htm...
Re:Show HN: HyTags – HTML as a Programming Language by dragonwriter on Thursday January 15, 2026 @03:29AM (#46629731)
Yes, (HT|X)ML have a semantic model that that can be represented in Lisp syntax, but so does everything else (well, every programming and data representation language, at least.) They don't do it with the same (or simple parallel) single simple syntactic fiundaton as Lisp, but with something more complex.
Re:Show HN: HyTags – HTML as a Programming Language by shakna on Thursday January 15, 2026 @03:43AM (#46629834)
... I'd call that simple, without complex additions. You're not exactly requiring a parser, here.
Re:Show HN: HyTags – HTML as a Programming Language by SkiFire13 on Wednesday January 14, 2026 @02:07PM (#46621006)
I'm not sure I see your point. Yes, you can describe the same meaning/structure with S-expressions and HTML/XML syntax, but that's the complete opposite of having the same syntax, in fact syntax is the difference!
Re:Show HN: HyTags – HTML as a Programming Language by lassejansen on Wednesday January 14, 2026 @01:25PM (#46620156)
Exactly, code is data ;)
Re:Show HN: HyTags – HTML as a Programming Language by publicdebates on Wednesday January 14, 2026 @01:29PM (#46620266)
Not sure how homoiconicity is related to this at all. Macros don't seem involved.

But I do think s-expressions are an improvement over HTML in certain scenarios.

That said (talking to OP now), why is the control handler outside the button?

In actual HTML, we have [button onclick="codeToBeEvaled()"]

In this thing, you have [button][onclick [sub-expressions]]

With s-expressions, at least you have some semblance of function calls, which would make control flow operators seem slightly more natural, but this hybrid of semantic and syntactic choice just seems bizarrely limited.

Re:Show HN: HyTags – HTML as a Programming Language by scatbot on Wednesday January 14, 2026 @01:52PM (#46620728)
>But I do think s-expressions are an improvement over HTML in certain scenarios.

I agree. S expressions are a data interchange format. HTML is a markup language. They solve different problems.

S expressions define nested lists of atoms. HTML describes semantic hypertext documents defined by a document tree made of element nodes as subtrees, attribute nodes as subtree metadata, and text nodes. In some scenarios a uniform data structure like s expressions is nicer to work with.

To be honest it boggles my mind that XML was ever used as a universal data format.

Re:Show HN: HyTags – HTML as a Programming Language by lassejansen on Wednesday January 14, 2026 @01:36PM (#46620405)
For most tags you can also put the event handlers as first children inside the element, but self-closing tags like <input> don't support that. I'm now putting the event handlers always outside (as next siblings) for consistency.
Re:Show HN: HyTags – HTML as a Programming Language by TeMPOraL on Wednesday January 14, 2026 @04:48PM (#46624119)
> Not sure how homoiconicity is related to this at all. Macros don't seem involved.

"Code is data" is more general and fundamental idea; it's a fact of nature. Homoiconicity is a way to try and embrace it instead of fighting it.

Re:Show HN: HyTags – HTML as a Programming Language by chajath on Wednesday January 14, 2026 @09:47PM (#46627409)