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/
daurnimator has quit [Ping timeout: 244 seconds]
stripedpajamas has quit [Quit: stripedpajamas]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ronsor> so is zig on ntdll yet? https://github.com/ziglang/zig/issues/1840
daurnimator has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
KoljaKube has quit [Ping timeout: 246 seconds]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
CodeSpelunker has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
ur5us has joined #zig
nvmd has quit [Quit: Later nerds.]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> ronsor, almost, there are just a few dependencies on kernel32.dll left
<andrewrk> ifreund, for elf files we have to close the file so that you can run the executable in between updates. for wasm files this shouldn't be necessary. I think makeFileExecutable can be a no-op and makeFileWritable can also be a no-op for wasm
dongcarl has quit [Read error: Connection reset by peer]
<andrewrk> that's why the function is named makeFileExecutable and not closeTheFile
<andrewrk> "specify intent precisely" :)
dongcarl has joined #zig
<andrewrk> ronsor, the main thing left is child processes I believe
<andrewrk> all of std.fs is using ntdll now I believe
dongcarl has quit [Read error: Connection reset by peer]
<andrewrk> ifreund, I still need to look into updateDeclExports being called out of order right?
dongcarl has joined #zig
<pixelherodev> andrewrk: I thought we'd solved that?
<pixelherodev> updateDeclExports is called *both* before *and* after updateDecl, no?
<andrewrk> ok I think that the only thing that needs to be changed is the doc comment that says it has to be called after updateDecl
<andrewrk> the elf code has: if (decl.link.elf.local_sym_index == 0) return;
<andrewrk> that gets assigned by allocateDeclIndexes
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<daurnimator> oooo; child processes on windows is gonna be fun
<daurnimator> who wants to go for a forking adventure?
<andrewrk> I think daurnimator wants to go on a forking adventure
waleee-cl has quit [Quit: Connection closed for inactivity]
<daurnimator> so not sure you know the difficulties with windows and forking... or if you want to know
<daurnimator> but zig is about as best situated for it as any language/runtime can be
<andrewrk> I don't see any reason to implement fork on windows
<daurnimator> unique selling point?
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> I just want to execute a child process without heap allocation
<daurnimator> I'm reminded of https://www.youtube.com/watch?v=egyPfO60ePA
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
CodeSpelunker has quit [Quit: CodeSpelunker]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
Nypsie[m] has quit [Ping timeout: 246 seconds]
gpanders[m] has quit [Ping timeout: 246 seconds]
alva has quit [Ping timeout: 246 seconds]
alexnask[m] has quit [Remote host closed the connection]
return0e[m] has quit [Remote host closed the connection]
dtz has quit [Remote host closed the connection]
josias has quit [Remote host closed the connection]
metheflea has quit [Remote host closed the connection]
Snektron has quit [Remote host closed the connection]
protheory8-new-m has quit [Read error: Connection reset by peer]
fengb has quit [Read error: Connection reset by peer]
hamoko[m] has quit [Remote host closed the connection]
jorge-jbs has quit [Remote host closed the connection]
ifreund[m] has quit [Remote host closed the connection]
Bastian[m] has quit [Remote host closed the connection]
BaroqueLarouche has quit [Remote host closed the connection]
mkchan_ has joined #zig
mkchan has quit [Ping timeout: 246 seconds]
hamoko[m] has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
alva has joined #zig
ifreund[m] has joined #zig
dtz has joined #zig
alexnask[m] has joined #zig
jorge-jbs has joined #zig
return0e[m] has joined #zig
BaroqueLarouche has joined #zig
protheory8-new-m has joined #zig
metheflea has joined #zig
Snektron has joined #zig
Bastian[m] has joined #zig
Nypsie[m] has joined #zig
fengb has joined #zig
gpanders[m] has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> ifreund, when I run the wasm test case with wasmtime I don't see any output
<andrewrk> maybe I have an old version
nycex has quit [Remote host closed the connection]
<andrewrk> ah yeah I have a really old version
nycex has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
josias has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Ping timeout: 264 seconds]
craigo has quit [Ping timeout: 246 seconds]
dongcarl has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
mkchan_ is now known as mkchan
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
nycex has quit [Remote host closed the connection]
nycex has joined #zig
dongcarl has quit [Ping timeout: 240 seconds]
Michcioperz has joined #zig
daurnimator has quit [Ping timeout: 246 seconds]
dongcarl has joined #zig
daurnimator has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
daurnimator has quit [Ping timeout: 244 seconds]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
<andrewrk> I'm kinda bummed about https://github.com/ziglang/zig/issues/6082
dongcarl has joined #zig
<andrewrk> all I want is a way to tell if a file is changed since last time I looked at it. apparently this is too much to ask
KoljaKube has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
<gonz_> Since I know at least a couple of people were curious in the channel about coding by voice (and likely don't exactly know what they'd expect), I made a video of writing some Zig code: https://www.youtube.com/watch?v=itI1Y28nCYo
dongcarl has joined #zig
mattmurr has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
<gonz_> It's a very simple program but still a fairly raw experience since it's me thinking while doing it and not just dictating ready-made changes I already know (which is what a lot of demonstrations are).
<andrewrk> wow those vscode auto completes seem really helpful for this use case
<KoljaKube> Only a few minutes in, but do you mention the software used?
<gonz_> Ah, no, I'll put that in the description. The software it's based on is Dragon Professional Individual 15
<gonz_> Nuance (the company that makes it) hacked Python scripting support into it at some point.
<gonz_> And I use a base set called dragonfly to script the things I want, like the basic alphabet, ways of saying things (the variable casing types, for example).
<gonz_> Auto-complete is a huge boon, yes, and zls made this a lot better overall.
<andrewrk> one thing I'm noticing - I get the impression that you could say a lot more things faster if the latency was smaller. It seems like you spend a lot of time waiting to make sure the system correctly interpreted the instructions before saying the next one
<gonz_> This is in part configurable
<gonz_> You can have it spend less time per thing and execute things faster
<gonz_> Generally it's also that I'm slower at it now than I was before as well. You can become a lot more efficcient than this.
<gonz_> You want to batch as many vim operations as you can in one go.
<gonz_> Though I'll say that when f.e. exploring some API via auto-complete you're unlikely to batch many of them, obviously.
<gonz_> I think part of it is also me being nervous to some extent.
dongcarl has quit [Read error: Connection reset by peer]
<andrewrk> thank you for providing this video, it's very insightful for me
<gonz_> I should note that OBS adds some latency as well
<gonz_> Dragon doesn't do super well with this for whatever reason and screen sharing is even worse.
dongcarl has joined #zig
<andrewrk> my hypothesis is that the latency is CPU-bound
<andrewrk> "prick" and "slap" are such satisfying names for '.' and \n
<gonz_> I look at OBS sometimes and it's not really using a ton of anything, not so much that I would think other apps were SoL but there it is anyway.
<gonz_> Heh, yeah, I used to use "dot" for '.' but switched because sometimes it wasn't unambiguous enough and I needed something very clear.
<gonz_> "prick" also means "dot" in Swedish, so it was oddly appropriate as well.
<gonz_> "slap" I stole from a guy that did an excellent coding by voice talk at PyCon which is where I saw this the first time.
<andrewrk> am I correct in understanding that the vim key bindings for vs code are pulling a lot of weight here?
<gonz_> In that they enable it, yeah.
<andrewrk> idea being that "keyboard golf" is now promoted from a game into the most practical way to input
<gonz_> You really need a strong way to control things by keyboard and to string things together, so vim is probably the way you want it to work.
<gonz_> With that said you can make your own commands that string together other things in editors. This is just a much better way to get started and base your thinking on if you know vim.
<andrewrk> I see
ur5us has joined #zig
<gonz_> Lots of people have had success using emacs and making their own thing out of it there, though, and there are deep programming language-specific things you can get into.
<gonz_> I've gone more for a vim base for everything and on top have made language layers. Zig is the first language I've (almost) emptied out my language layer for in favor of snippets.
<gonz_> It used to be that I said "while" and it immediately just output an entire while loop with some anchor characters I could jump to and change.
<gonz_> This makes the voice bits a bit more fluid sometimes, but you have to put manual sleeps in there if you're dealing with VSCode because the insert mode isn't instant and exiting it isn't either
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> hmm I see so queuing up voice commands doesn't work with vs code? that seems really frustrating
<gonz_> I mean, it does, but not for exactly everything, like moving in and out of insert mode.
<gonz_> Not to the degree that you want for voice scripting, at least.
<gonz_> I think this newer scheme I'm using will be good when I get more used to saying "say constant tabby snake some cool name" which has you batch all of "const some_cool_name = ;" in one go, for example.
<gonz_> As opposed to having it be 3 steps like in the majority of this video.
<andrewrk> it seems like if you could eliminate the pauses to make sure errors aren't made, you could actually get a pretty high WPM with this
<gonz_> Yeah, when you get comfortable with a scheme and you do it to a certain degree you do get very efficient.
<andrewrk> maybe even faster than traditional keyboard typing
<gonz_> Add to that a more capable terminal with `fzf` for terminal searching, etc.
<andrewrk> yeah I see how these kind of tools are invaluable
daurnimator has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
<KoljaKube> When I @call a function that may or may not return an error union, and need to catch if it does, do I need to write two @calls or can I somehow handle both cases in one?
ur5us has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
cole-h has quit [Ping timeout: 265 seconds]
dongcarl has joined #zig
<andrewrk> what do you mean may or may not return an error union? are you doing some kind of reflection / generic code?
<andrewrk> you could capture the return value in a variable and then handle the return value separately depending on the type
alva has quit [Quit: killed]
ifreund[m] has quit [Quit: killed]
return0e[m] has quit [Quit: killed]
Bastian[m] has quit [Quit: killed]
hamoko[m] has quit [Quit: killed]
alexnask[m] has quit [Quit: killed]
jorge-jbs has quit [Quit: killed]
fengb has quit [Quit: killed]
dtz has quit [Quit: killed]
protheory8-new-m has quit [Quit: killed]
BaroqueLarouche has quit [Quit: killed]
gpanders[m] has quit [Quit: killed]
metheflea has quit [Quit: killed]
Nypsie[m] has quit [Quit: killed]
josias has quit [Quit: killed]
Snektron has quit [Quit: killed]
<KoljaKube> Line 201 contains the @call in question
<ikskuh> there goes the matrix party
<KoljaKube> Does that happen often?
<ikskuh> haven't noticed that the matrix bridge dies
<ikskuh> but netsplits are common
<ikskuh> andrewrk: where are the compiler errors/warnings emittet in stage1?
<ikskuh> i'd like to do a small pr improving quality-of-live in vscode :D
<andrewrk> look for add_node_error
<ikskuh> thanks
<andrewrk> I'm so frustrated about #6082
<andrewrk> all I want is a way to tell if a file has changed since the last time I looked at it. apparently this is too much to ask
ifreund[m] has joined #zig
<ikskuh> sounds ugly
dongcarl has quit [Read error: Connection reset by peer]
<KoljaKube> You already tagged it linux, but I can confirm that it works on macOS
dongcarl has joined #zig
Nypsie[m] has joined #zig
<Nypsie[m]> gonz_: That is so cool! It's amazing to see how advanced this is.
<ikskuh> btw, the new log api is nice
<ikskuh> const log = std.log.scoped(.sdl2);
<ikskuh> log.debug()
<ikskuh> neat!
<andrewrk> KoljaKube, when you say works, what do you mean?
<KoljaKube> count is always 1
<andrewrk> aha. that's good news
alexnask[m] has joined #zig
alva has joined #zig
dtz has joined #zig
jorge-jbs has joined #zig
return0e[m] has joined #zig
metheflea has joined #zig
BaroqueLarouche has joined #zig
Bastian[m] has joined #zig
fengb has joined #zig
Snektron has joined #zig
gpanders[m] has joined #zig
protheory8-new-m has joined #zig
hamoko[m] has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
daurnimator has quit [Quit: WeeChat 2.9]
daurnimator has joined #zig
<ifreund> andrewrk: is it not required that allocateDeclIndexes be called before any call to updateDecl or updatedDeclExports?
dongcarl has quit [Read error: Connection reset by peer]
<ifreund> I'm pretty sure it is, will do a PR adding/correcting comments
dongcarl has joined #zig
<KoljaKube> When I add the comptime in L49 (and remove the prints), the code compiles. Does the compiler evaluate wrap() for every possible input (=decl in TestClass)
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> yeah it should afaik
<ifreund> can use @compileLog() to check
<KoljaKube> Somehow I expected more automatic comptime-ness from a function that operates on a comptime type argument
<KoljaKube> I guess with the prints it should have been obvious
waleee-cl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<KoljaKube> This crashes the compiler: https://godbolt.org/z/4GbaK9
<KoljaKube> Inlining the loop works
<KoljaKube> Segfaults in can_mutate_comptime_var_state
<KoljaKube> Something I should create an issue for? Can't seem to find an existing one
<ifreund> yes please
<ifreund> #itwillworkinstage2 though
ky0ko has quit [Quit: killed]
ky0ko has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<KoljaKube> stage2 really is an eierlegende Wollmilchsau, huh? ;-)
ur5us has quit [Ping timeout: 240 seconds]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ikskuh> KoljaKube, well the plan is to make stage2 actually good :D
<ikskuh> and not just "work" as stage1 right now
<ikskuh> btw: i'm starting to hate the guy that made the decision that git has autocrlf enabled by default
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> easy soultion: forget windows exists
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
st4ll1 has quit [Ping timeout: 256 seconds]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ikskuh> hmm
<ikskuh> ifreund: cannot do that :D
<ikskuh> what's the current way of casting a float safely to an integer?
<ifreund> @floatToInt()?
<ifreund> or is that not safe enough for you?
<ikskuh> floatToInt will crash when it's not a integer, out of bounds or similar ;)
<ifreund> maybe there's something in std.math
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
marnix has joined #zig
st4ll1 has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
craigo has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
marnix has quit [Read error: Connection reset by peer]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> why does't File.seekBy() return the offset?
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
radgeRayden has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
xackus has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
PC9801 has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
xackus has quit [Ping timeout: 246 seconds]
dongcarl has joined #zig
LanceThePants has joined #zig
sawzall has quit [Ping timeout: 256 seconds]
mrhistory has joined #zig
rzezeski has joined #zig
dingenskirchen has joined #zig
dingenskirchen has quit [Client Quit]
sawzall has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
LanceThePants has quit [Ping timeout: 264 seconds]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
xackus has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
st4ll1 has quit [Ping timeout: 240 seconds]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
mrhistory has quit [Remote host closed the connection]
dongcarl has joined #zig
bgiannan has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
nvmd has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<shakesoda> i wonder how nasty it'd be to get zig going on old windows (9x, 2000 + xp)
<ikskuh> shakesoda: i don't think 2000 and XP support should be hard
<ikskuh> the PE files are the same, except for some minor entries
<shakesoda> ikskuh: i don't get the impression those two would be particularly bad, they aren't *that* different
<ikskuh> 9x is different though
CodeSpelunker has joined #zig
<shakesoda> I assume much of the os dependent stdlib stuff just wouldn't work on 9x, afaik a good bit of those use nt apis
<shakesoda> i don't know the details of any differences with the binaries
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<fengb> stdlib won't officially support <8
<shakesoda> well that's a shame since i run 7
<CodeSpelunker> is there any SIMD support in zig?
<ifreund> CodeSpelunker: yes, what do you want to know about it?
<shakesoda> i don't expect official support for pre-7, certainly, thinking about 2k and 9x is just an idle curiosity
<CodeSpelunker> ifreund: dunno haha, just how it works
<ifreund> shakesoda: why would we officially supported a deprecated proprietary os :P
<CodeSpelunker> I'm just getting started with zig
<ifreund> well, you can make SIMD vectors with std.meta.Vector()
<ifreund> you can splat values with @splat()
<shakesoda> ifreund: 7's practical, vendor support be damned
<shakesoda> a situation which won't last forever. i've been considering never upgrading again ;)
<ifreund> you can then do stuff like `vec + @splat(16, 1);` to add 1 to every element in vec
<CodeSpelunker> ifreund: that's awesome, thanks for sharing
<shakesoda> the vector stuff is magical
<ifreund> yeah, llvm is doing the heavy lifting in this case
<CodeSpelunker> liking zig so far
<ifreund> codegen for that's going to be fun for self-hosted
<shakesoda> ifreund: at least it's fine if it starts out very naive in that case
<companion_cube> can't self hosted "just" fallback to non simd ops?
<ifreund> well yes, but what would be the fun in that :P
<shakesoda> companion_cube: zig has infected my brain and i keep reading your name as comptime_cube
<CodeSpelunker> lol
<companion_cube> because you haven't seen me at runtime ;)
<shakesoda> my expectation is that at runtime you are simply cube. already calculated and ready!
<shakesoda> that or nonexistent, it was all compiler work all along
<ifreund> yeah, hate to break it to you but you get GC'd before runtime :P
<companion_cube> that sounds like chistian rapture stuff
<companion_cube> the reaper comes for me
<shakesoda> something interesting for the risc v crowd https://www.phoronix.com/scan.php?page=news_item&px=Alibaba-XT910-RISC-V-Speed
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> I would love to have a beefy risc v laptop
<KoljaKube> What is the best way to compare a slice and a C string? std.cstr.cmp doesn't like slices, and std.mem.eql doesn't like C strings
<KoljaKube> ifreund: Do those exist? What's the big advantage of risc v anyway?
<ifreund> KoljaKube: probably std.mem.span() the C string
<ifreund> and no they don't yet, but will eventually
<companion_cube> a beefy wasm laptop
<ifreund> risc v is a open standard unlike x86 or arm
<KoljaKube> ifreund: Would span traverse the C string to find its length?
<ifreund> yes
<KoljaKube> Mhkay. So hand-rolling the comparison would be faster, I guess :-/
<ifreund> marginally, but does it really matter in your use case?
<KoljaKube> Very likely not. I just had hoped for a better solution, given that std.cstr exists at all
<KoljaKube> While I get that an open architecture is nice, is there any advantage on top of that?
<ifreund> well it's also vastly simpler and nicer to work with than x86
<KoljaKube> That's not too hard from what I understand ;-)
<KoljaKube> And compared to e. g. ARM?
<KoljaKube> My interest was piqued when Chris Lattner joined SiFive, but I'm not sure I'm getting the big benefit for consumer hardware
<KoljaKube> Brb, bringing the little one to bed
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> well, not needing to pay licensing fees is a solid advangate. It's also extensible in a way that ARM isn't afaik
<ifreund> I believe it also has potential for greater theoretical efficiency, but am not an expert
<Bastian[m]> I recently saw https://twitter.com/Underfox3/status/1295598895679131648 in my twitter TL, can't really judge it but it looks like an exciting riscv application
dongcarl has quit [Read error: Connection reset by peer]
<KoljaKube> Bastian[m]: That's what I meant when I said "consumer hardware". Being able to design/build special-purpose chips relatively easily is cool, but I'm not sure why I would want to have the architecture in my next general purpose laptop
dongcarl has joined #zig
<KoljaKube> And, given the introduction of Apple silicon, if the dominant architecture of other vendors switches away from x86, I'd bet it will be ARM
<KoljaKube> But I will watch any risc v news with great interest. It does sound neat
<Bastian[m]> yeah, but at least arm could get some long term competition, I've also seen riscv just in an emulated fuzzing application, compile the target for riscv and run it in a jit-ed emulator for improved performance by stubbing syscalls and better per core scaling
dongcarl has quit [Read error: Connection reset by peer]
st4ll1 has joined #zig
dongcarl has joined #zig
a_chou has joined #zig
<fengb> I'm curious how RISC-V will play out. The core instructions are a little... weak so what's the ecosystem going to gel around
st4ll1 has quit [Quit: WeeChat 2.9]
<companion_cube> are they weak even with the various extensions>
<companion_cube> ?
a_chou has quit [Remote host closed the connection]
dongcarl has quit [Read error: Connection reset by peer]
<fengb> Those are pretty comprehensive. I'm curious if it'll develop into 2 ecosystems
<fengb> Embedded and "full"
dongcarl has joined #zig
<companion_cube> embedded probably has a better chance of growing (like HDD chips and stuff)
<KoljaKube> Hm, the no-variable-shadowing is starting to get a little annoying
xackus has quit [Ping timeout: 240 seconds]
<KoljaKube> So what if my generic struct needs to have a field named like a parameter of its template?
<fengb> If nvidia absorbs arm, I can see a lot of vendors potentially jumping ship
marnix has joined #zig
<KoljaKube> Given the momentum arm has, I'd be surprised
<KoljaKube> Also, the value of arm depends on its adoption. I'd expect any buyer to behave accordingly
dongcarl has quit [Read error: Connection reset by peer]
marijnfs has joined #zig
<marijnfs> mutex changed?
dongcarl has joined #zig
<Nypsie[m]> Yes, I believe it's simply std.Mutex now
<Nypsie[m]> Yes, I believe it's simply std.Mutex now
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dddddd_ has joined #zig
dddddd has quit [Ping timeout: 256 seconds]
eiro has joined #zig
<eiro> hello people
dddddd__ has joined #zig
dddddd_ has quit [Ping timeout: 264 seconds]
dddddd_ has joined #zig
marijnfs_ has joined #zig
<ifreund> hello!
dddddd__ has quit [Ping timeout: 264 seconds]
marijnfs has quit [Ping timeout: 260 seconds]
dddddd has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dddddd_ has quit [Ping timeout: 240 seconds]
dongcarl has joined #zig
<oats> what? Is arm getting bought?
<Nypsie[m]> Yes, it's for sale
cole-h has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> hrm, my rewrite of the wasm for in-memory incremental compilation seems to be silently corrupting memory elsewhere in stage2
<ikskuh> :O
dongcarl has quit [Read error: Connection reset by peer]
<ifreund> it does produce valid wasm binaries an the incremental compilation works, all with about half the LoC
<ifreund> annoying I can only get the memory corruption to reproduce when running the test harness
<ifreund> *annoyingly
dongcarl has joined #zig
<ikskuh> maybe it's the test harness then?
<ifreund> well, it doesn't seg fault on master :P
<ikskuh> lol
<ifreund> but yeah I don't really know what's happening
<ifreund> my best guess is that Decls are getting free'd without link.File.freeDecl() being called
<ifreund> and then my code does a good old use-after free
<ifreund> which doesn't manifest until the next test runs
<ikskuh> does stage2 already use the GPA?
<ifreund> yeah
<ifreund> already caught several leaks before I comitted them :)
<ifreund> anyhow, I need to go buy food before the store closes so I'll have to debug later
<ikskuh> neat
leeward has joined #zig
wootehfoot has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
Akuli has joined #zig
gordonfish has joined #zig
gordonfish has left #zig [#zig]
r0bby has quit [Ping timeout: 246 seconds]
kushalp has quit [Read error: Connection reset by peer]
tracernz has quit [Ping timeout: 256 seconds]
procnto has quit [Read error: Connection reset by peer]
karrick has quit [Read error: Connection reset by peer]
kwilczynski has quit [Read error: Connection reset by peer]
rzezeski has quit [Read error: Connection reset by peer]
waleee-cl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
r0bby has joined #zig
cole-h_ has joined #zig
r0bby has quit [Excess Flood]
karrick has joined #zig
dongcarl has joined #zig
kwilczynski has joined #zig
rzezeski has joined #zig
tracernz has joined #zig
cole-h has quit [Ping timeout: 256 seconds]
xackus has joined #zig
kushalp has joined #zig
kwilczynski has quit [Max SendQ exceeded]
kwilczynski has joined #zig
r0bby has joined #zig
kwilczynski has quit [Max SendQ exceeded]
kwilczynski has joined #zig
procnto has joined #zig
<andrewrk> ifreund, run it with valgrind
<andrewrk> stage2 should be immune to use-after-free memory corruption on the heap, but it could happen with stack variables
<andrewrk> this could potentially also be a good time to learn to use https://rr-project.org/
<andrewrk> if you capture the corruption happening 1 time, you can then use it to debug the same execution deterministically, and you can even do reverse-continue + hardware memory watchpoint to find when the memory got corrupted
<andrewrk> IMO it's worth learning. it actually only took 1 minute to learn once I decided to try it out. it's really simple
<andrewrk> damn, another endangered species mozilla project
<ikskuh> andrewrk: nice showoff in the stream btw :)
<ky0ko> re:zig on old windows (9x/2000), that would actually be more useful to me than zig on current windows
<andrewrk> heh, which one?
<ky0ko> (i'm an outlier!)
<ikskuh> andrewrk: just zig in general
<ikskuh> btw: what's YOUR favourite zig feature?
<andrewrk> ah :)
<andrewrk> catch |err| switch (err)
<ikskuh> yeah this is definitly a good one
<ikskuh> i was team comptime at first, but i think error handling and pointer types are just so much more convenient than C equivalent
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ikskuh> you have achieved that i now feel unsafe programming C/C++/C#
<ikskuh> because error handling is so much more clumsy
<andrewrk> I think it really comes down to control flow
<ikskuh> "everything expression" is quite nice
cren has joined #zig
<ikskuh> try foo.create(switch(bla) { })
<ikskuh> this is just great :)
ave_ has quit [Quit: o/ https://thelounge.lasagna.dev]
linuxgemini has quit [Quit: o/ https://thelounge.lasagna.dev]
lunamn has quit [Quit: o/ https://thelounge.lasagna.dev]
wootehfoot has quit [Read error: Connection reset by peer]
<ifreund> andrewrk: thanks for the tips, I have made my dinner now and will give it a try
<andrewrk> ifreund, I'm invested in this because in theory memory corruption should only be possible via dangling stack pointers now
<andrewrk> (and I have a plan to solve that too!)
<ifreund> well I'm not 100% sure it's memory corruption, but i'm not sure what else it could be. Heres the stack trace: https://paste.rs/0vr
<ifreund> something is messing with a hash table in Module that I don't think I directly had anything to do with
<andrewrk> ah, to be clear, a segfault could very well be use-after-free - but it means that a segfault happened instead of corruption
<ifreund> good to know
<andrewrk> oh hm this is in the -femit-zir code
<ifreund> yeah it seems very strange to me, which is why I jumpped to "memory corruption"
<andrewrk> this is in code that I recently added, I probably did something silly
<ifreund> alright well I have my branch which triggers it pushed here if you want to dig in https://github.com/ifreund/zig/tree/s2-wasm-rework
<andrewrk> ok will take a look as soon as I fix master branch
<ifreund> thanks, I will move on to implementing function calls then
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
heidezomp has joined #zig
<heidezomp> hey andrewrk, I was still investigating bug #6082 about the mtimes on Linux which you just closed. I found out that the actual granularity is set by the CONFIG_HZ kernel configuration, which on my laptop is 250Hz. Do you still want me to investigate further for a "proper" Linux implementation of isProblematicTimestamp, or are you ok with your fix?
<andrewrk> heidezomp, I'd be interested in a further improvement. what do you think it might look like?
<andrewrk> I'll re-open the issue
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<heidezomp> I don't have a solution yet, I was still in investigation mode ;) But once the actual granularity on the system can be found (which might involve writing some temp files (yuck!) and then doing some math), at least we know the actual number of significant digits to discard... I'm afraid I haven't found a better solution yet
<heidezomp> This only applies if the kernel isn't compiled "tickless" (which is done for real-time kernels I guess?)
<heidezomp> If this sounds too ugly/hacky to you, I guess I can just let it be... or I'll dump my observations in the issue, if you've reopened it
<andrewrk> the problem with opening temp files to determine granularity is that it might fail, and also the temp file might be a different filesystem than the actual file we are trying to observe, which may be on a read only file system
<heidezomp> hmm you're right, this would only work if the granularity of the fs is greater than the CONFIG_HZ of the kernel
<andrewrk> the real answer is for operating systems to provide a way to determine if a file has changed since you last looked at it. all it would have to do is increment an integer. or update a few random bytes to new random bytes on open-for-writing
<andrewrk> it's ridiculous that we as application developers don't have such APIs available to us after all these years
<heidezomp> yes, if only everyone in the world did things in a sane and proper way :D well we're trying raise the status quo with Zig at least ;)
<andrewrk> :)
<heidezomp> I'll look into it some more and then dump my findings in the issue, even if I don't find a proper solution, at least what this "kernel bug" is will be documented a bit more for posterity... is that okay with you?
<andrewrk> yes absolutely
<heidezomp> cool!
<andrewrk> it doesn't make sense to me that linux would not update the mtime when we are writing to the file anyway
<andrewrk> it's not like atime where it turns a read-only operation into a read-and-write operation
<heidezomp> especially since there is `utimensat` which _can_ apparently set the timestamps with nanosecond precision
<andrewrk> ifreund, I'd like to unify Wasm.zig and codegen.zig so that they follow the same code skeleton, (1) are you on board with that? and (2) would it be better for me to do that before or after looking at s2-wasm-rework ?
<ifreund> you mean codegen/wasm.zig? or link/Wasm.zig?
<andrewrk> codegen/wasm.zig
<andrewrk> idea being rather than codegen.zig generateSymbol and codegen/wasm.zig genCode being seperate functions the logic from the latter is spliced into the former
<andrewrk> benefit would be that the logic that is architecture-independent gets de-duplicated
<ifreund> yeah I agree that that should probably happen, there's a bit of experimentation left to do still with regards to the rework to the in-memory incremental compilation approach
<ifreund> bascially need to get function calls working to prove this approach of emiting some kind of escape sequence into the in-memory code and then replacing it with the function index on flush is sound
<andrewrk> I'm also ok with letting it diverge some more and seeing what happens. maybe we find out that it wouldn't be worth it after all
dongcarl has quit [Read error: Connection reset by peer]
<ifreund> so yeah I'd rather wait unitl I get this rework done
<ifreund> is it blocking you on anything or just come up on the todo list?
<andrewrk> sounds good. I'm looking into the stack trace you linked me now
<ifreund> sweet
dongcarl has joined #zig
CodeSpelunker has quit [Quit: CodeSpelunker]
<ifreund> that's what I get from zig-git build test-stage2 -Denable-wasmtime=true
<andrewrk> ah, I have to figure out how to update my wasmtime
<ifreund> I recently packaged it for void, wasn't too bad
<ifreund> oh, you might not need wasmtime to reproduce
ave_ has joined #zig
lunamn has joined #zig
linuxgemini has joined #zig
<andrewrk> I got it installed
<ifreund> yeah just being on my branch triggers it even without the -Denable-wasmtime=true
<ifreund> that's weird
<ifreund> or well I guess it still compiles the test cases but doesn't check their output?
cren has quit [Quit: Swirc IRC client]
<fengb> Yes, the test runner always does a cross compile. Actually executing the test is enabled via flags
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> pretty sweet right
dec05eba has joined #zig
heidezomp has quit [Remote host closed the connection]
<andrewrk> to be clear it executes all the tests that it can. -Denable-wasmtime informs the test harness that you are able to execute wasi tests
<fengb> Did I miss a stream? D:
<ikskuh> it looks like
<dec05eba> is anyone working on a http client? im working on one right (starting with the tls layer)
<ikskuh> dec05eba, do you know zig-bearssl?
<dec05eba> ah, i meant in pure zig
<ikskuh> oh, including tls?! :D
<dec05eba> yes
<fengb> :o
<fengb> truemedian has implemented protocol handling only: hzzp and wz
<ifreund> theres some http header stuff in the std as well no?
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
ur5us has joined #zig
<KoljaKube> The code owes a lot to daurnimator, but I'm finally moving in the right direction. Man, Zig's comptime metaprogramming is cool! https://gist.github.com/koljakube/0f4555cb69abeea90c56c4a18ff1db03 (registerForeignClasses is where the magic happens)
<ikskuh> neat!
<KoljaKube> It really is! I haven't had this much fun discovering a language since I got into Ruby in like '08 or so
<ikskuh> hehe
* ikskuh is struggling with his too large codebase :D
<ikskuh> something in my base does this:
<ikskuh> "\n" gets unescaped, stored, loaded and unescaped in printing :D
<dec05eba> i like how small static binaries zig generates. For such small binaries the only options i really have is musl and zig
dongcarl has quit [Read error: Connection reset by peer]
marnix has quit [Ping timeout: 256 seconds]
<dec05eba> i had a program written in python and it ended up using around 70mb ram for some reason. Then i rewrote it in c with musl and it uses 50kb with 0 dependencies. Now I get that but with extra nice features with zig
dongcarl has joined #zig
<KoljaKube> Yeah, I think Drew DeVault had a blog post comparing binary sizes of languages, with Zig being at or close to the top
<companion_cube> I think he was comparing numbers of syscalls
<ifreund> both actually
<KoljaKube> ifreund: Angeber ;-)
<ifreund> but it's really not a meaningful benchmark, just kinda neat :P
<KoljaKube> Where did you pull that from this quickly?
<dec05eba> i got my binary smaller than that. I got it to 2kb
<KoljaKube> Sure, but still interesting
<ifreund> I have all the links
<KoljaKube> The linkmaster :-o
Akuli has quit [Quit: Leaving]
st4ll1 has joined #zig
joey152 has joined #zig
<andrewrk> ifreund, this crash is perplexing
gert_ has joined #zig
<ky0ko> is it (or could it be) possible to target ms-dos/freedos with zig
<andrewrk> oh neat, I didn't know about freedos
cmann has joined #zig
<ifreund> :/
<ky0ko> 16 bit would be a hassle, obviously, but i know a few other languages can target ms-dos with vsci or dpmi
<ifreund> I think function calls are on the verge of working and then I will try and help debug
<andrewrk> ifreund, ok, I followed my own advice with using rr, watchpoint, and reverse-cont and it led me directly to the problem, haha
<ifreund> lol
<andrewrk> this really is awesome, you gotta try this
<ky0ko> and one of the various machines i like to do development on runs dos+desqview/x
<andrewrk> ky0ko, I could see that being in scope, especially given the existence of freedos
<ifreund> I've been eyeing rr for a while, it certainly looks awesome
<pixelherodev> ky0ko: 16-bit wouldn't be the *worst*
<pixelherodev> I'm working on a 16-bit target
<pixelherodev> And I want to work on z80 (8-bit!) eventually
<andrewrk> ifreund, check it out: https://clbin.com/xoi4Z
<ifreund> nice, so it was a use after free of the metadata hashmap between testcases?
<andrewrk> yeah that led directly to the issue
<andrewrk> it's a spot-the-fail
<andrewrk> https://clbin.com/KmAmU look how those defers should be errdefers
<ifreund> heh, yep
<ifreund> one of them is though!
<andrewrk> so this was a use-after-free. it was not memory corruption, however, and the fact that it wasn't memory corruption is why debugging it with rr was so straightforward
<ifreund> yeah
<ifreund> the funny part was that my code triggered it
<andrewrk> this still counts as "safe"
<andrewrk> yeah
<andrewrk> will push to master shortly
<ifreund> nice
<ifreund> I've come to realize that putting escape sequences in the code is a dumb idea and just made an arraylist of offsets instead
<ifreund> Decl.fn_link is getting a little chunky for wasm though, I may investigate moving that to Module.Fn or whatever that was
xackus has quit [Ping timeout: 265 seconds]
<andrewrk> tfw Decl.fn_link is a chonky boi
dec05eba has quit [Quit: Leaving]
ur5us has quit [Quit: Leaving]
ur5us has joined #zig
dddddd_ has joined #zig
dddddd has quit [Ping timeout: 240 seconds]
dddddd__ has joined #zig
dddddd_ has quit [Ping timeout: 240 seconds]
dddddd_ has joined #zig
chrismills has joined #zig
dddddd__ has quit [Ping timeout: 240 seconds]
dddddd__ has joined #zig
dddddd_ has quit [Ping timeout: 240 seconds]
chrismills has quit [Remote host closed the connection]
ovf has quit [Ping timeout: 244 seconds]
jzelinskie has quit [Read error: Connection reset by peer]
utzig has quit [Read error: Connection reset by peer]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
JimRM has quit [Ping timeout: 272 seconds]
dddddd_ has joined #zig
dddddd__ has quit [Ping timeout: 240 seconds]
marijnfs_ has quit [Quit: Lost terminal]
lanodan has quit [Ping timeout: 260 seconds]
ovf has joined #zig
ovf has quit [Excess Flood]
eddyb[legacy] has joined #zig
JimRM has joined #zig
<pixelherodev> Thought there was another netsplit for a minute :P
craigo has quit [Ping timeout: 265 seconds]
jzelinskie has joined #zig
utzig has joined #zig
ovf has joined #zig
cmann has quit [Remote host closed the connection]
lanodan has joined #zig
<ky0ko> that'd be cool! for my current purposes 32-bit dpmi or vcpi interface is what i'd want
<ky0ko> if 8 bit stuff works an sm83 target would be cool too (the cpu in the gameboy. which is not a z80.)
<andrewrk> ky0ko, architectures like sm83 and z80 are one of the reasons we have a non-llvm backend :)
<andrewrk> ugh so many llvm11 regressions to report
<pixelherodev> Behold, the field in which I grow my shock.
<pixelherodev> Note that it lays barren
cole-h_ is now known as cole-h
traviss has quit [Quit: Leaving]
traviss has joined #zig
<ifreund> nice, function calls work
<andrewrk> I wonder what it would look like to start making wasm builds of stage2 for an in-browser sandbox
<ifreund> that would be pretty slick
<ifreund> though I guess you'd need a VM of some kind to run non-wasm code