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!!
4 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.
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
Hi All, here is a question i couldnt get a proper answer for. It is related to this project so i do not want to create a new topic as the context would be lost.
This weeknd, i finally cleaned up the features Talon supports and while doing that i was puzzled about one of the features which is ‘Wasm Support’. The wasm support for Talon depends on 'Zig’s build system which works great for me. but when an end users start to use talon, i dont think it is fair to ask them to install zig in order for them to compile their games to wasm.
The options i considered were
- Embed the zig compiler with Talon when building it. (i dont know how to do this and i couldnt find anyone doing it.)
- Provide docker starter files so users can use to download the starters (by executing ‘talon init-wasm’) and they would start using ‘docker’ normally. This dockerfile is supposed to download zig and provide build.zig that does the work to compile the game into wasm. I dont think if this is recommended approach but this was the option i went with at the end.
I want to hear your feedback on this problem and on overall the project, since this was my serious project that i did with zig. and honestly, I am liking the zig language and the whole community around it. Thanks.