ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
_Vi has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 240 seconds]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 255 seconds]
<frmdstryr> Shoulding readAllBuffer use max_size + 1? I think this should work https://godbolt.org/z/4NW_CV
<frmdstryr> *Shouldn't
<frmdstryr> Yes, since std.Buffer.len = self.list.len -1
<frmdstryr> std.Buffer shoudl just be replaced with std.ArrayList(u8)
<frmdstryr> the math in len and capacity makes the performance of it terrible
<fengb> Maybe we should rename it to BufferZ like mikdusan suggested
ur5us has joined #zig
<frmdstryr> Yes, I'd rename Buffer to BufferZ and make Buffer = ArrayList(u8) since people would probably still use BufferZ anyways
<daurnimator> frmdstryr: I agree with something like that. andrewrk disagreed at first; I'm waiting for him to review #4405
<alexnask> Yay, finally fixed both bugs that were affecting my Interface implementation
<alexnask> Or at least affecting natural, non-clunky usage
<alexnask> daurnimator lol I didn't even know square brackets worked with tuples
<alexnask> (major facepalm moment)
<daurnimator> I once suggested using a UUID for the string-key to stop people ever accidently using them
<daurnimator> "oh no one will ever do that" they said :P
<daurnimator> "`@"1"` is too awkward for anyone to actually use it" they said
<alexnask> :D
<alexnask> Random country flag emojis would have been cool too
<alexnask> 🇬🇷 🇬🇷
<fengb> 🇱🇷
<fengb> Nothing screams ‘murica like misusing the Liberia flag 🙃
<gchristensen> interesting. those show up as just very bold, large "GR" "GR" and "LR"
<alexnask> Too bad there are no Liberian county flag emojis
<alexnask> I would suggest looking them up for a good laugh
<alexnask> gchristensen, HexChat doesn't render them either D:
<mikdusan> export LANG=en_US.UTF-8
<fengb> 🇵🇷
<fengb> I guess Puerto Rico is special enough to have a country flag?
waleee-cl has quit [Quit: Connection closed for inactivity]
<alexnask> 🇭🇰
<daurnimator> fengb: same as 🇬🇺 apparently
<fengb> I guess territories are more special than states or provinces
<fengb> “We don’t have rights but we get a Unicode flag!”
<alexnask> lol
<gchristensen> easier for the unicode group to mkae a policy which doesn't require them to put themselves on a particular side of issues like HK
<daurnimator> gchristensen: uhhhhh 🇹🇼
<gchristensen> erm TW
<alexnask> 🏴󠁧󠁲󠀶󠀹󠁿
<gchristensen> ack
<daurnimator> (note: that emoji is legally enforced to be ignored/replaced in china)
<gchristensen> impressive.
<daurnimator> IIRC iphones replace it with a picture of tofu?
<fengb> That sounds... racist lol
<alexnask> Everyone supports Vatican flag emojis but Mount Athos doesn't even get one :(
<gchristensen> "tofu" is the widely used term for a unicode symbol which has no specific glyph, so I doubt it is actually a picture of tofu but ... just "tofu" -- the "no glyph" symbol
<alexnask> Ah, it's the empty square
<fengb> Oh I thought it was transforming Taiwan into tofu, like turning US into guns or something >_>
<alexnask> eagles*
<gchristensen> the Noto font from Google is named for it. ie: no tofu
<fengb> Stupid aside: bald eagles make the dumbest chirps
<fengb> The iconic sound is actually a red tailed hawk
<fengb> My childhood is a lie
<alexnask> Well my country's (Greece) national animal is the dolphin which also sounds stupid :P
<daurnimator> gchristensen: oh. maybe. I thought it was because stinky tofu is the national food of taiwan
nepugia has quit [Ping timeout: 256 seconds]
alexnask has quit [Ping timeout: 260 seconds]
dddddd_ has joined #zig
dddddd has quit [Ping timeout: 265 seconds]
_whitelogger has joined #zig
mahmudov has quit [Remote host closed the connection]
lqd has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
dddddd_ has quit [Ping timeout: 260 seconds]
_Vi has joined #zig
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 256 seconds]
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_Vi has quit [Ping timeout: 272 seconds]
return0e_ has joined #zig
lqd has joined #zig
alexnask has joined #zig
tralamazza has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
BaroqueLarouche has quit [Quit: killed]
fengb has quit [Quit: killed]
BitPuffin has quit [Quit: killed]
AlexMax has quit [Quit: killed]
alva has quit [Quit: killed]
hryx has quit [Quit: killed]
jzck has quit [Quit: killed]
Dominic[m] has quit [Quit: killed]
pmwhite has quit [Quit: killed]
Snektron has quit [Quit: killed]
ianc6209 has joined #zig
Dominic[m] has joined #zig
AlexMax has joined #zig
dtz has joined #zig
BitPuffin has joined #zig
hryx has joined #zig
Snektron has joined #zig
BaroqueLarouche has joined #zig
pmwhite has joined #zig
jzck has joined #zig
fengb has joined #zig
_Vi has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 240 seconds]
<alexnask> Added proof of concept Allocator implementation to std.interface
<alexnask> Now I just have to test async virtual functions and write a lot of docs and some more general tests and I think it's pretty complete
marmotini_ has joined #zig
frmdstryr has quit [Ping timeout: 255 seconds]
marmotini_ has quit [Read error: No route to host]
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 265 seconds]
<mq32> lul
<mq32> return; // yields unreachable code
<mq32> if(true) return; // does not yield unreachable code
<alexnask> huh
recombinant has joined #zig
return0e_ has quit [Remote host closed the connection]
return0e_ has joined #zig
waleee-cl has joined #zig
return0e_ has quit [Remote host closed the connection]
return0e_ has joined #zig
WilhelmVonWeiner has joined #zig
<WilhelmVonWeiner> how would you make a multidimensional array of strings?
<WilhelmVonWeiner> hardcoded
<fengb> const foo = [_][]const u8 { "aaa", "bbb" };
<WilhelmVonWeiner> why will []const u8 but not [] u8 work?
<mq32> because []u8 is a mutable slice of u8s
<mq32> and all literals are immutable by-definition
<WilhelmVonWeiner> that makes sense
<WilhelmVonWeiner> if they're known at compile time, why is it not [_][_] u8 { "s1", "s2" }; ?
<WilhelmVonWeiner> is there something more efficient about making all strings slices even if they're const?
<mq32> because then you would need all strings to be the same length ;)
<WilhelmVonWeiner> got it.
<WilhelmVonWeiner> thanks
<mq32> you're welcome
<fengb> "Well actually" you can make variable literals: `var foo = "blah";` makes a variable chunk of memory on the stack
<andrewrk> WilhelmVonWeiner, you can do [_][2]u8 { "s1".*, "s2".* }
<mq32> fengb, does that still work?
<mikdusan> as an excercise: `var foo = [_][2]u8 { "s1".*, "s2".* };` and the lengths must be exact
<mikdusan> oh andrewrk beat me to it
<mq32> fengb: well, it would make a mutable pointer to const slice
<andrewrk> var foo = "blah".*; foo[1] += 1;
<fengb> Damn you're right. I thought I had this working earlier >_>
<mq32> yep, it did work at some point in time
<andrewrk> master branch is going to be broken for a couple days
<WilhelmVonWeiner> andrewrk: interesting syntax but now it makes sense
<andrewrk> freebsd has some kind of weird bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244549
<shakesoda> why will master be broken
<shakesoda> failing tests?
<andrewrk> upstream freebsd bug. if they don't fix it for a few days then we'll freeze freebsd support from the CI / download page for a month while they get their shit together
<shakesoda> i see
<mikdusan> instead of selecting "freebsd/latest" how about "frebsd/12.1"
<fengb> https://godbolt.org/z/f5U7tz is this a valid way of emulating continue?
<fengb> Or should I manually wrap it with another block
<andrewrk> mikdusan, those are aliases
<andrewrk> fengb, this language feature is probably going to remain broken until the relevant part of the lang spec is written and and stage2 is implemented
<andrewrk> break / continue inside inline loops is probably going to remain janky in stage1
<fengb> I meant breaking to the named for block. It works like a continue but feels weird
<andrewrk> yeahthat's the same as continue
<mq32> that's a weird continue :D
<fengb> Okay cool
<fengb> Yeah it feels a little weird so I want to make sure I'm not relying on some quirk
<andrewrk> nah that's intended
frmdstryr has joined #zig
FireFox317 has joined #zig
<mikdusan> heh wow. took a try with freebsd/current and same breakage. what. is. freebsd. thinking? jesus.
metaleap has joined #zig
<fengb> 1 point for not relying on package managers? 🙃
<gchristensen> a knife to my heart
TheLemonMan has joined #zig
<shakesoda> package managers, a plague upon software reliability
<mq32> software reliability died when we stopped burning the software into immutable eeproms that were shipped to the customer *grin*
<companion_cube> even CPUs are not reliable!!
<mq32> yeah, because they use software :D
<mq32> and can be patched nowadays
<companion_cube> exactly
<shakesoda> mq32: that's the spirit
<mq32> btw, my pet language is coming along great today
<CommunistWolf> mq32: wait until you learn about IoT
<CommunistWolf> you're going to be so happy
<mq32> CommunistWolf: i am crying already, isn't that enough?!
<metaleap> "master branch is going to be broken for a couple days" because "upstream freebsd bug". so to clarify, will it be "broken" for freebsd-ers only, or everyone else too?
<CommunistWolf> crying with joy, I hope
<CommunistWolf> because they're shipping millions of devices with baked-in software that can't be updated
<mq32> haha :D
<mq32> but with the developer spirit of 2020, not 1990 ^^
<CommunistWolf> yes, it's much more capitalist now
<mq32> "ah yeah, if something breaks, we can patch that later… Wait? What do you say? We can't patch that anymore?!"
<companion_cube> you should be happy, it fuels the botnet industry
<CommunistWolf> > Basically it seemed that NetThings UK Ltd made remote controlled thermostats and lighting controllers for large retail spaces etc. And their devices had one of BitFolk’s IP addresses burnt into them at the factory. And they could not be identified or remotely updated.
<CommunistWolf> what I like most about this story is how that's the least insane bit
<alexnask> lol
<alexnask> Must be really insane though I should read it
<alexnask> then*
marmotini_ has joined #zig
return0__ has joined #zig
<andrewrk> metaleap, to clarify - the CI will be reporting red x's for freebsd, and the download page won't update
<metaleap> andrewrk ah ok thx!
return0e has quit [Ping timeout: 255 seconds]
<TheLemonMan> andrewrk, keep in mind #4617 if you ever decide to implement pwrite64
<andrewrk> TheLemonMan, ah, thanks
waleee-cl has quit [Quit: Connection closed for inactivity]
dingenskirchen has quit [Remote host closed the connection]
<TheLemonMan> 7999 commits, nice
dingenskirchen has joined #zig
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
nepugia has joined #zig
marmotini_ has quit [Remote host closed the connection]
<mikdusan> 1001 issues. all kinds of strange digits
alexnask has quit [Quit: Leaving]
<mq32> it's good that we fluctuate around 1000 issues for a while now
alexnask has joined #zig
<TheLemonMan> a lot of those have already been fixed
alexnask has quit [Client Quit]
alexnask has joined #zig
<FireFox317> its freaking awesome we now have stack traces in stage1 by code that is in stage2 :O :^)
<mq32> yep
alexnask has quit [Client Quit]
<companion_cube> https://lobste.rs/s/zcsveo/rust_dependencies_scare more food for thoughts… :)
alexnask has joined #zig
<mq32> i hope that Zig will keep quite stabe and consistent on language features from 1.0 on
<andrewrk> after 1.0 the language will pretty much stop accepting proposals
<companion_cube> or even no new language features :p
<companion_cube> andrewrk: I thought having implicit async was a bad idea, but a talk by pron changed my mind
<companion_cube> nice not to have function colors indeed
<metaleap> companion_cube what talk
<mq32> <andrewrk> after 1.0 the language will pretty much stop accepting proposals
<mq32> this is a good idea
<mq32> C had some changes over the year
<companion_cube> C barely had significant changes to the language itself…
<mq32> but we can still count them on one hand for 50 years of existence
<metaleap> thx something to put on the watchlist for the next "burnout preemption day" :D
<mq32> i think the best change in C was for(int i = …) { }
<companion_cube> don't be scared by the monad word
<companion_cube> anyway, it convinced me that imperative languages shouldn't try to become functional languages
<mq32> yeah, true dat
<alexnask> Best C feature is _Generic /s
<metaleap> monads never scared me but the neverending talk about them does :D
<andrewrk> there are quite a few more breaking changes needed to be done before 1.0 though
<metaleap> shouldve been called "byo control-flow" from the get-go
<companion_cube> well it's a talk about not using them
<alexnask> Aren't error sets and optional types monads?
<alexnask> Error unions*
<mq32> andrewrk: can you name some of them? #1717 is one of them probably, right?
<companion_cube> error sets are effects, not a monad
<andrewrk> mq32, look for the breaking label
<metaleap> meh first they modelled/showed "exceptions via monads", later they go "effects are generalized exceptions (not just for errors)" .. smells all similar with minor variations
<mq32> breaking+accepted would be a good filter, right?
<andrewrk> yes
<companion_cube> alexnask: Result<T,E> in rust is a kind of monad (with special support)
<companion_cube> error sets in Zig are more like an effect, afaict
_Vi has quit [Ping timeout: 272 seconds]
<fengb> I like pron’s “reinterpretation” that imperative languages are all about control flow
<fengb> Never thought of it before but it makes perfect sense
<companion_cube> idk about that, but it makes sense to keep the existing control flow structures :s
waleee-cl has joined #zig
frmdstryr has quit [Ping timeout: 265 seconds]
frmdstryr has joined #zig
return0e_ has quit [Ping timeout: 260 seconds]
<fengb> Oh boy it’s ahead of me :(
<mq32> so: zig in browser soon? *grin*
marmotini_ has joined #zig
_Vi has joined #zig
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
<andrewrk> offset=12297829382473034410, hmmmmmmmmm
<andrewrk> >>> hex(12297829382473034410)
<andrewrk> '0xaaaaaaaaaaaaaaaa'
* mq32 screams in 0xaa
<mikdusan> so look at any integer last 2-digits '10' with suspicion
<fengb> https://github.com/fengb/wazm/issues/9 hey async functions are magical unicorns and makes my shitty design decisions work
<mq32> mikdusan: 170, 43690, 2863311530, that number above
tav_ has joined #zig
<mikdusan> oh neat: { 10, 70, 30, 90, 50 }
SyrupThinker is now known as syrupthinker
syrupthinker is now known as SyrupThinker
<metaleap> halp! how can this line segfault? https://github.com/ziglang/zig/blob/master/lib/std/zig/parse_string_literal.zig#L68 i'm giving it a ptr to a local `var unused: usize = undefined`
<metaleap> (the string i pass it still alive in arena, too, no way it's been freed so that cant be it either)
<metaleap> the `unused` is declared right before the call-site, cant have fallen out of scope while inside `parseStringLiteral` =/
<mikdusan> bad_index is bogus
<metaleap> cant be tho.. i'm passing it a *usize pointing to a local still in scope
<metaleap> check the call-site: how can it be bogus if its just being written to? https://github.com/meta-leap/zigsess/blob/master/src/src_intel.zig#L477 will change from undefined to 0 tho
<TheLemonMan> you have an undefined pointer
<metaleap> ah cripes! thx
<mikdusan> the best kind
<TheLemonMan> you want `var bogus: usize = undefined` and pass `&bogus`
<metaleap> exactly somehow "i thought i was doing that" even tho the code is right before me. own-code-blindness is worst blindness
<metaleap> thx gang
<andrewrk> an undefined pointer might point to something cool!
<mikdusan> can we rename keyword `null` -> `tofu` and `undefined` -> `bogus`
<TheLemonMan> undefined pointer + release mode + no MMU = good luck finding what's wrong
Akuli has joined #zig
<mq32> "accessed bogus tofu?"
<nepugia> but what if your tofu pointer points to noto fonts? ;)
<mikdusan> then it's semantically tofu but not really tofu
mahmudov has joined #zig
<fengb> #define tofu null
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
dddddd has joined #zig
frmdstryr has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
<metaleap> in a .{} passed to fmt.allocPrint, i can place `if (someUsize(foo)) |n| n else |_| 0` and it compiles, but: `someUsize(foo) catch 0` errors with "expected type 'comptime_int', found 'usize'". using @intCast(usize, 0) gives "cannot store runtime value in compile time variable", same with @as.
<metaleap> what was I missing that I didnt intuitively predict such compile errors with the smoother `call() catch 0` notion? =)
<metaleap> or is this a known edgecase not yet handled..
marmotini_ has quit [Remote host closed the connection]
jjido_ has joined #zig
redj has quit [Read error: Connection reset by peer]
* andrewrk will do a live coding stream today at 17:00 EST (in 42 minutes) at https://www.twitch.tv/andrewrok
<andrewrk> topic will be: demo some recent zig improvements, more casual game dev, and ongoing Q&A (you don't have to wait until the end)
<companion_cube> I'd really like it if there was an IRC <-> twitch bridge ^
tav_ has quit [Quit: Connection closed for inactivity]
<companion_cube> ^^
<andrewrk> this is just a little preview of what decentralized package management will be like ;)
Akuli has quit [Quit: Leaving]
<mq32> andrewrk, is it possible (in theory or practice) to build a c++17 library with zig cc?
<andrewrk> mq32, yes
<mq32> neat!
<andrewrk> it will be more straightforward to accomplish when https://github.com/ziglang/zig/issues/3089 is done
<mq32> so i can probably get rid of qmake for my pet languge project
<fengb> ZigPM over all
<andrewrk> basically with #3089 you can use `zig cc` as a drop-in replacement for `clang`, except it will support cross compiling
<andrewrk> if that was done before llvm 10 released, it would be pretty funny if we were able to get 30 MiB zig tarballs up with llvm 10 before clang's ~200 MiB binaries
<andrewrk> "still waiting for clang to build? you can use `zig cc` while you wait"
<mq32> that would be great :D
<mq32> you can build your llvm10 with "zig clang" instead of clan :D
<andrewrk> that would be a good test
<mq32> huh
<mq32> zig cc can't find "<stddef.h>"
<andrewrk> I don't recommend using zig cc until 3089 is done
<andrewrk> the higher level CLI works fine however (build-exe & friends)
<nepugia> are you only trying to replace clang or also clang++? :)
<andrewrk> in the zig compiler that links libclang, may as well expose all of clang, since we already pay the price for it
<andrewrk> this is not a feature of the zig language; it's a feature of the toolchain which uses clang & llvm
<fengb> So C-less Zig will be standards compliant?
<fengb> For fuzzy definitions of standards >_>
frmdstryr has joined #zig
<mq32> [felix@denkplatte-v2 tmp]$ ./hello
<mq32> CPP Version: 201703
redj has joined #zig
<mq32> okay, so using clang++ and link the object with zig works :)
<andrewrk> yes, all the C features of the language will be an "extension" in the spec
<andrewrk> so you can prepare for the future by e.g. avoiding C integer types when you are not actually interfacing with C code
<companion_cube> 😍
<mq32> i wonder which font i need to see the smileys companion_cube writes…
<companion_cube> noto-emoji ?
<mq32> companion_cube: ♥
<mq32> thanks, works now :)
<fengb> 💩
<companion_cube> 💃🔋
<mq32> poo, dancer (female) and battery :D
<mq32> ha!
<mq32> no empty messages anymore!
<pixelherodev> Thanks for the font tip :)
<fengb> 🇱🇷
<nepugia> heh, i see only two emoji in that message
<nepugia> ​
<TheLemonMan> andrewrk, if you're in the right mood for some std.fs reworking you could also make the linux version use statx on newer kernels
metaleap has quit [Quit: Leaving]
jjido_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> :o N++
<companion_cube> I loved N
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
recombinant has left #zig ["Leaving"]
lunamn has joined #zig
FireFox317 has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 256 seconds]
ur5us has joined #zig
FireFox317 has joined #zig
<mq32> andrewrk: in case you didn't read in twitch chat: windows exe plays sinewave on my setup (x86_64-archlinux-5.5.7, wine-5.3)
<FireFox317> mq32: still through wine tho xd
<mq32> yeah
<andrewrk> pretty sweet, right?
<mq32> yep!
<FireFox317> i think it would have been faster if i cross compiled on linux since i have a zig build there and then just run it on windows (have a dual boot)
<andrewrk> it's also not taking advantage of multiple cores yet
<andrewrk> that will be a straightforward, notable win
<FireFox317> but, im already at linking stage, so not its probably faster to wait
<mq32> the most impressive thing about "zig build" is that it either works, or the problems are easy to debug (usually)
<mq32> Makefiles are just horrible to debug, even more when autogenerated
_Vi has quit [Ping timeout: 272 seconds]
<andrewrk> and we haven't even seen any zig build debug tools yet! it's declarative, so it can do things like show you a dependency graph, or explain why something is not getting updated
<andrewrk> also multiple build.zig outputs can be merged into one and built together (that is currently vaporware, but it's designed with that in mind)
<mq32> yeah, also it will build me my crosscompiler foo
<FireFox317> just using `zig build` on windows doesnt work. I probably have to cross compile to windows on windows? xd
<FireFox317> i guess its trying to use my system SDL and soundio, but i dont have these installed
<andrewrk> FireFox317, ah, wait let me try something
<FireFox317> hmm, when passing the target x86_64-windows-gnu, its failing to find sdl2/sdl.h when doing cimport
<andrewrk> FireFox317, if you pull latest master clashproto, it should now prefer the gnu abi on native windows
<andrewrk> so that bare `zig build` works
<andrewrk> that's strange about the missing header. that sounds like it may be a bug in the build system or even the standard library
<FireFox317> i think its in the standard library, in the zig-sdl/zig-prebuilt/include there is just one file called SDL2 without extension
<FireFox317> where as that should have been a directory?
mq32 has quit [Ping timeout: 246 seconds]
<FireFox317> oh, that is a symlink. do symlinks work on windows?
<BaroqueLarouche> Only on NTFS systems
<BaroqueLarouche> MS calls it Junctions and it is not exposed in the UI
<daurnimator> BaroqueLarouche: yes only on NTFS; but no they're not junctions