Live data from Hacker News

Show HN: Lyceum – An MMO game built with Zig and Erlang

github.com

21–30 of 72 posts

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#21
What's your experience been like with Nix?

How do you feel about devenv vs stock Nix? How are you getting devenv to work, as I don't see a devenv.nix file. I'm still a Nix beginner and would like to find ways of integrating it more into my development and improving my current techniques.[0]

[0] https://mtlynch.io/notes/nix-dev-environment/

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#22
post #7

Pretty amazing effort, this looks like a great labour of love! I can't give feedback on the code/technology, but on the writing on the lore section, I would try to simplify the writing. For instance the following: > The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening. With swords unsheathed and hearts ablaze, they clashed in a thunderous symphony of war, each…

It's a style thing. Fantasy writing often does this deliberately.

I've thought about this before when I revisited fantasy after years of being in the CS domain which helped me abhor ornate writing. I definitely think there is such thing as TOO ornate but dead-simple language also feels bad. It feels wrong to just say its an exception with fantasy - simplicity is good because it conveys the same thing more clearly and with less effort. I would think that transcends all domains. Still not sure how I feel about this. I guess there is a baseline non-styled language that is all about communicating raw info and then there is style that can be applied to writing which makes it feel more natural in different domains.

Having said all this, I actually do like your example more.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#23
post #19
post #18

Earlier quoted context omitted.

I see now, you are sending messages directly to Erlang server so you don't have to worry about network sockets. In my experience the issues with Erlang come with working with data structures, records are not flexible and there is not much one can do to abstract the boilerplate.

We are using maps all over the place in the server, and so far nothing has been annoying. I gotta say though that lack of infix custom operators for the monadic bind is a pain.

Take a look at Erlang's "parse transforms" which would allow you to implement some syntactic sugar. That's what is used to implement qlc, the query language for ETS/Mnesia - that one adds new semantics to list comprehensions, but you can modify any part of the syntax you want.

Also, Elixir supports macros and infix operator overloading - have you considered using it? If you know Erlang's stdlib and BEAM, switching to Elixir (and back) is almost painless. Not sure which monads you needed, but `with` macro is built-in, and it's a monadic bind for Option types (well, more or less). Adapting it for other monads shouldn't be hard.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#24
post #19

Earlier quoted context omitted.

We are using maps all over the place in the server, and so far nothing has been annoying. I gotta say though that lack of infix custom operators for the monadic bind is a pain.

Take a look at Erlang's "parse transforms" which would allow you to implement some syntactic sugar. That's what is used to implement qlc, the query language for ETS/Mnesia - that one adds new semantics to list comprehensions, but you can modify any part of the syntax you want. Also, Elixir supports macros and infix operator overloading - have you considered using it? If you know Erlang's stdlib and BEAM, switching to…

Thanks, I will for sure take a look!

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#25
post #7

Pretty amazing effort, this looks like a great labour of love! I can't give feedback on the code/technology, but on the writing on the lore section, I would try to simplify the writing. For instance the following: > The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening. With swords unsheathed and hearts ablaze, they clashed in a thunderous symphony of war, each…

It's a style thing. Fantasy writing often does this deliberately. I've thought about this before when I revisited fantasy after years of being in the CS domain which helped me abhor ornate writing. I definitely think there is such thing as TOO ornate but dead-simple language also feels bad. It feels wrong to just say its an exception with fantasy - simplicity is good because it conveys the same thing more clearly and…

You are right - it's a balance and definitely a matter of taste.

Although not-ornate doesn't necessarily mean dead-simple or bad. For instance compare the following:

> The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening.

With a very similar sentence from Tolkein:

> At that moment, among the trees nearby, a horn rang out. It rent the night like fire on a hill-top. Awake! Fear! Fire! Foes! Awake!

This is much less ornate, with simpler language, yet easier to parse and the image is much more vivid.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#26
post #25

Earlier quoted context omitted.

It's a style thing. Fantasy writing often does this deliberately. I've thought about this before when I revisited fantasy after years of being in the CS domain which helped me abhor ornate writing. I definitely think there is such thing as TOO ornate but dead-simple language also feels bad. It feels wrong to just say its an exception with fantasy - simplicity is good because it conveys the same thing more clearly and…

You are right - it's a balance and definitely a matter of taste. Although not-ornate doesn't necessarily mean dead-simple or bad. For instance compare the following: > The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening. With a very similar sentence from Tolkein: > At that moment, among the trees nearby, a horn rang out. It rent the night like fire on a hill-t…

So when there is less ornate and difficult language to parse for the brain, there are more cycles available for imagination? Indeed z a thin line to balance.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#28
post #7

Pretty amazing effort, this looks like a great labour of love! I can't give feedback on the code/technology, but on the writing on the lore section, I would try to simplify the writing. For instance the following: > The reverberations of the trumpet stirred the knights from their deep repose, igniting a tumultuous awakening. With swords unsheathed and hearts ablaze, they clashed in a thunderous symphony of war, each…

The short version is better.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#29
post #18
post #14

Earlier quoted context omitted.

We haven't touched the distributed part of the game, but our understanding is that when that time comes, it will be easier to use the BEAM approach given that it was made for this purpose. Given the experience so far, it seems that using Erlang was the correct choice, not only because of the above, but also because Erlang made the server implementation way easier than we thought.

I see now, you are sending messages directly to Erlang server so you don't have to worry about network sockets. In my experience the issues with Erlang come with working with data structures, records are not flexible and there is not much one can do to abstract the boilerplate.

Having a potentially untrusted client connect to the erlang node as a c_node (which seems to be what zerl does) is not a good idea generally, as connecting that way essentially allows the client to execute arbitrary code on the server.

Re: Show HN: Lyceum – An MMO game built with Zig and Erlang

#30
post #24

Earlier quoted context omitted.

Take a look at Erlang's "parse transforms" which would allow you to implement some syntactic sugar. That's what is used to implement qlc, the query language for ETS/Mnesia - that one adds new semantics to list comprehensions, but you can modify any part of the syntax you want. Also, Elixir supports macros and infix operator overloading - have you considered using it? If you know Erlang's stdlib and BEAM, switching to…

Thanks, I will for sure take a look!

For reference (for the "parse transform" approach in Erlang): https://github.com/rabbitmq/erlando - it doesn't look maintained, but it's probably still usable; otherwise, you might get some inspiration from the code :) This also (ab)uses list comprehension syntax:

    write_file(Path, Data, Modes) ->
        Modes1 = [binary, write | (Modes -- [binary, write])],
        do([error_m ||
            Bin 
(if one of the calls returns `{error, Reason}` tuple, the execution terminates and the tuple is returned; otherwise, `{ok, Value}` tuple is unpacked)
Post reply on HN