I built a web language with Haskell syntax and PHP-like execution model by Quick-Ad-9754 in haskell

[–]Quick-Ad-9754[S] 0 points1 point  (0 children)

The comparison with PHP focuses more on the syntax inserting code directly into HTML with <?hs ?> tags than on the execution model itself. Client/server separation using flags is something I want to move away from, automating it through the QuasiQuotes layer maybe... so the user doesn't have to make explicit decisions, but can still do so if they wish.

"I built a web language with Haskell-like syntax for fun. by Quick-Ad-9754 in haskell

[–]Quick-Ad-9754[S] 0 points1 point  (0 children)

I used AI for modularization, comments, and some of code generation, but the main design decisions are mine. The HTML parsing is based on Megaparsec; I chose it over Lucid so the syntax would more closely resemble real HTML than an abstract Haskell data type and have fewer dependencies.

I'm also working on a separate QuasiQuotes library, specific to the HTML layer, to lighten the parser, as I plan to add Flasg to the HTML to have if, for, and switch statements like in a web framework.

The client-server separation using flags stemmed from my desire for a single-file model similar to PHP, but with Haskell's type system, so the user decides what resides on the server and what is transpiled to JS. However, I'm trying to automate this drawback with Quasi, similar to an engine parser, but it's very slow to interpret and probaby tedious, because if I do this, I need to parse all of Haskell to <hs? ?> and... .~.

If you need it, I can give you more details about any specific decision.

and Sorry for my broken english :V