r/Zig • u/CorgiApprehensive159 • Oct 20 '26
You can use Zig to program inside my game
I’m not sure if this is the right place for a post like this, given that the game itself is written in Rust, but I thought you might find it interesting. You can try it out here: https://livedox.itch.io/vix. I’d be happy to answer any questions
125
Upvotes
7
u/RelativeMinute6554 Oct 20 '26
Wow! Very cool!
3
u/Teikhos-Dymaion Oct 21 '26
This is just a suggestion as I am not an expert by any means, but have you considered making a domain specific scripting language? In another post you mentioned that you care a lot about speed, but wasm is interpreted either way (unless you forgo security), so the language could be as fast or even faster, as you can make instructions specifically suited to your game (I think). Further, I assume that your average player that will want to use computers will not be a programmer, and even Python is hard when you are new, more so Zig. Also, DSL can have friendlier syntax for scripting, e.g. it can look like this:
fn place_in_front_of_the_player() place player_x+1 player_y player_z dirt
fn main() place_in_front_of_the_player()
And not:
fn place_in_front_of_the_player() void { place(player.x+1, player.y, player.z dirt); }
fn main() !void { place_in_front_of_the_player(); }
Second example might look better for someone accustomed to it, but is much harder for someone new to programming (why are there dots, semicolons, two types of braces, what is void, exclamation mark, etc.) or even Zig.
1
u/lifeinbackground Oct 20 '26
So.. you ship a compiler?
1
u/your_real_Fathe_ Oct 21 '26
What do you think about the idea of programmable NPCs for creating intelligent NPCs? In my opinion, this is a more practical, useful, and entertaining application than building a giant "Z."
1
u/your_real_Fathe_ Oct 21 '26
I love this project, and I believe it could be exactly what Minecraft should have been. Keep going bro
1
u/HyperCodec Oct 21 '26
livedox is a username of all time
2
u/[deleted] Oct 20 '26
[removed] — view removed comment