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/
a_chou has quit [Remote host closed the connection]
a_chou has joined #zig
msingle has quit [Ping timeout: 272 seconds]
msingle has joined #zig
a_chou has quit [Ping timeout: 272 seconds]
a_chou has joined #zig
a_chou has quit [Ping timeout: 260 seconds]
ryuukk_ has joined #zig
ryuukk__ has quit [Read error: Connection reset by peer]
a_chou has joined #zig
Snetry has quit [Quit: left Freenode]
Snetry has joined #zig
ryuukk_ has quit [Read error: Connection reset by peer]
msingle has quit [Ping timeout: 265 seconds]
jabb has quit [Quit: WeeChat 2.9]
msingle has joined #zig
kristoff_it1 has quit [Ping timeout: 272 seconds]
ryuukk_ has joined #zig
lltt has quit [Ping timeout: 264 seconds]
adamkowalski has joined #zig
<adamkowalski> is there something like putNoClobber for AutoHashMap that doesn't assert that it's not contained, and instead returns and error if it already exists
adamkowalski has quit [Quit: Lost terminal]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
a_chou has quit [Quit: a_chou]
<pixelherodev> I'd have answered if you stuck around for another two minutes...
<pixelherodev> (well, six, but still)
earnestly has quit [Ping timeout: 258 seconds]
_whitelogger has joined #zig
msingle has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 260 seconds]
lltt has joined #zig
radgeRayden has joined #zig
<justin_smith> pixelherodev: so for those following along at home, what's the answer?
<Nypsie[m]> Probably by using getOrPut() and return an error yourself if it was found
cole-h has quit [Ping timeout: 258 seconds]
AceNovo has quit [Remote host closed the connection]
knebulae has quit [Ping timeout: 256 seconds]
frett27 has joined #zig
knebulae has joined #zig
frett27 has quit [Ping timeout: 272 seconds]
keegans has quit [Remote host closed the connection]
omglasers2 has joined #zig
dddddd has quit [Ping timeout: 240 seconds]
earnestly has joined #zig
supercoven has joined #zig
supercoven has quit [Max SendQ exceeded]
supercoven has joined #zig
supercoven has quit [Max SendQ exceeded]
supercoven has joined #zig
osa1 has joined #zig
msingle has joined #zig
FireFox317_ has joined #zig
frett27 has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
msingle has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 260 seconds]
msingle has joined #zig
frett27 has quit [Ping timeout: 246 seconds]
msingle has quit [Ping timeout: 240 seconds]
lltt has quit [Ping timeout: 265 seconds]
m4r35n357 has joined #zig
<m4r35n357> hi all! looking at zig translate-c, main example works, so I tried my own code. First two functions OK, but third fails because: tsm-test.c:3:10: 'stdio.h' file not found
<m4r35n357> adding stdio to main example is ok
<m4r35n357> my functions are here: https://pastebin.com/d6ECgvnG
<m4r35n357> any ideas?
<m4r35n357> I put stddef in my own code because I wanted to see that it worked OK outside main example
<ifreund> m4r35n357: pass -lc to zig translate-c
<ifreund> (i'm not sure why this isn't default, you could open an issue)
frett27 has joined #zig
<ifreund> also be aware that it's primarily targeted at translating header files not full codebases
<m4r35n357> ifreund, OK cheers that cured the error. I didn't get the header bit from the docs "a gradual transfer from C to Zig within a codebase is a supported use case." The example here https://ziglearn.org/chapter-4/ certainly is not a header ;)
<m4r35n357> I am attempting to doing this one function at a time until I get something that runs
<m4r35n357> do
<omglasers2> is the if here https://pastebin.com/DTXD4Mcj guaranteed to be done at compile-time because the parameter is comptime?
<ifreund> yes it definitely is supported, I was just saying that most of the development focus has been towards translating headers for @cImport()
<ifreund> omglasers2: yes
<ifreund> in general zig will evaluate as much as it can at comptime
<m4r35n357> ifreund, OK cheers for that I will continue bit by bit for the time being
haliucinas has quit [Quit: leaving]
ask6155_ has joined #zig
<ask6155_> Hello!
<omglasers2> ifreund, thanks; related to this, should I expect @typeInfo and @TypeOf will always be evaluated at compile-time?
<ifreund> omglasers2: yep, they deal with types as values which can only be done at comptime
SimonNa has quit [Read error: Connection reset by peer]
<m4r35n357> ifreund, OK the code no longer gives a compile error, but I get "TODO. Unable to dump stack trace: debug info stripped. Aborted" with build-exe, build-lib and run subcommands. The "TODO" bit sounds a bit fatal. Is there any hope or should I stop here?
haliucinas has joined #zig
TheVector1991 has joined #zig
ask6155_ has left #zig [#zig]
marnix has quit [Ping timeout: 260 seconds]
<ifreund> it's probably some small edge case, could I see the code?
marnix has joined #zig
<ifreund> unfortuneatly the stage1 compiler isn't the greatest :/ stage2 is coming along nicely though
jjsullivan has quit [Ping timeout: 260 seconds]
<m4r35n357> ifreund, was that for me? if so https://pastebin.com/d6ECgvnG
<omglasers2> ifreund, thanks, was expecting it to be comptime
TheVector1991 has quit [Remote host closed the connection]
dddddd has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<ifreund> m4r35n357: yeah, I'd probably just manually translate this code. the generated output isn't very good code and you'd end up rewriting basically all of it to be idiomatic anyways :/
<m4r35n357> ifreund, TBH I tried the translation as a last resort, can't find enough info in the docs to do it manually (not really expert in c, never mind zig!), so I think I'll try again in a few months. Thanks very much for your help!
<ifreund> no problem!
kristoff_it1 has joined #zig
ur5us has joined #zig
osa1 has joined #zig
g-w1 has quit [Quit: WeeChat 2.3]
g-w1 has joined #zig
xackus has joined #zig
frett27 has quit [Ping timeout: 256 seconds]
tines9 has quit [Ping timeout: 260 seconds]
tines9 has joined #zig
msingle has joined #zig
ur5us has quit [Quit: Leaving]
donniewest has joined #zig
ask6155_ has joined #zig
ask6155_ has left #zig [#zig]
ask6155_ has joined #zig
<ask6155_> hello!
<FireFox317_> ask6155_, hello!
ask6155_ has left #zig [#zig]
<FireFox317_> bye :(
ask6155_ has joined #zig
ask6155_ has left #zig [#zig]
ask6155_ has joined #zig
ask6155_ is now known as beans
beans has quit [Quit: beans]
beans has joined #zig
beans has quit [Client Quit]
burkac has joined #zig
ifreund has quit [Ping timeout: 260 seconds]
ifreund has joined #zig
<WilhelmVonWeiner> http://ix.io/2AV4
<WilhelmVonWeiner> I'm sure this used to compile on 0.6.0_0 or _1 but after upgrading to _2 I get an error on line 20
<WilhelmVonWeiner> expected error union type, found 'void'
<WilhelmVonWeiner> if anyone can see my issue please help. Thanks!
<omglasers2> you should: 1) make cwd var instead of const on line 10; 2) remove the _ = from _ = cwd.close() on line 23 because close() returns void; 3) remove the try from line 20 because you already catch the error with catch return 1;
ask6155 has joined #zig
<ask6155> aah finally my nick works
layneson has joined #zig
xackus has quit [Ping timeout: 258 seconds]
xackus has joined #zig
layneson has quit [Ping timeout: 265 seconds]
<travv0> is the merging/inference of error sum types a zig invention? i just started playing with zig and honestly that's one of the most exciting parts of it for me
<ifreund> zig's the only language I know of that takes this approach at least
<companion_cube> it's not very different than checked exceptions
<companion_cube> doing it with values is new, afaik
<omglasers2> I remember a video with Herb Sutter about the future of c++ where he talked about a similar approach as an alternative to c++ exceptions (using try at the call site etc.), hope I'm not confusing things though, so maybe it will be adopted by other languages
<WilhelmVonWeiner> omglasers2: compiles now. Thanks
radgeRayden has quit [Remote host closed the connection]
stro has joined #zig
<WilhelmVonWeiner> is this a compiler bug? http://ix.io/2AVs
<WilhelmVonWeiner> in this code: http://ix.io/2AVt
<wilsonk> not a compiler error. You are getting a race condition (ie. bad file descriptor) when calling os.close
<wilsonk> not sure how the cwd gets closed prematurely, but I think that is the problem. Maybe the cwd.openFile call fails and closes the handle to cwd? Some one with more experience probably has to weigh in on that ;)
<stro> Is there a way to define a struct that initializes internal members at compile time with self-referential pointers? e.g. similar semantics to LIST_HEAD_INIT: https://github.com/torvalds/linux/blob/master/include/linux/list.h
<WilhelmVonWeiner> wilsonk: this was also happening with the args.nextPosix() loop commented out
<wilsonk> hmm, sorry, I am not familiar enough with cwd to be sure what is going on there...hopefully someone else will chime in
Ondingen has joined #zig
<Ondingen> Is it possible to pass flags to the linker through build.zig? Or some other alternative to passing -nodefaultlib:libc and -safeseh:no
<marler8997__> For those interested in Windows, I've got an initial implementation of my autogenerated Zig windows bindings, along with a concrete set of Goals for this project: https://github.com/marler8997/zig-os-windows
skuzzymiglet has joined #zig
ryuukk_ has quit [Ping timeout: 260 seconds]
<Ondingen> marler8997__ useful, thanks!
<ifreund> wilsonk: you don't close the cwd
<ifreund> WilhelmVonWeiner: ^
<WilhelmVonWeiner> ifreund: I do, line 11
<WilhelmVonWeiner> defer cwd.close();
frmdstryr has joined #zig
<ifreund> don't do that
<WilhelmVonWeiner> ohhh
<WilhelmVonWeiner> i see
<ifreund> it will always give you EBADF
<WilhelmVonWeiner> why's that?
<ifreund> it's how the kernel works?
<WilhelmVonWeiner> lmao tyvm
<WilhelmVonWeiner> appreciated
<ifreund> I'll try and find the man page
xackus has quit [Ping timeout: 258 seconds]
<g-w1> does anyone know how to get the linux programmers manual on arch linux. i try man 2 open and it doesn't work
<WilhelmVonWeiner> I see it in the docs now. "Closing the returned Dir is checked illegal behavior.", must've missed that initially
<ifreund> g-w1: iirc there's a blurb about man pages in the install guide on their wiki
<g-w1> yeaah
<g-w1> its just pacman -S man-pages
<g-w1> thanks
hnOsmium0001 has joined #zig
ryuukk_ has joined #zig
<ifreund> WilhelmVonWeiner: openat(3) has some info
<WilhelmVonWeiner> cheers!
<ifreund> the cwd fd isn't a real fd, it's just a special value you can pass to openat(3)
<ifreund> i.e. doing other normal fd things on it is invalid
heitzmann has left #zig ["The Lounge - https://thelounge.chat"]
<ryuukk_> one thing that has been a little annoying is having to type self: *MyStruct, all the time for functions, i feel like it is redundant and makes functions larger in width for no real benefits
stro has quit [Remote host closed the connection]
<frmdstryr> How can I run zig's stage1 tests?
<ifreund> ryuukk_: how else would you like to pass the pointer to functions? implicitly?
<ifreund> frmdstryr: iirc it's just zig build test-stage1
<ifreund> er, just read zig build --help
<ryuukk_> ifreund: i don't know really know, but it feels noisy https://i.imgur.com/l65c18j.png
<ifreund> there are lots of different tests
<frmdstryr> Ah ok, I see, just want the compile tests
<ifreund> ryuukk_: it feels explicit
<frmdstryr> thanks!
<ryuukk_> ifreund: yes you are right, it's the right word
<ifreund> note that you can do `const Self = @This();` if you want to avoid retyping the name of the struct
<ifreund> explicit is good
<ryuukk_> can use self: *@This() ?
<ryuukk_> well i don't mind having to write the full type
<ifreund> sure
<ifreund> @This() returns the type of the enclosing struct, so you can use it anywhere a type is expected
<g-w1> you can also do const Self = @This(); in the struct body and then you have it for all the functions
<g-w1> oh didn't see that was said already
ask6155 has left #zig [#zig]
<ifreund> :P
Akuli has joined #zig
mmohammadi981266 has joined #zig
cole-h has joined #zig
lltt has joined #zig
wootehfoot has joined #zig
mmohammadi981266 has quit [Ping timeout: 260 seconds]
mmohammadi981266 has joined #zig
wootehfoot has quit [Ping timeout: 272 seconds]
frett27 has joined #zig
wootehfoot has joined #zig
mmohammadi981266 has quit [Ping timeout: 256 seconds]
mmohammadi981266 has joined #zig
<g-w1> does llvm take a long time to compile
<g-w1> i am on arch linux but have nix installed. if i install https://search.nixos.org/packages?show=llvm_11&query=llvm_11&from=0&size=30&sort=relevance&channel=unstable#disabled llvm_11 through it will cmake pick it up?
<g-w1> i am kinda stuck on zig development
xackus has joined #zig
FireFox317_ has quit [Ping timeout: 272 seconds]
mmohammadi981266 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
<g-w1> i might just have to build it from source
<g-w1> huh, it found llvm but not clang
<g-w1> can i point it to the llvm prefix
<g-w1> my libraries are in ~/.nix-profile/lib, but how can i point cmake to that?
<frett27> g-w1: there is bootstrap to help
<g-w1> wdym
<g-w1> in the zig-bootstrap repo?
<g-w1> thanks
<g-w1> well i already have the llvm libs
<frett27> it recompiles the needed llvm components (.. clang, .. and zig)
<g-w1> i just need to point cmake to them
<g-w1> I dont really wanna recompile
<frett27> i did that this morning, moving to llvm11
<frett27> AND recompile zig
<frett27> i got the ubuntu package names
<frett27> if it helps
<g-w1> im on arch :) but thanks anyways
<frett27> the cmake works nicely then
<g-w1> i think my llvm is working now. i just need clang
<g-w1> cool
<frett27> there is also lld, and C++ libs abi
<g-w1> ok
<frett27> zig is then 10 mins away
<g-w1> cool! im trying a slightly different route using nix but ill try that if my way doens't work. thanks
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<frett27> g-w1: nix seems cool, what the benefits regarding arch, it seems to have the same objective ?
<g-w1> really the only reason im trying it is that it has llvm11
<g-w1> it basically allowss you to keep your whole system configuration in one place
<g-w1> so its nice for develeopment
<g-w1> where you have lots of versions of packages that conflict
<frett27> ok, i just see https://github.com/ziglang/docker-zig
<g-w1> but it still didn't work
<g-w1> ill just wait a few weeks or install nixos. whichever comes first
<frett27> what's the trouble ?
<g-w1> its getting llvm 11 but the clang libs are clang 7
<g-w1> im not that good at nix yet
<g-w1> i dont know how to do package versions
<g-w1> i got it.
<g-w1> nice
<g-w1> i had to do clang_11
xd1le has joined #zig
SimonNa has joined #zig
<g-w1> if anyone knows anything about nix and would provide me with a default.nix file for development that would be great. i still cant get it to work. thanks :)
<tdeo> g-w1: i use `with (import <nixpkgs> { }); (zig.overrideAttrs ({ ... }: { hardeningDisable = [ "all" ]; })).override { llvmPackages = llvmPackages_11; }` as my default.nix
<g-w1> ok
<frett27> tdeo: thank's, it works for me
<g-w1> frett27: you installed nix?
<g-w1> tdeo: thannks sooo much!!! i tried for a VERY long time and now it works
<tdeo> np
<frett27> g-w1: yes ! :-)
squiddy has joined #zig
osa1 has quit [Quit: osa1]
cole-h has quit [Ping timeout: 272 seconds]
frmdstryr has quit [Ping timeout: 256 seconds]
ryuukk__ has joined #zig
ryuukk_ has quit [Ping timeout: 260 seconds]
frmdstryr has joined #zig
marnix has quit [Ping timeout: 260 seconds]
<waleee-cl> ryuukk__: do instead https://ziglang.org/documentation/master/#This ?
<waleee-cl> oops I hadn't scrolled down
Dominic[m] has joined #zig
supercoven has quit [Ping timeout: 240 seconds]
burkac has quit [Remote host closed the connection]
<Dominic[m]> I'm getting errors like https://bin.disroot.org/?5de075bde2851074#Ftn1mQ379nEu81MMbxt1Pu54fjWXbPKoqcdYpWnzSFbo when I use c macros from zig. Are they supposed to work, if so, what am I doing wrong in this case?
DonnieWest[m] has joined #zig
ur5us has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
notpiika has joined #zig
<notpiika> stupid question - but how would i get the absolute path that a Dir points to?
<notpiika> can't seem to find any field or method that can do this...
<Dominic[m]> Ah, I think I figured it out by myself. The generated cimport is using G_CONNECT_SWAPPED which should be .G_CONNECT_SWAPPED to indicate it's from the enum. I guess that's a bug then.
<Dominic[m]> https://github.com/ziglang/zig/issues/5656 is this the bug? Or is mine separate?
skuzzymiglet has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 244 seconds]
<g-w1> notpiika: maybe use std.fs.realpath with pathname as "." as a workaround
ryuukk_ has joined #zig
frmdstryr has quit [Ping timeout: 256 seconds]
ryuukk__ has quit [Ping timeout: 264 seconds]
frmdstryr has joined #zig
donniewest has quit [Quit: WeeChat 2.9]
frett27 has quit [Ping timeout: 240 seconds]
Akuli has quit [Quit: Leaving]
<g-w1> im getting this weird error when trying to build on debian under nix-shell /home/jacob/repos/zig/build/zig0: error while loading shared libraries: libffi.so.6: cannot open shared object file: No such file or directory
squeek502 has joined #zig
<g-w1> it is trying to run zig0
squiddy has quit [Ping timeout: 245 seconds]
xackus has quit [Quit: Leaving]
xd1le has quit [Ping timeout: 260 seconds]
<tdeo> g-w1: sounds like a nix-on-non-nixos issue i think
<g-w1> oh
<g-w1> yeah i was using nix because debian is behind
<g-w1> ill try zig bootstrap
<g-w1> its a server
<pixelherodev> g-w1: have you tri - ah nevermind thenn
<pixelherodev> (my suggestion isn't fit for a server, ignore me)
<g-w1> i mean its in my house just running all the time
<pixelherodev> Have you considered using unstable?
<pixelherodev> I abhor Debian these days, but back in the day I used that regularly
<g-w1> ok
<g-w1> ill try zig-bootstrap first
jjsullivan has joined #zig
<g-w1> I am getting this when try to bootstrap ./build: 16: ./build: Bad substitution
xd1le has joined #zig
<g-w1> nvm it needs bash
<pixelherodev> g-w1: are you sure?
<pixelherodev> Ahh, I see them, never mind
<g-w1> yeah. i had to change #!/bin/sh to /bin/bash
* pixelherodev nods
<pixelherodev> Idea: we could redo it to require three separate arguments, arch, platform, and abi, instead of taking the full triple?
<pixelherodev> That'd avoid using bashstitutions to extract them
<g-w1> good idea
<pixelherodev> and the replacements can be replaced (pun intended) with conditionals
<pixelherodev> "if macos then Darwin"
<g-w1> doesn't posix have sed
<g-w1> or is that gnu
<earnestly> sed is POSIX, sure
<earnestly> GNU does add a feature or two on top of what POSIX defines
<pixelherodev> but it's also not something that requires sed.
<g-w1> yeah ig
<pixelherodev> Heck, if anything, it'd be more correct with conditionals, wouldn't it?
<pixelherodev> Since e.g. `linuxa` is an invalid target anyways, we don't care if it doesn't turn into Linuxa
<earnestly> pixelherodev: POSIX parameter expansion can cut up a triple quite easily as each part cannot contain '-'
<earnestly> When it comes to shell scripting though, unless you're a #bash regular, good luck doing anything well
<andrewrk> how are everyone's projects doing post #6250 merge? anyone still waiting on regressions to be fixed?
<pixelherodev> I haven't... actually... well
<pixelherodev> I haven't touched any of mine since then :P
<earnestly> pixelherodev: If you don't already, use shellcheck as a minimum
<pixelherodev> ... it has... 45 dependencies...
<pixelherodev> why
<pixelherodev> Just this once I'm installing the binary package lol
<earnestly> pixelherodev: Haskell, *shrug*
<pixelherodev> earnestly: wait, the parameter expansion is POSIX?
<pixelherodev> Then why would it need bash???
<earnestly> pixelherodev: bash adds / and // (and /?, //?), but the rest is POSIX
<pixelherodev> Ahh, it's *only* the replacement
<pixelherodev> Yeah, just noticed
<pixelherodev> All that needs to be changed is // -> conditional
<earnestly> shellcheck will warn you of any non-posix constructs when using a sh shebang
<earnestly> It's a good baseline that tries to avoid opinion, but it's a tool that came from #bash, so it embodies quite a lot of wisdom as it stands
<earnestly> So in essence; use wooledge and avoid google/stackoverflow for shell scripting advice because it's almost all wrong
<earnestly> (Don't use set -e either)
ur5us has joined #zig
<pixelherodev> earnestly: thanks!
<earnestly> pixelherodev: conditional here would be a case statement
<pixelherodev> What's wrong with `set -e`?
<pixelherodev> And yeah, I don't ever use SO
<earnestly> pixelherodev: /query greybot set-e
<pixelherodev> Man pages, official docs, and experimentation, in that order :P
<pixelherodev> earnestly: ?
<earnestly> What's confusing?
<pixelherodev> Ahh, there's a bot that responds to dms?
<earnestly> Sure, all bots are like that
<earnestly> "DM" heh
<earnestly> pixelherodev: You may like /query greybot varcap
<travv0> anyone willing to do a quick code review of a couple advent of code days i did in zig? i don't really have much experience doing stuff in low level languages so i want to make sure i'm not doing anything too dumb right off the bat. https://github.com/travv0/AdventOfCode2016/blob/master/day01/src/main.zig https://github.com/travv0/AdventOfCode2016/blob/master/day02/src/main.zig
<pixelherodev> earnestly: you know what I mean :P
<pixelherodev> Yeah, I'm going to send patches for zig-bootstrap shortly
<pixelherodev> earnestly: set -e is actually fine here
<earnestly> Yeah, you and a thousand others say the same thing
<earnestly> It is what it is
<pixelherodev> earnestly: look at the script and say that ;)
ryuukk_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<ifreund> andrewrk: my last wish post #6250 would be a way to expose full custom output filenames using -femit-bin=foo in the zig build system
<andrewrk> ah right
<ifreund> I had a look at implementing it but didn't find a good way to do it given that -femit-bin=foo copies the file back out of the cache dir
<ifreund> not really a release blocker, but you asked :P
<andrewrk> fair enough :)
<andrewrk> ok I'm going to keep tackling PRs and if I get down to yours that is revelant to this topic I'll see if I can solve the use case for ya
<ifreund> alright cool
<ifreund> I could also just use a Makefile for this project tbh, but I'd rather not
<andrewrk> I wouldn't be offended if you did but I do think if you force yourself to use zig build it will cause the right kind of pressure we need to make sure this use case is handled satisfactorily
<ifreund> my thoughts exactly
<ifreund> I was also planning on using it as the first zig project packaged for void linux to test things out
<earnestly> Oh that will be interesting. Both Go and Rust are excructiating to integrate anywhere those psuedo-package-managers don't quite expect
<earnestly> And that's not merely lacking "support" for distributions, that's just straight up bad design
<andrewrk> I think it's something more subtle - a power struggle between package maintainers who want to patch packages to make the user experience on that system better vs application developers who want to use language specific package managers to make the user experience consistent across all systems
<andrewrk> it's interesting because both parties have the user experience in mind, yet it is still a power struggle
<andrewrk> zig is caught in the middle of this, just like those other languages, we are not exempt from this
<earnestly> They don't want to patch anything
<andrewrk> but I am optimistic that we can try to address both parties' concerns, rather than just ignoring the use cases and needs of system package maintainers
<ifreund> it's mostly debian that patches stuff
<earnestly> They rarely have to patch things because language build system/package managers are outright broken. The Ada gprbuild is a good example
<ifreund> arch and void don't much
<andrewrk> what do arch and void do for npm applications? do they force nodejs dependencies to be in separate arch/void packages, or do they allow "vendoring" node_modules/ ?
<earnestly> What makes Rust and Go painful is how they expect to not only find their packages, but what they can and cannot link with
<ifreund> anyhow, my project wouldn't be a full test as we don't have a zig package manager yet of course and the project has no zig dependencies other than the std
<earnestly> A good example of how to do things as a language is python, oddly
<andrewrk> yeah that would be the "hello world" equivalent of difficulty packaging
<earnestly> It uses the filesystem as a package manager
<andrewrk> the python experience is horrible for the application developer
<andrewrk> but it's nice for the system package maintainer
<andrewrk> nodejs is the exact opposite
<ifreund> andrewrk: not familiar with packaging npm stuff really, but void at least lets rust/go/haskell packages vendor all their stuff using their respective package managers
<earnestly> andrewrk: If you're curious, Arch does have a wiki: https://wiki.archlinux.org/index.php/Go_package_guidelines - although none for npm. Some which use npm do: npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/$pkgname-$pkgver.tgz
<earnestly> andrewrk: What makes python horrible?
<andrewrk> dependencies on system installed packages, making it very difficult to have a consistent development environment
<earnestly> Python doesn't require that
<ifreund> earnestly: you need to deal with virtual environments to do the stuff that e.g. cargo lets you do without
<andrewrk> yeah virtual environments is a hack
<andrewrk> like setting global variables to pass parameters instead of just passing a parameter
<earnestly> ifreund: You really don't need those but, well, that's the path people have taken
<ifreund> I'd say they've taken the path of least resistence, the alternatives are worse :P
<companion_cube> how else do you do if you have two projecs with different requirements?
<companion_cube> the problem with system-wide libraries is that they're, well, global
<andrewrk> project-local dependency management
<andrewrk> zig package manager won't even support installing packages globally
<companion_cube> yes, I mean, wrt python
<andrewrk> ahh
<ifreund> yeah, gloabal installation of anything is the job of the system package manager and the system package manager alone
<andrewrk> glad we're on the same page there :)
<andrewrk> but do you see my point about how the global package installation of python actually does make life easier for system package maintainers (at least debian)
<companion_cube> python follows C (well, "modern" C with pkg-config)
<earnestly> The only thing zig has to do is not make assumptions about the locations of things. With python one can isolate entire sets of libraries through PYTHONHOME
<earnestly> C has -I and -L
<earnestly> andrewrk: If you're interested, GoboLinux wrote up a paper comparing different package management approaches and explains their idea of using the filesystem itself as a package manager
<ifreund> earnestly: I'd be interested
<earnestly> That is, instead of "pm list-installed", theirs would be: ls /packages/installed, heh
<companion_cube> it's still global, then?
ur5us has quit [Ping timeout: 260 seconds]
<companion_cube> tbh I'm not sure what the point of having *libraries* installed on a distro is (except for .so)
<companion_cube> if you're developping, it's just better to have per-project dependencies
<companion_cube> if you're a user, well, programs is what matters, and they should link to libraries as statically as possible imho
<earnestly> Closest thing to plan9 linux has so far, heh
<ifreund> earnestly: thanks
<companion_cube> yay, more magic?
<earnestly> There's no magic, that's the point
<earnestly> If you want magic, that's nix
<companion_cube> the magic is in the filesystem, isn't it?
<earnestly> If that's your threshold, then everything is magic
<companion_cube> I mean, is it based on a union fs or something like that?
<earnestly> Runner uses overlayfs. Plan9 had bind by default
<companion_cube> yeah, /System/Index seems to be magical
<companion_cube> oh well
<earnestly> There's a degree of complexity needed to express anything, the purpose is to not be more complex than necessary
<earnestly> But not to be needlessly simple either as that ends up producing more code, more complexity, as a result of people fighting with it
<earnestly> Everything is tradeoff, sadly
<companion_cube> I mean, it's an interesting idea
<companion_cube> kind of bypassing the problem
<earnestly> And to be practical you're stuck with working with what you've got
<earnestly> I'm not suggesting any of this to zig, it's not zig's place to concern itself with this. What zig has to do is be humble in its design so that it can be used in all these manifold environments
ryuukk_ has joined #zig
<earnestly> (And it's easier than people think; the main thing is not making assumptions, or allowing the user to tell zig where things are)
<earnestly> Not many people seem to take seriously the reasons why C has remained so dominant, for this long. Things like actual stability, "Better the Devil you know" - Holtzmann when asked why NASA still uses C. Things like the flexibility to be adapted to anything; almost any build system can be used to integrate C's build flow
<earnestly> I can't do the same with Rust, or Go. I can't easily use `make' to build Ada files
<earnestly> Let along wanting to integrate it into anything newer like bazel or ninja
<earnestly> (One is forced to use the language's NIH system instead because it gets tied up with it and its assumptions.)
<companion_cube> earnestly: C typically has a special status in distros, which also explains why it works so smoothly
<earnestly> companion_cube: There's nothing about C that makes it special
<companion_cube> you mean, like the presence of /usr/include ? :D
<earnestly> Yes
<companion_cube> no, the *distros* make C special
<companion_cube> they're revolving around C in the way they handle libraries
<companion_cube> other languages are just an imitation of that
<earnestly> They don't. Compilers like gcc/clang have a set of default locations where they look for libraries which is set at compiletime
<earnestly> There's nothing special about C, that distros install their libraries for various things is because bootstrap tooling needs it
<earnestly> The entire thing can be controlled through -I and -L flags
<companion_cube> I'm not denying that
GrooveStomp has quit [Remote host closed the connection]
<companion_cube> just pointing out that I have /usr/lib and /usr/include, but not /usr/ocaml/ for example
<earnestly> Does rust have default search locations?
<earnestly> Nope
<companion_cube> no, because it doesn't even try :)
<earnestly> companion_cube: I do, it's in /usr/lib/ocaml though
<earnestly> And ocaml is a very good about it too
<companion_cube> yep, a subdirectory, as it's an afterthought
<g-w1> is there a development guide for the zig compiler like this? https://rustc-dev-guide.rust-lang.org/index.html im struggling to understand that much about the compiler. if there is not a guide, i could just brute force read the code and then maybe write one.
<companion_cube> and all my .cmi are in /usr/lib and not /usr/include
<earnestly> companion_cube: You want /usr/lib/c?
<companion_cube> I don't want anything, I'm just pointing out that C has a special treatment :p
<earnestly> If so, you can have it
<earnestly> Nothing about C prevents it
<earnestly> Or even distros, the compilers can integrate with it no problem
<companion_cube> maybe some day we'll have /usr/rust indeed, with precompiled libraries, so it would all compile faster
<earnestly> Can't do that with Go or Rust
<earnestly> (And many others)
<g-w1> ive never worked on a codebase this big before. do you have any suggestions on reading it?
<tdeo> the zig part or the c++ part?
<g-w1> zig
<g-w1> i actually found the c++ easier to read. idk y. ive never written very much zig or any c++
<g-w1> maybe its because similarity to rust which I have written a bunch
<companion_cube> earnestly: even with OCaml, it supposedly works with system libs, but no one uses that cause it plays badly with opam
<companion_cube> I don't really know a language that has both a language-level package manager and a good story wrt. system libraries
<earnestly> companion_cube: I do and it works beautifully. I don't understand people who fall for pits like opam and virtualenv and co.
<companion_cube> probably because it's hard to be split brained
<companion_cube> so you don't use opam? woah
<earnestly> No, I just use my package manager
<earnestly> That's why it's there
<companion_cube> did you package all the dependencies you use then?
<earnestly> Sure, it's a doddle
<companion_cube> I'd be curious to see a list
<earnestly> Start locally though
<earnestly> companion_cube: Not much: https://0x0.st/iDXe.txt
<earnestly> distro already has a bunch
<earnestly> Enough to get things like why3, frama-c, spark, etc. building
<g-w1> maybe its just because Ive never really done that much with code written by anyone other than myself. i have put it on my kindle, so ill just read it a bunch
<earnestly> companion_cube: Although the new Dune thing is once again causing problems
<companion_cube> right, that's not much
<companion_cube> (you do smt stuff? we should talk :p)
<companion_cube> I'm surprised, dune is among the best thigns that happened to OCaml in the last few years
<companion_cube> maybe we should move to #ocaml or something though
<earnestly> I hate it ;D
<earnestly> But it has been a long time since I tried to wrangle it so I've forgotten the specifics
<earnestly> companion_cube: Looking at some newer examples it seems fine, perhaps the project using it was doing something wrong (which is possible with all build systems)
<earnestly> Looks nice even
<companion_cube> yes, also it takes care of a lot of things ocamlbuild sucked at (like .cmt or .cmxs files)
<earnestly> All of that, though good, is incidental to how well it inegrates. The borders/environment is often ignored, even by formally proven systems, which end up with bugs (although much fewer) for stupid reasons such as assuming the network is reliable, or that they'll never get a half completed packet
<earnestly> integerates* This is really my only concern with zig. Language build systems/managers, I understand why they exist, but so often they forget the rest of the world and become impossible to use outside of a narrowly defined role
<companion_cube> for zig it's pretty clear it must play well with at least C
<companion_cube> for mixed C projects
<earnestly> That was impressive to see
<earnestly> zig does pretty much everything right and I see a lot of people who use C quite happy with it