So, it looks like every other language designed in the last 40 years? This is good?
So, it looks like every other language designed in the last 40 years? This is good?
A lot of game developers attach a small scripting language to their game engines because C++ isn't a good language for rapid game logic prototyping, and takes ages to compile. The majority of them use Lua for this purpose. Lua is certainly simple and elegant, but has its shortcomings (no direct support for classes, 1-based indexing, indexing a wrong field returns nil, can accidentally declare global variables on assignment, lack of syntactic sugar...) I've looked at other languages such as Angelscript, Squirrel, Wren, etc..., to use for game development, but I think Gravity is the cleanest and has the most features so far. I'm still curious about the performance though (If it runs about the same as non-JIT Lua I'll call it a success, given how Lua is much simpler than Gravity)
Even if you aren't a game developer, scripting languages also has its use with UI development. The majority of UI developers use Javascript with a combination of web technologies, so that's one example. Even QT developers use a scripting language called Qt Quick (which also resembles Javascript a bit), because C++ can be too tedious for rapid prototyping. The author of Gravity have also developed this language for mobile UI Development, so it seems good for its intended usage.
The language isn't particularily shining on new concepts, but I think it will be very useful for some of us.
Anyone programing in Lua should be well versed in http://www.luafaq.org/gotchas.html
Gravity's class system is inflexible compared to Lua where it has Multiple Inheritance https://github.com/limadm/lua-oo Prototypical OO https://github.com/nusov/lua-object or anything else you desire.
As for extending syntax and semantics, http://lua-users.org/wiki/MetatableEvents provide a clean mechanism to do so.
Lua coroutines are more powerful than Gravity's fibers.
I was hoping that Gravity had pattern matching support, but it looks like it does not.
Given that Lua has more capabilities than Gravity could you substantiate
> Lua is much simpler than Gravity
In what ways?
The underlying problem with Lua is that it went too wild with the philosophy of "being the most expressive using the least amount of features" (so you can implement everything using only metatables). Although many would say that this is a good thing, for me it seems better for a language to have some kind of subset for which people can conform and rely on.
I have done quite a few Lua projects, and I can tell you've not quite gotten it right.
The Class system you use is the one you take with you on the project. This is a strength, not a weakness; your patterns are a base file in the project.
I prefer this. Its more Scheme-like, philosophically. I've seen your criticism from many quarters and here's my guess at what happens: people come to Lua from other languages, find missing abstractions, recreate them, and in the process don't thoroughly learn the metamethod system.
Pure prototyping is a joy once you realize what all the moving parts are and how many ways they can be usefully combined. This is my experience anyway.
It is a problem when writing general-purpose code in Lua. But why would it be a problem when deciding to embed it, and comparing it to Gravity in this context? With Lua, you'd pick one such system, and stick to it. With Gravity, the system is picked for you - if you don't like it, too bad.
I have often wondered whether, rather than a new, very orthodox language, it would be more useful to have a lightweight implementation of (a subset of) an existing language?
However, my discussions about MicroPython have shown that many programmers would rather learn a new language than try to restrict themselves to a subset of one they already know. It's likely that programmers who don't know e.g. Python, would also rather learn a brand new language.
So, the number of lightweight, very orthodox languages continues to increase.