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

It seems like a really strange choice for the "source" language to be JS - a language without any real static typing capability (even with TS).

The most limited & basic kinds of static analysis are technically possible, but why not just start with an entirely static language and translate from that to dynamic languages? Would seem much simpler...




> It seems like a really strange choice for the "source" language to be JS

I can't speak for the author, but I can think of several reasons I might choose JS:

1. Almost everyone working on the web knows it, so not knowing the source language won't be a roadblock right away.

2. Precisely because of the issues you mentioned, JS is a lot easier to translate with perfect (or close to perfect) fidelity. If the source were something like Haskell, every translation would be very lossy.

3. JS has no boilerplate, like setting up a class or something. You can just type statements.

4. OneLang itself is written in TS, which means working with JS as the source might be easier than, say, C#.


> 2. Precisely because of the issues you mentioned, JS is a lot easier to translate with perfect (or close to perfect) fidelity. If the source were something like Haskell, every translation would be very lossy.

On the contrary, the fewer restrictions a language has, the more difficult it becomes to translate it into languages with stricter requirements. If this were built on JavaScript and not TypeScript, it couldn't even generate the correct type annotations for the other languages that require them. I doubt that this project is going to grow a Haskell backend anytime soon.


Yeah, Id choose an ML as the root language.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: