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/
hspak has joined #zig
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 256 seconds]
<companion_cube> ifreund: wut, ok, so weird. So there will be a physical machine with this ISA at some point
<companion_cube> (in, maybe, 10 instances? :D)
<pixelherodev> companion_cube: there's already one ;P
<alexnask[m]> companion_cube: https://youtu.be/YbXrcxkUZTQ?t=337 :)
<daurnimator> 5.8 kernel is out. anyone want to do the honours?
<pixelherodev> ... of what?
<pixelherodev> ... installing one?
<daurnimator> looks like I missed 5.7 too :(
ur5us has quit [Ping timeout: 244 seconds]
<companion_cube> oh wait, it was on showtime?
<companion_cube> I see, assembler in zig
<companion_cube> funny :D
<companion_cube> bootstrapping down to the metal, heh
<andrewrk> "<no .debug_str section" ?? https://clbin.com/YrrYJ
<andrewrk> what do you call this then: [ 9] .debug_str PROGBITS 0000000000000000 000001dc
ur5us has joined #zig
<pixelherodev> andrewrk: fake?
<pixelherodev> Maybe it wants Cyrillic letters!
<pixelherodev> andrewrk: I split out the short-term-usable parts of the ELF PR into #5976
<pixelherodev> Going to redo from scratch the 16-bit support tomorrow
<pixelherodev> I closed the original one for now
<pixelherodev> also, holy *hell* the CI's been running for *four hours!*
<companion_cube> I wonder why spu mark 2 has its own ISA and not risc-v, though
<pixelherodev> 5 hours*
<pixelherodev> companion_cube: because SPU Mark II *is* an ISA?
<pixelherodev> :P
<pixelherodev> You mean the computer (Ashet)?
<companion_cube> yes
<pixelherodev> The two aren't really comparable
<companion_cube> (I mean, I can imagine it's super fun to do)
<pixelherodev> The ISAs are very different
<pixelherodev> Very, *very* different
<pixelherodev> RISC-V wouldn't be usable for this
<pixelherodev> RISC-V is a register machine, SPU II is a stack machine
<pixelherodev> RISC-V has *32 registers*
<pixelherodev> (with rv32i base at least)
<pixelherodev> it's also 32-bit vs 16-bit, among other differences
<pixelherodev> andrewrk: jokes on you, oldest one is #5972 now :)
CodeSpelunker has joined #zig
<companion_cube> 32 registers? pfiu
<pixelherodev> SPU II has zero [GPRs].
<companion_cube> so do you mean it's not doable to do a risc-v board as a hobbyist?
<pixelherodev> It is, but it's a completely different system
<pixelherodev> You might as well ask "Why use RISC-V instead of the z80?"
<pixelherodev> They're both ISAs
<pixelherodev> That's their greatest commonality :P
<companion_cube> hmm ok ok
<companion_cube> (well, I only know of risc-v because it's a modern ISA, and it's open, I guess)
<pixelherodev> snerk
<companion_cube> I need to finish the talk though
<companion_cube> to know what's the point :p
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 246 seconds]
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
<andrewrk> nice, the debug info is crashing gdb
<andrewrk> dare I... gdb gdb
<leeward> Seems like the thing to do.
<pixelherodev> But then you'll have to pow(gdb, 3) !
<andrewrk> yo dawg i heard u liked debugging https://i.imgur.com/SjeM2NM.png
<pixelherodev> haha
<gruebite> hahaha
<pixelherodev> hahahaha
<companion_cube> well damn :D
<shachaf> rr apparently has a ptrace emulation feature that lets it trace a program that uses ptrace, by emulating its ptrace calls.
<shachaf> (Since a program can only have one tracer.)
<andrewrk> computing at its finest
<andrewrk> ??? readelf: Warning: file index 0 > number of files 1
<andrewrk> last I checked 0 < 1
<mikdusan> https://github.com/gimli-rs/gimli has some example programs .debug_info parser and dwarf-validate. maybe if those are easy to build, they could give a decent hint
<andrewrk> good thinking
<ronsor> is it possible to async call a function pointer?
<ronsor> crap I just read that the other day too
<ronsor> my bad
<mikdusan> hmmm macos has `dwarfdump --verify`
<mikdusan> and there's also `llvm-dwarfdump --verify`
<gruebite> perhaps you need to check again
<andrewrk> llvm-dwarfdump --verify found something
<andrewrk> ok that wasn't the main issue though, and now llvm-dwarfdump --verify gives clean output
<gruebite> vulkan or vulkan_intel has too many memory leaks
<gruebite> they should have used zig
nvmd has joined #zig
nvmd has quit [Client Quit]
<andrewrk> hmm llvm-dwarfdump says the line number data is fine. I suspect this is gdb and readelf not supporting DWARFv5 yet
<andrewrk> https://clbin.com/1jEAs makes no sense
edr has quit [Ping timeout: 264 seconds]
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
edr has joined #zig
nmeum_ has joined #zig
nmeum has quit [Read error: Connection reset by peer]
CodeSpelunker has quit [Quit: CodeSpelunker]
<pixelherodev> Whoops
<pixelherodev> andrewrk: fixed the PR
<pixelherodev> Looking at the commit which I `drop`ed, I see what I was doing wrong
pmwhite has quit [Ping timeout: 244 seconds]
<pixelherodev> Huh
<pixelherodev> I think the CSS for the post is actually fine
<pixelherodev> It's Jekyll extending the size of the main area because of a large code block which I didn't manually wrap :P
<andrewrk> gdb you're killing me
<andrewrk> I thought for sure gdb 8.3.1 would support DWARF v5 (3 years old)
<pixelherodev> "I did not hit [that unreachable]! I did not! It's bullshit! Oh, hi gdb."
<andrewrk> ha
<andrewrk> ughhh I think I have to downgrade to dwarf v4
<pixelherodev> Oof, really?
<pixelherodev> That makes no sense...
<pixelherodev> I vaguely recall seeing DWARF 5 structures in my freestanding code when I was figuring out how to get the panic handler working
<pixelherodev> andrewrk: you know what we need to do if GDB doesn't support it, right?
<pixelherodev> std.debug.ChildProcess time!
<pixelherodev> /s
<andrewrk> I don't get it
<mikdusan> huh. if gdb doesn't support it do you have lldb avail to try?
<pixelherodev> RiiZ :P
<pixelherodev> Add a GDB replacement to std.debug ;)
<andrewrk> mikdusan, yeah I just tried v10, didn't seem to recognize the info either
<andrewrk> mikdusan, you want to play with the branch?
<pixelherodev> Link me an ELF?
<pixelherodev> I'll test it out
<daurnimator> andrewrk: while vaguely on this topic; did you have any opinion on how we should support other debug formats? (like ORC)
<mikdusan> i'm kinda restricted to macos (all VM tech on macos 10.15.6 has fatal mem leak) until 10.15.7
<andrewrk> ah yeah I haven't attempted macho yet
<andrewrk> pixelherodev, curl https://clbin.com/Tejh5 | base64 -d | gunzip >test
<pixelherodev> lol nice
<andrewrk> test.zig is https://clbin.com/CVYMV
<pixelherodev> `[1] 31100 invalid system call file test`
* pixelherodev facepalms
<pixelherodev> I keep forgetting that `file` is brokend
<pixelherodev> andrewrk: what should I see?
<pixelherodev> Seems fine to me
<pixelherodev> `break _start` works, for instance
<andrewrk> you should see full source and line info
<andrewrk> you should be able to step over each line
<pixelherodev> You don't though, right?
<pixelherodev> Hmm
<andrewrk> right and `info sources` shows nothing
<pixelherodev> If I curl test.zig next to exectable, it works fine
<andrewrk> orly
<pixelherodev> Yeah
<pixelherodev> info sources shows /home/noam/test{,.zig}
<andrewrk> what gdb version
<pixelherodev> 9.2
<andrewrk> there's the answer
<pixelherodev> What are you on?
<andrewrk> 8.3.1
<pixelherodev> 8.c?
<pixelherodev> x*
<pixelherodev> Yeah
<pixelherodev> That's probably it
<mikdusan> 8.dwarfless
<pixelherodev> Can you upgrade?
<andrewrk> doesn't matter. 8.3.1 is a comman version of gdb to be installed on people's systems
<pixelherodev> ... wrong question, yeah
<pixelherodev> So we should support both 4 and 5 for now, right?
craigo has quit [Ping timeout: 256 seconds]
<pixelherodev> Keep 5 support, default to 4
<andrewrk> I don't see any reason to support more than one format
<pixelherodev> Is there any eral differene between the two?
<pixelherodev> real*
<andrewrk> not really so far
<pixelherodev> Then I agree, yeah
<pixelherodev> No point in supporting two nearly identical formats
<andrewrk> damn I didn't even get to see my own code working correctly
<pixelherodev> There's got to be *something* that changes
<pixelherodev> I can screenshot?
<mikdusan> I would think dwarf version 2 and higher supported version spec... and gdb 8.3.x would at least check for supported dwarf version instead of just core'ing out
<andrewrk> the incremental compilation dwarf thing is working so far :D just gotta add a bit more code for updating functions
<pixelherodev> andrewrk: http://pixelhero.dev/gdb.png
FireFox317 has joined #zig
<mikdusan> haha the money shot
<andrewrk> what about stepping tho
<pixelherodev> Didn't try
<pixelherodev> `Single stepping until exit from function _start, which has no line number information`
<pixelherodev> Then exits :P
<andrewrk> fail
<pixelherodev> `info line` -> no line number info available
<pixelherodev> (at the breakpoint)
<andrewrk> that's a load of B.S. https://clbin.com/azxCm
<pixelherodev> Don't curse the messenger
<pixelherodev> :P
stripedpajamas has joined #zig
<andrewrk> anyway, down to dwarf 4 then I guess
<pixelherodev> `list` works though
<pixelherodev> which is weird
<pixelherodev> Well, it starts at line 1
<pixelherodev> might just be default
<pixelherodev> Hmm
<pixelherodev> Doesn't show up in `info files`
<pixelherodev> The section doesn't, i mean
<pixelherodev> Though none of the debug ones do I think
<pixelherodev> I get the same output from `llvm-dwarfdump` tho
<mikdusan> fwiw: post re dwarf 5 support in gcc/gdb: https://github.com/golang/go/issues/26379
<andrewrk> well here's the branch if anyone wants to play with it. https://github.com/ziglang/zig/pull/5978 suppertime for me
<pixelherodev> Night
wicd has quit [Remote host closed the connection]
SimonNa has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
SimonNa has joined #zig
FireFox317 has quit [Ping timeout: 264 seconds]
rzezeski has quit [Quit: Connection closed for inactivity]
<ronsor> thanks to the power of zig, I now have a working task scheduler
Kingsquee has joined #zig
<Kingsquee> can't nest functions?
<daurnimator> Kingsquee: need to wrap in a struct for now
<daurnimator> Kingsquee: `struct {fn nested() i32 { ..... }}.nested`
<Kingsquee> aiieee, thanks
<shakesoda> Kingsquee: my understanding is that issue 1717 (functions as expressions) will let you do that naturally
<shakesoda> whenever we get that in the future
trevarj has joined #zig
knebulae has quit [Ping timeout: 246 seconds]
marnix has joined #zig
knebulae has joined #zig
knebulae has quit [Ping timeout: 264 seconds]
knebulae has joined #zig
<andrewrk> gdb, notice me senpai
<ikskuh> heyo
<andrewrk> "...which has no line number information." yes it does :'-(
<shachaf> Is DWARF 5 not backward compatible?
<andrewrk> I tried v4 now too
<andrewrk> bout to try 2
<shachaf> Looking at the gdb source code it talks about DWARF-5 a bunch.
cole-h has quit [Ping timeout: 260 seconds]
<andrewrk> makes no sense to me
<andrewrk> readelf --debug-dump=decodedline also tells me it's good
<shachaf> Does it work with lldb?
<andrewrk> no
<andrewrk> maybe it wants DW_AT_ranges
Kingsquee has quit [Read error: Connection reset by peer]
<andrewrk> nope that wasn't it.
weka is now known as ggVGc
stripedpajamas has quit [Quit: sleeping...]
<alexnask[m]> Incremental DWARF is so sick :)
ur5us has joined #zig
zigusr has quit [Ping timeout: 245 seconds]
<andrewrk> ok looks like gdb doesn't like my extended opcode trick. it's a shame, arguably it's gdb doing it wrong
<andrewrk> that's OK I still have the 2-byte NOP {DW_LNS_negate_stmt, DW_LNS_negate_stmt} trick left. it's just unfortunate because it means the padding bytes have to actually be written to the file which costs perf, and there's the annoying thing that they have to be in sets of 2 or else the stmt register gets incorrectly inverted
ur5us has quit [Remote host closed the connection]
<andrewrk> I should file an issue asking for DWARFv6 to have a DW_LNS_jmp
ur5us has joined #zig
nikita` has joined #zig
marnix has quit [Ping timeout: 256 seconds]
bsrd has quit [Quit: WeeChat 2.9]
bsrd has joined #zig
<Snektron> What about 16 byte nop
bsrd has quit [Client Quit]
bsrd has joined #zig
bsrd has quit [Client Quit]
bsrd has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
trevarj has left #zig [#zig]
ur5us has joined #zig
bsrd has quit [Quit: WeeChat 2.9]
bsrd has joined #zig
<gruebite> can i have variable number of struct members at comptime? :P like say `fn Foo(comptime nmembers: i32) type { return struct { fn foo1, fn foo2 } }`
<ikskuh> no, that's not possible atm
<gruebite> anything akin to attributes when going through an anytype?
<ikskuh> nope
<ikskuh> but you can pass tags
<ikskuh> manually created tags
<ikskuh> struct { pub const tags = .{ .format = .{ .a = "{d}", }; a: f32, b: i32 };
<ikskuh> could be used to tag "a" with a "format" tag
<gruebite> nice
<gruebite> more or less a trick by using a special field
<gruebite> i like it :p
<alexnask[m]> Closest you can get to generating a struct at comptime currently is using the Tuple trick (https://github.com/ziglang/zig/issues/4607#issuecomment-647170974)
<alexnask[m]> (you could store the generated tuple + a list of "field names" in a struct and make a getter + some init function that takes an anonymous struct literal with the correct field names)
<gruebite> nice, i'll take a look at this
<gruebite> thanks
<alexnask[m]> I will make a small StructType(fields...) to make this easier actually
<alexnask[m]> Ive seen a couple of people that want @Type(.Struct) recently and this is the closest you can get so there ought to be some easy way to do it even if it relies on pretty... interesting, hacky things :P
nycex has quit [Remote host closed the connection]
nycex has joined #zig
<ikskuh> i still wonder if it's a good idea to forbid @Type(.Struct)
<alexnask[m]> Its still not ruled out
<alexnask[m]> But yeah I would argue its better than the abomination Im about to write
<alexnask[m]> As long as you cant generate functions in the @Type(.Struct) scope
<ikskuh> yeah, exactly
<ikskuh> people are already hacking around that restriction
<ikskuh> you, me, others
ur5us has quit [Ping timeout: 260 seconds]
forgot-password has joined #zig
<ikskuh> if you are allowed to add symbols to a namespace (instead of just creating struct fields), you can also add functions
<alexnask[m]> Well, the way the TypeInfo structs are made you couldnt actually reify a function even if you could reify other decls (which personally I think would be fine)
<ikskuh> why that?
<ikskuh> i could make a function taking `anytype` :D
<alexnask[m]> The FnDecl doesnt include the function code
<alexnask[m]> Only the signature, calling convention etc
<ikskuh> you can make it a FnPtr though ;)
<alexnask[m]> Even if it did you couldnt make a function that takes Self because Self doesnt exist yet (even if we had @specialize)
<ikskuh> const fnptr
<alexnask[m]> True
<ikskuh> alexnask[m]: yeah, i'm aware of that
<alexnask[m]> ikskuh: When I wrote TypeInfo I actually wanted to make it in a way that would support this (foolishly) but I never came up with an elegant design
<ikskuh> heh
<ikskuh> i think it's good that it's not possible :D
<ikskuh> even if we could make a beautiful interface API with that in userspace
<forgot-password> I have a semi-zig-related question regarding macos: When I build an executable the compiler says that it cannot find the libc headers. From "cc -E -Wp,-v -xc /dev/null" I can see that the include directory with the libc headers is missing in the list. The question is how can i tell it to look there? Last week it worked fine and I don't know what I did to fuck it up :/
<forgot-password> Same thing when I compile a simple c-file which includes libc.h with clang. Somehow I removed (xcrun --show-sdk-path)/usr/include from its global include paths.
<alexnask[m]> Hmm anonymous struct literals dont seem to have len
<alexnask[m]> T_T
<alexnask[m]> I can meta.fields.len though
<alexnask[m]> Behold: https://zig.godbolt.org/z/hW7vr1
<alexnask[m]> (StructType simple implementation, could be improved with default fields etc)
nycex has quit [Remote host closed the connection]
nycex has joined #zig
<ikskuh> the hell :D
<ikskuh> nice work!
<ifreund> ok, that's pretty funky
<ifreund> alexnask[m]: I think you sould link that in the issue for @Type(.struct)
<alexnask[m]> Just did ;)
<ifreund> nice
forgot-password has quit [Ping timeout: 246 seconds]
<ikskuh> crazy :D
<ikskuh> zig userland is just so overpowered :D
<alexnask[m]> That Tuple hack unlocks a bunch of things
<ikskuh> "But does your language have feature X?" - "No, but we have lib-X that implements that in userland"
<alexnask[m]> Its the only way to take some iterable of types and make some runtime storage out of it afaict
<ikskuh> why is the second parameter of StructType2 a anytype?
<ikskuh> can't that be a []type ?
<alexnask[m]> Yeah it could be []type, just left it anytype for flexibility :shrugs: Although I guess with this logic I could have made the names anytype too
<alexnask[m]> Someone should use this in a big zig library so that we can strongarm @Type(.Struct) in /s
forgot-password has joined #zig
craigo has joined #zig
pmwhite has joined #zig
forgot-password has quit [Quit: leaving]
<danyspin97> can I call a custom command in build.zig?
<danyspin97> like running a shell script
<andrewrk> gdb gonna fix their code for us https://sourceware.org/bugzilla/show_bug.cgi?id=26333
<danyspin97> found, builder.exec
<ikskuh> danyspin97: You probably want toi use addSystemCommand ;)
<danyspin97> hmm, not sure
<ikskuh> what do you need the command for?
<ikskuh> as a build step?
<ikskuh> like "pregenerate some files" or "package my output"?
<danyspin97> adding a capability to an executable
<danyspin97> after building it
<ikskuh> yeah, then addSystemCommand is probably the right thing to do
<ikskuh> it has access to the cache-itnernal paths
<andrewrk> good news: I came up with an even better way than the 2-byte NOP thing, which involves skipping an arbitrary number of bytes by taking advantage of Extended Opcode User-Defined which encodes the length of the operation and expects consumers to ignore operations they don't support. So you can put any number here, and skip forward, over padding bytes, avoiding the need to write NOPs to disk.
<andrewrk> Bad news: even though it's handled correctly in most places - binutils readelf, llvm-dwarfdump, zig's own stack trace code - it's not handled correctly by GDB, which silently ignores the .debug_line data when it sees a user-defined extended opcode.
<andrewrk> Good news: They're gonna fix it for us https://sourceware.org/bugzilla/show_bug.cgi?id=26333
<ikskuh> andrewrk: neeeead
<andrewrk> Bad news: A version of GDB with the fix won't be widespread for years
<ikskuh> *neat!
<daurnimator> andrewrk: that's cool; zig code will be widespread by then too ;)
<ikskuh> danyspin97: const cmd = b.addSystemCommand(&[_][]const u8 { "cmd", "arg0", "arg1" });
<ikskuh> cmd.addArtifactArg(my_exe);
<ikskuh> cmd.addArg("another-arg");
<ikskuh> andrewrk: I've read your comment on pixelherodevs PR for std.ihex
<ikskuh> i think you're right, i could rewrite that to use a push-oriented parser instead of callbacks
<daurnimator> ikskuh: push? should be pull.
<ikskuh> daurnimator: push data in, pull a single event back
<danyspin97> ikskuh: i'll try that
<danyspin97> thank you
<ikskuh> i've made a parser based on that mode
<ikskuh> you tell the parser to parse X bytes, and the parser tells you that it used Y bytes of that data
rzezeski has joined #zig
<daurnimator> ikskuh: IMO the best pattern should be: `while(true) { try source.read(somebuffer.freespace()); p.feed(somebuffer.availabledata()); while(try p.next()) |thing| { ...... } }`
<daurnimator> where that read+feed may be encapsulated in the `.next()` method
<ikskuh> daurnimator: that may need allocation though
<daurnimator> ikskuh: `somebuffer` there would be something like a `std.LinearFifo`
<ikskuh> because you may need to store up to X things that will be returned by p.next()
<ikskuh> ah
<ikskuh> hm
<daurnimator> for LinearFifo you can: s/freespace/writableSlicw/ s/availabledata/readableSlice/
<daurnimator> and note that LinearFifo has 3 modes for backing storage: static buffer; slice you pass; or it can do dynamic allocations
<ikskuh> daurnimator: would you mind setting up a nice usage example for that? maybe we can even use the ihex parser as a example
<ikskuh> i'm also happy to help here
<ikskuh> because i think it would be nice to share some good ways of implementing stuff like parsers and such in a zero-alloc way
<ikskuh> i *think* i got your idea, but i'm not 100% sure yet
<daurnimator> it becomes a lot easier with an iterator<>async protocol
<daurnimator> I'll have a quick go though
<daurnimator> okay yeah without an iterator<>async thing you essentially have to write out the state machine explicitly
<andrewrk> Snektron, how would you make a 16 byte nop?
<daurnimator> is there a form of `try ` that you can call when you *know* the error is set?
<daurnimator> `catch unreachable` is unwrapping an error union you know is not an error. but what is the inverse?
<companion_cube> try foo; unreachable ?
<daurnimator> companion_cube: I need it as an expression of type `noreturn`
<daurnimator> `x orelse return someerrorunion_that_I_know_is_error`
<alexnask[m]> Not very elegant but: `blk: { try foo; break :blk unreachable; }` perhaps?
<daurnimator> I guess `x orelse return try ....`
<companion_cube> daurnimator: good point
<daurnimator> ikskuh: https://zig.godbolt.org/z/h5Ws4j
<daurnimator> sorry for the async<>iterator hackery.... I didn't feel like rewriting it
<Snektron> andrewrk: you can stack the REP prefix any number of times
<Snektron> Or one of the other prefixes
<Snektron> `data16 data16 data16 data16 data16 nopw cs:[eax+eax*1+512]` should be 16 bytes
dermetfan has joined #zig
<Snektron> Turns out its a CPU feature whether a stack of data16 can be efficiently decoded
<ifreund> wasm is a lot simpler, I can just pad any expression with as many 1 byte nop instructions as I want
<Snektron> oh you can do that on x86
<Snektron> but then you have exactly that: n single-byte nop instructions
<Snektron> which takes up to n cycles
<Snektron> These long nops actually only take a single cycle
<ikskuh> daurnimator: not sure if i like it that way
<Snektron> So you can do nothing, but more fficiently
<daurnimator> ikskuh: is that because of the iterator thing? >.<
<ifreund> Snektron: ah, I see
<ifreund> that is pretty neat
<ikskuh> daurnimator: yeah
<Snektron> its mainly for alignment purposes of code
<daurnimator> also I realised it can be a little terser by putting the `resume frame` in the loop continuation: `while (item) |result| : (resume frame) {`
<daurnimator> ikskuh: with an actual state machine you wouldn't need it
<ikskuh> the problem i see with this code is that it's blocking
<daurnimator> ikskuh: what is?
<ikskuh> i cannot parse half an entry and continue with whatever i was doing
<ikskuh> the usage is blocking
<daurnimator> can't you?
<ikskuh> well, the code right now is definitly blocking
<ikskuh> so reading a single byte ':', then receiving a single byte 'F' will block the outer scope until another character is available in the stream
<ikskuh> the idea with FiFo is more elegant imho
<ikskuh> because i can *stop* parsing and doing something else in the meantime without having to utilize async code
<daurnimator> You can though.... just don't resume until you want more
<ikskuh> the point is: maybe i don't know when i *want* more
<ikskuh> but i want to react to when i *have* more
<ikskuh> imagine you have a really slow and sloppy connection to some end point
<daurnimator> I don't think that's a good idea
<daurnimator> you shouldn't be able to force your downstream to consume you
<ikskuh> hm?
<daurnimator> the consumer should be the one that causes forward progress.
<ikskuh> so?
<ikskuh> the parser should still be tolerant against incomplete data being fed into it
<ikskuh> and not block then
<daurnimator> yes.
<ikskuh> until enough data is there
<daurnimator> yes.
<ikskuh> the ihex example right now does this though
<ikskuh> which is my main critique
<daurnimator> not if you give it an async stream
<ikskuh> then i have async code which is imho not always desirable
<daurnimator> why?
<ikskuh> it should be possible, but i for myself won't be using a lot of async
<ikskuh> because i find it harder to read and reason about
<ikskuh> it also *requires* a event loop
<ikskuh> which is something i usually don't have
<daurnimator> not at all.
linuxgemini9 has quit [Quit: o/ https://thelounge.lasagna.dev]
<ikskuh> comment on which? event loop or readabiltiy?
linuxgemini has joined #zig
<daurnimator> no need for an event loop
<daurnimator> zig async/await doesn't imply or require an event loop
<ikskuh> how do i use async then?
<daurnimator> async just means "start a function and don't wait for it to finish"
<ikskuh> it still makes code a lot more complex without bringing much benefit in most cases (imho)
<daurnimator> not really IMO
<daurnimator> we just don't have the syntactic sugar for it
<ikskuh> i'm thinking about how to implement async/await
<ikskuh> from scratch
<ikskuh> but i struggle to get all corner cases right
<ikskuh> "having a plan to resume" isn't a trivial job
<ikskuh> and having code *depending* on that to be non-blocking is bad
<ikskuh> especially for non-I/O code
<daurnimator> there is no depedence on non-blocking IO beyond what the stream you pass in expects
<ikskuh> and that's my problem :D
<ikskuh> what if i don'T have a stream available that is async?
<ikskuh> the code would *require* use of async i/o to be nonblocking in cases where not enough data is available
waleee-cl has joined #zig
FireFox317 has joined #zig
<ikskuh> i don't see how it should work without requiring a async i/o reader
KKRT has joined #zig
stripedpajamas has joined #zig
xackus_ has joined #zig
FireFox317 has quit [Ping timeout: 246 seconds]
cole-h has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
dermetfan has quit [Ping timeout: 246 seconds]
FireFox317 has joined #zig
<ronsor> Does @asyncCall() happen to create a new stack?
marnix has joined #zig
heitzmann has quit [Quit: WeeChat 2.9]
heitzmann has joined #zig
marnix has quit [Ping timeout: 256 seconds]
Akuli has joined #zig
<andrewrk> Snektron, this is a DWARF line number program nop
<andrewrk> not x86 :)
<andrewrk> anyway gdb has the fix now: https://sourceware.org/bugzilla/show_bug.cgi?id=26333
<andrewrk> all we gotta do is wait 2 years until it is widely available everywhere ;)
<alexnask[m]> Quick fix though, nice
<pixelherodev> lol
<pixelherodev> Maybe it'll get backported?
<pixelherodev> ... that was stupid of me, sorry.
<pixelherodev> I know better than that
marnix has joined #zig
<pixelherodev> That was really impressively fast though
<pixelherodev> Kudos to them
<pixelherodev> andrewrk: I think it's your turn again :)
<Snektron> andrewrk: oh, my bad
nvmd has joined #zig
<pixelherodev> Hmm
<pixelherodev> Is it possible to have standalone DWARF info?
<pixelherodev> Without ELF?
<Sahnvour> I think mingw can do dwarf
<pixelherodev> hmm
<pixelherodev> "Independent of object file formats"
<Sahnvour> that I don't know :)
<pixelherodev> It is :)
<pixelherodev> I just checked
euandreh has quit [Ping timeout: 272 seconds]
<pixelherodev> andrewrk: idea: we should build DWARF info in self-hosted *independent of the linker target*, and the ELF backend should embed that info as part of flush()
<pixelherodev> This would allow, for instance, flushing that info to its own file when we're not targeting ELF
nikita` has quit [Quit: leaving]
<Sahnvour> what would be the usecase ? only target one debug info format and use it on all platforms from zig ?
<andrewrk> this idea would not do incremental compilation, so it's a non-starter
<pixelherodev> andrewrk: Why wouldn't it?
<pixelherodev> File.updateDecl would handle it before routing downwards
<pixelherodev> Sahnvour: yeah, basically
<pixelherodev> The entire idea is incrementally compiled debug info independent of object format
nikita` has joined #zig
<Sahnvour> you'd still need "native" debug format to use platform's tools though, for example PDBs on windows
<andrewrk> yeah. better to integrate with the target's tooling conventions
euandreh has joined #zig
<pixelherodev> So what I'm hearing is
<pixelherodev> "Convince Microsoft to use DWARF and then your idea is valid?"
<pixelherodev> s/?"/"?
marnix has quit [Read error: Connection reset by peer]
<Sahnvour> that'd be a mean way to put it haha, but people expect their native dev tools to work especially since stage1 complied with them
<pixelherodev> ;P
stripedpajamas has quit [Quit: sleeping...]
stripedpajamas has joined #zig
pmwhite has quit [Remote host closed the connection]
dermetfan has joined #zig
<gruebite> is it fooUint or fooUInt?
wootehfoot has joined #zig
<ifreund> gruebite: the former afaik
<ifreund> you'd definitely do foo_uint over foo_u_int
<alexnask[m]> I think Cygwin gdb uses dwarf :p
<ifreund> I reall hope #1097 gets accepted though, I'm really not a fan of camelCase function names
<gruebite> it's a method :P
<gruebite> makeUint or makeUInt
<ifreund> yeah, so makeUint() is what I'd say
wootehfoot has quit [Read error: Connection reset by peer]
r4pr0n has joined #zig
stripedpajamas has quit [Remote host closed the connection]
ur5us has joined #zig
Akuli has quit [Quit: Leaving]
casaca has quit [Remote host closed the connection]
casaca has joined #zig
KKRT has quit [Quit: KKRT]
dermetfan has quit [Ping timeout: 240 seconds]
<pixelherodev> The awesomest thing ever is being able to use a git repo on a personal server :D
<torque> psh, cool kids use git repos stored in a different folder on the same machine
<ifreund> branches? never heard of em. I just make more clones :P
<pixelherodev> ifreund: I'm working branchless rn actually ;)
<leeward> Well crap. Looks like I'm in the market for a new laptop.
<ifreund> well if you only work on one thing at a time, you don't reall need branches
<ifreund> s/reall/really
<pixelherodev> Branches are just references are just commit IDs
<pixelherodev> ifreund: I refactor frequently at this point
<pixelherodev> Largely because Zig has ingrained that habit in me TBH
<mikdusan> git worktree ftw
<ifreund> yes branches are just labels for commits
<shakesoda> branches are a lot more of a headache if you don't work on one thing at a time
<ifreund> I find this useful to organize work on mulitple things
<shakesoda> i am vastly too scatterbrained for that lol
<shakesoda> so usually i only make branches after the fact in order to submit prs
<pixelherodev> To avoid GNU extensions in a Makefile, we literally wrote a Python file to generate a Makefile heh
<pixelherodev> The worst part is this is now the second-best build system I've used, after ZBS
<pixelherodev> a 100 line python file beats out almost everything else I've used. I don't know how to feel about that.
r4pr0n has quit [Quit: r4pr0n]
<companion_cube> if you generate something, why not generate ninja, then? :D
<pixelherodev> Because we already did this
<pixelherodev> And we were *going* to just use `make`
<pixelherodev> and it didn't occur until afterwards
<pixelherodev> and we're not wasting more time on it
<companion_cube> :D fair enough
<ifreund> pixelherodev: pretty sure -march=native implies -mtune=native
<pixelherodev> ifreund: technically, it should, yes.
<pixelherodev> I use it explicitly anyways, just from habit
<pixelherodev> Didn't you see the help description for it?
<ifreund> yes :P
<pixelherodev> `--pixel Enable additional development flags because you're pixelherodev and you make bad life choices`
<pixelherodev> :P
FireFox317 has quit [Ping timeout: 246 seconds]
euandreh has quit [Ping timeout: 272 seconds]
xackus_ has quit [Ping timeout: 240 seconds]
blinghound has joined #zig
euandreh has joined #zig
euandreh has quit [Remote host closed the connection]
euandreh has joined #zig
blinghound has quit [Remote host closed the connection]