News for hackers. Stuff that matters.
Re:Understanding React Compiler by afavour on Friday June 28, 2024 @09:22AM (#40820377)
> How many different levels of interpretation and compilation does V8 do?

This part is key to the OPs objection. They’re saying that V8 is a very capable optimizer (which it is), so why can’t it optimize the things React Compiler optimizes? It’s a fair question.

> compilation steps don't cause cognitive load if they work

Personally I disagree. Any source code transformation adds cognitive load because my original source code now doesn’t match the source in the browser. Source maps are the traditional answer to that but if React is rewriting logic (like getting rid of arrays) you’re not going to be able to maintain a 1:1 source map.

Re:Understanding React Compiler by a_wild_dandan on Friday June 28, 2024 @09:49AM (#40820581)
> They’re saying that V8 is a very capable optimizer (which it is), so why can’t it optimize the things React Compiler optimizes?

Because capable != exhaustive? All compiled languages can benefit from further optimizations. I genuinely don't understand the issue here. Help!

Re:Understanding React Compiler by andybak on Friday June 28, 2024 @10:13AM (#40820785)
I think OP is questioning whether these are optimizations or whether they are just redundant.

I don't know the answer - I don't use React personally.