Live data from Hacker News

Game Jam 2 Results

wasm4.org

131–140 of 193 posts

Re: Game Jam 2 Results

#131
post #129

Earlier quoted context omitted.

> We've been through that. Those are syntactically delineated unsafe features for C interop. Rust has them, too. And again we're assuming that the ones we went over in the previous thread are all there is. I found some more: @intToPtr, @bitCast, @alignCast. Some of those @ functions are spatially-memory-safe, and some are not: the differences are not clearly called out. (I'm going to charitably assume that taking a p…

> Again, "struggling to get 1% of the market" is a weird way to describe a language that's serving billions of users right now. Which language and which project is this referring to?

Android is heavily adopting Rust. They rewrote the Bluetooth stack, hardware keystore HAL, etc. in Rust and new components like virtualization are heavily using it. This is also behind the effort to get official Rust support in the Linux kernel. Android defines a stable kernel ABI for Linux LTS branches for GKIs (Generic Kernel Images). For example, 6th generation Pixels use the 5.10 LTS branch via a 5.10 GKI which can be updated independent of the device-specific kernel drivers. 7th generation Pixels will use the 5.15 LTS branch / GKIs and 6th generation ones have an experimental 5.15 LTS branch. They want to work towards having the SoC drivers and device drivers written against this stable API/ABI almost entirely written in Rust even if mainline Linux is slow to adopt it.

Re: Game Jam 2 Results

#132
post #3

Earlier quoted context omitted.

Yeah, not a lot of data points, and a niche subject, game dev, but I am playing with the Mach game and graphics engine, and so far so good. I started programming in 1978 in CPM Basic, C, 6502 assembler, etc. I play with Rust, but if I am really looking for high-integrity software, I am currently using SPARK2014 (the subset of Ada), that has some legs beneath it. Rust and AdaCore are starting to work together to bring…

How is Spark2014 easier to understand than Rust? The borrowing rules [1] are more or less the same. [1]: https://docs.adacore.com/spark2014-docs/html/ug/en/source/la...

Perhaps "understand" was the wrong word given I meant for me to understand. I have a C background and Pascal as well as assembler back in the day (late 70s/early 80s). I dove into Ada/SPARK2014 and picked it up much quicker than Rust. Ada has been around a lot longer than Rust, so I think it's syntax allows for a clearer readability even if they have similar borrowing rules. If I had my druthers I'd be programming in APL or J all the time, so take what I find clearer with a grain of salt. There wasn't as much tribalism around PLs as there is nowadays. I guess people stake a lot of emotion on what they have chosen as their main language or programming paradigm they may have committed so much of their time learning. I still recommend Ada/SPARK2014 to anyone who asks me about verifiable or high-inegrity software with a follow on comment to keep an eye on Rust especially with Adacore and Ferrous Systems teaming up to help Rust get there. Zig does not have a major sponsor like Rust, but it appeals to the low-level hacker, former C programmer. I love playing with Hexops' Mach game engine and graphics toolkit in Zig! I tried Bevy and Rust, but it just doesn't flow as quickly for me. Maybe it does for others.

Re: Game Jam 2 Results

#134
post #118

Earlier quoted context omitted.

You have chance to prevent it. It's not going to be perfect but use huge lesson learned from js ecosystem "mess" (I found this triggers some (many) js folks, it's quite ridiculous). Javascript "mess" in browsers could be reduced by dividing into two parts. DOM stuff, and pure language stuff. The first part can stay as is. Probably wrapped into thin API for new lang interop. The second part is a completely new lang th…

IMHO most software problem are social or caused by wider economic incentives. People come and go either because of life or work, and complexity piles up. I don't think there are any silver bullets. There is a reason Worse is Better. It's quicker to ship and spread.

I agree with your line_1 and line_2. However I think Worse is Worse because it's only better 20% of all aspects, that makes it sounds better. Anything can be best with context pruning.

Re: Game Jam 2 Results

#135

Earlier quoted context omitted.

Not sure which lens you are using for coming to this conclusion. In my experience, most people writing Rust code have no "moral superiority" and treat Rust as a "better tool", not as a religion per se. However, what I've seen in the discourse of several programmers that claim to prefer Zig is the assumption that Rust is "not really that big of a deal". There's a constant minimization of the advancements both the owne…

> However, what I've seen in the discourse of several programmers that claim to prefer Zig is the assumption that Rust is "not really that big of a deal". There's a constant minimization of the advancements both the ownership system and the safety approach provide, and a lack of recognition for the fact that the language is a "game changer" in the industry. I think you have inadvertently worded this in a way that sil…

