4 ms·
This looks horrendous. Watch the video for the hello world example. It's probably 100 lines of unintelligible code. Miguel de Icaza's CLI for the web idea (ht
by equark 16y ago
This looks horrendous. Watch the video for the hello world example. It's probably 100 lines of unintelligible code.
Miguel de Icaza's CLI for the web idea (http://tirania.org/blog/archive/2010/May-03.html http://tirania.org/blog/archive/2010/May-03.html) looks like a much better approach.
- valisystem 16y agoYou just have to port your CLI to native client and it's done, the ugly code is wrote once and then shared.
- weavejester 16y agoIt doesn't really matter that the code is unintelligible. One can use higher-level languages on top. What isn't so good is that NaCl targets the architecture of the host machine. So you're not going to be able to run a NaCl app compiled on x86 on a browser running under ARM. Someone please correct me if I'm wrong. Miguel suggesting CLI isn't exactly surprising ;), but personally I'd prefer to use a sandboxed VM based on LLVM. CLI makes too many assumptions about the architecture of your language, whilst LLVM is more low-level.
- nimrody 16y agoRegarding LLVM -- See the comment about PNaCl (Portable Native Code Client). This is portable code based on LLVM intermediate representation.
- Detrus 16y agoYou can compile your binary for multiple architectures, check the type of processor and give it the appropriate binary. They also have the LLVM option so that old binaries keep working on new architectures without recompiling and rewriting NaCl for them, but it has downsides http://blog.chromium.org/2010/03/native-client-and-web-portability.html http://blog.chromium.org/2010/03/native-client-and-web-porta... The reason they didn't go with LLVM as the main approach was performance. Google wants there to be no distinction between desktop and web apps, and for web apps to have even 60% of desktop performance is still unacceptable. 90+% is more like it.
- weavejester 16y agoIt's good to know that there's work being done in marrying LLVM to NaCl. Even 60% performance seems a very fair trade-off for low-level, platform-neutral, sandboxed binaries.
- enneff 16y agoGo runs under NaCl - check out setting up a rendering context for a simple tetris game: http://golang.org/src/pkg/exp/4s/4s.go http://golang.org/src/pkg/exp/4s/4s.go It's literally a couple of lines in the main function. Pretty straightforward. I think the guys here chose a less-than-ideal way of demoing the interface for this video, which is surprising.