Is Native Client compilation possible?

Started by
2 comments, last by bluesnessman 12 years, 2 months ago
Hi,
I was just wondering if Angelscript could be compiled specifically for Google's Native Client?
I don't have much time right now because of my exams but I have taken a quick peek at the source, AngelScript has a lot of assembly codes some of which maybe could violate security restrictions set by NaCl.
The reason is, this summer, I have written a framework with which you can create all kinds of games using Angelscript called Un Poco Loco, I want to port it to NaCl. It's first version was almost complete, I said was because I couldn't work on it like for 5 months because of school. I will continue working on it after February. It uses SFML for rendering and sound, has physics by Box2D and network support by Raknet. I have created a platformer, a shooter and a multiplayer shooter with client-side prediction as well, other genres like RTS should be no problem neither. It is not ready to be released yet as it has some bugs and code needs to be cleaned. When it is, I will make it open source. It has also its map editor and shape editor to define convex/concave shapes for physics. Everything is designed to be straightforward and the framework handles all the messy stuff.
When I saw NaCl I got really excited, I think it is really cool to run native code right from the browser, so I wanted to port my framework. A Bullet port exists so Box2D should prove no problem, that leaves only Angelscript and Raknet. Raknet cannot work with NaCl because as far as I know, NaCl doesn't support UDP right now, so the framework for NaCl would have no multiplayer support. If Angelscript can be compiled though, my framework could prove to be a nice option for HTML5, Unity or Flash. There would be only a single executable with small size unlike Unity, no compiling, just uploading the code, to a web server. With its map editor and out-of-the-box physics and with all the features of Angelscript like C++ syntax, classes,
I think it would be a delight for us C++ programmers who doesn't want to get their hands dirty with Javascript or Flash or Unity for web development.
So, I really hope we can compile Angelscript somehow for NaCl.
Thanks in advance.
Advertisement
I'm not familiar with Google's Native Client, but AngelScript doesn't require the assembly code, if compiled with AS_MAX_PORTABILITY. You lose the ability to bind non-generic functions, but there are a number of different options for auto-generating generic functions for native functions now.
This sounds interesting.

It seems the Google NativeClient compiler is based on the g++ compiler, so AngelScript should compile just fine. As you pointed out, the inline assembly used for supporting native calling conventions might not compile. Even if it did, it would probably not work as I'm pretty sure the NativeClient has its own way of doing native calling conventions.

Fortunately AngelScript can be compiled with the AS_MAX_PORTABILITY mode that removes all the native calling convention support, and the application should then use the generic calling convention instead when registering the application interface.

Please keep us updated on the progress of Un Poco Loco.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Wow, that is great news, should've read the manual better :)
Thanks a lot, can't wait to start coding when my exams are over in about a month and I will keep you updated!

This topic is closed to new replies.

Advertisement