I think the issue is memory safety is reachable. Correctness is either extremely hard (proof program satisfied specifications) to nigh impossible (make sure all icon pointy things are aligned).

Re: Game Jam 2 Results

#136
post #84

Earlier quoted context omitted.

Good habit, maybe, but it shouldn't cause a compilation failure. Add to that the snowball effect: you comment out a variable, compile, and you get another error because commenting out variable a made variable b unused. Rinse and repeat. It's a huge and totally unnecessary time sink. It should be opt-in, so that it's a warning by default, and then, when I'm ready to push my code, I could run some --strict mode that wo…

One of the features in go that makes it workable is you can assign it away via: _ = somevar That eliminates the unused chain problem. Not sure if zig included that part of the feature as well. Generally I agree though. The main problem with forcing unused variables, imo, is that it forces you to think a certain way. When I'm exploring the solution space on something, those constraints feel inhibiting.

> you can assign it away via: _ = somevar

If one suggested this in any other language to suppress "unused variable" warnings it would be considered a lazy way to avoid fixing the issue.

Meanwhile the developer of Zig himself recommended doing this[0] which only shows what a bad idea it is to make this a compiler error imho. It encourages workarounds and enforces something we automated long ago in the form of dead code elimination.

[0] https://github.com/ziglang/zig/issues/335#issuecomment-43526...

Re: Game Jam 2 Results

#137
post #85

Earlier quoted context omitted.

Memory safety isn't in conflict with low-level control over memory layout.

It can just be limiting in terms of ergonomics. Like I've implemented a couple of ECS's and what you want to do is dispatch a bunch of threads over big swaths of structured memory. One of the main things the borrow checker doesn't want you to do is use the same memory on multiple threads. You can do that in rust, and people have, but you have to put a lot of effort into convincing the borrow checker that what you're…

> So basically rust imposes a lot of limitations on how you can structure your program relative to something like Zig or C.

I don't see it imposing that much of a limit. If there is code you know is correct and Rust can't reason about it, do it in unsafe block.

And ECS is not just possible in Rust, but due to mutability guarantees you can make your ECS schedule systems in such way to maximize multi threading. See Bevy ECS.

Re: Game Jam 2 Results

#138

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

You're not alone. Fridays are my live streaming day and I've chosen today's topic to be the user experience of unused variable errors. I have an idea to solve this that can satisfy both parties - those who don't want to be bothered by such errors, and those who want the premise upheld that if Zig code compiles, it does not have any unused variables. In approximately 60 minutes I'll go live on https://www.twitch.tv/an…

Nice to see you here. I'm not much of a twitch guy, but I'm glad this is on your radar and I'll read about it afterwards!

If you're talking about the `zig fmt` idea, I'd like to draw your attention to a possible pitfall -- Silencing the errors with _ increases the risk that unused vars will be committed to the repo. https://news.ycombinator.com/item?id=32753079

I normally add the equivalent of `-Werror` to pre-commit and CI. But if those warnings are silenced directly in the source code, I can no longer rely on the compiler's guidance to clean up the code, and I would have to hope I could remember all the places I need to clean up before committing. In that way, solving this in the formatter could have the opposite effect on code quality than you intended. I _do_ want the compiler to yell at me... just not yet. Only when it comes time to commit.

Overall I've been impressed reading about Zig's design. You clearly have good engineering taste and I respect you challenging the status quo and trying unconventional ideas, even if I may disagree from time to time. I'm itching to start using the language once this is solved!

Re: Game Jam 2 Results

#139
post #135

Earlier quoted context omitted.

> However, what I've seen in the discourse of several programmers that claim to prefer Zig is the assumption that Rust is "not really that big of a deal". There's a constant minimization of the advancements both the ownership system and the safety approach provide, and a lack of recognition for the fact that the language is a "game changer" in the industry. I think you have inadvertently worded this in a way that sil…

I think the issue is memory safety is reachable. Correctness is either extremely hard (proof program satisfied specifications) to nigh impossible (make sure all icon pointy things are aligned).

And yet there are programs out there that work well enough, but that's not a story PL theorists would tell you.

Re: Game Jam 2 Results

#140

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.

It is when you have chains of them: see Vulkan setup.

In Zig, I find that I put a whole litany of "_ = varname;" at the bottom of my functions (starting with the function arguments) and they stay there permanently. This is NOT an improvement.

However, it's not really enough to stop me from using the language as that's an easy thing to evantually fix.

Post reply on HN