Live data from Hacker News

Vidact – a compiler that turns React into direct DOM operations

vidact.dev

31–34 of 34 posts

Re: Vidact – a compiler that turns React into direct DOM operations

#31
post #26
post #10

Not sure what this project is for... the only way to statically compile JSX into direct DOM mutations is to either castrate React's dynamic runtime flexibility and closure model, or break its semantics like SolidJS does (in this case worse because the lack of templating/syntax constraints just shifts the burden from the compiler to the developer).

Maybe a decade ago there was chatter in the Purescript land about FRP in an applicative context. There's ways you can write your code such that you _know_ that certain blocks of code are going to be unaffected by input changes, and you can then use that information to reduce the scope of changes that need to be done, with only minimal costs to expressivity. I think with a decently smart compiler (and of course the co…

Sure, but trying to strip React of its virtual DOM is just a fundamental architectural mismatch; you can't have your cake and eat it (coarse-grained vs. fine-grained reactivity, fully dynamic arbitrary JSX vs. a templating language etc.). The point I'm trying to make with SolidJS is that it manages to keep JSX by intentionally swapping to signals and introducing primitives and control flow components to scope the compiler, whereas this forces the developer to hold all of this complexity in their heads and write in a specific convoluted way. It's like shipping TypeScript without type declarations and pitching knowing your types in your head as a feature lol.

In the first place, I imagine the subset of React code that’s static enough to compile into direct DOM mutations is so trivial that it’s not a useful optimization target.

Re: Vidact – a compiler that turns React into direct DOM operations

#34

I started Vidact as an experiment 6 years ago, an experimental compiler that takes React-style function components and hooks and compiles them into direct DOM operations. The basic idea is: keep React's programming model, but replace its runtime model. It was a very ambitious project back then, but recently, another project I was working on (grep.codemod.com) inspired me to rebuild this and I thought of using React c…

i suggest changing the name to something that is related to react. or atleast unrelated to Vue (the logo seems Vue inspired)
Post reply on HN