An open API service indexing awesome lists of open source software.

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

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);
```