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/
gpanders has quit [Quit: ZNC - https://znc.in]
gpanders has joined #zig
Jeanne-Kamikaze has joined #zig
<THFKA4> i...is this for a challenge or something? why are you calling the runtime linker manually ohgod
<THFKA4> ultra-portable binaries
msingle has joined #zig
Jeanne-Kamikaze has quit [Quit: Leaving]
skuzzymiglet has quit [Ping timeout: 240 seconds]
Jeanne-Kamikaze has joined #zig
tane has quit [Quit: Leaving]
<pixelherodev> marler8997: I don't know of any
<pixelherodev> I know of a few that never ended up being officially released
<karchnu> void linux uses musl instead of glibc, and statically compiles their tools (I don't know how many)
<waleee-cl> karchnu: void has musl as an alternative to glibc
<waleee-cl> karchnu: you were perhaps thinking of apline? There glibc has been "banished"
<waleee-cl> * alpine
<karchnu> we were talking about distributions that made the choice of statically compile their own tools, and I think that is the case for void
<karchnu> yes, alpine uses musl, but it is not statically compiled (even though it will not change much, at least for the base system since they use busybox + musl)
<karchnu> https://wiki.musl-libc.org/projects-using-musl.html the musl website has a list of projects, some of them are statically compiled OSs
radgeRayden has joined #zig
radgeRayden has quit [Remote host closed the connection]
<dominikh> looking at syscalls in zig, I'm noticing that errors that can happen, but are due to programmer error, are being handled as unreachable. for example https://github.com/ziglang/zig/blob/2fbe9519acec0d7b9c9dcc41a877fec912337124/lib/std/os.zig#L3000-L3011 – is this really the idiomatic way of dealing with programmer error in Zig? blow up in debug builds, invoke undefined behavior in release builds?
<daurnimator> dominikh: that's correct.
<daurnimator> dominikh: release-safe vs release-fast builds
<daurnimator> most people should be using release-safe. release-fast is telling the compiler that you haven't made any mistakes and to make things go as fast as possible
<dominikh> I suppose that's fair
hlolli_ has quit [Ping timeout: 260 seconds]
radgeRayden has joined #zig
Kuraitou has quit [Ping timeout: 240 seconds]
a92 has quit [Quit: My presence will now cease]
<marler8997> andrewrk that's cool! I'll have to look into the Vulkan loader myself to see what it's doing
<andrewrk> I think I'm going to have a working demo soon :D
<marler8997> did you find the X extension to map a framebuffer?
Jeanne-Kamikaze has quit [Ping timeout: 264 seconds]
<andrewrk> I found some example code that does it
Jeanne-Kamikaze has joined #zig
frmdstryr has joined #zig
msingle has quit [Ping timeout: 240 seconds]
msingle has joined #zig
GuerrillaMonkey has joined #zig
Jeanne-Kamikaze has quit [Ping timeout: 264 seconds]
msingle has quit [Ping timeout: 272 seconds]
GuerrillaMonkey has quit [Quit: Leaving]
msingle has joined #zig
Jeanne-Kamikaze has joined #zig
CodeSpelunker has quit [Ping timeout: 256 seconds]
shakesoda has quit [Quit: Connection closed for inactivity]
GuerrillaMonkey has joined #zig
<andrewrk> marler8997, https://i.imgur.com/VUlXsNM.png
<dominikh> congrats
GuerrillaMonkey has quit [Remote host closed the connection]
Jeanne-Kamikaze has quit [Ping timeout: 240 seconds]
<andrewrk> will publish the code in a little bit after I clean it up
GuerrillaMonkey has joined #zig
msingle has quit [Ping timeout: 246 seconds]
GuerrillaMonkey has quit [Ping timeout: 272 seconds]
radgeRayden has quit [Remote host closed the connection]
msingle has joined #zig
<ifreund> marler8997: here's one https://github.com/oasislinux/oasis
<ifreund> that's super impressive how fast y'all got to a working demo!
<andrewrk> I'm cheating a bit due to zig not having PIE support yet
<andrewrk> still have a problem to solve associated with that, and then need to add a small patch to Vulkan-Loader to make the SYSCONFDIR runtime-configurable
<andrewrk> then I need to figure out how in the hell to test alpine
<andrewrk> maybe a VM
<pixelherodev> oh right, oasis!
<pixelherodev> andrewrk: now for a Wayland version?
<pixelherodev> :P
kristoff_it has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
lucid_0x80 has joined #zig
frmdstryr has quit [Ping timeout: 272 seconds]
knebulae has quit [Read error: Connection reset by peer]
marnix has joined #zig
msingle has quit [Ping timeout: 240 seconds]
cole-h has quit [Ping timeout: 240 seconds]
tetsuo-cpp has joined #zig
tetsuo-cpp has quit [Read error: Connection reset by peer]
tetsuo-cpp has joined #zig
aerona has quit [Quit: Leaving]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
neptunepink has quit [Quit: Bye]
sawzall has quit [Read error: Connection reset by peer]
neptunepink has joined #zig
neptunepink has quit [Client Quit]
neptunepink has joined #zig
wilsonk_ has quit [Quit: Leaving]
wilsonk has joined #zig
tetsuo-cpp has quit [Ping timeout: 240 seconds]
Kuraitou_ has joined #zig
Kuraitou_ is now known as Kuraitou
st4ll1 has joined #zig
wilsonk has quit [Quit: Leaving]
wilsonk has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
knebulae has joined #zig
xackus has joined #zig
xackus has quit [Client Quit]
earnestly has joined #zig
dumenci has joined #zig
lucid_0x80 has quit [Ping timeout: 240 seconds]
haliucinas has quit [Ping timeout: 240 seconds]
haliucinas has joined #zig
wilsonk has quit [Quit: Leaving]
<ifreund> zig-wayland is coming along pretty nicely and might make a wayland version more pleasant to write. Haven't experimented with accelerated client side graphics yet thoguh
xmarto has joined #zig
xackus has joined #zig
skuzzymiglet has joined #zig
Xavi92 has joined #zig
_whitelogger has joined #zig
<Xavi92> I'll update to latest zig and try again
<daurnimator> Xavi92: you should be able to add mips1 to your zig target
<daurnimator> oh I see you already do
m4r35n357 has joined #zig
m4r35n357_ has joined #zig
m4r35n357_ has quit [Client Quit]
m4r35n357 has quit [Client Quit]
m4r35n357 has joined #zig
<Xavi92> daurnimator: still happens on latest zig. I see zig passing "-target mipsel-unknown-unknown-unknown" to clang, but not "-mips1"
<daurnimator> Xavi92: what if you run with --verbose-llvm-cpu-features ?
<Xavi92> daurnimator: returns pretty much the same https://bpa.st/raw/5OJQ
<daurnimator> Xavi92: might need to clear your zig-cache
skuzzymiglet has quit [Ping timeout: 260 seconds]
<Xavi92> daurnimator: oh, sorry. https://bpa.st/raw/Y2YQ
<ifreund> should be an easy fix at least
<Xavi92> Hm, so is this also an issue for targets other than riscv32/64?
<daurnimator> Xavi92: wait hang on..... I see e.g. `-Xclang -target-cpu -Xclang mips1` in your output there
<daurnimator> then `-Xclang -target-feature -Xclang +mips1`
<daurnimator> that *is* passing it along
<daurnimator> the key point is `cdromh.s` doesn't have a .c/.cpp file extension
<Xavi92> daurnimator: I felt somewhat forced to use zig for assembling .s files because apparently mipsel-unknown-elf-as has a bug that affects the link process. Please read the original comment at https://bugs.llvm.org/show_bug.cgi?id=48062
tane has joined #zig
marnix has quit [Ping timeout: 264 seconds]
skuzzymiglet has joined #zig
<daurnimator> Xavi92: idea for a quick fix: http://sprunge.us/z5hcge
marnix has joined #zig
skuzzymiglet has quit [Ping timeout: 246 seconds]
<Xavi92> daurnimator: thanks, I'll give it a try ASAP
marnix has quit [Read error: Connection reset by peer]
hlolli_ has joined #zig
Xavi92 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<daurnimator> it's likely to not work... you might try using `-Xassembler` instead and moving it into the switch
dimenus has joined #zig
dimenus has quit [Client Quit]
supercoven has joined #zig
dimenus has joined #zig
marnix has joined #zig
riba has joined #zig
nycex- is now known as nycex
frmdstryr has joined #zig
<dimenus> ifreund: didn't you write a wayland scanner?
<ifreund> It's still quite young and subject to change but is already a big step up on autogenerated bindings IMO
cole-h has joined #zig
waleee-cl has joined #zig
a_chou has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
riba has quit [Ping timeout: 256 seconds]
lltt has quit [Ping timeout: 260 seconds]
gpanders has quit [Quit: ZNC - https://znc.in]
a_chou has quit [Ping timeout: 256 seconds]
gpanders has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
gpanders has quit [Client Quit]
gpanders has joined #zig
<mq32> ifreund: std.log was mainly your work, right?
<ifreund> mq32: sure, I got the ball rolling
<mq32> <3
<mq32> it's so niiiice!
<mq32> love it
<mq32> warning(wavefront_obj): unrecognized line: 'map_Kd Textures/metalLight(Clone).png'
<mq32> my wavefront obj parser now uses std.log instead of std.debug.print :)
<ifreund> i'm very happy with enum literal approach to scoping :)
<mq32> yes!
<mq32> very neat
dimenus has quit [Quit: WeeChat 2.9]
<dominikh> any plans for updating https://ziglang.org/documentation/master/std/? been a while (July)
Jayce has joined #zig
g-w1 has joined #zig
Jayce has quit [Remote host closed the connection]
cren has joined #zig
riba has joined #zig
riba has quit [Ping timeout: 260 seconds]
TheLemonMan has joined #zig
dkibi has quit [Quit: leaving]
msingle has joined #zig
<TheLemonMan> ah I fucking hate when the FreeBSD CI fails with no error whatsoever
<TheLemonMan> I guess I can't just ssh into the CI box... or can I?
<TheLemonMan> no way, nice
skuzzymiglet has joined #zig
hnOsmium0001 has joined #zig
wootehfoot has joined #zig
<dominikh> I have a design question on allocator use. in https://github.com/ziglang/zig/blob/2fbe9519acec0d7b9c9dcc41a877fec912337124/lib/std/os.zig#L1357-L1388 is there any reason not to use an arena, and avoid the code for freeing stuff?
xmarto has quit [Ping timeout: 245 seconds]
<andrewrk> TheLemonMan, I can get you access to be able to do that
<andrewrk> tracking issue is https://github.com/ziglang/zig/issues/7105
<TheLemonMan> that'd be neat
<andrewrk> btw TheLemonMan https://i.imgur.com/VUlXsNM.png
<andrewrk> I'm cheating by doing -lc since we don't have PIE yet
<andrewrk> but I think it's going to work!
<TheLemonMan> aha, it worked! amazing
* pixelherodev is honestly kinda grossed out that that's necessary
<earnestly> Apparently the design of vulkan make static linking, difficult
<andrewrk> well look at all the libs the actual driver depends on: https://clbin.com/xMSLR
<andrewrk> it includes LLVM 9, libstdc++, xml2, ...
<pixelherodev> That's honestly insane.
<andrewrk> and libncurses
<earnestly> Something is cursed alright
<pixelherodev> I'll stick to my nice, uncursed software rendering :P
<earnestly> I'm sure there's a good list of reasons for this
<earnestly> But I don't know enough to understand yet
<andrewrk> I bet I can explain every one of those libs
<dominikh> LLVM is probably because of SPIR-V?
<pixelherodev> That just tells me SPIR-V is probably implemented horribly :P
<dominikh> I've used Zig once, but then I saw it needed LLVM. that really put me off :P
<TheLemonMan> is this a meeting of LLVM haters?
<dominikh> apparently
<TheLemonMan> more people for my /ignore list!
<dominikh> I knew I should've included an /s on my anti-LLVM message :<
<pixelherodev> TheLemonMan: I hate it because I looked at the source :P
<fengb> Am I on your ignore list too?
<pixelherodev> That and the four(?) different infinite loops and optimizer bugs I've had to deal with
<andrewrk> TheLemonMan, if you're gonna troubleshoot the freebsd thing you should know that there is one llvm assert we are tripping when is built in debug mode. I haven't had the time to work it out yet but was hoping to do so before 0.7.1
<pixelherodev> Also the entire philosophy of LLVM is ridiculous and leads to bad code
<dominikh> what's that philosophy?
dumenci has quit [Quit: Leaving]
<TheLemonMan> andrewrk, do we trip that assert only on FreeBSD?
<pixelherodev> Keep in mind that this is the interpretation of someone who hates the project filtered through that lens
<pixelherodev> They focus on "performance" above all else, micro optimizing for stupid benchmarks
<dominikh> in their implementation or in the code they produce?
<pixelherodev> The latter
<andrewrk> TheLemonMan, I ran into it with release builds of std lib tests on linux. It could be in linux specific std lib code but more likely it will trip for every OS
<andrewrk> but (not) tripping an llvm assert is basically UB, so it could be manifesting in a flaky freebsd std lib run
<TheLemonMan> oh, I'll give that a spin on the beastly aarch64 server then
<andrewrk> 💪
Jeanne-Kamikaze has joined #zig
<pixelherodev> To put it differently, it's poorly designed C++ written by people who like C++ and think that micro-optimizations are better than solid designs
moka has joined #zig
<TheLemonMan> lol
marnix has quit [Ping timeout: 260 seconds]
<andrewrk> llvm's design process is a lot more decentralized than zig's. you can't really generalize it that way; there are many people contributing major things to llvm and all bringing different perspectives, use cases, and design philosophies
marnix has joined #zig
waleee-cl has quit [Ping timeout: 260 seconds]
<andrewrk> that is its power and its weakness. it's why its runtime optimizations are state of the art but why it's difficult for the project to have competitive compilation speeds, and why it keeps growing in lines of code over time
THFKA4 has quit [Ping timeout: 260 seconds]
THFKA4 has joined #zig
<pixelherodev> andrewrk: I was very explicit that I'm biased here
mokafolio has quit [Ping timeout: 260 seconds]
moka is now known as mokafolio
<pixelherodev> That's probably a much more accurate perspective
waleee-cl has joined #zig
<andrewrk> TheLemonMan, I'm gonna revive your PIE diff today unless you were already in the middle of it
<TheLemonMan> andrewrk, go for it! are you plainning on making it default?
<andrewrk> current plan is still to make things as static as possible. so I think you would have to ask for it
<andrewrk> maybe in release safe we would do it by default, since it enables ASLR?
supercoven has quit [Ping timeout: 260 seconds]
<TheLemonMan> many Linux distros (and some BSDs) enable PIE by default as security measure
<TheLemonMan> the impact on the binary size should be minimal, of course some numbers are welcome
<andrewrk> I think linux distros would likely choose ReleaseSafe for zig packages. that's ifreund's preferred release mode for his wayland window manager for example
<earnestly> Distros mostly focus on hardening flags but some may care about size too
<andrewrk> today in zig development https://www.youtube.com/watch?v=sb8rWCvnNbk
<companion_cube> It'd be nice to have a equivalent of llvm but aiming at small size/reasonable code
<TheLemonMan> cranelift?
<THFKA4> PIE is the future
Xavi92 has joined #zig
<TheLemonMan> it really depends on the filling
<THFKA4> cranelift is that second compiler for LSP-tier debugging feedback because LLVM is fat
<THFKA4> we can't all be Roslyn
<THFKA4> and generate the same bytecode from incremental builds as from a batch compile
skuzzymiglet has quit [Read error: No route to host]
ur5us_ has joined #zig
<Michcioperz> i believe there was something called qbe trying to be a simplified llvm
<Michcioperz> intentionally doesn't have an asm syntax and that's a big shame for me
Xavi92 has left #zig ["https://quassel-irc.org - Chat comfortably. Anywhere."]
<companion_cube> Also not really maintained, is it?
<companion_cube> Cranelift might be a good bet though.
kushalp has joined #zig
<pixelherodev> qbe is neat
<kushalp> I'm trying to use the `translate-c` command and I'm receiving the following error: time.c:1:10: 'arpa/inet.h' file not found. Any ideas what I'm doing wrong?
<pixelherodev> There's a full C11 compiler using it
<pixelherodev> (cproc)
skuzzymiglet has joined #zig
<pixelherodev> Really simple code, too :D
<companion_cube> It's a devault project isn't it? Cproc I mean
<pixelherodev> No?
<Michcioperz> iirc it is on srht but not devault
<pixelherodev> ^
<pixelherodev> yes and yes
<pixelherodev> There is literally nothing that would compel me to use clang over cproc *ever*
<Michcioperz> hmm arpa/inet.h is a non-standard kind of header no?
<pixelherodev> Probably
<pixelherodev> arpa/ prefix heavily implies that
Xavi92 has joined #zig
a_chou has joined #zig
<Michcioperz> hmm i added -I/usr/include -I/usr/include/x86_64-linux-gnu and it translated
<Michcioperz> isn't there a cleaner way?
<Michcioperz> cc kushalp in case this is good enough for you
<Michcioperz> oh i'm still on 0.6 hmm
<Xavi92> daurnimator: the patch for MIPS I now apparently appends tons of complementary flags to clang (e.g.: several mips architectures) https://bpa.st/OYKA
<pixelherodev> If you have to specify a local header, it's not portable
<Michcioperz> sure i was just wondering if there isn't a shortcut for including system headers
aerona has joined #zig
<kushalp> Thanks, that appears to have worked!
<Michcioperz> happy to hear it, i wish there was a cleaner way
<kushalp> A little crazy that it converts all of the header methods as well, but a useful starting point
<kushalp> s/crazy/too much/
aerona has quit [Quit: Leaving]
msingle has quit [Ping timeout: 264 seconds]
<pixelherodev> kushalp: I like to think of translate-c as a tool. Sometimes, in simple cases, `cImport` is the way to go; oftentimes, it's better to run it manually and clean up the result
Jeanne-Kamikaze has quit [*.net *.split]
isolier has quit [*.net *.split]
osa1 has quit [*.net *.split]
idxu has quit [*.net *.split]
gazler has quit [*.net *.split]
SimonN has quit [*.net *.split]
notpiika has quit [*.net *.split]
demizer has quit [*.net *.split]
tomku has quit [*.net *.split]
companion_cube has quit [*.net *.split]
kandinski has quit [*.net *.split]
sjums has quit [*.net *.split]
Thalheim has quit [*.net *.split]
isolier has joined #zig
Jeanne-Kamikaze has joined #zig
gazler has joined #zig
SimonN has joined #zig
notpiika has joined #zig
demizer has joined #zig
tomku has joined #zig
companion_cube has joined #zig
Thalheim has joined #zig
idxu has joined #zig
sjums has joined #zig
osa1 has joined #zig
kandinski has joined #zig
midgard has quit [Ping timeout: 246 seconds]
iwq has quit [Ping timeout: 264 seconds]
iwq has joined #zig
midgard has joined #zig
skuzzymiglet has quit [Read error: Connection reset by peer]
cren has quit [Quit: cren]
<ifreund> For complex apis you may be able to improve the ergonomics or type safety alot with some more complex bindings as well
<ifreund> e.g. I've worked out a way to eliminate almost all void pointer casting in libwayland's api
demizer has quit [Remote host closed the connection]
a_chou has quit [Remote host closed the connection]
marnix has quit [Ping timeout: 256 seconds]
riba has joined #zig
GuerrillaMonkey has joined #zig
Jeanne-Kamikaze has quit [Ping timeout: 260 seconds]
hlolli__ has joined #zig
hlolli_ has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
<andrewrk> qbe shells out to a system installed assembler. it doesn't have instruction selection
<adsr> Hello all, are condition variables in the standard lib? I see threads and mutexes and wanted to make sure I'm not overlooking something
<adsr> Looking to write a producer/consumer thing
<andrewrk> have a look at ResetEvent
<andrewrk> but overall, I wouldn't say zig yet has a comprehensive concurrency API yet
<adsr> Will check that out, thanks andrewrk. Also just found std.event.Channel
<andrewrk> that API is currently for evented I/O stuff only, although I do aspire to make it work in both contexts with the same API
nvmd has joined #zig
<andrewrk> TheLemonMan, damn you did a lot of work in this PIE patch
<andrewrk> I also didn't realize you already had a viable workaround for lack of language support for weak externs
<TheLemonMan> you can do a lot of weird shit with a block of comptime asm heh
demizer has joined #zig
<andrewrk> TheLemonMan, how do you think the logic here should change? https://github.com/ziglang/zig/blob/98d5bfbd4d21e99363a0a68ef5a0d0104c302ecb/src/link/Elf.zig#L1418-L1430
<andrewrk> I made `self.base.options.pie == true` when target_util.requiresPIE is true
<andrewrk> in your patch you have it only if the link_mode is .Static
<andrewrk> hm I think I know the answer
<TheLemonMan> yeah, I focused on static PIE
<andrewrk> I'll throw up a PR if you want to have a look
<TheLemonMan> sure, I'll have a look in the morning
aerona has joined #zig
riba has quit [Ping timeout: 256 seconds]
<TheLemonMan> wee, more tests passing on FreeBSD
<andrewrk> nice
frmdstryr has quit [Ping timeout: 260 seconds]
wilsonk has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<pixelherodev> Nice wor - oh you're gone :(
<pixelherodev> Still, nice work!
wootehfoot has quit [Read error: Connection reset by peer]
wilsonk has quit [Quit: Leaving]
wilsonk has joined #zig
moinstar has quit [Ping timeout: 240 seconds]
moinstar has joined #zig
frmdstryr has joined #zig
GuerrillaMonkey has quit [Ping timeout: 256 seconds]
Xavi92 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
kristoff_it has quit [Ping timeout: 240 seconds]