Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JamesBoer/Jinx
Embeddable scripting language for real-time applications
https://github.com/JamesBoer/Jinx
c-plus-plus c-plus-plus-17 cmake embeddable-scripting-language game-development gamedev-library jinx jinx-scripts jinx-website language scripting-language
Last synced: 3 days ago
JSON representation
Embeddable scripting language for real-time applications
- Host: GitHub
- URL: https://github.com/JamesBoer/Jinx
- Owner: JamesBoer
- License: mit
- Created: 2016-07-08T08:36:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T19:55:31.000Z (almost 2 years ago)
- Last Synced: 2024-10-26T20:43:16.065Z (14 days ago)
- Topics: c-plus-plus, c-plus-plus-17, cmake, embeddable-scripting-language, game-development, gamedev-library, jinx, jinx-scripts, jinx-website, language, scripting-language
- Language: C++
- Homepage: https://jamesboer.github.io/Jinx/
- Size: 53.8 MB
- Stars: 312
- Watchers: 22
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-programming-languages - Jinx - Embeddable scripting language for real-time applications. (Uncategorized / Uncategorized)
README
# Jinx ![CI](https://github.com/JamesBoer/Jinx/workflows/CI/badge.svg)
Jinx is a lightweight embeddable scripting language, written in modern C++, intended to be compiled and used from within a host application. The Jinx language is clean and simple, looking like a cross between pseudo-code and natural language phrases, thanks to its highly flexible function syntax and identifiers that can incorporate whitespace.
It was inspired by languages such as Lua, Python, C++, AppleScript, and a few others. A significant design goal was to make Jinx not only simple to use as a language, but also to make it straightforward to integrate and use via the native API. Jinx scripts are designed to be executed asynchronously as co-routines, or even on separate threads, since the runtime is thread-safe. The language also uses no garbage collection, ensuring predictable CPU usage. This makes it a potential candidate for real-time applications like videogames.
You can [visit the main Jinx website here](https://jamesboer.github.io/Jinx/), or [see recent changes](https://github.com/JamesBoer/Jinx/blob/master/Docs/Changelog.md)
## Getting Started with Jinx
Jinx requires a C++ 17 compliant compiler to build, and it is available both as a traditional or header-only library.
Jinx supports the CMake build system, so for CMake users, adding Jinx should be as simple as pointing your build scripts to the root folder of the project. Stand-alone build scripts for several platforms/IDEs are found in the ```Bin``` folder. Alternatively, to build the library manually, copy all the files within the ```Source``` folder to your project, add them via your IDE or build system of choice, and include ```Source/Jinx.h``` from your own source files. This should be reasonably simple, since the entire library is contained in a single folder.
Using the header-only version is even simple. Include the header file ```Include/Jinx.hpp``` from your own source, which contains the entire library in a single amalgamated header.
## Your First Jinx Script
Jinx is incredibly simple to use, requiring only a few lines of C++ code to compile and execute your first script. Here's a Hello, World that not only demonstrates the Jinx script, but all the C++ code required as well.
``` c++
#include "Jinx.h"
// Create the Jinx runtime object
auto runtime = Jinx::CreateRuntime();
// Text containing our Jinx script
const char * scriptText =
u8R"(
-- Use the core library
import core
-- Write to the debug output
write line "Hello, world!"
)";
// Create and execute a script object
auto script = runtime->ExecuteScript(scriptText);
```There is a [more comprehensive tutorial](https://jamesboer.github.io/Jinx/Tutorial.pdf) on the Jinx website for anyone who wants to dive a bit deeper into the language.
## Jinx Status
Jinx was released as 1.0.0 (stable) on January 1, 2019, after three years of development, refinement, and testing. Since then, mostly minor language features and API enhancements have been edded. Additional work, for the immediate future, will be restricted to bug fixing or critical refinements, with the intention of retaining backwards compatibility.