Talon - Write Raylib programs in Wren

Hi Everyone,

I want to share a project i have been working on for the last few days. Talon is a wren runtime that allows you to write Raylib games in Wren programming language. I am using Zig to write the core embedding logic.

Why?
Recently, I have recently exploring how to write Raylib programs in Zig and was really impressed by Raylib’s simplicity and features. This project is my attempt in trying to make writing Raylib games in simple scripting languages easier.
I chose wren because it was the language that i really enjoyed writing back when i discovered it three/four years ago. My plan for Talon is to make it stable that eventually it is going to replace my 2d game usecases.

Here is the repo on github.

Talon

If you have prior knowledge of Raylib it will be really easy to get started as most of the raylib core functionalities are encapuslated in the builtin Raylib class.

Appreciate any feedback. Enjoy!!

3 Likes

Does anyone know if there exists a standard library way to parse C files. I am looking for std.zig.parse() but for C. i checked if std.c.parse() was available but it wasnt. Add (unfinished) C parser to std lib by Vexu · Pull Request #4317 · ziglang/zig · GitHub this might be what i am looking for. but its not available on latest zig 0.14.0.

Can you use Aro ?

2 Likes

Oh nice. That looks exactly what i am looking for. Thanks.

Hi Again,

Do you know why i am facing

 error: type 'u29' has no members
strings: std.ArrayListAligned(u8, .@"4"),
                                  ~^~~~
error: the following command failed with 1 compilation errors:

error when using aro. Here is a sample code i copied from one of arocc’s tests

  var diagnostics: aro.Diagnostics = .{ .output = .ignore };
    var comp = aro.Compilation.init(allocator, &diagnostics, std.fs.cwd());
    defer comp.deinit();

    const f = try comp.addSourceFromBuffer("main.c",
        \\int main(void) {}
        \\
    );

    const builtin_macros = try comp.generateBuiltinMacros(.no_system_defines);

    var pp = aro.Preprocessor.init(&comp, .default);
    defer pp.deinit();
    try pp.addBuiltinMacros();

    _ = try pp.preprocess(builtin_macros);

    const eof = try pp.preprocess(f);
    try pp.addToken(eof);

    var tree = try aro.Parser.parse(&pp);
    defer tree.deinit();

Looks like you’re building with Zig 0.14, but Aro master tracks Zig master

1 Like