Hacker News new | past | comments | ask | show | jobs | submit login

What I’m asking is, even if you support type checking how can it fit usefully into your compilation model, given you can’t do any cross-module analysis?

Or more pithily: a fast linker isn’t impressive if it has no error handling.




So JS has this really nice property where things really can be just deployed as independent modules, and they will just work together without any cross-module compilation or analysis needed. It's a big part of what makes Reflame's approach possible.

That said, Reflame does actually perform dependency analysis on the entire module graph, persists it, and then updates it in response to every change. We're mostly doing this for optimizations like preloading only modules reachable from the entry point to flatten the network waterfall, but we also use it to provide nice error messaging as well. Here's a quick PR showing the dependency analysis in action: https://github.com/reflame/example-typescript/pull/2

We do this by doing analysis on each module as they come in to generate metadata on what modules they depend on, so subsequent modules can build up the dependency graph using just that metadata for each module, without having to have download the full code or analyze them again.


> So JS has this really nice property where things really can be just deployed as independent modules, and they will just work together without any cross-module compilation or analysis needed.

If you're tolerant of undefined behavior when interfaces don't match expectations, every language has this property. In truth it's not really nice!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: