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/
bitmapper has joined #zig
lumo_e has quit [Quit: lumo_e]
catern has joined #zig
<catern> I just read in https://twitter.com/andy_kelley/status/1374079306423435265 that the Zig general purpose memory allocator doesn't reuse memory/address space, that's really interesting to me - is there some documentation of how the allocator is structured?
<mikdusan> catern: fyi this is the source to that allocator:
<catern> ah I found https://github.com/andrewrk/zig-general-purpose-allocator#current-design which has a pretty good description - which is probably close enough to accurate for me
earnestly has quit [Ping timeout: 240 seconds]
leeward has quit [Remote host closed the connection]
SLWW_ has joined #zig
SLWW has quit [Ping timeout: 246 seconds]
<andrewrk> https://clbin.com/abpvw anybody want to help out and implement this?
<andrewrk> I can point you to an existing implementation in C
<andrewrk> https://git.musl-libc.org/cgit/musl/tree/src/internal/floatscan.c#n314 assume LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384, the zig version should produce a f128
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
teratorn has quit [Ping timeout: 240 seconds]
aerona has joined #zig
<shachaf> Hmm, does the parser code mirror the grammar in the language reference by design, or would you be open to using a much more compact style of precedence parser?
<andrewrk> shachaf, I'm fine with it being more compact but I am against passing functions around as parameters
<andrewrk> also would want to see perf changes with any parser refactoring
<shachaf> Sure, not passing functions around (but maybe having a table of operators with precedences).
<andrewrk> yeah that's fine. there is also https://github.com/ziglang/zig/issues/114 to keep in mind
<andrewrk> the only other design consideration is that it is intended to be somewhat error tolerant, for use by IDE integration services
<shachaf> It'd just be a different way to structure the same thing, for the most part. Probably more efficient because you don't need to descend the entire precedence chain for every expression, you just go right to the right level.
<andrewrk> makes sense to me
<shachaf> The other unusual thing I see is that "a == b == c" seems to be banned?
<andrewrk> #114 applies here, parens should be required
<shachaf> I mean, in the existing grammar.
<shachaf> But that should be pretty easy to handle, I guess. "a == b and c == d" is still permitted, of course.
<shachaf> Man, I swear, every time I try to build Zig I run into not having the right version of LLVM available. Every time.
<andrewrk> LLVM is one hell of a dependency
<andrewrk> in the near future, for this task, you'll be able to bootstrap without LLVM, and build self-
<shachaf> Does it really need to be a system dependency, rather than something local?
<andrewrk> hosted without llvm enabled, to test the parser
<andrewrk> not sure what you're asking
<andrewrk> you mean copy pasting the codebase to the zig source tree
<andrewrk> ?
<shachaf> Can I just download LLVM and put it in the current directory to build Zig, rather than try to get the right version installed systemwide?
<andrewrk> those two are the same thing
<andrewrk> what OS/arch are you on
<shachaf> Ubuntu.
<shachaf> On amd64.
<shachaf> I've always installed it with apt. Maybe I missed something.
<andrewrk> but because c++ is crazy you'll have to follow the same steps as the CI does to use this tarball, which is building with zig cc. https://github.com/ziglang/zig/blob/a279f18bce488460f87f41545411fc964dcaa4b0/ci/azure/linux_script#L29-L66
<andrewrk> or you can build it from source, see https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source. or you can use apt.llvm.org
<shachaf> Or upgrade to the latest Ubuntu that just came out, I guess.
<shachaf> Man, this happens every time I want to look at Zig, which is apparently about the same cadence as new LLVM major versions.
riceweasel has joined #zig
riceweasel has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
SLWW has joined #zig
SLWW_ has quit [Ping timeout: 268 seconds]
aerona has quit [Quit: Leaving]
pretty_dumm_guy has joined #zig
cole-h has quit [Ping timeout: 252 seconds]
SLWW has quit [Read error: Connection reset by peer]
SLWW has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
earnestly has joined #zig
leon-p has joined #zig
wootehfoot has joined #zig
lemur has joined #zig
lemur has quit [Remote host closed the connection]
lemur has joined #zig
lemur has quit [Client Quit]
xackus_ has joined #zig
klltkr has joined #zig
zenkuro has joined #zig
koakuma has joined #zig
SLWW_ has joined #zig
SLWW has quit [Ping timeout: 240 seconds]
moka has joined #zig
mokafolio has quit [Read error: Connection reset by peer]
moka is now known as mokafolio
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
SLWW_ has quit [Ping timeout: 265 seconds]
SLWW has joined #zig
plumm has quit [Quit: Textual IRC Client: www.textualapp.com]
plumm has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leon-p> I am writing a generator for shell completion scripts. Any pointers on how to best integrate that with the build system? The idea is that users define the completion tree in build.zig and that the files get generated and installed together with the corresponing executable.
TheLemonMan has joined #zig
mikdusan has quit [Quit: WeeChat 3.0.1]
<koakuma> Hello all, just updated my copy to the latest master and I'm encountering a strange miscompilation issue on SPARCv9 Linux
<koakuma> @atomicRmw operations, when compiled normally without a target flag, results in a call to __atomic_exchange_XX, which then proceeds to do an infinite recursion, but if I explicitly add a "-target sparcv9-linux-gnu" to the flags, it compiles correctly into membar-ed instructions
<koakuma> Anyone knows what's going wrong here?
<TheLemonMan> yes
Bernstein has joined #zig
<koakuma> Ah, so what's happening? Did I specify the flags wrong or what?
<TheLemonMan> hang on a second, I'm pushing a commit
<TheLemonMan> g-w1, pushed a zig fmt fix, thank you for the reminder
<g-w1> nice
<TheLemonMan> koakuma, the baseline cpu model is so bare bones it has no hw support for atomic ops. LLVM tries to paper over this problem by using libcalls, hence the __atomic_exchange_XX
<koakuma> Ouch. Is that also the reason why __atomic_exchange_XX gets compiled into infinite recursion?
<koakuma> I see that its implementation also does an @atomicRmw inside
<TheLemonMan> that's dependent on largest_atomic_size (and largest_atomic_size)
<TheLemonMan> but v9 is the default cpu for 64bit sparcs, perhaps we're picking the wrong default?
<TheLemonMan> what's the output of `zig build-obj --show-builtin` ?
fritchie has quit [Quit: Leaving]
<TheLemonMan> I think the problem is that we're using LLVM's host-detection functions and they are defaulting to "generic" as cpu model
<TheLemonMan> too bad that's a 32bit bare-bones model that's almost unusable...
<TheLemonMan> koakuma, try setting `largest_atomic_size` to 0
<koakuma> Okay, let me change and rebuild
<koakuma> Now the call chain becomes something like @atomicRmw -> __atomic_exchange_4 -> __atomic_exchange_8 -> __atomic_exchange_8 (infinite recursion)
<TheLemonMan> alright, we can't even implement a simple spinlock
<koakuma> Also, should I add a v9 entry here? Seems like it is what causes the generic CPU model to be picked https://github.com/ziglang/zig/blob/master/lib/std/target.zig#L1222
<TheLemonMan> it's more the use of ZigLLVMGetHostCPUName
waleee-cl has joined #zig
<koakuma> It returns the wrong thing for generic SPARCv9?
<TheLemonMan> there's no autodetection at all, it simply returns "generic"
SLWW_ has joined #zig
SLWW has quit [Ping timeout: 252 seconds]
<ifreund> leon-p: you probably want to define a custom build step users can import into their build.zig, see zig-wayland's ScanProtocolsStep for an example
<leon-p> I see, thanks.
<koakuma> TheLemonMan, so this is an LLVM issue of sorts? In that it returns "generic" rather than "v9" when compiling for SPARCv9?
mikdusan has joined #zig
<TheLemonMan> more or less, the idea is to eventually get rid of LLVM's host detection code and do our own thing
<koakuma> Hmmm, okay. So for now I must explicitly specify the target when compiling, that should be enough right
<TheLemonMan> yeah, but I think that every 64bit sparc can safely default to v9
aigoo has joined #zig
mjsir911 has quit [Quit: Goodbye, World!]
mjsir911 has joined #zig
<aigoo> Are there any plans on implementing http utilities in the standard library?
Sumera[m] has quit [Ping timeout: 245 seconds]
Sumera[m] has joined #zig
AtomToast has quit [Ping timeout: 245 seconds]
cepheus has quit [Ping timeout: 245 seconds]
SLWW_ has quit [Read error: Connection reset by peer]
AtomToast has joined #zig
cepheus has joined #zig
SLWW has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
TheLemonMan has joined #zig
cole-h has joined #zig
TheLemonMan has quit [Client Quit]
TheLemonMan has joined #zig
nycex has quit [Ping timeout: 240 seconds]
nycex has joined #zig
nycex has quit [Ping timeout: 240 seconds]
nycex has joined #zig
nycex has quit [Quit: Quit]
nycex has joined #zig
Akuli has joined #zig
SLWW_ has joined #zig
SLWW has quit [Ping timeout: 240 seconds]
<xackus_> Zig SHOWTIME is live! https://www.twitch.tv/kristoff_it
<companion_cube> what is even going on
<companion_cube> ah. still not sure why it's not on the website instead…
<andrewrk> *shrug* I'm not doing the work of running showtime. he probably has a good reason for it
<companion_cube> not blaming you andrewrk :)
<andrewrk> I'm just saying don't look a gift horse in the mouth
<TheLemonMan> hey, don't kink-shame!
<ifreund> :D
<torque> comprehensive dental understanding is valuable regardless of horse provenance
<andrewrk> lol
marijnfs has joined #zig
klltkr has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
xackus__ has joined #zig
xackus_ has quit [Ping timeout: 252 seconds]
Lucas_Toole has joined #zig
<shachaf> Is the precedence table at https://ziglang.org/documentation/master/#Precedence accurate? It looks like orelse/catch are at the same level as bitwise operators.
<andrewrk> I think it needs auditing
<mikdusan> andrewrk: on drone pipeline, is the availability for `$HOME/.s3cfg` somehow tied to the script pathname being executed?
<mikdusan> I get this now after reworking things in a pr: `ERROR: /root/.s3cfg: None` yet I can see no action in thes script of copying the file there like azure scripts do
<andrewrk> mikdusan, it's a "secret" so I think it's configured to only be present for master branch
<mikdusan> thanks for the clue. I had some condition logic backwards
<g-w1> mikdusan: would it be too hacky to only disable debug on the THUNDERX hosts?
<g-w1> just thought of this
SLWW has joined #zig
Bernstein has quit [*.net *.split]
notzmv has quit [*.net *.split]
gazler_ has quit [*.net *.split]
SLWW has quit [*.net *.split]
xackus__ has quit [*.net *.split]
marijnfs has quit [*.net *.split]
casaca has quit [*.net *.split]
semarie has quit [*.net *.split]
[RMS] has quit [*.net *.split]
adsr has quit [*.net *.split]
nore has quit [*.net *.split]
rinfo has quit [*.net *.split]
via has quit [*.net *.split]
Akuli has quit [*.net *.split]
wootehfoot has quit [*.net *.split]
braket has quit [*.net *.split]
ifreund has quit [*.net *.split]
shodan45 has quit [*.net *.split]
m6w6 has quit [*.net *.split]
lohengrin has quit [*.net *.split]
doublej41 has quit [*.net *.split]
chivay has quit [*.net *.split]
crimson_penguin has quit [*.net *.split]
nycex has quit [*.net *.split]
v0idifyy has quit [*.net *.split]
suhashebbar[m] has quit [*.net *.split]
vazub[m] has quit [*.net *.split]
mattmurr___[m] has quit [*.net *.split]
fengb has quit [*.net *.split]
ugla has quit [*.net *.split]
pafmaf[m] has quit [*.net *.split]
Sphax has quit [*.net *.split]
torque has quit [*.net *.split]
ikskuh has quit [*.net *.split]
Cloudef has quit [*.net *.split]
Sumera[m] has quit [*.net *.split]
jaens[m] has quit [*.net *.split]
bitonic has quit [*.net *.split]
leibniz[m] has quit [*.net *.split]
mgxm has quit [*.net *.split]
blackbeard420 has quit [*.net *.split]
letoram has quit [*.net *.split]
maddievision has quit [*.net *.split]
Flaminator has quit [*.net *.split]
waleee-cl has quit [*.net *.split]
kushalp has quit [*.net *.split]
kwilczynski has quit [*.net *.split]
meinside has quit [*.net *.split]
euantorano has quit [*.net *.split]
Yardanico has quit [*.net *.split]
op_4 has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
betawaffle has quit [*.net *.split]
jsb has quit [*.net *.split]
ki9a has quit [*.net *.split]
plumm has quit [*.net *.split]
koakuma has quit [*.net *.split]
sm2n has quit [*.net *.split]
Nazral has quit [*.net *.split]
afk has quit [*.net *.split]
Amun_Ra has quit [*.net *.split]
allan0 has quit [*.net *.split]
Witcher01 has quit [*.net *.split]
pjz has quit [*.net *.split]
Lucas_Toole has quit [*.net *.split]
SLWW_ has quit [*.net *.split]
r0bby has quit [*.net *.split]
linear_cannon has quit [*.net *.split]
andrewrk has quit [*.net *.split]
deb303 has quit [*.net *.split]
cow-orker has quit [*.net *.split]
moodman has quit [*.net *.split]
linuxgemini has quit [*.net *.split]
ShockTohp has quit [*.net *.split]
so_ has quit [*.net *.split]
siraben has quit [*.net *.split]
tcsc has quit [*.net *.split]
Snektron has quit [*.net *.split]
racoon has quit [*.net *.split]
di-wu has quit [*.net *.split]
lunamn has quit [*.net *.split]
stilbruch has quit [*.net *.split]
justin_smith has quit [*.net *.split]
Tharro has quit [*.net *.split]
cCCCCcccccCCc has quit [*.net *.split]
klltkr has quit [*.net *.split]
mikdusan has quit [*.net *.split]
bsrd has quit [*.net *.split]
gracefu has quit [*.net *.split]
Stephanie has quit [*.net *.split]
Piraty has quit [*.net *.split]
xentec_ has quit [*.net *.split]
wilsonk has quit [*.net *.split]
tm-exa_ has quit [*.net *.split]
Seich has quit [*.net *.split]
st4ll1 has quit [*.net *.split]
blueberrypie has quit [*.net *.split]
shachaf has quit [*.net *.split]
haliucin1s has quit [*.net *.split]
meatcar has quit [*.net *.split]
noam has quit [*.net *.split]
jjsullivan has quit [*.net *.split]
redj has quit [*.net *.split]
cepheus has quit [*.net *.split]
yeti has quit [*.net *.split]
leah2 has quit [*.net *.split]
ifreund_ has quit [*.net *.split]
dutchie has quit [*.net *.split]
Ekho has quit [*.net *.split]
bens has quit [*.net *.split]
dagle has quit [*.net *.split]
M-ou-se has quit [*.net *.split]
vegai has quit [*.net *.split]
mschwaig has quit [*.net *.split]
hspak has quit [*.net *.split]
edr has quit [*.net *.split]
kurufu has quit [*.net *.split]
commander has quit [*.net *.split]
g-w1 has quit [*.net *.split]
Miaourt has quit [*.net *.split]
wootehfoot has joined #zig
Bernstein has joined #zig
ShockTohp has joined #zig
so_ has joined #zig
cow-orker has joined #zig
moodman has joined #zig
deb303 has joined #zig
linear_cannon has joined #zig
Lucas_Toole has joined #zig
andrewrk has joined #zig
SLWW has joined #zig
xackus__ has joined #zig
[RMS] has joined #zig
notzmv has joined #zig
gazler_ has joined #zig
braket has joined #zig
ifreund has joined #zig
casaca has joined #zig
semarie has joined #zig
via has joined #zig
shodan45 has joined #zig
rinfo has joined #zig
Akuli has joined #zig
linuxgemini has joined #zig
nore has joined #zig
crimson_penguin has joined #zig
adsr has joined #zig
doublej41 has joined #zig
chivay has joined #zig
m6w6 has joined #zig
marijnfs has joined #zig
lohengrin has joined #zig
Lucas_Toole has quit [Max SendQ exceeded]
nycex has joined #zig
v0idifyy has joined #zig
siraben has joined #zig
Snektron has joined #zig
tcsc has joined #zig
di-wu has joined #zig
racoon has joined #zig
lunamn has joined #zig
stilbruch has joined #zig
cCCCCcccccCCc has joined #zig
Tharro has joined #zig
justin_smith has joined #zig
g-w1 has joined #zig
kurufu has joined #zig
hspak has joined #zig
mschwaig has joined #zig
edr has joined #zig
commander has joined #zig
Miaourt has joined #zig
siraben has quit [Max SendQ exceeded]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
leah2 has joined #zig
cepheus has joined #zig
ifreund_ has joined #zig
dagle has joined #zig
bens has joined #zig
Ekho has joined #zig
dutchie has joined #zig
M-ou-se has joined #zig
vegai has joined #zig
bsrd has joined #zig
xentec_ has joined #zig
wilsonk has joined #zig
mikdusan has joined #zig
gracefu has joined #zig
Stephanie has joined #zig
Piraty has joined #zig
st4ll1 has joined #zig
noam has joined #zig
shachaf has joined #zig
blueberrypie has joined #zig
meatcar has joined #zig
haliucin1s has joined #zig
jjsullivan has joined #zig
yeti has joined #zig
redj has joined #zig
tm-exa_ has joined #zig
Seich has joined #zig
tm-exa_ has quit [Excess Flood]
vazub[m] has joined #zig
pafmaf[m] has joined #zig
ikskuh has joined #zig
mattmurr___[m] has joined #zig
Cloudef has joined #zig
torque has joined #zig
Sphax has joined #zig
ugla has joined #zig
suhashebbar[m] has joined #zig
fengb has joined #zig
Sumera[m] has joined #zig
bitonic has joined #zig
jaens[m] has joined #zig
blackbeard420 has joined #zig
letoram has joined #zig
maddievision has joined #zig
Flaminator has joined #zig
mgxm has joined #zig
Ekho has quit [Max SendQ exceeded]
ifreund_ has quit [Ping timeout: 267 seconds]
Snektron has quit [Ping timeout: 248 seconds]
Sumera[m] has quit [Ping timeout: 272 seconds]
jaens[m] has quit [Ping timeout: 272 seconds]
bitonic has quit [Ping timeout: 272 seconds]
cepheus has quit [Ping timeout: 246 seconds]
AtomToast has quit [Ping timeout: 258 seconds]
meinside has joined #zig
euantorano has joined #zig
op_4 has joined #zig
kushalp has joined #zig
Yardanico has joined #zig
jzelinskie has joined #zig
kwilczynski has joined #zig
ki9a has joined #zig
jsb has joined #zig
suhashebbar[m] has quit [Ping timeout: 276 seconds]
mattmurr___[m] has quit [Ping timeout: 276 seconds]
fengb has quit [Ping timeout: 276 seconds]
pafmaf[m] has quit [Ping timeout: 276 seconds]
ugla has quit [Ping timeout: 276 seconds]
kwilczynski has quit [Max SendQ exceeded]
tracernz has quit [Ping timeout: 258 seconds]
vazub[m] has quit [Ping timeout: 276 seconds]
allan0 has joined #zig
koakuma has joined #zig
Nazral has joined #zig
plumm has joined #zig
Amun_Ra has joined #zig
pjz has joined #zig
Witcher01 has joined #zig
afk has joined #zig
tcsc has quit [Ping timeout: 248 seconds]
kushalp has quit [Ping timeout: 265 seconds]
<Nypsie> exit
<Nypsie> Woops, you peops didn't see that!
<andrewrk> see what?
<ikskuh> /exit <leaving #zig now>
<ikskuh> :D
Akuli has quit [Quit: Leaving]
<shachaf> How do I run all the tests, rather than just one file's tests?
<mikdusan> everything? `zig build test`
<mikdusan> or do you mean run all tests for your project of > 1 source file?
<shachaf> I mean for the Zig compiler.
<shachaf> Or, I guess, how do I make sure my change didn't break any tests.
<mikdusan> yeah the first thing I suggested. you might begin first by `zig build test -Dskip-non-native -Dskip-release` locally is a very good way to get sanity
<andrewrk> CONTRIBUTING.md has some advince on running tests
<shachaf> Aha, I didn't see that file.
<andrewrk> the whole test suite can take a long time; depending on what you're changing there may be much faster options
<andrewrk> if it's the parser, you want: ./zig test ../lib/std/zig/parser_test.zig
<andrewrk> that'll be nice and fast
<shachaf> This is definitely taking longer than 6 minutes, even with -Dskip-release
<shachaf> Yes, I already got the parser tests passing that way.
sm2n has joined #zig
tm-exa has joined #zig
klltkr has joined #zig
selby has joined #zig
riba has joined #zig
eddyb[legacy] has joined #zig
<shachaf> andrewrk: What about the parser performance benchmarks you mentioned yesterday?
<andrewrk> are you asking for a tool to measure perf?
Ekho has joined #zig
<shachaf> Yes, is there one? Or how do you normally evaluate parser changes?
<andrewrk> I've been using `zig fmt` on the std lib to measure it
waleee-cl has joined #zig
<shachaf> The time to do that varies between 4s and 4.5s with the same executable. :-(
<shachaf> Maybe it's my laptop not being very good for benchmarking anything.
SLWW_ has joined #zig
SLWW has quit [Ping timeout: 246 seconds]
xackus__ has quit [Ping timeout: 246 seconds]
<andrewrk> shachaf, use `perf stat -e cache-misses -e instructions -e cycles`
<andrewrk> wall clock time will vary but those 3 things will be pretty consistent
<companion_cube> (perf also combines well with flamegraph ♥)
<shachaf> Hmm, cache misses also vary by 15% for runs of the same code.
<andrewrk> maybe try hyperfine?
<shachaf> The number of instructions is pretty stable, at least.
wootehfoot has quit [Read error: Connection reset by peer]
xackus__ has joined #zig
leon-p has quit [Quit: leaving]
riba has quit [Ping timeout: 240 seconds]
<shachaf> Is there a way to submit a patch other than a GitHub pull request? I don't like making forks on GitHub.
<g-w1> you can do it on the mailing list
<shachaf> Hmm, looks like it gets a couple of messages a month.
<shachaf> Maybe I can just make a fork and then delete it.
<g-w1> i read the mailing list 🤷