Zig :)

"Will shill this language till you all know about it" edition

What are (you) uzing zig for?
What are your hopes for zig?
What do you like / dislike?
Share your projects / experiences, ask questions, out yourself as a
S O Y by telling us how shit the language is.

>Language overview
I put this together to convert non-believers, it's just a few quick tl;drs of zig:
Who zig is for / other tips: pastebin.com/4BpjsUw8
Interfacing with c library: pastebin.com/2R1LBYyM
Basic stuff: pastebin.com/pf3GnDF5
Generics / error handling: pastebin.com/aAqXfW3V

>Docs (0.9.0)
Lang ref: ziglang.org/documentation/0.9.0/
Stdlib docs: [YOUR_ZIG_DIR]/lib/std/
Build system: zig.news/xq/zig-build-explained-part-1-59lf

>Learning / practice
github.com/ratfactor/ziglings
adventofcode.com

Attached: zig.png (153x153, 4.27K)

Other urls found in this thread:

harelang.org
twitter.com/SFWRedditImages

I don't use Zig :^)

Where is zig used in production?
Not a cnile, just generally curious.

>What are your hopes for zig
That Jai comes out and buries it 6 feet under so I don't have to hear anyone recommend this shitty language again.

>Where is zig used in production?
>Not a cnile, just generally curious.
It isn't, language is 0.9, so it will take a while. The language itself is already fairly well defined, but there are still things that change, and it still uses llvm. You shouldn't use zig for production stuff yet, unless you don't mind having to change things down the line.

I use it for personal projects, and have pretty much been [transitioning] all my C code to zig (which isn't even necessary, since it just works with c, but it gives me a comfy feeling).

Jai buries itself 6 feet under is what is happening

Ah yes, another language was just what we need.

As far as I'm concerned, the only languages which exist are C (my ex-favourite language), and Zig (my favourite language), so I don't know what you're talking about.

c++chads enjoy another debugger for llvm

There are no reasons for this language to exist.
Everything listed in your language overview is already present in mainstream languages
Whatever zig peculiarity is, doesn't justify its existence, although you are free to use it

That explain why zig sounds appealing to you

harelang.org

ok so i've done ziglings, i've read what's there of ziglearn, started going through the documentation page
where do i go from here? i've written some assembly but have no experience with c or other low level languages and a lot of these concepts are alien to me

Finally, this is the 2nd day in a row i see a thread about Zig.

>What are (you) uzing zig for?
Currently: everything i write at home.

>What are your hopes for zig?
Wide industry adoption, writing Zig is fun!

>What do you like / dislike?
I like:
- Error Handling (Done like almost perfectly, don't know how to make it better)
- if/else/switch as expression
- Manual Memory management
- No OOP bullshit
- No preprocessor / macros / bullshittery like that
- Cross compilation (obv.)
- Relatively straight forward Async implementation
- Native Unit-test framework
- The typesystem is literally pure perfection

Dislike / Find weird:
- Optionals = null, anything else = undefined, why?
- Allocator instantiation is kind of... weird i suppose?
- print function always has to receive a anonymous struct
- I would love to see an option for Race-condition detection in compile-time

Advent of code or any of those kinds of programming challenges are usually a good place for you to start getting used to applying shit you know to problems you want to solve. Afterwards it's just a matter of deciding on a project and going for it.

Why don't you make a hare general? Will hare live forever in zig's shadow just like you are forever living in the shadow of a zigchad's thread?

Way to completely miss the point, holy shit.
Also S O Y

It's not stable so I would not recommend doing that.
You could use it wherever C is used though.

>8-column-wide tab characters
pass

>Allocator instantiation is kind of... weird i suppose?
I'm not sure if this is what you mean by instantiation, but you can pass the allocator directly, at least with the c allocator:
>var arr = std.ArrayList(u8).init(std.heap.c_allocator);

>print function always has to receive a anonymous struct
I'm unsure about this myself, but I get the idea behind not allowing overloading and default arguments.

My recommendation is:
Start writing basic datastructure from here, like a doubly linked list or smth, that will get you familiar with basic memory management.

> Way to completely miss the point, holy shit.
What was the point in the first place?

I tried hare once and it wasn't FIOC

based and bunnypilled

Attached: hare.jpg (256x256, 24K)

i mean something along the lines of having an allocator yourself:
var galloc = std.heap.GeneralPurposeAllocator(.{}){}.allocator();

Cuck license

I didn't even know that was a thing, kek. I just use c_allocator everywhere like a caveman. I guess that's just one of those things you'd have as a global, unless it was a contained pool.