8 ms·
JXCore LLVM JavaScript Frontend
- andreyvit 13y agoFound this via [1], would love to hear some opinions from knowledgable people here. [1] http://www.echojs.com/news/8496 http://www.echojs.com/news/8496
- ahoge 13y agoThey should have used one or several of the existing benchmark suites instead of creating their own micro benchmarks.
- lohan 13y agoconsidering all the other advantages. benchmarks are less important..
- patents-suck 13y ago+1
- azakai 13y agoMy concern given the very simple nature of the benchmarks tested on, is that this will not work on more sophisticated code. And, it is very easy to beat existing engines on small new benchmarks. Much harder to win on larger, more varied benchmarks, and much harder still to win on real-world codebases. But, the project is existing nonetheless, looking forward to see more information on it.
- moisy 13y agonative javascript mobile
- seabrookmx 13y agoAgreed. Write a game once in JS/WebGL. People can play it through the browser on the desktop, or download an app on Android/iOS/BB10/whatever that is the same code compiled with JXCore/LLVM for native performance and/or offline play. Best of both world really. Especially with things out there like CoffeeScript, LLJS, and Typescript, which make using JS as your dev language manageable even for us traditional OO-heavy game devs.
- chebum 13y agoLet's see how limited will we be with it. Like, will it allow us to change variable types dynamically? And what JS libraries will run on it "out-of-the-box".
- pjmlp 13y agoNice to see a dynamic language getting an AOT compiler, in this VM age, even if it is JavaScript. :)
- mpweiher 13y agoObjective-C is a dynamic OO language and it has always been AOT compiled. Also there's Smalltalk/X: http://www.exept.de/en/products/smalltalkx http://www.exept.de/en/products/smalltalkx libart for Android also brings AOT to a jitted/VMed language.
- deleted 13y ago[deleted]
- pjmlp 13y agoYou forgot Lisp, Scheme, Dylan, Julia, Basic.
- AlexanderDhoore 13y agoFunny enough, even C#: http://www.mono-project.com/AOT http://www.mono-project.com/AOT This is used to run C# on iOS.
- danabramov 13y agoStill does.
- lohan 13y ago+1
- pjmlp 13y agoC# is not a dynamic language.
- 13y ago
- a-priori 13y agoThis sounds like the first step in a vision I've had for how the web should evolve. We now have an LLVM frontend for Javascript, so Javascript code can be turned into LLVM bytecode. The next step would be to swap out the existing Javascript runtimes with this frontend plus a sandboxed backend for the native platform so they can compile Javascript to LLVM bytecode, then to native code. Finally, you add an extension to the <script> tag to allow loading arbitrary LLVM bytecode, something like <script src="http://some/url/code.llvm" http://some/url/code.llvm" type="text/llvm">. Once that's in place then you'd be able to execute any language that has an LLVM front end inside the browser environment. Javascript is no longer the sole language of the web, and things like Emscripten and asm.js become obsolete.
- chubot 13y agoIn other words, you want to use LLVM as a VM. Sorry to be harsh, but you're only the millionth person to think of this "idea". LLVM is not a well-defined protocol or specification; it's a library for making a compiler that changes with every release. Read: http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/0437...
- limsup 13y agothis is essentially what PNaCl is http://blog.chromium.org/2013/11/portable-native-client-pinnacle-of.html http://blog.chromium.org/2013/11/portable-native-client-pinn...
- KMag 13y agoInstead of arbitrary LLVM bitcode, you probably want a subset with some statically verifiable security properties, as a form of very lightweight sandboxing. Google has already created this, and calls it PNaCl. Running arbitrary LLVM bitcode would make browser exploits trivial, unless you ran the bitcode in a sandboxed subprocess. PNaCl's sandboxing is much lighter weight than requiring IPC to interact with the browser. EDIT: Just realized this is mostly redundant with another reply, but hopefully gives a bit more detail for those not interested in following links.
- jmgrosen 13y agoDoes this mean I can translate JS to LLVM bitcode with this tool, then translate that bitcode back to Javscript with Emscripten? Sounds amazing :)
- cliffbean 13y agoThis blog post is either spectacularly naive, or ridiculously over-hyped, or both. "Consistent performance. (not like the V8 engine pausing the whole application for GC)" Static complication doesn't get you out of having to worry about memory management. What's the alternative here? Reference counting? Leaking everything? Using a subset of JS that doesn't allocate anything? All of these things come with considerable costs.
- lohan 13y agoSo you are okay with having the server process is not responding for ten seconds? Come on!
- mbreese 13y agoBe serious. It's not a question of the process not responding for 10 seconds. If the same code in V8 is causing a pause to deal with GC, then the LLVM compiled code must be doing something different to handle the memory. Is it using a different GC? Is it running on a different thread? Is it just sucking up memory without freeing it? These are all things that need to be known before getting too excited about the speed of LLVM compiled Javascript.
- moisy 13y agoI don't know the details but in my opinion a deamon thread like with the Java could work. Besides, I don't think V8 specifically designed for the server use.
- cliffbean 13y agoIf you implement a GC which runs on its own thread, doesn't pause the application, and achieves good overall performance on any real-world code, then it would be a terrific thing to mention in your big blog post announcing the system. We'd love to hear anything you'd like to say about it. If you don't mention it, and if you also say numerous other things which give the impression that you may not have given the entire topic much thought, then even people who would otherwise prefer to be positive and supportive may struggle to take you seriously, and may react with frustration if you also make extraordinary claims.
- jvilk 13y agoCool hack. Is the source code available somewhere? > - Consistent performance. > (not like the V8 engine pausing the whole application for GC) But... you're still going to need garbage collection, unless you are only planning on supporting something like ASM.js. So there will still be application pauses for GC. Also, you mention that you have support for JavaScript OO, but I notice the benchmarks don't exercise programmer-defined JavaScript objects/prototypes. Do you have numbers on its OO performance, or is that still something you're working on? Finally, how do you handle type inference at the LLVM level? I assume you implemented some form of JIT compilation? I'd be interested to hear more!
- conanobre 13y agoI was expecting this coming
- TheMakeA 13y agoMy only concern is Apple's patent for this: http://www.google.com/patents/US20100153929 http://www.google.com/patents/US20100153929
- conanobre 13y agoJulia, Rust etc. languages are already doing it.
- moisy 13y agoand Lua .. how Unity3D uses javascript is also related.
- pygy_ 13y agoThe patent specifically targets compiling JavaScript to LLVM and running a monitoring daemon to update the IR when the source changes. It is ridiculous. It is a general compilation process, applying it to these specific conditions is in no way technically original. I hope it isn't from a legal standpoint, but IANAL...
- obastemur 13y agoI'm aware of that patent long before and not following the same structure. Besides, it also targets other languages by saying 'Javascript or similar'. No worries here. Thanks for reminding.
- deleted 13y ago[deleted]
- patents-suck 13y agoWell good news is that it is not a granted patent yet. Although it looks like Apple is fighting it to the teeth and most likely discussing reduction of claims (check the PAIR system). Regardless if its a patent or not, what is being described here doesn't seem to be infringing on the patent anyway. See the first Claim #1: PART1 <storing a device-independent intermediate representation of a source code; > and PART2 < in the event an indication is received that the source code has changed, using the changed source code to generate and store a new intermediate representation of the changed source code.> If I understood correctly, only thing you would be doing is the PART1 hence you are NOT infridging on the patent. IMHO Disclaimer= not a lawyer, dont follow any advice you see here ;-P
- cpeterso 13y agoDoes Node have an equivalent to the JVM's server and client modes? Node can probably assume that it will be hosting a long-running server process, skip the lazy JIT, and just AOT compile all JS code at maximum optimization.
- azakai 13y ago> Javascript has always been considered as a scripting language with low performance compared to most low level languages. Thanks to V8 engine, it is now becoming a platform where developers can prepare a fully functional backend. This is not accurate, and shows a lack of respect for the JS VM developers at other browser vendors. Very close to the time v8 was launched, SquirrelFish Extreme from Apple and TraceMonkey from Mozilla were also launched, each far faster than previous JS VMs, beat v8 on various benchmarks while losing on others, etc. Since then v8 has generally been in the lead, certainly, but not always, and it would depend on the benchmark and platform. So it is not fair to say - and this is not the first time I see it, or else I would not write this comment - that v8 is single-handedly responsible for JS being fast today.