🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LLVM

Started by
7 comments, last by Dentoid 16 years, 11 months ago
Father, I have sinned. I have strayed from the righteous path of AngelScript, and fraternized with other scripting solutions. Nah, seriously... I have checked out Mono some, to see if it's usable for scripting in a game engine. Mostly because I was currently bored with actually developing stuff, so I investigated Mono some since I'm curious about it in general but just haven't really found an application where I get to use it. :) So... While messing around with that (which by the way is way more complex than integrating AS, so good job there WitchBoy :), I ran into something called LLVM. Anyone seen anything about that? Here's the site: http://www.llvm.org I'm actually writing here before I've even done more than reading the feature list over there, so I'm totally jumping the gun. But... It looks to me like a pretty feature rich script engine backend (got some JIT compilation to x86 etc and stuff going on there), so basically I'm wondering if it'd be possible (or at all desireable) to have the frontend of AS (which I like a lot) on the backend of LLVM (which, in my five second analyzis, sounds fast and cool as a runtime)? Just throwing the ball out there to see what you can make of it. :)
Advertisement
I hadn't heard of LLVM before this moment.

I would have to study it before I decide whether it is of any interest to me and the future of AngelScript.

However, I have no immediate plans to substitute the AngelScript VM machine. My focus is on improving the interface to make AngelScript more useful and flexible.

I'm keeping a link to LLVM in my reference database for future use. Thanks for the link.

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

Yeah, I haven't studied it myself yet either. I just wanted to note that it existed.

And I indeed understand that it's a bit like coming to Audi and say "Hey guys, Toyota has great engines, can't we just slab one of those into our casing since they're better?". But my point is that if it turns out it indeed is better (I've got no idea right now, AS' VM might be way better for all I know), it might be a good idea to use so the focus can be put on developing AS as a nice language and API, and not have to think about the VM backend. (But I also realize that writing the VM etc is a lot of fun as well, at least sometimes. :)
I can't say the AngelScript VM is better than LLVM, but then again, the AngelScript VM is very tiny. I hardly spend any time working on it anymore. Everything goes into the compiler and the interface nowadays.

However, when I get so far as to start thinking about JIT compilation to native code etc, then I'll definitely check out the LLVM since it seems to have this already.

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

Yup, I hear you. I might have a look at hacking it in myself someday though, just for testing. :)
Let me know what you find out through this hacking. :)

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

What I've found so far is that LLVM and the AS bytecode has a bit different abstraction level. LLVM has notion of functions, blocks and variables, which by AS (as far as I can tell) is mostly handled in the compiler, generating more LL bytecode. This makes the overlap a bit weird, since parts that's currently outside of the bytecode would have to go into the bytecode instead.

It's not necessarily bad, just makes it more complex. Also, makes it harder to abstract to two parallel backends.
Interesting. I wonder why they did it the way they did. Could there be any performance benefits? I hope you can tell me more.

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

I don't know really, but I'm guessing there's at least two reasons... First, I'm guessing you can do some more optimizations if the VM knows more about the context of things. Second, it makes it _a lot_ easier to write frontends for, since you don't really have to worry about a bunch of stuff that usually I guess is the most cumbersome part of the LL pieces of the compiler.

But I'm just guessing. :)

This topic is closed to new replies.

Advertisement