https://github.com/hobby-engine/hobby-script
The scripting language for the (future) Hobby game engine
https://github.com/hobby-engine/hobby-script
hobby-script hobbyscript interpreter language programming-language scripting-language
Last synced: 8 months ago
JSON representation
The scripting language for the (future) Hobby game engine
- Host: GitHub
- URL: https://github.com/hobby-engine/hobby-script
- Owner: hobby-engine
- License: mit
- Created: 2024-09-12T23:06:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-03T22:00:06.000Z (about 1 year ago)
- Last Synced: 2025-04-04T21:39:45.427Z (10 months ago)
- Topics: hobby-script, hobbyscript, interpreter, language, programming-language, scripting-language
- Language: C
- Homepage:
- Size: 1.37 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hobby Script
A dynamically typed programming language designed for use in game development.
Hobby Script is designed for use in the future Hobby Game Engine, although it
is standalone as well.
### Features
- Lack of OOP
- Speed
- faster than Wren and Python, slower than Lua (on my machine)
- Dynamic typing
## Building
It should be as easy as cloning the repo and going:
```shell
mkdir bin
make
```
Requires MinGW on Windows.
## Snippets
Hello world:
```zig
io:print("Hello, world!");
```
Here's timer, so you can get a better feel for the language:
```zig
// Timer.hby
struct Timer;
var total_time = 0;
var time_left = 0;
static fn new(total_time) -> Timer{total_time=time};
fn is_over() -> self.time_left <= 0;
fn step(dt) {
self.time_left -= dt;
}
```
Then, you can use it in some other file like this:
```zig
// main.hby
var Timer = import("Timer.hby");
var timer = Timer:new(5);
timer.step(1);
```