Gravity Embeddable Programming Language

Currently trending on Hacker News, Gravity is an open source programming language that is designed to be embedded in iOS and Android applications.  Released under the MIT license, Gravity is entirely C99 code with the single dependency being the C Standard Library, making Gravity incredible portable.  It is also extremely light weight while still being feature rich, with a syntax inspired by the Swift programming language.

Details from the Gravity website:

Gravity is a powerful, dynamically typed, lightweight, embeddable programming language written in C without any external dependencies (except for stdlib). It is a class-based concurrent scripting language with a modern Swift like syntax.

Gravity supports procedural programming, object-oriented programming, functional programming and data-driven programming. Thanks to special built-in methods, it can also be used as a prototype-based programming language.

Gravity has been developed from scratch for the Creo project in order to offer an easy way to write portable code for the iOS and Android platforms. It is written in portable C code that can be compiled on any platform using a C99 compiler. The VM code is about 4K lines long, the multipass compiler code is about 7K lines and the shared code is about 3K lines long. The compiler and virtual machine combined, add less than 200KB to the executable on a 64 bit system.

The source code for Gravity is available here, with various editor syntax support available for download here.  Gravity was ultimately created to be the scripting language behind the Creo IDE for iOS and Mac development.  You can learn more about Gravity in the video below.

Scroll to Top