JSX syntax and QuasiQuoters in PureScript

what complexity? jsx works pretty much out of the box everywhere else and the tooling is barely visible to the end user. I think the value is immense as seen by the wide adoption in the js world. Also, what do you mean with it doesn’t pay off in the long term. Pay off to whom?

I find a really interesting example of a “jsx”-like solution here: Deku - Pursx

In the docs of deku by @mikesol.

Perhaps such a solution can also be generalized for other Libs?

Example from deku:

myHtml =
  ( Proxy
      :: Proxy
           """<nav class="flex" aria-label="Breadcrumb">
                 <ol role="list" class="flex space-x-4 rounded-md
                    ...
1 Like

I believe this talk fits very nicely in this context (simplicity vs easiness):

JSX is “familiar,” of course, but QuasiQuoters (let’s say probably the “correct” way of implementing an external language in a host language) in my humble opinion, enable such “complex” use cases that very rarely pays off compared with an internal language (or embedded language) - if the host language has the features for such endeavors.

Correct if I’m wrong, but I believe deku’s approach is more for quickly copying and pasting HTML in PureScript, it does not offer IDE LSP features like auto-complete or docs for the language in PureScript.

1 Like

Just following up here a bit late. Yes, absolutely, pursx in Deku is very much about copying and pasting. In my case, I am a heavy tailwind user, and my flow is that I often buy a template, copy it directly into pursx, and then add little bits of interactivity here and there.

This flow has gotten less relevant, though, as GPT is now so good at generating deku from html.

1 Like