<andrewrk>
e.g. if `run readelf -d | grep whatever` and then paste that into tools/generate_musl_stub.zig or something
<ifreund>
sounds good
<andrewrk>
ifreund, now there are 68 issues closed in the 0.7.1 milestone, so the one you are working on will be the last one ;)
<ifreund>
alright, it's 2am and I'm done socalizing, back to work :D
<andrewrk>
haha
<ifreund>
oh was that a 69 joke that flew over my head?
<andrewrk>
hehe
hlolli__ has quit [Ping timeout: 240 seconds]
powerofzero has quit [Ping timeout: 240 seconds]
powerofzero has joined #zig
osa1_ has joined #zig
marijnfs_ has joined #zig
osa1 has quit [Ping timeout: 265 seconds]
marijnfs has quit [Ping timeout: 265 seconds]
cole-h has joined #zig
powerofzero has quit [Remote host closed the connection]
powerofzero has joined #zig
<ifreund>
andrewrk: PR is good to go afaik, I can update the wiki page with more detailed instructions than the example in the comments tomorrow sometime
<ifreund>
off to sleep now though, it got late
radgeRayden has quit [Ping timeout: 258 seconds]
radgeRayden has joined #zig
proteusguy has joined #zig
<proteusguy>
Does zig use C-style calling conventions or is it more efficient with function calls? I see it claims to be faster than C, what's the reason for this claim? Looks pretty interesting.
freshmaker666 has joined #zig
spiderstew has quit [Ping timeout: 272 seconds]
<llimllib>
I have a function that accepts a `[10][10]u8`, but then if I try to change the array I get "cannot assign to constant"
<llimllib>
I'm surprised that this is a constant - how would I know that, and why is it a constant?
<llimllib>
it's something like I'm stuck in a C mindset that the array is a pointer
earnestly has quit [Ping timeout: 240 seconds]
<proteusguy>
llimllib, all parameters come in as constants.
powerofzero has quit [Ping timeout: 258 seconds]
a_chou has joined #zig
marnix has joined #zig
<leeward>
proteusguy: I think there was a blog post somewhere where some vector code was being better optimized by Zig than by C. That's the source I've seen for the "faster" claim. Zig does what in C is called link-time optimization, which is a speed thing. I don't know if I would describe it as faster than C in general, but Zig tends to emit assembler code that looks a lot like what a C compiler emits in my experience.
<leeward>
It's in the same class, certainly, and if you actually need "faster" it won't get in the way.
<radgeRayden>
I think at some point the claim got updated to being faster at default settings
<radgeRayden>
I always personally thought that claim was a mistake :)
<karchnu>
Zig has many operators, some of them tend to fix undefined behaviors in C. Could one of them be translated into a specific assembly code that the C compiler can't?
<rowbee>
i placed // zig fmt: off/on around a code block i don't want formatted but zigfmt seems to still format it, any ideas?
a_chou has quit [Remote host closed the connection]
klltkr has quit [Ping timeout: 272 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
cole-h has quit [Ping timeout: 260 seconds]
sord937 has joined #zig
wootehfoot has joined #zig
sord937 has quit [Ping timeout: 240 seconds]
sord937 has joined #zig
radgeRayden has quit [Remote host closed the connection]
kenran has joined #zig
xackus has joined #zig
spiderstew has joined #zig
<ifreund>
rowbee: those comments need to be at the top level for it to work
<rowbee>
hm... can't have just a few lines un-formatted?
<rowbee>
ah well
rzezeski has quit [Quit: Connection closed for inactivity]
philtor has quit [Ping timeout: 256 seconds]
wootehfoot has quit [Read error: Connection reset by peer]
earnestly has joined #zig
lucid_0x80 has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<betawaffle>
should i be using 0.7.0 or master for my doc generator experiments?
<ifreund>
betawaffle: probably master, though there isn't much difference in terms of language/std features currently, mostly bugfixes
tane has joined #zig
xackus has quit [Ping timeout: 272 seconds]
wootehfoot has joined #zig
kenran has quit [Quit: leaving]
<ifreund>
do we have a way to compare ascii slices alphabetically in the std somewhere?
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
osa1_ is now known as osa1
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<betawaffle>
are there things i can do to tell zig's `make install` to be faster?
<ikskuh>
make -j install
<ikskuh>
but the linking step is the longest afaik
waleee-cl has joined #zig
xackus has joined #zig
klltkr has joined #zig
<betawaffle>
the slow part for me is zig_build_zig1
<betawaffle>
is that what you mean?
<ifreund>
yeah that's definitely the slowest because the stage1 compiler is slow and a memory hog
<ifreund>
not anything that can be done about that really aside from waiting for stage2 to be ready
<betawaffle>
ah, ok
hlolli__ has joined #zig
[RMS] has quit [Ping timeout: 256 seconds]
knebulae has quit [Read error: Connection reset by peer]
kenran has joined #zig
kenran has quit [Client Quit]
kenran has joined #zig
kenran has quit [Client Quit]
kenran has joined #zig
wootehfoot has quit [Ping timeout: 258 seconds]
<ikskuh>
is there a quick way to get the executable directory?
<ikskuh>
nevermind
<ikskuh>
std.fs.selfExe…()
rzezeski has joined #zig
xackus has quit [Read error: Connection reset by peer]
xackus_ has joined #zig
Akuli has joined #zig
[RMS] has joined #zig
leon-p has joined #zig
leon-p has joined #zig
marler8997 has joined #zig
<marler8997>
Trying out the new windows build option w/out MSVC, but I'm confused by the --override-lib-dir argument
<marler8997>
it says it's the path to the zig source code...so is that supposed to be a subpath to my zig repo somewhere?
<marler8997>
example is C:\zig\lib....but if it's zig source shouldn't it be the src directory?
<ifreund>
well, the source of the std is in the lib dir, maybe that's what it means?
<marler8997>
yeah I'll try that and if it's correct maybe I'll update the wiki
<marler8997>
worked
<marler8997>
I don't understand why that argument is needed though
knebulae has joined #zig
g-w1 has quit [Ping timeout: 256 seconds]
hnOsmium0001 has joined #zig
amk has quit [Read error: Connection reset by peer]
amk has joined #zig
g-w1 has joined #zig
a_chou has joined #zig
a_chou has quit [Remote host closed the connection]
wootehfoot has joined #zig
lucid_0x80 has quit [Ping timeout: 256 seconds]
marnix has quit [Read error: Connection reset by peer]
letoram has quit [Ping timeout: 240 seconds]
letoram has joined #zig
xackus_ has quit [Ping timeout: 264 seconds]
mattnite has joined #zig
TheLemonMan has joined #zig
<TheLemonMan>
yo ifreund, are you setting libc.so soname?
<ifreund>
TheLemonMan: oh no, that's totally it. I just went "musl's .so isn't versioned we don't need that" in my head
<ifreund>
will try and report back
<andrewrk>
ifreund, I was also curious what the rpaths are in the hello binary
<andrewrk>
readelf -d hello
<andrewrk>
ideally it wouldn't have anything in there in the zig-cache
<ifreund>
just setting the soname seems to have fixed it :)
<andrewrk>
wonderful
<ifreund>
do either of you thing getting the link sections rigth for the stubs matters?
marnix has joined #zig
<andrewrk>
ehh not really. but I think it would be a 1 liner if you want to do it
<ifreund>
not quite a one liner, there are some edge cases from what I saw
<ifreund>
objdump prints ABS and UND for some symbols and I'm not sure how I would recreate that in asm
<andrewrk>
I'm not either
<ifreund>
actually musl doesn't seem to have any symbols in that category currently, I'll implement it real quick and ignore the edge case :D
<TheLemonMan>
UND symbols are skipped in glibc's abilist.awk
<TheLemonMan>
and so are ABS ones
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<ifreund>
thanks lemon
<leeward>
Is unsigned integer overflow really undefined in unsafe build modes? If I overflow my u8, is it possible I'll get 256?
klltkr has quit [Quit: Leaving]
<ifreund>
I'd think so
<leeward>
cool
seadragon-droid has joined #zig
dsmcfarl has joined #zig
<ifreund>
got the diff between real musl and the stub objdumps down to https://0x0.st/iFiv.txt
<llimllib>
I'm surprised that creating a struct with a usize member is resulting in a reference rather than a copy (`&Move { .x = x}` where x is a usize) - what's the idiomatic way to ensure that x is copied instead?
<ifreund>
llimllib: why do you say that's resulting in a reference? it should be a copy
<llimllib>
that's certainly what I expected? let me see if I can boil it to a test or prove that I'm being dense
<llimllib>
(very probable)
<llimllib>
nope I'm being dense, and asking made me realize it. apologies.
<ifreund>
no worries!
<llimllib>
(I was thinking that &Move was a type, and I was constructing a new one on the stack, but instead I was changing the literal value of a single const Move)
wootehfoot has quit [Quit: Leaving]
cren has joined #zig
marnix has quit [Read error: Connection reset by peer]
ur5us has joined #zig
marnix has joined #zig
jmiven has quit [Quit: reboot]
jmiven has joined #zig
msiism has joined #zig
riba has joined #zig
marnix has quit [Ping timeout: 264 seconds]
marnix has joined #zig
msiism has left #zig [#zig]
marnix has quit [Ping timeout: 260 seconds]
Akuli has quit [Quit: Leaving]
kenran has quit [Quit: leaving]
sord937 has quit [Quit: sord937]
<andrewrk>
ifreund, what do you think about tying the default link mode to is_native_os rather than is_native_abi?
<andrewrk>
hmm maybe not. I think the way you have it is nice
<ifreund>
andrewrk: my reasoning was that it was weird that building for native-native-musl on a glibc system would link dynamically by default
<andrewrk>
omg `const ally = &arena.allocator` that is so cute
<ifreund>
I stole that from SpexGuy :D
<andrewrk>
I agree, I think your additions for native ABI are an improvement
<ifreund>
it's so much better than `allocator` or `alloc`
<andrewrk>
I love it
<andrewrk>
although I've started using gpa or arena
<ifreund>
yeah I use gpa for gpas too, ally is nice when it's a generic allocator though
ur5us has quit [Ping timeout: 260 seconds]
<andrewrk>
nice work! just finished reviewing it
<andrewrk>
that was a neat little project. you had to learn some new stuff, it took a good chunk of time, but it's a big deal to have it working now :)
<ifreund>
yeah I definitely learned a lot more about how linking works and how zig does the magic it does
<ifreund>
thanks for the hand-holding :D
a92 has joined #zig
<andrewrk>
np, it seemed like you did everything on your own to me, all I did was brainstorm ideas when things were not working
<ifreund>
well it probably would have taken me 10x as long without you and TheLemonMan lol
mattnite has quit [Quit: Lost terminal]
seadragon-droid has quit [Ping timeout: 258 seconds]
<andrewrk>
ifreund, that looks squeaky clean. thanks!
<andrewrk>
ready for a merge?
<ifreund>
yep!
<ifreund>
can't wait to merge my river branch blocked on 0.7.1 \o/
<andrewrk>
haha sweet I just made a dynamically linked musl hello world that I can't run on my native machine
<ifreund>
heh
cren has quit [Quit: cren]
<andrewrk>
it's pretty cool how little that added to our installation size to be able to support that