Is possible to create LuaX-like dialect?
Jipok opened this issue · 2 comments
I hate js and the entire modern web in general. Therefore, I am interested in various alternatives that somehow improve the situation. HTMX is my favorite right now. But recently I came across this interesting concept:
https://bvisness.me/luax/
I really liked the idea of mixing tags this way. I'm wondering if it is possible to implement such a dialect/DSL? Just a theoretical question.
If possible, what about support in the code editor? Will there be support for user-defined DSLs or is this impossible to implement without a type system?
I've scanned the page and examples. Of course something similar to this is be possible to make. The luax as I saw uses transpiler to generate Lua code (structures) from HTML tags. In Rye this would not be needed because Rye has a concept of xwords ( ) and exwords () which are basically xml or html tags so they are native tokens.
In fact just last night I was working on something related, because I'm working on a demo of generating SEPA XML from CSV so I was working on a dialect for generating XML. Last PR was from branch xmlgen.
So theorethically something like this would be possible yes. After I make XML gen dialect I will look at luax again and see what would that entail. I currently wasn't plannign to make anything that generates html on the server particularly ... but maybe for a proof of concept something could be made. We will see.
I've made a prototype xmlgen dialect in Rye (most dialects are made in Go, but this was a test if how hard it would be to make one in Rye).
You can see the use of it in examples/xmlprint/example1.rye
and implementation in examples/xmlprint/xmlprint.rye
I am closing this, if you have any comments let me know.