HTML, the Programming Language
html-lang.org
html-lang.org
My one nit, is the lack of static typing. I'm not a fan of radically changing the direction of a project, so instead of baking it into HTML, the Programming Language I suggest the TypeScript route. Something like a hypertext typed programming syntax, HTTPS, to compile to HTML, the Programming Language.
also looking at HTML, the programming language,++, or, possibly, Objective-HTML, the programming langauge, which would be easier to get to and potentially more awful
Hindley Type Milner Language
#ifixeditforyou
This works pretty well for composable server side generated view components.
<script type="text/javascript">
const foo = (bar) => {
document.getElementById('my-element');
// More here!
};
</script>
That way you could really leverage the full power of HTML, the programming language!functions defined in HTML, the programming language, can be invoked by JavaScript, the programming language (sic) and vice versa.
[0] https://dev.to/thormeier/dont-try-this-at-home-css-as-the-ba...
Edit: I actually think I recall some pure-CSS frontend examples. We might just need to combine that with backend CSS technologies.
Edit edit: Probably the biggest issue will be to prevent the server from evaluating the CSS fully but maybe something like what Next.js does with server and client components could work here.
It would be awesome if they were using some sort of macro system / templating engine to consistently expand {{html_prog}} and {{html_markup}} just to keep it straight while they're writing it.
Thank you for posting this, it made my day a bunch brighter!
You could use the <template> tag.
<template id="my-macro-name">
<!-- some operations -->
</template>
To use it: <source src="my-macro-name"/>
Using source to look familiar to bash users because why not. <script src="my-macro-name" type="macro"></script>I appreciate their joke, but “HyperText Markup Language, the markup language” is a little redundant.
Some of us have had to include XSLT programming in our careers. We have seen into the dark abyss… and been paid to do it!
Well, except for the syntax and the lack of resources and that it wasn't designed to be a programming language...
Okay so it wasn't the best. But somewhere in there is a language which does want to be the best!
XSLT is a pattern matching DSL for converting trees into other trees. What things are trees? Programs.
It is also XML. XML is a boring business thing for boring business people associated with legacy Java codebases. We like json here. Or maybe yaml. To quote an otherwise excellent past colleague, "the pointy brackets hurt my eyes". It's horrible to edit in notepad too.
Who wants XML syntax for a purely functional programming language? No-one wants that, we write our compilers in C++ thank you.
As a bonus extra, "XML schema" are a similarly crufty rubbish old thing in nasty XML syntax that look suspiciously like "type of that tree". So you can typecheck the intermediate IR in your compiler pipeline. If you wrote it in the bad language from the before times. Emacs knows what those schema mean too.
The world has moved on to better marketed semantically worse things with prettier syntax. This brings me joy.
What XSLT did do was standardize XML on a transformation language. JSON never really got that, and the ecosystem is worse for it.
The definitive and complete resource is Michael Kay’s XSLT book (originally Wrox Press, but now part of O’Reilly I think?). Granted, a paper book as a resource isn’t great, but it’s some book!
Kay went to Cambridge (Trinity) and did his PhD under Sir Maurice Wilkes. He’s no joke: one of the examples from the book is implementing the Knight’s Tour. Although this is only the chapter pre-amble, the commentary is indicative of what kind of book this is:
https://www.oreilly.com/library/view/xslt-20-and/97804701927...
It’s like Dijkstra writing the definitive reference manual for CSS and one of the formatting examples being an engine for solving Towers of Hanoi.
While I have qualms about the utility of XSLT as a general purpose language — it’s fine if you embed it in an imperative language a la SQL in Python, and awful if you try and use it standalone — it also gave us XPath which is by far the best way of querying markup that I’ve ever used. (Well, until CSS got attribute selectors, so I use it less and less these days I suppose.)
(You probably know all this, but it was interesting to add to the thread.)
Is it pronounced "ex-slut"?
Thanks to "a slightly unhinged man living in montana"
Or is it? I once considered using that tag for some price calculator widget, but it couldn't even replace a div because of styling issues or something.
That being said, I spent like half a minute trying to figure out the point of this post and then lost interest...
Will try again, was hoping for a funny Rube Goldberg machine instead of T-shirt merchandise.
So nah, it's about as "based" as blogging about JS frameworks IMO.
<dl>
<dt>foo<dd><s>Foo</s>
<dt>bar<dd><data value=10></data>
</dl>
You could reasonably leave tables as a way of defining an Array<Object>.Using <dd> for addition and <dt> for duplication just makes me sad. It almost makes be suppose you don’t care about HTML (the markup language) semantics!
https://html-lang.org/#extending
and, in fact, HTML, the programming language, programs can modify not only themselves, but also the language itself, at runtime!
interesting possibilities await you, the programmer of HTML, the programming language!
https://html-lang.org/#example
and live demo at the bottom:
https://html-lang.org/#live-demo
that runs disturbingly fast given the implementation is an inefficient recursive algo
computers are fast
All the best,
i tried to fix it
Thank you!
All the best,
This would enable interesting features such as visual debugging (you just check the document to see the status of the program) and more importantly would enable the "code as data" paradigm, giving us easy metaprogramming and essentially a "lisp with brackets"
(Yes, I am not being completely serious)
(Neither am I)
Of course, the parser is just a DOM parser, which is built in browsers and that's what the interpreter is using. But if you want to write a standalone compiler for it, just take an off the shelf XML DOM parser and you have your AST.
Mallory: Is HTML a programming language?
Bob: No! Well some people think is, but they are wrong! Then again, there is the HTML programming language...
Mallory: !???
P.S., S-expression or not, XML-based DSLs are horrible. I don't know how many people have PTSDs using ANT or a slew of commercial "user-friendly" DSLs for test automation, process automation, and etc. It turns out the companies just didn't know how to design small programming languages and certainly lacked of compiler-writing skills.
I'm mostly joking, though. I think htmx is not likely to be a trolling attempt, but it would be absolutely epic if it was :)
<script src="html.html"></script>still optimistic!
Edit: nevermind, but the comment still says "This ul tag"
Basically, HTML->Python transpiler.
[1]: https://github.com/Koous61/htpl/blob/master/example/scratch....
It's not HTML, but a language using HTML syntax.
it's called HTML, the programming langauge
(sometime I use "HTML" just to keep things shorter)
HTML: Turing-complete Machine Language
i mean, who knows, maybe that's what HTML in HTML, the programming language stands for!
nah, a GNU (new) idea
Then you could pronounce it “High temple”.
The explanation basically uses an AST that's apparent to the user to explain the language - and this is a language built on an AST whose structure is apparent to the user. I love it and will definitely be turning the idea over in my head for the next few days.
That already exists, though: https://esolangs.org/wiki/HTPL
https://www.projekt-gutenberg.org/schiller/aesterz/aesterz3....
<loop>
<loop-statement></loop-statement>
</loop>most HTML, the markup langauge, developers are used to anchor tags (i.e. the <a> tag) with an href that begins with a hash "jumping" to that element. Therefore I decided to take that well known semantic and integrate it into HTML, the programming language.
there are multiple examples of loops using this (as well as the <i> "if" conditional) tag that I think show how intuitive this will be for most HTML, the markup language, developers, but of course research is ongoing in this and other matters
Either way, fun project!
How and why not? What languages do you use?
And here I was hoping for someone to have discovered a way to make HTML Turing complete
Same with sub, ul, ...
The more a I read the page the more it looks like a joke...
div({ class: 'example' }, [
p('Hello, ', [
b('world!)
])
])LISP has done more, with less.
Jesus. As a lover of plain HTML and a hater of JS, my head just burst and painted the walls.
See https://github.com/Saasufy/saasufy-components#saasufy-compon...
Actually, the elements from this article could complement my own nicely as they seem to provide more fine-grained control.
My platform is https://saasufy.com/ (you can log in with GitHub)