Replies: 2 comments 7 replies
-
I think you could certainly use Gleam the language in a game. The APIs would have to be different to what one would normally find given the popularity of OOP and mutability in that world, but you could certainly make functional equivalents. I think the challenge would be how to run Gleam within your game. The Erlang VM is not well suited for embedding, and talking to it over a network doesn't sound great for in-game code, but it could work very well in a game that is multiplayer and thus already running over a network. There are several games that use Erlang backends. JavaScript could be a better fit for conventional game scripting, as you say. I'd be very interested in exploring wasm for this too! |
Beta Was this translation helpful? Give feedback.
-
It might work if Gleam adds a Lua backend. Lua is simple to generate and simple to embed. Fennel is a Lisp that compiles to Lua, for example. |
Beta Was this translation helpful? Give feedback.
-
Hi! Discovered gleam a little while ago and while going through the language tour I kept thinking to myself how clean the syntax was, and how much I'd love to do games programming in a language like this. I've been working with rust quite a bit recently and gleam feels pretty similar but is a lot more "fun" to me, if that makes any sense!
I'm not super familiar with the erlang world and the ways it works and differs from other languages but it does seem like gleam is designed around some choices that would make things like games more difficult to do. It sounds like erlang and by extent gleam is pretty server-focused. From what I've seen so far it seems like gleams notion of mutability, how it "updates" records, and its list type would be pretty limiting factors for that kind of application.
Being able to transpile into javascript sounds like lets it get around some of those limitations, though - so maybe there is some opportunity there? I work on a nodejs library that lets you do native graphics on the system with opengl, so it'd be interesting to see if I could set up a project that uses gleam in conjunction there.
I'm definitely not asking for anything like an interpreter for gleam, I'm more just curious, as folks more attuned to gleam/erlang what sort of difficulties or problems you might expect someone to run into if they try to use it for that purpose? What sort of changes or other features would the language need to work better for games as a use-case, and are those sorts of things even in line with the vision of the language?
Beta Was this translation helpful? Give feedback.
All reactions