I just read Joe’s blog on HTML as a programming language. It looks very interesting!
Joe had written:
I have a prototype that works and I’ll publish it when it’s sufficiently mature.
So I am hoping that the code can be found somewhere. I had searched his Github repos but didn’t find it.
2 Likes
No, this is the blog page generator from his another article. What I’m searching for is the Vue Single-File Component
-like framework where you can write the page like this:
@function{demo_html}
<? my_css("red") ?>
<p>
hello <? user_name() ?>
</p>
@function{my_css}
<style>
body {
color: <? to_string(ln) ?>;
}
@function{my_js}
<script>
let on_click = (ev) => {
console.log(">>> click event:", ev);
};
@erlang
user_name() ->
user_util:get_name(db_util:find_user_by_id(N)).
to_string(A) ->
#{html => A}.
</script>
1 Like
Right you are, I suppose when i looked at the code (which it has been a while!), I saw 80% of what you’re interested in
That said, that code can not be found. I suppose a question is which part are you mostly interested in? There’s separation of sections via tags and functions, which could be recursive such that augmentation can be supported. Then there’s everything getting compiled into a single function (which is something that Plug in Elixir does, always nice when Joe’s ideas made it into something concrete).
1 Like
Thank you for your reply You are right, with the template engine, maybe 80% of what I’m interested in is already working.
What I was looking for is a complete and working solution. The part I am mostly interested in is the separation of sections via tags and functions. (Code in this style looks beautiful and has a similar style as leex and yecc files)
The idea of compiling those sections into erlang functions seems to be simple and robust. But I am still wondering whether there are something I am missing. Maybe I could try to implement what Joe had described and try to write some websites with it someday.
1 Like
You are welcome. Ehe
Do note, you will have to step through quite a bit there, perhaps a better place to start is here
3 Likes
Wow ! Joe’s repos are filled with treasures
1 Like