HTML: The Programming Language. "HTML, the programming language, is a practical, turing-complete[1], stack-based programming language based on HTML, the markup language. It uses elements defined in HTML, the markup language, in order to do computations."

22 comments · 91% upvoted · source · other discussions

comments

rodarmor

Footnotes: This was revealed to me in a dream.

Unfathomably based.

InfiniteGamerd

https://bigsky.software/ well that's interesting for a footnote

thyporter

Oh, it's made by the team that makes htmx and hyperscript. That explains a lot

betelgeuse_7

I don't think it is a team. It is only Carson Gross. I might be wrong, though.

_htmx

do split personalities count?

[deleted]

[deleted]

_htmx

I have some good news for you! HTML, the programming language is completely pluggable, so you can redefine HTML, the programming language, to have whatever semantics you would like!

https://html-lang.org/#extending

You can add new commands to the language, or redefine existing ones, by writing to html.meta.commands

If you want to implement custom control flow, simply return the next element to execute from your command definition, and HTML, the programming langauge, will jump to that element and begin executing it!

Don't feel like using the stack? No problem!

Want infix operators? Go ham!

Want to define the symbol "null" to mean "lmao"? You're the man now, dog!

The possibilities are endless with HTML, the programming language, a programming language.

beephod_zabblebrox

this why dont esoteric langs use stuff thats more interesting :(

purple__dog

Stack based is easier to implement, and it's equivalent to anything else you can do assuming you get a turing complete language at the end.

beephod_zabblebrox

for an esoteric language its not about being able to do stuff, its about being interesting imo

purple__dog

Very rarely is the evaluation model the interesting part though.

beephod_zabblebrox

i dont think i agree. maybe you could give some examples?

purple__dog

Take turing tarpits. Those are languages with tiny instruction sets.

The point here is to make the language as small as possible, other than that you would just do whatever is easiest.

beephod_zabblebrox

"a tiny instruction set for minimalism/'language-golfing'" is different from "generic language with an interesting syntax, but a not-super-interesting evaluation model that could've been made a lot more exciting"

it could've been worse (eg a reskin of brainfuck) but i think just having different syntax isnt that cool, when semantics are super simple

slaymaker1907

Since HTML is 2D, maybe you could have memory allocated in square and work sort of like a Turing machine with a cursor, but only allow it to move like a knight on a chess board. Allow it to grow, but require it to grow in both directions equally.

That’s the most confusing storage mechanism I can think of right now.

_htmx

AdventOfCode day 1 problem 1 solved in HTML, The Programming Language:

https://gist.github.com/Renerick/23ee1ff5a96632c5bb16496dc96c056d

And an example of meta-programming in HTML, The Programming Language, where we add a new command to HTML, The Programming Language, from HTML, The Programming Language (<sup>) and then execute the command:

https://codepen.io/1cg/pen/KKJbQxq?editors=1001

i tried to comment it pretty well so you can follow along

raiph

.oO ( There's terse esoteric. And AoC D1P1 in 258 LoMC! )

We will add the &lt;sup> tag, which will raise the second to top value on the stack to the top value on the stack. We will then invoke this new command with the values [12, 2] on the stack.

I was almost sure there'd be a web page containing the text 12² alongside 144. That would have been cute. Is it there but I missed it? Did you intend that but give up? Did it not cross your mind? Am I going crazy?

_htmx

it's a stack based language, so the numbers are pushed on via <data value=""> tags, but that would certainly be something to consider implementing in the language via the pluggable grammar!

Cybernicus

'bout five months early, innit?

YBKy

this language is ahead of its time

arobie1992

On one hand, I want this to be called HTPL, but on the other, it will be great to shush the people who like to trot out "HTML isn't a programming language" after asking what languages the person knows.

brunogadaleta

Omg: like brainf*uck met XML.

elprophet

I was going to say "isn't this just coldfusion" but lol that's great