I’m planning use Gleam + zig in my server, is stupid?
Gleam have powerfull tools to handle with crash and recover. But Gleam is a language that’s too simple for what I want. I don’t want to be forced to follow the simplistic paradigm of the language throughout the entire architecture, so I thought about using a shared library to bridge the two: Gleam would receive the requests and handle the high-level stuff, while Zig would handle the actual business logic.
Zig has comptime, very compelling data structures, better control over structure, error handling, and things like that. Performance isn’t really my main concern for now — it’s the architecture and structure.
I haven’t found another language that gives me what Zig does in terms of structure, error handling, and so on. Basically, Gleam would handle authentication, headers, validation, timeouts, etc., while Zig would handle the business rules and data structures in general.
Is this completely stupid, or does it actually make some sense? As long as the performance doesn’t degrade to the point where it’s basically as slow as a Node server, that would already be enough for me.