Better HN
topnewbestaskshowjobs
Log inSign up

sobeston

135 karma · joined Dec 9, 2019 (6y ago) · 26 submissions

Submissions

comment 6mo ago · link · parent

Level1Techs' KVM products have always been expensive, and they're arguably the best around. There aren't many competing products.

comment 1y ago · link · parent

It doesn't. This article doesn't measure that, and full screen works differently. This article also only measures gnome.

comment 2y ago · link · parent

You could probably make a good docs site in hugo with enough work, but Docusaurus has pretty much everything I need out of the box (and is less annoying to extend). I think it really is a lot better for documentation.

comment 2y ago · link · parent

Small self plug: https://zig.guide is ready for Zig 0.12.

Some notable changes in zig.guide since Zig 0.11 came out:

  - Changed from following master, to following major releases (Zig is more stable now, less work for me. Yay.).

  - Migrated from Hugo to Docusaurus, bringing some large frontend improvements.

  - Moved over from ziglearn.org to zig.guide.

  - Removed 'usage in production is not recommended' from the front page.

  - Support for versioning.

  - Greatly improved testing through build.zig.

  - Opened up for github sponsorships.

  - Added another section for supplementary walkthroughs.
The site still isn't nearly where I want it to be but there's been some big improvements in the last few months.

comment 2y ago · link · parent

Win32 isn't stable on Linux, though.

comment 3y ago · link · parent

You claim to be healthy, yet you have not died yet. Curious.

comment 4y ago · link · parent

I believe where this stands is that if someone were to contribute and maintain this, then it could be part of the Zig compiler, however it is not something the Zig team themselves are planning on doing. Maybe give it a shot? I personally find the project interesting and fun but I'm not convinced that it's a good solution.

comment 4y ago · link · parent

https://www.reddit.com/r/learnprogramming/comments/y1zuzv/is... https://www.reddit.com/r/AskProgramming/comments/y1zwan/is_t...

Assuming this is you also. There were commits to Zig less than an hour before you posted this.

comment 4y ago · link · parent

I actually saw multiple people in the Zig core team (and others) actively working on the Zig compiler in person this weekend! Development may have slowed in the last 2 weeks or so because of the SYCL conference; given the turnout I can assure you that there is no decline in people working with or on Zig long-term. If you look at the commits, issues, or the stage 2 meetings (normally held every thursday in the discord), you would also see that the project isn't on the decline. You're correct that the financial reports of the ZSF aren't up to date - these are updated manually so you can expect some delay.

I'm assuming you're the same person that made multiple new stack overflow accounts recently to ask (and answer, on a different account) this question here: https://stackoverflow.com/questions/74040564/is-the-zig-prog... (since removed by moderators).

My question to you is: Why are you trying to force this false narrative?

comment 5y ago · link · parent

Author here, I'm just showing how I did it. It took a few minutes to do it for myself - figured it would be worth the 15 minutes or so it'd take to write it down. Just sharing my process, there's nothing too serious about this post.

I've happened to have written a lot of C, but some areas (like this one) I'm not as confident in. This way of casting, and working with types is very poor syntax in my opinion (I mean below in this thread you have people arguing about the spiral rule and such, it's obviously a common confusion).

Zig's way of expressing types and pointers is far superior, these transformations I made were done quickly and I didn't feel like there was any ambiguity or confusion in anything. Just a series of simple reductions, there are no "tricks" or easy mistakes to make in the code. It feels like a trivial proof.

Obviously I am biased, this was posted to zig.news. I thought it was a neat showcase of translate-c, and how zig does some of these things nicer. I'm not telling everyone that they should do what I did, but this works for me and I'm happy to share.

comment 5y ago · link · parent

ptr.field works.

comment 5y ago · link · parent

I think Zig does cross compilation (ignoring for the moment, projects with C dependencies) better because it comes out-of-the-box with the libraries and headers needed to target a lot of systems. In Rust, you typically get additional toolchains via rustup, whereas Zig works on all of the targets with a single install.

comment 5y ago · link · parent

This is silly.

If you make code that requires allocation and does not have an allocator passed into it, there is literally nothing stopping you from allocating anyway. Zig does not stop you from, for example, heap allocating without the usage of an allocator (Zig does not know what heap allocation even is). You can directly use the std page_allocator (and others) wherever you want, too.

There are very few good reasons to do this (e.g. spawning a thread requires particular allocation; using an allocator might not be sound depending on the OS).

All you have to do is document that it allocates memory and that's fine; there is no split.

comment 5y ago · link · parent

The concept of the heap is in the userspace of the language. This terminology is confusing to someone thinking of usermode/kernelmode - this is instead talking of userspace versus language-space. As in, users implement code to reason about heap memory; the language does not know or care what heap is.

At a language level, zig does not have a "new" or a "malloc" or anything of the sort.

comment 5y ago · link · parent

Getting command line arguments is covered here:

https://ziglearn.org/chapter-2/#iterators

I don't think that going further into parsing is in scope. std.log is something that definitely needs to be covered. HTTP, I'm not sure about as it requires a lot of extra machinery outside of the standard library and these things aren't mature yet.

comment 5y ago · link · parent

Hi, I am currently writing ziglearn.org which aims to show a lot of detailed examples.

comment 5y ago · link · parent

Maintainer of ziglearn.org here. I have just now added details on using stat and directory creation + walking here:

https://ziglearn.org/chapter-2/#filesystem

And details on reading the next line here:

https://ziglearn.org/chapter-2/#readers-and-writers

fread/fstat/fgets/fopen is now all covered. The build system is something I need to cover much more thoroughly, but is something that will take a long time.

comment 6y ago · link · parent

For future proofing, I just don't want to exactly support tagged releases as of now. Zig could release breaking changes next week and I would update the guide to fit that; master is followed.

comment 6y ago · link · parent

https://ziglearn.org/ should be up to date for 0.7.0 already. Do have a peak if you haven't yet learned how to use Zig; the first chapter (most of the language) should be readable in under an hour.

comment 6y ago · link · parent

It's been working great on windows for me for the last year or so. When did you last try it?

comment 6y ago · link · parent

The version that tio has is very old at this point. Godbolt stays up to date.

comment 6y ago · link · parent

https://godbolt.org/ hosts zig, try zig trunk.

comment 6y ago · link · parent

I pushed some changes to reflect this

comment 6y ago · link · parent

I have done this as zig makes many breaking changes often, not because new features come out all the time (almost all of the things showcased on the site if not all were around back in 0.6). I do not want to teach people things that are already for the most part outdated. Things move very fast, especially in the standard library.

edit: to clarify I am the maintainer/owner of ziglearn

comment 6y ago · link · parent

Traits are a part of the stdlib (under std.meta) as opposed to the language. This is unlikely to change