ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
thither has left #zig ["WeeChat 1.6"]
<GitHub31> [zig] bnoordhuis opened pull request #1094: support `--target-arch wasm32` (master...wasm) https://git.io/vh2y6
pjmp has joined #zig
<clownpriest> https://github.com/clownpriest/xxhash preliminary benchmarks look promising
<clownpriest> granted it's just compared to Go, but the zig code could be tuned quite a lot more
pjmp has quit [Quit: Page closed]
<andrewrk> clownpriest, neat!
clownpriest has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
isd has joined #zig
bheads has joined #zig
clownpriest has joined #zig
clownpriest has quit [Client Quit]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
donlzx has joined #zig
<donlzx> what is floating point optimized mode and strict mode exactly? I got confused when following the official langref.html.
return0e_ has joined #zig
return0e has quit [Ping timeout: 245 seconds]
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #zig
isd has quit [Ping timeout: 248 seconds]
isd has joined #zig
mahmudov has quit [Ping timeout: 255 seconds]
sagecode has joined #zig
<andrewrk> donlzx, do you have a specific question? I'll try to explain it
<GitHub196> [zig] andrewrk opened pull request #1095: breaking syntax change: ??x to x.? (master...optionals) https://git.io/vh2Hg
<GitHub198> [zig] andrewrk pushed 1 new commit to master: https://git.io/vh2H2
<GitHub198> zig/master d464b25 Ben Noordhuis: support `--target-arch wasm32` (#1094)...
<GitHub15> [zig] andrewrk closed pull request #1094: support `--target-arch wasm32` (master...wasm) https://git.io/vh2y6
<bheads> nice you got the .? change in. Did you decide on the ?? to ifnull change yet?
bheads___ has joined #zig
bheads has quit [Ping timeout: 240 seconds]
<bheads___> var window = sdl.SDL_CreateaWindow(...) orelse std.os.abort();
<bheads___> I like the way ir looks
clownpriest has joined #zig
<andrewrk> it has the nice property that someone who never saw any zig syntax could probably get the gist of it
<bheads___> Way better then ?? at first glance
clownpriest has quit [Client Quit]
sagecode has quit [Ping timeout: 264 seconds]
<bheads___> Ebeen enjoy zig, thanks for the hard work Andrew
<andrewrk> glad to hear :)
<andrewrk> what are you working on?
<bheads___> Porting a raycaster to zig, impressed with how easy it was to get Sdl working
<andrewrk> ah nice. yeah sdl was one of the libraries I made sure works: https://github.com/andrewrk/sdl-zig-demo
<bheads___> I am slowly porting my D app, but not planning to take to production anytime soon.
frmdstryr has joined #zig
<bheads___> Lol i see you had an issue with the same macros
<andrewrk> I don't understand why C libraries make such heavy use of macros
<bheads___> I have always hated that as well about c and c++
<andrewrk> the only macros that are intended to be used by users are the aliases for native and foreign endian. and even then I probably should have made it enums or something
<andrewrk> ok and SOUNDIO_MAX_CHANNELS because C doesn't let you use static consts as array lengths
<bheads___> I also hate how macros are how you handle cross platform, and build logic. But ehhh the 70s
<donlzx> hi andrewrk, I'm new to Zig. Upon reading the doc the first time, I couldn't tell what is the difference between strict and optimized float modes. It would be better that these concepts were briefly explained in the langref.html#Floats section before the example codes.
<andrewrk> donlzx, I see, maybe the docs that are under @setFloatMode can be more prominently advertised in the main float section
<bheads___> I bet you cant wait to port that lib to zig! But looks like a good library to me.
<andrewrk> it's tempting, but there's a big hurdle to overcome: on linux, alsa-lib kind of *is* the kernel API to the sound system
<andrewrk> linux sound essentially depends on alsa-lib
<andrewrk> and alsa-lib does things like dump log lines to stdout, and it has a lisp interpreter in it
<andrewrk> I'm sure it has some panics on out of memory in there
<bheads___> Ugh... What about pulse?
<andrewrk> one of my projects will be to look into avoiding alsa lib
<andrewrk> pulse should be reasonable to have a pure zig lib for it, assuming the protocol is reasonably stable
<andrewrk> the protocol between libpulseaudio and pulseaudio-server
<bheads___> I would think so, its been around for a long time now
<bheads___> Linux legacy is such a crux, even wayland has failed to replace x11.
isd has quit [Ping timeout: 268 seconds]
<bheads___> Okay off to bed, later all
frmdstryr has quit [Ping timeout: 264 seconds]
<GitHub63> [zig] andrewrk closed pull request #1095: breaking syntax change: ??x to x.? (master...optionals) https://git.io/vh2Hg
<GitHub102> zig/master ec1b6f6 Andrew Kelley: breaking syntax change: ??x to x.? (#1095)...
<GitHub102> [zig] andrewrk pushed 1 new commit to master: https://git.io/vh2Q7
<GitHub57> [zig] andrewrk opened pull request #1096: breaking syntax change: orelse keyword instead of ?? (master...orelse) https://git.io/vh27V
avisaven has joined #zig
<avisaven> hi
<andrewrk> hi avisaven
<avisaven> zig looks like its matured a lot recently, it's really an awesome project andrewrk, congrats on it dude
<avisaven> i was wondering at what version you were thinking about syntax lockdown
isd has joined #zig
isd has quit [Ping timeout: 240 seconds]
isd has joined #zig
<avisaven> why are function return types the only time that the type of something is not denoted after a colon?
<avisaven> for variable types, argument types, and member types, they're all after a colon, but the return type isn't
<andrewrk> thanks avisaven
<andrewrk> the current plan is no lock down of any kind until 1.0.0
<GitHub57> [zig] andrewrk closed pull request #1096: breaking syntax change: orelse keyword instead of ?? (master...orelse) https://git.io/vh27V
<GitHub199> [zig] andrewrk pushed 1 new commit to master: https://git.io/vh254
<GitHub199> zig/master 77678b2 Andrew Kelley: breaking syntax change: orelse keyword instead of ?? (#1096)...
<avisaven> ah gotchya, sounds good
<andrewrk> return type used to have -> and then the type, but I removed that when we made return types mandatory
<andrewrk> there's still an outstanding syntax issue with return types
<andrewrk> I'm going to bed, night all
<GitHub175> [zig] andrewrk pushed 1 new commit to master: https://git.io/vh250
<GitHub175> zig/master 0a95b0f Andrew Kelley: std.zig: update syntax for orelse keyword
<avisaven> have a good night!
avisaven has left #zig [#zig]
very-mediocre has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
<GitHub20> [zig] tiehuis closed pull request #1081: Add arbitrary-precision integer to std (master...bigint) https://git.io/vhghr
<GitHub84> [zig] tiehuis pushed 1 new commit to master: https://git.io/vh2d7
<GitHub84> zig/master dc8bda7 Marc Tiehuis: Add arbitrary-precision integer to std...
dbandstra has quit [Quit: Leaving]
jjido has joined #zig
IntoxicatedHippo has quit [Read error: Connection reset by peer]
IntoxicatedHippo has joined #zig
quc has joined #zig
atk has quit [Ping timeout: 240 seconds]
atk has joined #zig
davr0s has joined #zig
isd has quit [Quit: Leaving.]
donlzx has quit [Remote host closed the connection]
ysengrimm has quit [Quit: Ping timeout (120 seconds)]
ysengrimm has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tiehuis has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tiehuis> bb010g: thanks for those aur patches, i've updated the zig/zig-git packages to omit the stage2 artifacts
<tiehuis> namcap is also handy, wasn't aware of it, i've not changed the dependencies for the moment though since there is no harm in them and i haven't checked if the xml2 was fixed in the system llvm yet
tiehuis has quit [Quit: WeeChat 2.1]
mahmudov has joined #zig
<bb010g> tiehus: Since you didn't make git a makedepend, this still fails when building without git installed
tiehuis has joined #zig
<tiehuis> thanks, fixed
tiehuis has quit [Quit: WeeChat 2.1]
davr0s has joined #zig
<bb010g> tiehuis: It still fails when building in a chroot because you didn't properly place your patches in the source array, as recommended in https://wiki.archlinux.org/index.php/Patching_packages . My PKGBUILD does fully work in a chroot, if you just want to use that instead of continually modifying the old one.
<bb010g> Also, the libxml2 change makes no difference besides that namcap lint because the llvm package depends on libxml2.
Ichorio has joined #zig
jjido has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
very-mediocre has quit [Ping timeout: 260 seconds]
hoppetosse has joined #zig
bheads has joined #zig
davr0s has joined #zig
_whitelogger has joined #zig
mahmudov has quit [Remote host closed the connection]
sagecode has joined #zig
hoppetosse has quit [Ping timeout: 260 seconds]
isaachier has joined #zig
ysengrimm has quit [Quit: The Lounge - https://thelounge.chat]
ysengrimm has joined #zig
very-mediocre has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
clownpriest has joined #zig
davr0s has joined #zig
hoppetosse has joined #zig
clownpriest has quit [Client Quit]
clownpriest has joined #zig
clownpriest has quit [Client Quit]
frmdstryr has joined #zig
hoppetosse has quit [Remote host closed the connection]
hoppetosse has joined #zig
mahmudov has joined #zig
clownpriest has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SimonNa has quit [Remote host closed the connection]
<isaachier> Is there a reason the compiler code doesn't use any std constructs and/or C++11?
<isaachier> STL*
SimonNa has joined #zig
frmdstryr has quit [Ping timeout: 248 seconds]
hoppetosse has quit [Remote host closed the connection]
hoppetosse has joined #zig
xtreak has joined #zig
hoppetosse has quit [Ping timeout: 240 seconds]
jjido has joined #zig
xtreak has quit [Ping timeout: 264 seconds]
xtreak has joined #zig
xtreak has quit [Ping timeout: 240 seconds]
isaachier has quit [Quit: Page closed]
davr0s has joined #zig
frmdstryr has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tanner_ has joined #zig
Tanner_ has quit [Client Quit]
Tanner_ has joined #zig
<Tanner_> Is the build system documented anywhere at all?
frmdstryr has quit [Ping timeout: 264 seconds]
<andrewrk> Tanner_, not yet
<andrewrk> isaachier, just that I personally find code that looks more like C and less like C++ easier to maintain
Tanner_ has quit [Ping timeout: 260 seconds]
hoppetosse has joined #zig
<GitHub115> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhaqB
<GitHub115> zig/master 854f90a tgschultz: Added C string support to fmt by using "{s}". The format string requirement is for saftey. (#1092)
<GitHub13> [zig] andrewrk closed pull request #1092: Add C string support to std.fmt w/ "{s}" (master...zig-std.fmt-c-string) https://git.io/vh2rC
isaachier has joined #zig
Tanner_ has joined #zig
<Tanner_> I love the idea of using Zig because it seems like a blatantly better C, but my use case requires cross compilation. Can I do that without the build system for now?
<Tanner_> I have compiled Zig from source.
<isaachier> Tanner_ zig is inherently a cross compiler
<Tanner_> Yes, I know, but there isn't documentation on using that feature.
<isaachier> try this: <path-to-zig-dir>/zig targets
<isaachier> running zig on its own shows the options `--target-arch`, `--target-environ`, and `--target-os`.
<isaachier> that should help you start
<Tanner_> Oh, thank you!
isaachier has quit [Quit: Page closed]
very-mediocre has quit [Ping timeout: 260 seconds]
mahmudov has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<Tanner_> andrewrk: are there any plans to fill out some more of the docs soon?
<andrewrk> Tanner_, yes. here's the issue: https://github.com/ziglang/zig/issues/367
<andrewrk> every week day except friday I plan to fill out a documentation section
<andrewrk> docs for the std lib are coming after the self hosted compiler
<Tanner_> sounds great. do you know the next section you're working on?
<andrewrk> I'll probably just search the docs for TODO and do the first one
jjido has joined #zig
<Tanner_> Are there plans to stabilize the language soon? Or will breaking changes still be made?
<andrewrk> breaking changes can be made right up until 1.0.0
<andrewrk> however I'm trying to do all the breaking changes at the same time, and as early as possible
<Tanner_> With the pointer update from & to *, was that purely syntactical or was something else added?
<Tanner_> I find build.zig code with things like "&Builder"
<andrewrk> semantically, it made it possible to have a pointer to `type` instead of crashing the compiler
<andrewrk> and now we also have [*] which is an unknown length pointer, while * is a single-item pointer
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> this makes the runtime alias safety for #733 simple, so now you'll start seeing fn(Foo) rather than fn(*const Foo)
<Tanner_> Do you know of any up to date build.zig files?
<andrewrk> this one gets tested by CI
<Tanner_> ah, nice. thank you!
Tanner_ has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alo has joined #zig
alo has left #zig [#zig]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bheads has quit [Ping timeout: 276 seconds]
Tanner_ has joined #zig
byronh__ has joined #zig
<Tanner_> zig-by-example might be good
dbandstra has joined #zig
mahmudov has joined #zig
bheads___ has quit [Ping timeout: 240 seconds]
byronh__ has quit [Ping timeout: 260 seconds]
mahmudov has quit [Remote host closed the connection]
quc has quit [Ping timeout: 268 seconds]
<Tanner_> Is there a standard by which a function is a @? Some of these are compiler internals, I understand, but what about clz and ctz?
davr0s has joined #zig
frmdstryr has joined #zig
<andrewrk> Tanner_, all functions that start with @ are compiler-provided functions: https://ziglang.org/documentation/master/#Builtin-Functions
<Tanner_> I guess my question is why should something such as clz or memset be considered special?
<Tanner_> I would think having fewer things be intrinsic would be better.
isd has joined #zig
byronh__ has joined #zig
Tanner_ has quit [Ping timeout: 260 seconds]
byronh__ has quit [Ping timeout: 276 seconds]
byronh__ has joined #zig
Ichorio has quit [Ping timeout: 264 seconds]
byronh__ has quit [Ping timeout: 276 seconds]
frmdstryr has quit [Ping timeout: 264 seconds]
frmdstryr has joined #zig
bheads has joined #zig
byronh__ has joined #zig
bheads has quit [Client Quit]
frmdstryr has quit [Ping timeout: 256 seconds]
Tanner_ has joined #zig
sagecode has quit [Ping timeout: 276 seconds]
Tanner_ has quit [Quit: Page closed]
Tanner_ has joined #zig
blleeeb has joined #zig
blleeeb has quit [Client Quit]
Tanner_ has quit [Ping timeout: 260 seconds]
sagecode has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<clownpriest> dude...zig is faster than reference C implementation of xxhash
<clownpriest> this is nuts
<clownpriest> (by a very considerable margin)
<byronh__> Thats iteresting since xxhash is a simple algorithm, is zigs simplicity alowwing for better optimization?
<clownpriest> that's my guess, smaller semantics allow for more llvm ir optimization
<clownpriest> tho i haven't looked at the generated assembly yet
<byronh__> Did you try compiling the reference c code with zig and measuring?
<clownpriest> i have not yet, no
<clownpriest> benchmark code is in the test folder. maybe i set thing up improperly? i think for the most part i'm comparing apples to apples
hoppetosse has quit [Ping timeout: 240 seconds]
<byronh__> Hummm only big difference i see (and i am on a phone) is that it looks like your not including the init call in the benchmark. Is the reference c or c++?
<byronh__> Other thing to make sure is maybe use clang6 to compile the reference implementation, maybe llvm6 is giving a performance boost
<byronh__> But yeah awsome you got xxhash lib. I have been thinking about a zlib zig lib
<dbandstra> i'm playing with zlib atm
<byronh__> Ooo... I will definitely be interested in what you come up with
<clownpriest> byronh__, the init call is definitely outside of the benchmark, you think i should include it? i think the bare XXH64 function in C is also stateless
<clownpriest> whereas the streaming API would have a stateful init as well
<clownpriest> but yeah, i should probably test an llvm6 compile C version. tho i doubt it could make up that large of a gap, but could definitely be wrong
<byronh__> I would messure the init, yeah i doubt it will make a difference but better to be sure
<clownpriest> just tried, still faster than C on all load sizes
<clownpriest> tho slightly slower than current numbers
<clownpriest> (with init included)
<byronh__> Nice!!
<dbandstra> does anyone know how to link against a c library (like zlib) in the `zig test` or `zig build-exe` command? i only have it working with a build.zig file
<clownpriest> either way, the checksum() function in the zig impl doesn't actually need an init() call
<clownpriest> all state is in the function
<dbandstra> i use --library but then i get `lld: error: unable to find library -lz`
<byronh__> dbandstra Need to set the lib path?