<daurnimator>
looks like there are merge conflicts; I should rebase
<diltsman>
I accept that I need to rewrite to use io.OutStream. Is there something obvious that I did that causes it to think that the buffer is const?
<daurnimator>
diltsman: parameters are const.
<diltsman>
Are talking about the out_stream parameter for stringify()?
<daurnimator>
yes
<diltsman>
Thanks. New languages always have a bit of a learning curve.
<fengb>
You’re doing it wrong™
jwh_ has left #zig [#zig]
<daurnimator>
So..... anyone able to help me compile zig against a fresh llvm build?
<daurnimator>
Is there a way to ask cmake for a list of build options?
<daurnimator>
I'm trying to do it without a ~/local or other common "build" directory
<daurnimator>
i.e. I want to invoke zig's cmake something like: `cmake -DLLVM_DIR=../../llvm-project/build ..`
ur5us has joined #zig
diltsman has quit [Remote host closed the connection]
<fengb>
Is it spring cleaning time?
<mikdusan>
daurnimator: when you invoke cmake's build, this option is where it finds llvm stuff: -DCMAKE_PREFIX_PATH=/opt/llvm-10.0.0
<mikdusan>
correction; when you invoke zig's cmake build
<daurnimator>
mikdusan: > I'm trying to do it without a ~/local or other common "build" directory
dermetfan has joined #zig
<mikdusan>
ok so DCMAKE_PREFIX_PATH=../../llvm-project/build
<mikdusan>
but i am not sure if an "uninstalled" llvm is usable
<daurnimator>
mikdusan: it is... but paths returned by e.g. llvm-config aren't going to be correct
<mikdusan>
is that the goal? build llvm and do not install, then build zig ?
marijnfs1 has joined #zig
marijnfs has quit [Ping timeout: 250 seconds]
<marijnfs_>
are there some tricks to do closures?
marijnfs has joined #zig
marijnfs2 has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
dermetfan has quit [Ping timeout: 246 seconds]
nephele_ has joined #zig
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
marijnfs2 has quit [Client Quit]
marijnfs has quit [Quit: Lost terminal]
nephele has quit [Ping timeout: 256 seconds]
<daurnimator>
mikdusan: yes
<shakesoda>
are there any good examples for std.json
<shakesoda>
the tests are kind of cryptic as examples
<daurnimator>
andrewrk: thoughts on a packed bit array being created with: `[4]align(0) u2` ?
<daurnimator>
shakesoda: the autojson facility?
<daurnimator>
shakesoda: serialisation or deserialisation?
<shakesoda>
deserialization
<daurnimator>
shakesoda: the examples aren't that cryptic at all... `try parse(bool, &TokenStream.init("false"), ParseOptions{})` => parse the string "false" into a `bool`.
<shakesoda>
well, i wasn't looking for the right thing it seems
<shakesoda>
thanks
<daurnimator>
I want to refactor it: get rid of the separate lexing and tokenisation. if you're parsing into a `bool` then if you see anything that isn't a 't' or an 'f' then you can immediately bail out
<yrashk>
Is there a way for build.cfg to use a libc allocator?
<yrashk>
err, build.zig :)
<junon>
daurnimator: I tried doing what you're trying to do just the other day and couldn't get it to work (I'm not exactly 'bad' at cmake, either). I don't think llvm-config was handing out strange paths IIRC. I just ended up installing llvm system wide and building zig, but it would be nice to be able to do it how you're wanting to do it, too.
waleee-cl has quit [Quit: Connection closed for inactivity]
layneson has quit [Quit: Leaving]
mahmudov has quit [Ping timeout: 256 seconds]
mahmudov has joined #zig
dddddd has quit [Remote host closed the connection]
<daurnimator>
andrewrk: 4665 rebased.
<mikdusan>
daurnimator: I took a quick look at building against un-installed llvm+clang+lld build dir. While llvm-config may be quite clever, the include/ are not yet consolodated; for example clang would need includes from both that build/ and also from clang/ source tree. I suspect same for lld and maybe even llvm. libdir might be fairily straightfwd for archive.a
<daurnimator>
mikdusan: yeah I ended up doing it all in a temporary directory for now :(
daex has quit [Ping timeout: 256 seconds]
daex has joined #zig
darithorn has quit [Quit: Leaving]
_whitelogger has joined #zig
_whitelogger has joined #zig
cole-h has quit [Quit: Goodbye]
_whitelogger has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Read error: Connection reset by peer]
ur5us has joined #zig
kenaryn has joined #zig
<kenaryn>
andrewk: Does this pull request could help improve std.sort? It is based on GrailSort, another implementation of wikiSort based on the same research paper.
<Cogitri>
Hello. I'm sure this has been asked too often in the last days, but is there an ETA for the next release? I'm currently bumping LLVM to 10.x on Alpine Linux and Zig isn't compatible with that as of now
<Cogitri>
We do have multiple versions versions of LLVM in our repos for such cases, but we don't have that for clang and lld and I'm pretty sure that mixing major versions between llvm/clang/lld is a recipe for certain doom
<Cogitri>
Ah, okay. I suppose there aren't some seperate patches for LLVM10, so how stable is git so we can use that in the meantime?
<Cogitri>
We can't really wait until April 13 + testing to upgrade LLVM10 since Alpine 3.12 is due in May and I want more than 15 days for testing all of that
<Cogitri>
(The change only affects Alpine Linux Edge, the stable 3.11 release will keep using zig 0.5 w/ LLVM9)
<daurnimator>
Cogitri: LLVM 10 was merged into master just a few days ago
<daurnimator>
git master is about as stable as the 0.5.0 was
<Cogitri>
Alrighty, I guess we'll switch to that for the time being then. Thanks!
kenaryn has left #zig ["WeeChat 2.3"]
jjido has joined #zig
mps has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
ur5us has quit [Ping timeout: 240 seconds]
slowtyper has joined #zig
dermetfan has joined #zig
mahmudov has quit [Ping timeout: 265 seconds]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mahmudov has joined #zig
jjido has joined #zig
marijnfs has joined #zig
r4pr0n has joined #zig
SimonNa has joined #zig
_Vi has joined #zig
<mps>
which git commit is safe enough to upgrade zig on alpine linux
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
dingenskirchen has quit [Remote host closed the connection]
<mps>
ifreund: thanks for info, will test when the llvm10 build on alpine
<ifreund>
cool, no problem
<marijnfs>
pmwhite: what type should the argument be then?
<marijnfs>
to pass a switch
<ifreund>
you wouldn't be passing a switch, but the result of a switch. so what ever the switch breaks with
<pmwhite>
yeah, ifreund is right. I misunderstood what you are asking.
<marijnfs>
yeah i see, you can't use the switch as a function type or something and pass it
<pmwhite>
for example, `f(switch(x) { else => 5 })` is equivalent to `f(5)`
<ifreund>
not currently, though I think nicer anon functions are planned
<andrewrk>
mps, can you try it with no patches and tell me if it works?
<mps>
andrewrk: ofc, but waiting till llvm10 is built. when it finish I'll test and inform you
jjido has joined #zig
<andrewrk>
my goal is no patches needed on any os
<mps>
nice goal :)
nephele_ is now known as nephele
marijnfs has quit [Ping timeout: 252 seconds]
darithorn has joined #zig
marijnfs has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #zig
dermetfan has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
mahmudov has joined #zig
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cole-h has joined #zig
frett27 has joined #zig
TheLemonMan has joined #zig
<shakesoda>
Snektron: this radix sort is significantly faster than the one I wrote
<shakesoda>
very nice
jjido has joined #zig
<Snektron>
:) nice
<TheLemonMan>
andrewrk, yo
<Snektron>
Its such a nice algorithm too
<Snektron>
I took a look at porting the GPU version, but it requires some intrinsics which i think are avx512
<andrewrk>
yo
<Snektron>
yeah you need a scatter operation, and those were only added in avx 512
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Snektron>
(even though the scatter would never cause memory problems)
<TheLemonMan>
andrewrk, wrt #4840, should we just allow the user to index the sentinel as any other element?
<TheLemonMan>
the comptime machinery doesn't reserve a slot for the len+1 element as it assumes the sentinel is there and is correct
<andrewrk>
I was just about to look into that
<TheLemonMan>
wunderbar, I'll jump to the next question then
<TheLemonMan>
NetBSD libc requires us to use a few non-standard names (eg. fstat -> __fstat50), I did that for a few occurrences that happened to break the tests but I've discovered that there are many more
<TheLemonMan>
I'm not sure if we can do something better than the status quo (select the symbol name with a switch and then call it with @field(sym_name)(args...)
<andrewrk>
2 things: (1) setting the sentinel to 0 manually should not be required; it is supposed to be set by the variable declaration. (2) maybe it should be allowed to "mutate" comptime memory, even if the pointer is const, when the value would not be changed?
<andrewrk>
regarding weird names, could we perhaps put the extern name correctly in c.zig and then make an alias?
<TheLemonMan>
hmm, thinking more about the sentinel issue, what does &array[sentinel_idx] return?
<TheLemonMan>
hmm, we can put the versioned names in c/netbsd.zig (or whatever the path is) and then have std/c.zig pick those and define some aliases if the os is NetBSD
<andrewrk>
yeah that makes sense to me
<TheLemonMan>
lel, all the sentinels have the same address
<andrewrk>
hmm that's a bug
<TheLemonMan>
not really, llvm generates a different constant for each one
<TheLemonMan>
but they have a completely different address
<andrewrk>
the sentinel is supposed to be in memory adjacent to the rest of the array
<TheLemonMan>
they're in .rodata or .bss or god knows where
<andrewrk>
it would be legal for a zig program to ptrtoint and subtract to read data from the array before the sentinel
dddddd has quit [Ping timeout: 256 seconds]
<lunamn>
andrewrk: is there a specific reason why std.net.Address.parseIp6 does not support alphanumerical scope IDs (e.g %wlp3s0)? I'm tracking down how to do it and it involves creating sockets and doing ioctls (how musl does it), but I'm not sure if that should be put in parseIp6...
<andrewrk>
lunamn, hmm it seems like a code smell that parsing an addr would involve any syscalls. maybe that should be a different function called "resolveIp6" or something
<lunamn>
andrewrk, would that be an okay change to do? I think we can still peek parseIp6, but guide everyone to using resolveIp6
<lunamn>
s/peek/keep
<andrewrk>
that sounds reasonable to me
<ifreund>
hmm this feels a little weird, but i think it's actually a pretty clean way to do logging https://paste.rs/KmY
<TheLemonMan>
ifreund, hm, iirc the enum to ordinal mapping is left unspecified for non extern enums
<ifreund>
guess I should probably explictly set them then, it did seem to work as intended from brief testing though
<TheLemonMan>
the compiler atm doesn't take advantage of none of those extra degrees of freedom
<ifreund>
i quite like the syntax of `Log.Error.log("I messed up", .{});`
<frett27>
hi, i switched to llvm - 10, on master, i got an undefined reference at link : référence indéfinie vers « getPollyPluginInfo() , what may i missed ?
<mps>
source is zig commit 86795c03f918dbcc0fc06811cc7c496d275deae1
<Sphax>
mikdusan: thank you
<mps>
oh, looks like lld is not yet upgraded
<mps>
will check tomorrow again
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<ifreund>
andrewrk: that looks pretty neat, are you hinting that I should implement it :D
ur5us has joined #zig
<junon>
andrewrk: does the zig compiler have suggestive functionality/autocomplete to any degree? Would love to integrate it with ncm so I get hints inside my editor.
rjtobin has joined #zig
jjido has joined #zig
<Snektron>
Since the zig parser is part of the standard library, i think you can implement autocomplete to a certain degree pretty easily
<Snektron>
Although i guess the parser needs to be able to recover and im not sure if it can do that
<pmwhite>
At the very least, it could autocomplete from the last successful parse, which is not useless at all.
rjtobin has quit [Remote host closed the connection]
rjtobin has joined #zig
rjtobin has quit [Remote host closed the connection]
rjtobin has joined #zig
meraymond2 has joined #zig
meraymond2 has quit [Remote host closed the connection]
<pixelherodev>
The one problem with my remote zig solution is that it's generating LLVM 10, and my parser is 9-only for now :(
r4pr0n has quit [Quit: r4pr0n]
afontain_ has quit [Ping timeout: 246 seconds]
<Snektron>
Did llvm ir change a lot?
BaroqueLarouche has quit [Ping timeout: 246 seconds]
afontain_ has joined #zig
pmwhite has quit [Ping timeout: 246 seconds]
<pixelherodev>
Nah, but there's now a willreturn function attribute :P
BaroqueLarouche has joined #zig
<pixelherodev>
And I don't want to do partial lexer fixes
dermetfan has quit [Ping timeout: 240 seconds]
pmwhite has joined #zig
<yawniek>
hi, im new to zig. trying to use it to compile mruby on macos. but i get fatal error: 'stdarg.h' file not found. isnt that included with zig?
<ikskuh>
it is, but you have to use a libc
<ikskuh>
what is your current target?
<mikdusan>
yawniek: have you both recently upgraded xcode and used zig before that xcode upgrade?
<yawniek>
mikdusan: i dont think so
<yawniek>
i simply set CC to zig cc and nothing else so far
<mikdusan>
one sec. i have mruby on my machine let me try
<yawniek>
(actually i want to compile the h2o server but it failed at mruby and plain mruby does the same)
<mikdusan>
try this first: rm ~/Library/Application\ Support/zig/stage1/native_libc.txt
jasom has joined #zig
<mikdusan>
btw, mruby master worked for me: export CC and CXX with `zig cc` and `zig c++` respectively; note you will see warnings about "-MD" option don't worry about that for now
<yawniek>
no luck. i dont have native_libc there (installed zig via homebrew)
<mikdusan>
`zig version`
<yawniek>
0.5.0 (just installing head now)
<yawniek>
failed :/
<mikdusan>
just grab latest build of zig from website
<pixelherodev>
There a way to force the progress output on a non-TTY?
marijnfs has quit [Quit: Lost terminal]
Xatenev has quit [Quit: Leaving.]
<yawniek>
mikdusan seems to work with that one, thanks!
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]