koczkatamas
But yeah, generally only a limited subset of a language is supported. This is the price of writing code targeting multiple language. That's why you cannot (and probably won't be able to) convert existing code.
I am probably not emphasizing this enough, but One is currently a "toolkit" for converting syntax between languages.
`Math.random()` is ~a standard library function. One has limited knowledge about language's StdLibs. But you can make `Math.random` (or any method) work without modifying the compiler, only by adding the appropriate implementation and StdLib definitions to appropriate files. (Even now only using the WebIDE).
The plan is to make One plugin-able and create a "package" manager infrastructure, so anybody can implement `Math.random()` or any other methods, publish it and then you can just download that package.
Implementing every language's StdLib is not a one-man job, so I've always considered this out-of-scope.
Sorry if any published information regarding this was misleading.
Tl;dr: you cannot use One in production now, but the grand plan is to make One as hackable and flexible as I can.
So here is the plan:
- the compiler does not contain any target language-specific part, you can add a new language by creating a few hundred lines of template file (this actually works already, it is not just a plan)
- rewrite One in One, so you can convert from any language to any language in any language
- there is no StdLib, but libraries can be created by anyone. We publish interface and implementation definition separately, and you can eg. implement a Web client interface for PHP and Node, while somebody else can implement it for C# and Swift. Behaviour defined by interface tests, if your implementation passes interface test => good. If there is no test for an edge-case => undefined behaviour. Read more here: https://github.com/koczkatamas/onelang/issues/9
- you write a library in One and it helps you to publish to every language's package manager (npm, pip, NuGet, etc). You can reach much more developer with your library compared to targeting only one lang's developer base