4 ms·
It's fun but breaks very quickly. One simple line such as "console.log(Math.random(10));" will fail. Amusing anyhow. Also: please make it python 3. It's been
by sametmax 9y ago
It's fun but breaks very quickly. One simple line such as "console.log(Math.random(10));" will fail.
Amusing anyhow.
Also: please make it python 3. It's been 13 years...
- Stratoscope 9y agoThat would fail to compile in TypeScript as well, and you should get a red squiggly or other syntax error indication in most IDEs. Math.random() takes no parameters. From lib.d.ts: interface Math { // ... /** Returns a pseudorandom number between 0 and 1. */ random(): number; // ... }
- koczkatamas 9y agoActually `Math.random()` will fail too. 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.
- Iv 9y agoOh, ok I think I understand it better. That sounds like a really useful tool. Actually in a project I was in last year we really hesitated between writing a lib in C++, C# or Java (Native android, Unity3D lib, Android java) and had good arguments for either but no budget for maintaining all three. I would have seriously considered your option at the time. I have no time to dive into this now but I'll bookmark it and come to wave at your gitter. Is it realistic to contribute to it with knowledge of C++/C#/Java/Python but a pretty poor grasp of JS?
- stochastic_monk 9y ago2008 to 2018 is 10 years last I checked.
- TomK32 9y agoDecember 2008, not even 10 yrs yet.
- sametmax 9y agoAlright, my aim is very off. But even 5 years would be enough don't you think ?
- stochastic_monk 9y agoI think it’s certainly time to have switched. All important libraries have migrated and Python 3.6’s dictionary is faster and more memory-efficient. Python 2 is dead. Long live Python 3.
- deleted 9y ago[deleted]