Live data from Hacker News

Game Jam 2 Results

wasm4.org

31–40 of 193 posts

Re: Game Jam 2 Results

#33

Earlier quoted context omitted.

That's the one thing keeping me from considering Zig for new projects right now. If some enterprising young developer is reading this and wants to make a name for themselves, you should fork the Zig compiler and change those errors to warnings. It would be an extremely popular project. EDIT: I'll even give you a catchy project name. Wig: Zig with Warnings

There's actually already a patch for this posted on the github issue. It's only about a 5 line change.

The patch works, but it's not efficient to have every user patch their own compiler on every release (and forgo the system package manager for upgrades). I was also envisioning adding a warning system, changing the checks to warnings instead of removing them completely, and adding a `-Werror` flag (or maybe `-Wno-error`). It would be a bit more than 5 lines, but still relatively low effort compared to how impactful the project would be.

Re: Game Jam 2 Results

#34

Earlier quoted context omitted.

For me Rust is a language that I would absolutely love to work with in a professional context. The type system and borrow checker have your back and help you make changes to the code without fear of accidentally introducing any regressions. For private lone-hacking projects though it feels way too complex and opinionated. Here Zig definitely gets closer to what I need, though sadly it made unused variables an compile…

I never understood this attitude, it's not like commenting out variables is difficult.

I just want the quick edit to test something to be quick.

Re: Game Jam 2 Results

#35
post #14

Earlier quoted context omitted.

What are you talking about? I don't understand how you've never encountered variables depending on each other. In any moderately complex function you'll have more than one expression, and those can depend on each other. And you want them to be named and assigned; it makes it easier to read and decode intent and debug things (unless you're one of those wizards who get it right on the first try every time, kudos to you…

Of course I have encountered dependent variables, but if I have a long chain of unused variables that means that either that code is ready to go, or the code organization needs refactoring.

At first you have a long chain of used variables that end up into a value used somewhere.

If then you refactor away that single final value you need to delete all the previously used variables that now need to be "deallocated" by you.

Re: Game Jam 2 Results

#36

Earlier quoted context omitted.

>it's not like commenting out variables is difficult. But if you comment var A that uses var B now B is unused and you need to commnet B, but now B was using a function parameter C and this param is unused now so you need to update the function signature (I do not use Go,Zig so maybe they did not forced you to also use all the function params my experience is with linters where ehwn you comment something then more un…

Wow sounds like you really need to clean up your codebase. Seriously, I have never had this problem while coding in Go, and I'm a very very sloppy coder.

As other said, it is not a good practice so inline all the code, I prefer well named variables, and I assume you can find examples in your code where you have a local variable that depends of a function parameter.

Funny enough I was correcting my son c++ homework yesterday, he had a complex if statement like

if (somefunction(m,n, y[j]) == m[j])

and I made him make a local variable to make it clear what is happening. then the code was easier to understand and debug because we culd print that local variable and see if is fine.

Btw, try not too respond that smug, you proved that you are an inexperienced coder and a shit person.

Re: Game Jam 2 Results

#37
post #31

From the perspective that development time is a big constraint in a game jam it's no wonder zig is more popular than rust

Arguably Zig is a better fit for game dev. At the high end game dev is all about memory layouts and cache optimization, and that goal can run counter to Rust's approach to memory safety.

Re: Game Jam 2 Results

#38
post #14

Earlier quoted context omitted.

What are you talking about? I don't understand how you've never encountered variables depending on each other. In any moderately complex function you'll have more than one expression, and those can depend on each other. And you want them to be named and assigned; it makes it easier to read and decode intent and debug things (unless you're one of those wizards who get it right on the first try every time, kudos to you…

Of course I have encountered dependent variables, but if I have a long chain of unused variables that means that either that code is ready to go, or the code organization needs refactoring.

Dude, it is about debugging, or work in progress...

Did you ever tried to debug some issue and start commenting stuff to try and find the problematic area? Hell when I comment stuff soemtimes private function will get unused , so with a shit compiler you would need to also comment the private functions, remove unused classes etc.

In my code I assure the linter will say 0 warnings.

Re: Game Jam 2 Results

#39
All WASM related stuff seems lacking of know-how of WebAssembly itself. I want the promise of "language-agnostic". For example, I have AST, I want to generate WebAssembly (either text or binary format, lets start with .wat), there's only a couple articles I found talks about how to map string to wasm's memory or table.

Current situation is it's not language-agnostic as movement, it's just c/rust mostly.

So wasm-4 seems to have more interesting examples than the other e.g. https://wasm4.org/docs/tutorials/snake/handling-user-input

Re: Game Jam 2 Results

#40
post #9

Earlier quoted context omitted.

It's not difficult, but it's disrupting to your coding flow, which is bad in itself and even worse when prototyping.

More disrupting than a really slow compiler?

Yes. If Zig takes 100ms to compile, and Rust takes 2s, but you just spent 20 seconds commenting unused vars in your Zig code, then the slow compiler comes out ahead. It's a great example of how good UX can be more important than raw performance numbers.
Post reply on HN