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/
nvmd has quit [Quit: Later nerds.]
nvmd has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
g_w1 has quit [Ping timeout: 260 seconds]
g_w1 has joined #zig
squeek502 has quit [Remote host closed the connection]
ur5us has joined #zig
radgeRayden has quit [Ping timeout: 272 seconds]
earnestly has quit [Ping timeout: 246 seconds]
msingle has quit [Ping timeout: 264 seconds]
Kingsquee has joined #zig
* daurnimator is watching twitch vod now
<daurnimator> andrewrk: with new build process; the process you showed off would only be for when targeting native? it would have to be different if trying to cross-compile zig....
<pixelherodev> daurnimator: which process is that?
<lunamn> watching it too, attempted to build zig now, but stage1's resource usage came on full steam to lock up the computer lol
<leeward> Needs more swap.
<leeward> Also, add an hour for every GiB of swap.
<leeward> Wow, 0.7 this month?
<leeward> Nifty.
<andrewrk> it may be delayed again if LLVM 11 doesn't release within 7 days
<andrewrk> and they have 3 open bug reports still
kristoff_it has quit [Ping timeout: 240 seconds]
<lunamn> andrewrk: might have found some bug, got zig from the downloads page, but didn't fix the lib directory, there weren't any (linked to my local repo later, since that's what I actually want in the end), it entered an infinite loop of attempting to open "lib/zig" but failing, might be good as an standalone issue?
<andrewrk> lunamn, are you asking if you should open an issue?
<lunamn> maybe, I don't know if it's trivial enough that it should go here, or if it should get a dedicated issue
<andrewrk> that will probably be best since I have a lot going on and will probably forget
<lunamn> gotcha
<pixelherodev> I think I'm going to increase how much time I'm spending on the CBE
<pixelherodev> I really really want to make sure it doesn't hold back the re-bootstrap plan back. I do *not* like stage1 :P
<daurnimator> pixelherodev: the building libstage1; then using that to link the final zig executable
<daurnimator> ==> you'd have to build libstage1 for both the host and the target
<andrewrk> daurnimator, note the current plan includes https://github.com/ziglang/zig/issues/6378
nvmd has quit [Remote host closed the connection]
radgeRayden has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<pixelherodev> marler8997: not sure if your comment on #6378 has been addressed, but the fundamental issue (to me) with using CBE to regularly regenerate a "stage1" is that we would be trapped in a bootstrapping loop, effectively
<pixelherodev> Stage1 would be dependent on stage2 which would be dependent on stage1 etc
<pixelherodev> Arguably, that'd be fine, since the "stage1" then would be a finished "product." I'm not sure where I stand on that, to be honest.
<pixelherodev> I think being able to maintain a C-based compiler without a stage2 dependency is useful, I'm just not certain what the cost is
waleee-cl has quit [Quit: Connection closed for inactivity]
<leeward> That doesn't sound like a serious problem. A single code base makes up for a lot.
a_chou has quit [Quit: a_chou]
a_chou has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
msingle has joined #zig
msingle has quit [Ping timeout: 240 seconds]
_whitelogger has joined #zig
marnix has joined #zig
a_chou has quit [Quit: a_chou]
frett27 has joined #zig
jjsullivan1 has quit [Remote host closed the connection]
jjsullivan1 has joined #zig
mokafoli- has joined #zig
tracernz has quit [*.net *.split]
procnto has quit [*.net *.split]
gonz_ has quit [*.net *.split]
dingenskirchen has quit [*.net *.split]
signop_ has quit [*.net *.split]
Marrikulus has quit [*.net *.split]
mokafolio has quit [*.net *.split]
euantorano has quit [*.net *.split]
vegai has quit [*.net *.split]
signop has joined #zig
mokafoli- is now known as mokafolio
vegai has joined #zig
gonz_ has joined #zig
euantorano has joined #zig
procnto has joined #zig
Marrikulus has joined #zig
dingenskirchen has joined #zig
osa1 has joined #zig
tracernz has joined #zig
frett27 has quit [Ping timeout: 256 seconds]
cole-h has quit [Ping timeout: 258 seconds]
radgeRayden_ has joined #zig
radgeRayden has quit [Ping timeout: 272 seconds]
marnix has quit [Ping timeout: 260 seconds]
<cr1901_modern> How do you declare a function to take a tuple (or return one)?
<cr1901_modern> https://ziglang.org/download/0.6.0/release-notes.html#Tuples-Added-Var-Args-Removed I found this, but it doesn't work as of last night
ur5us has joined #zig
earnestly has joined #zig
FireFox317_ has joined #zig
<FireFox317_> daurnimator, cross-compiling the zig compiler still works as before. I have been working on the zig-bootstrap script, and instead of building zig0 from a c++ codebase, we use a existing zig compiler from the host to build the zig1 compiler
azmr has joined #zig
<daurnimator> FireFox317_: it does mean that we have to actually compile a zig for the host
<FireFox317_> daurnimator, yes, but for cross-compiling we need that anyway, because we also use `zig c++` to build llvm for the target
<daurnimator> in zig-bootstrap we do that; but that wouldn't be a general thing.
<daurnimator> e.g. if you're building a zig debian package for a raspberry pi
<daurnimator> (from an x86_64 host)
<FireFox317_> hmm i see. yeah that requires a zig compiler indeed
<azmr> hey all, I'm looking at including Zig support in a dev tool I'm building. I was wondering what the options are for compiling Zig (and getting frontend/AST info) from my own application.Ideally this would be in the format of including Zig as a li
<azmr> (ah, shift+enter doesn't work on IRC)
<azmr> *library
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<azmr> I'm currently using Clang/LLVM libraries for C(++) support, and I know that Zig uses LLVM in the backend
<azmr> If there are other options for interop I'd also be open to them
<daurnimator> azmr: interesting. you would probably have to wrap the compiler into a library... we don't offer that out of the box; though I think it might be easyish
<azmr> Ah ok, thanks. Good to know what the current status is. I presume that I'd have to write the wrapper in Zig?
marnix has joined #zig
<azmr> I really like a lot of what Zig is going for but I have yet to actually write any
<fgenesis> compiler as library? i like the idea
<fgenesis> look where it's gotten llvm :D
<daurnimator> azmr: yeah. i'd essentially go into main.zig of the compiler and see what it does; then wrap that up in some exported functions
<azmr> daurnimator: thanks for pointing me in the right direction :D
Kingsquee has quit [Read error: Connection reset by peer]
Kingsquee has joined #zig
<FireFox317_> fgenesis, were you interested in a zig build for a rpi?
<FireFox317_> nvm, still debugging haha. I just put a binary on my rpi1, but running `zig build-exe hello.zig` catches a Illegal instruction
<daurnimator> FireFox317_: could be UBSAN
<FireFox317_> daurnimator, jup i'm guessing that is the case. I'm gdb'ing now
<FireFox317_> also because it happens in 'LLVM Emit Output"
<FireFox317_> jup 'llvm::DwarfExpression::addExpression', even llvm can't make sure they dont have undefined behaviour in their code -_-
<fgenesis> FireFox317_: for reference, my segfault was somewhere in zig code (had the zig symbols), and it dereferenced 0x1
<fgenesis> so nullptr somewhere
<FireFox317_> fgenesis, yeah i also fixed all the casts from u64 to usize
<FireFox317_> but its so annoying that llvm itself does not test their code for undefined behavior
<fgenesis> happens
<FireFox317_> jup, will try a build without ubsan
<fgenesis> at least with llvm you cn debug it
<FireFox317_> yeah open source :)
<fgenesis> fixing commercial closed-source stuff is so much harder
<FireFox317_> but i'm not gonna debug llvm haha
ky0ko has quit [Remote host closed the connection]
Xavi92 has joined #zig
Xavi92 has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
ky0ko has joined #zig
kristoff_it has joined #zig
skrzyp has quit [Ping timeout: 258 seconds]
Kingsquee has quit [Ping timeout: 260 seconds]
Kingsquee has joined #zig
msingle has joined #zig
dermetfan has joined #zig
mokafolio has quit [*.net *.split]
jjsullivan1 has quit [*.net *.split]
jmiven has quit [*.net *.split]
larme has quit [*.net *.split]
Miaourt has quit [*.net *.split]
mokafolio has joined #zig
Miaourt has joined #zig
larme has joined #zig
jmiven has joined #zig
jjsullivan1 has joined #zig
msingle has quit [Ping timeout: 260 seconds]
kristoff_it has quit [Ping timeout: 260 seconds]
Kingsquee has quit [Remote host closed the connection]
Xavi92 has joined #zig
kristoff_it has joined #zig
vegai has quit [Quit: leaving]
msingle has joined #zig
Xavi92 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Xavi92 has joined #zig
azmr has quit [Remote host closed the connection]
<Ristovski> Does Zig use fdata-sections/ffunction-sections when compiling in all the llvm deps? (not sure if it would make a difference if they are not being built as static libs first). I wonder if it could cause any size reduction
nvmd has joined #zig
<Ristovski> that along with flto usually completely obliterates the object sizes when compiling stuff with static libs
<Ristovski> (ofc, requires gc-sections linker arg for it to actually remove any unused data/code)
Xavi92 has quit [Remote host closed the connection]
nvmd has quit [Ping timeout: 240 seconds]
donniewest has joined #zig
dermetfan has quit [Ping timeout: 240 seconds]
marnix has quit [Ping timeout: 240 seconds]
nrdmn6 has joined #zig
idxu_ has joined #zig
idxu has quit [Read error: Connection reset by peer]
idxu_ is now known as idxu
tane has joined #zig
marnix has joined #zig
a_chou has joined #zig
layneson has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
layneson has quit [Ping timeout: 260 seconds]
Akuli has joined #zig
<marler8997> pixelherodev, what do you mean by "a bootstrap loop"?
frett27 has joined #zig
zippoh has joined #zig
<justin_smith> marler8997: reading what they said, it's a dependency loop, where each stage relies on the other
<marler8997> justin_smith, do you have an idea what they meant in this particular case by dependency loop?
<justin_smith> literally what they said made sense to me: the stage1 and stage2 each need the other to build?
<justin_smith> but I'll let them weigh in when they are around
<pixelherodev> pong
<pixelherodev> :)
<pixelherodev> Not that they directly need each other to *build*, but yeah
<pixelherodev> I'm starting to lean towards leeward's view to be honest
<pixelherodev> If you want a real reason why it's a bad idea, you'll need to ask Andrew, not me :P
<pixelherodev> I haven't thought about it all that much
<marler8997> I could be misunderstanding the requirement, but I don't see the need to manually support a C version of the zig compiler for bootstrapping if we have a C backend...?
<marler8997> oh you know what, I read through issue 6378 again...and I think I misunderstood what Andrew's proposal was. I think he's actually proposing exactly what I suggested
<marler8997> in other words, not maintaining a C version of the compiler, but utilizing the c backend to make a C version of the compiler available
<pixelherodev> marler8997: nope
<pixelherodev> He's proposing we do that *until 1.0*
<pixelherodev> at which point we start maintaining a C version separately
<pixelherodev> Based on that codebase
<marler8997> oh I see
<pixelherodev> See `Do #5246 (comment)`
<marler8997> why would we want to maintain the C version manually after 1.0 instead of just updating it using the C backend?
<pixelherodev> On that note, let me work on my schedule for the day - I can definitely get the open CBE PR fixed, and get to work on expanding the support further :)
hnOsmium0001 has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<marler8997> do we have a solution to access C struct definitions that are not typedefed from Zig?
<pixelherodev> marler8997: what do you mean?
<pixelherodev> extern structs?
<marler8997> including a struct definition using cImport
<pixelherodev> `extern struct` === guaranteed C ABI compatibility
<marler8997> that isn't typedefd
<pixelherodev> Ah, you mean translate-c?
<marler8997> I think so....
<pixelherodev> I think it should be fine as is?
<pixelherodev> `struct a{}` produces a file with `pub const a = struct_a`
ZigNewbie has joined #zig
<marler8997> ah you're right
Xavi92 has joined #zig
<pixelherodev> I mean yeah, I literally *just* tested it ;)
<ZigNewbie> When using zig build, how would I go ahead to see the arguments given to the linker (lld)?
<FireFox317_> ZigNewbie, `--verbose-link`
cole-h has joined #zig
g_w1 has quit [Ping timeout: 240 seconds]
<ZigNewbie> FireFox317_, thank you. However, that did not change the output. The reason I ask is that when attempting to compile a simple test zig file, I get the linker error "lld: error: Unable to find library for -lSystem", and Id like to get more information on how lld is called (and what lld executable is used) so I can fix it
<FireFox317_> ZigNewbie, okay. It probably is not outputting the information, because it is cached now and thus there is no need to call lld. So you should remove the zig-cache directory in the folder from which you are building.
<FireFox317_> Also it looks like you are doing stuff for macos? There are some specific options for macos: like -framework and -F[dir] which you might want to check out
g_w1 has joined #zig
<s-ol> can I @import something and the somehow merge the declarations into the containing scope?
<BaroqueLarouche> You want to use ´using namespace´
<pixelherodev> Only works on decls, not fields
Xavi92 has left #zig ["https://quassel-irc.org - Chat comfortably. Anywhere."]
<pixelherodev> For individual decls, you're explicitly and deliberately required to define them as e.g. `const a = b.a;`
<ZigNewbie> Removing zig-cache did not change output either. You are correct about macOS, however I think this isn't an issue with frameworks but I am not familiar enough with zig's build system to say that with certainty
<ZigNewbie> also, you meant that I should pass --verbose-link as in "zig build --verbose-link", right? :p
<pixelherodev> Hmm
<pixelherodev> ZigNewbie: try `--verbose`
<pixelherodev> > --verbose Print commands before executing them
<pixelherodev> --verbose-link is for debugging IIRC
<pixelherodev> As in, debugging the compiler itself
<FireFox317_> They asked for a way to look at lld command, you need --verbose-link for that
<FireFox317_> but weird that it doesnt print anything.
<ZigNewbie> To be clear, I am passing this as "zig build --verbose-link"
<FireFox317_> should work yes
<ZigNewbie> That's unfortunate
<FireFox317_> ZigNewbie, you might want to make a bit smaller and only use `zig build-exe` for example, because the build.zig adds another layer of abstraction
<pixelherodev> I think `--verbose` is the option for build.zig and `--verbose-link` is the option for `build-exe`
<pixelherodev> Or something along those li - oohhhhh right
<pixelherodev> ZigNewbie: set `exe.verbose = true` in build.zig :)
<pixelherodev> That's what it's missinhg
<pixelherodev> missing*
<pixelherodev> Rather
<pixelherodev> Set builder's verbose_link to true
<FireFox317_> pixelherodev, according to the `zig build --help` you can also pass --verbose-link to `zig build`
<pixelherodev> Yes, but I'm not sure if `--help` is 100% accurate there
<pixelherodev> Digging into the source should make it clear but I barely have time to comment offhand right now :P
dermetfan has joined #zig
<ZigNewbie> Currently, "zig build --help" has the same output as "zig build" for me, not sure what's going on here. The issues seem connected and maybe because of my system
<torque> which version of zig and which version of macOS? I think the 0.6.0 release is broken on the big sur betas because libsystem doesn't exist as a file on the disk any more. this is ostensibly fixed in master, see https://github.com/ziglang/zig/issues/5715
<pixelherodev> ZigNewbie: ... do you have a build.zig ?
<ZigNewbie> yes, in fact I just did init-exe
<pixelherodev> `zig build` is running in the same folder, I assume?
<pixelherodev> and it prints out the help?
<pixelherodev> That sounds like a bug
<ZigNewbie> torque, the big Sur. I've been on trunk and latest daily build - both have same issues
THFKA4 has joined #zig
layneson has joined #zig
ZigNewbie has quit [Remote host closed the connection]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
waleee-cl has joined #zig
<s-ol> i figured out the AVR assembly issue from yesterday
<s-ol> it is indeed an LLVM bug, and my original understanding was right, it wrongly parses / assembles inline assembly with relative offsets in jumps
<s-ol> all the clowning around yesterday was because the object-file output from LLVM leaves all jumps as .+0 and has a relocation entry on them
<s-ol> so I needed to link into a final ELF executable using avr-gcc before looking at the disassembly. There the problem is shown obviously
msingle has quit [Read error: Connection reset by peer]
<pixelherodev> andrewrk: given the current situation with stage2, feel free to let me know what parts of CBE / astgen to focus on for 0.8
<fgenesis> s-ol: hm, compiler explorer doesn't offer anything but avr-gcc, that's a bit inconvenient
osa1 has quit [Ping timeout: 272 seconds]
layneson has quit [Ping timeout: 264 seconds]
<s-ol> fgenesis: yeah i noticed that. Will put my repro file in the llvm bugzilla when they approve my account
wootehfoot has joined #zig
nvmd has joined #zig
wilsonk has quit [Ping timeout: 272 seconds]
wilsonk has joined #zig
wilsonk has quit [Ping timeout: 260 seconds]
marnix has quit [Ping timeout: 272 seconds]
frett27 has quit [Ping timeout: 260 seconds]
tane has quit [Read error: Connection reset by peer]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
wilsonk has joined #zig
zippoh has quit [Read error: Connection reset by peer]
zippoh has joined #zig
radgeRayden_ has quit [Read error: Connection reset by peer]
FireFox317_ has quit [Ping timeout: 240 seconds]
ur5us has joined #zig
eldamar has joined #zig
Kingsquee has joined #zig
<ikskuh> <fgenesis> s-ol: hm, compiler explorer doesn't offer anything but avr-gcc, that's a bit inconvenient
<ikskuh> you can just use clang with -target avr-freestanding-eabi
eldamar has quit [Remote host closed the connection]
Akuli has quit [Quit: Leaving]
a_chou has quit [Ping timeout: 260 seconds]
a_chou has joined #zig
gert_ has joined #zig
donniewest has quit [Quit: WeeChat 2.9]
a_chou has quit [Remote host closed the connection]
a_chou has joined #zig
a_chou has quit [Ping timeout: 264 seconds]
<andrewrk> pixelherodev, what's the current situation? I suggest to work towards getting all the same code examples that are passing for the other backends, also passing with the c backend
<andrewrk> do you need help setting up a test harness that compiles & runs the outputted c code?
<andrewrk> s/need/want/
<ifreund> andrewrk: hey, I was looking at exposing the new -femit-bin=foo option in the zig build system so I can get rid of the "lib" prefix on my libraries but it (intentionally) changes the behavior of --enable-cache
<ifreund> thoughts on what the best way to handle this would be?
<andrewrk> ifreund, yeah let's take a step back and re-think how this should work. especially in light of https://github.com/ziglang/zig/issues/6564
<ifreund> ooo, i would love to cache some non-zig artifacts using the zig build system
<andrewrk> I focused mainly in matching previous behavior with this particular thing so that the branch could be merged, but now it's time to re evaluate how all this machinery should work
<andrewrk> the previous design had the constraint that the cache system existed only in the compiler. we no longer have that constraint
<Cadey> does zig support RISC-V GD32?
<andrewrk> Cadey, what's GD32?
<Cadey> andrewrk: RISC-V 32 bit with multiplication/division, atomic, single and double precision floating point instructions
<andrewrk> ah, yeah it does
wootehfoot has quit [Read error: Connection reset by peer]
<andrewrk> Cadey, here's an example of how you can get a list of recognized CPUs and CPU features: https://clbin.com/cHcl6
<andrewrk> so you want -mcpu=generic_rv32+a+m+d+f
<pixelherodev> andrewrk: nah, I can do that myself, but that's a good call
<pixelherodev> Ah right, we talked about that :P
<pixelherodev> And, now that I'm remembering, you just solved the biggest blocker!
<pixelherodev> Now that the LLVM code is in stage2, we can make these tests depend on `enable-llvm`, pass the produced C code to LLVM, and then hook back into the normal `Execution` pipeline
<pixelherodev> You also just gave me a great idea to simplify the testing pipeline
<andrewrk> pixelherodev, yes, I specifically was thinking about this - the path forward is for the test runner to receive the path to the zig binary as a command line parameter, and make that available in std.testing.zig_exe_path and then pass that for self_exe_path to Compilation
<pixelherodev> A higher-level test harness which generates Cases for multiple architectures
<pixelherodev> That'd allow for e.g. tiered testing
<pixelherodev> A group of tests that all Tier 3 architectures have to pass, etc
<andrewrk> yeah I think that's where things are headed
<pixelherodev> Might be a good idea to define some new "tiers" for in-development backends to make it more obvious where they're all at
<pixelherodev> e.g. "stdlib support, no compilation"; "basic arithmetic and function calls only"; "everything astgen supports"
<andrewrk> yeah definitely. I think I will put that off until post-0.7.0 release
* pixelherodev nods
<pixelherodev> That's pretty arbitrary though, so it should be pretty limited
<andrewrk> it will be easy & fast to organize the tests once we decide to add this
<andrewrk> so, no rush to set it up IMO
<pixelherodev> I need to finish some physics work; I'll fix CBE test afterwards, and then work on C tests :)
ur5us has quit [Ping timeout: 240 seconds]
<pixelherodev> Gah, okay. I'm using a static Zig again :(
<pixelherodev> I still need to fix my LLVM/Clang set-up
a_chou has joined #zig
Kingsquee has quit []
ur5us has joined #zig