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/
<andrewrk> g-w1, I think you'd have a counter field in Module and increment it inside deleteDecl
teratorn_ has joined #zig
teratorn has quit [Read error: Connection reset by peer]
aerona has quit [Remote host closed the connection]
aerona has joined #zig
cole-h has quit [Ping timeout: 240 seconds]
<g-w1> thanks, ill do the same for createDecl
<g-w1> that pr looks sweet!
<g-w1> ill have to have a look at it more closely, but hopefully i can work on some of the TODOs
brzg has joined #zig
teratorn_ is now known as teratorn
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
voldial has joined #zig
<voldial> anyone have a zig.eclass? ir even an example ebuild that installs a zig app?
braket has quit [Read error: Connection reset by peer]
braket7 has joined #zig
<g-w1> ooh, looks line sizeof is next
<g-w1> luckily it is just pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);, so shouldn't be that bad
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
brzg has quit [Quit: leaving]
<g-w1> andrewrk: for get rid of failed_root_src_file, is it as simple as just removing all references to it? if so, I have a pr :P
earnestly has quit [Ping timeout: 240 seconds]
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
remby has joined #zig
aerona has quit [Remote host closed the connection]
<andrewrk> g-w1, that, and double checking for loose ends. do the tests all pass after that change?
<andrewrk> (of course not because my branch isn't passing either) - and that's why I'm saving it for later :)
waleee-cl has quit [Quit: Connection closed for inactivity]
<g-w1> ah, makes sense
teratorn_ has joined #zig
ur5us has quit [Ping timeout: 258 seconds]
teratorn has quit [Ping timeout: 252 seconds]
ur5us has joined #zig
teratorn_ is now known as teratorn
Seich has joined #zig
lyhokia has joined #zig
ur5us has quit [Ping timeout: 258 seconds]
johannes_ has joined #zig
johannes_ is now known as kenran
cole-h has joined #zig
remby has quit [Quit: remby]
lyhokia has quit [Ping timeout: 240 seconds]
RadekCh has joined #zig
kenran has quit [Quit: leaving]
tnorth_ has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
lyhokia has joined #zig
teratorn has quit [Read error: Connection reset by peer]
sord937 has joined #zig
teratorn has joined #zig
lyhokia has quit [Quit: Connection closed]
teratorn_ has joined #zig
teratorn__ has joined #zig
teratorn has quit [Ping timeout: 252 seconds]
teratorn_ has quit [Ping timeout: 240 seconds]
sord937 has quit [Quit: sord937]
teratorn has joined #zig
teratorn__ has quit [Ping timeout: 240 seconds]
retropikzel has joined #zig
voldial has quit [Quit: Connection closed]
osa1 has joined #zig
retropikzel has quit [Quit: Leaving]
retropikzel has joined #zig
cole-h has quit [Ping timeout: 252 seconds]
ur5us has joined #zig
Major_Biscuit has joined #zig
retropikzel has left #zig ["Leaving"]
<ifreund> O.o #8516 is hot
lemur has joined #zig
amk has quit [Remote host closed the connection]
amk has joined #zig
amk has quit [Remote host closed the connection]
amk has joined #zig
Major_Biscuit has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 258 seconds]
Major_Biscuit has joined #zig
pretty_dumm_guy has joined #zig
pagnol has joined #zig
klltkr has joined #zig
paulgrmn_ has joined #zig
koakuma has joined #zig
paulgrmn_ has quit [Ping timeout: 260 seconds]
pagnol has quit [Ping timeout: 252 seconds]
<koakuma> Hi, anyone have experience with libunwind errors when building stage2?
<koakuma> I am trying to make stage2 build on SPARC but I'm stuck on this error:
<koakuma> AFAIK it's because libunwind isn't available on SPARC, so is there a way to disable it?
Major_Biscuit has quit [Ping timeout: 240 seconds]
jcmdln has quit [Read error: Connection reset by peer]
paulgrmn_ has joined #zig
frmdstryr has joined #zig
rom1504 has quit [Ping timeout: 250 seconds]
nycex has quit [Ping timeout: 240 seconds]
nycex has joined #zig
paulgrmn_ has quit [Ping timeout: 240 seconds]
earnestly has joined #zig
remby has joined #zig
frmdstryr has quit [Ping timeout: 252 seconds]
Major_Biscuit has joined #zig
remby has quit [Quit: remby]
Snetry has quit [Ping timeout: 268 seconds]
Snetry has joined #zig
remby has joined #zig
remby has left #zig ["Good Bye"]
waleee-cl has joined #zig
pagnol has joined #zig
bndbsh has joined #zig
xackus has joined #zig
RadekCh has quit [Quit: Connection closed]
pagnol has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<v0idify> is something like `defer allocator.destroy(<the frame this code runs on>)` okay?
klltkr has quit [Ping timeout: 240 seconds]
klltkr has joined #zig
nycex has quit [Ping timeout: 240 seconds]
<ifreund> nope, pretty sure that would be UB
nycex has joined #zig
nvmd has quit [Quit: Later nerds.]
proteusguy has quit [Remote host closed the connection]
<fengb> There's an event loop runDetached that'll auto destroy once it's done
paulgrmn_ has joined #zig
<v0idify> oh cool! thanks fengb
<v0idify> how can I get the current event loop?
<v0idify> Loop.instance.?
<fengb> Yep
Major_Biscuit has quit [Ping timeout: 240 seconds]
lemur has quit [Quit: Konversation terminated!]
<v0idify> hmm that segfaults when passing a variable
<v0idify> which didn't happen otherwise
lemur has joined #zig
lemur has quit [Remote host closed the connection]
fcambus has left #zig [#zig]
tnorth_ has quit [Ping timeout: 250 seconds]
lemur has joined #zig
lemur has quit [Client Quit]
lemur has joined #zig
marijnfs has joined #zig
cole-h has joined #zig
pretty_dumm_guy has quit [Ping timeout: 240 seconds]
ifreund has quit [Ping timeout: 246 seconds]
ifreund has joined #zig
Akuli has joined #zig
<andrewrk> koakuma, you can try patching the link code here and see if that addresses the problem. if so we can put some sparc-specific logic there. https://github.com/ziglang/zig/blob/36a33c99e3bc0825ada2ce1b374c32b4d6dee6b0/src/link/Elf.zig#L1665-L1680
klltkr has quit [Quit: Textual IRC Client: www.textualapp.com]
backwhack has quit []
<marijnfs> is there a zig library that implements a fast key-value database like boltdb for Go?
<andrewrk> not that I'm aware of
<Nypsie> Lithdew made some bindings to lmdb if that works for you: https://github.com/lithdew/lmdb-zig
<marler8997> andrewrk, I had another idea to solve the start bootstrap problem
<marler8997> if we had @tryImport, then std.zig could do something like: comptime { _ = if (@tryImport("start")) |s| s else @import("start.zig") }
<marler8997> since std is always evaluated, it adds a "hook" into std that allows the "start" package to be overriden, and it's nice because it's implemented in the std library instead of being hardcoded in the compiler
rom1504 has joined #zig
<ifreund> I don't mind having something hardcoded in the compiler if it means avoiding adding a new language feature (@tryImport())
<marler8997> agree, this alone wouldn't justify @tryImport
<ifreund> if @tryImport() was decided to be a good idea for other reasons, sounds like a reasonable way to implement that though
<andrewrk> I'm guessing that will be one of the topics of the specs meeting tomorrow? :)
<marler8997> @tryImport might be mentioned, maybe just briefly
bndbsh has quit [Quit: Connection closed for inactivity]
<marler8997> is there a way or a trick to create a string constant, but not allow it's contents to be used at comptime?
<ifreund> I kind hope there isn't :P
<marler8997> I mean, you could just declare it as extern and link it in later, but I'm wondering if you could do it in pure zig without compiling it separately
<andrewrk> marler8997, var x = "foo".*;
<marler8997> not sure that's what I'm looking for, the use case here is my buildpkgs proposal is incomplete, a module needs a way of reporting it's "package path" to the build system, but a modules package path shouldn't affect it's compilation, so I'm wondering if there's a way to give it access to the path at runtime, but not allow it to read the contents at comptime
<ki9a> andrewrk: you guys working on a native zig backend to partially replace llvm now?
<ifreund> ki9a: yes
<ki9a> very cool!
<andrewrk> progress is well underway: https://clbin.com/zbaEo
<ifreund> though it will only truly replace llvm for debug builds for the forseeable future
voldial has joined #zig
<ki9a> that makes perfect sense. I don't think anyone really can replace llvm's optimizations in a near time
<andrewrk> we have some promising results as far as compilation speed so far, but only time will tell if we can maintain it all the way through full language implementation
<ki9a> I was actually looking at cranelift the other day for my own compiler
<ki9a> but it's the same kind of idea as what you are doing
<andrewrk> yeah. cranelift looks legit
<voldial> How do I not link std? it's still in here, I assume I'm using it implicitly? echo "pub fn main() u8 { return @as(u8, 42); }" > return_42.zig && zig build-exe return_42.zig
<andrewrk> voldial, you're only using what you depend on. probably you're noticing code for the default panic handler. you can override it
<andrewrk> there is also (necessary) code that runs before main()
<voldial> aah. undestood. I'll go watch the hellos tutorial again
<andrewrk> are you passing a freestanding target to the compiler?
<voldial> oops. nope to that too.
<marijnfs> Nypsie: thats not bad, i'm sure someone will build a native one in zig at some point
<andrewrk> voldial, that's probably the only issue then :)
<voldial> andrewrk: TIL:)
<andrewrk> marijnfs, it probably works fine to cimport the boltdb headers too
<andrewrk> translate-c is pretty sophisticated these days
<xackus> unless it's macros with ## like mingw uses to define integer literals
<andrewrk> yeah but even those we have some pretty decent heuristics
<andrewrk> if it's just integer literals, zig has you covered
<xackus> mingw has a macro for long literals which adds 'l' to the end
<xackus> they could just cast it but no
voldial has quit [Ping timeout: 240 seconds]
<andrewrk> pretty sure we have test coverage for that
pretty_dumm_guy has joined #zig
<xackus> if it's just a literal with a suffix it works, but the suffix is added by a macro
<andrewrk> ah I see
<ki9a> So there's a blog about zig/llvm/tls on darwin aarch64 ( http://www.jakubkonka.com/2021/01/21/llvm-tls-apple-silicon.html ) ; does anyone happen to know if this was reported to llvm and/or already fixed?
<ki9a> I have the exact same problem
<andrewrk> ki9a, not sure, you could ping kubkon on discord
<ki9a> thanks; i'll try that.
<xackus> there is some new api for expanding macros in clang master that looks promising
<xackus> clang::MacroExpansionContext
<andrewrk> ooh
klltkr has joined #zig
<g-w1> woah, if that could be used in translate-c that would be cool
<xackus> i want to do it, how long does it take to compile llvm + clang on six cores?
<ki9a> 1 platform?
<noam> ifreund: good point on e.g. std.mem.copy, thanks
<ki9a> for me llvm takes an hour with all targets enabled
<ki9a> (6 cores)
noam has left #zig ["WeeChat 3.0"]
noam has joined #zig
<xackus> that's not so bad if you don't need to recompile often
bitmapper has joined #zig
<andrewrk> xackus, maybe like an hour
<andrewrk> make sure to do release mode
Pixeli has joined #zig
Pixeli has quit [Client Quit]
<ki9a> one important thing is to do tablegen-release if you DO do debug
<andrewrk> why's that?
<g-w1> trying to work on getting the test harness compiling
<andrewrk> g-w1, I think I would advise making PRs against master branch, I'm going pretty cowboy in my draft branch
<marijnfs> andrewrk: boltdb is pure Go though, i'm not sure if translate-c is that sophisticated;)
<andrewrk> marijnfs, ahhh I missed that detail. anyway I've used leveldb in the past and had smooth experience with it
<g-w1> andrewrk: this is against the draft branch, trying to get the test harness compiling
<g-w1> should I still stop?
<andrewrk> if you put something up I'll take a look, it's just a suggestion
<g-w1> btw i think endian was changed to const native_endian = native_arch.endian(); ?
<g-w1> ok, ill see how hard this is :P
<andrewrk> but I might want to ignore it if I want to explore a different way
<andrewrk> just a heads up
<g-w1> ok cool
xackus has quit [Ping timeout: 265 seconds]
<g-w1> are you implementing 8516 in your branch?
xackus has joined #zig
plumm has quit [Quit: Textual IRC Client: www.textualapp.com]
plumm has joined #zig
<g-w1> andrewrk: this just fixes some compile errors: https://github.com/ziglang/zig/pull/8525
<g-w1> i assume the error is because files are actually structs now (!)
<g-w1> or maybe because _ = start;
aerona has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
klltkr has joined #zig
klltkr has quit [Client Quit]
lemur has quit [Quit: Konversation terminated!]
lemur has joined #zig
Akuli has quit [Quit: Leaving]
voldial has joined #zig
voldial has quit [Client Quit]
ur5us has joined #zig
<v0idify> what's a nice pattern for having both managed and unmanaged structs? i'd like to avoid having to do something like thing.managed.value
<v0idify> *thing.unmanaged.value(
<marler8997> you could put your code in one of them, and have the other one just forward calls to the other
<g-w1> ^
<g-w1> you can see how the datastructures in std do it
<v0idify> yeah that works but not for specific values
<marler8997> ?
<v0idify> values not functions
<marler8997> oh, I have a proposal for that :)
<marler8997> copied from the proposal: ...The problem is there's no way to forward a field from from a nested type to the parent. Unlike functions that can forward calls to other functions, fields have no ability to do this....
<g-w1> have a getter function 🤷
<g-w1> i think some std stuff does this
<marler8997> getter functions is one solution but comes with it's own problems
<g-w1> agreed
<marler8997> copied from proposal: naming conventions, the choice to return values or references, handling mutable vs const references to @This(), and requiring the caller to go through a function that can execute arbitrary code when all they want to do is access the field.
<v0idify> for a problem, there's always a zig proposal for it :P
<marler8997> yeah it kinda seems like that huh? :)
paulgrmn_ has quit [Ping timeout: 240 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
pjz has quit [Ping timeout: 252 seconds]
lemur has quit [Quit: Konversation terminated!]
pjz has joined #zig
nycex has quit [Remote host closed the connection]
nycex has joined #zig
marijnfs has quit [Quit: WeeChat 2.8]
<v0idify> there's no scrollbar when <750px width view on the auto-generated docs and the css is being weird
<v0idify> on firefox
DarkPlutonium has joined #zig
DarkUranium has quit [Ping timeout: 260 seconds]
<v0idify> how do i check for an error set in a switch?
<v0idify> like switch (err) { ErrorSet => {} }
<g-w1> you can't, switch on the errors in the error set
<g-w1> unless you are switching on a type, in that case it will work
<v0idify> is there no way to check if the error is inside the set?
<g-w1> i think with some @typeInfo metaprogramming you can
<g-w1> i might be overlooking something tho
<v0idify> yeah i'm sure it's possible with that but i find it weird it's not possible with the language itself
<xackus> there is an accepted proposal for that: https://github.com/ziglang/zig/issues/2473