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/
craigo has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 244 seconds]
_Vi has quit [Ping timeout: 272 seconds]
<pixelherodev> Almost at the point where I figure out just how broken stage2 gets when there's a zero-register architecture :P
<andrewrk> s/broken/unimplemented/
<pixelherodev> Well, sorta
<pixelherodev> A bit of both
<pixelherodev> I don't think we have a proper fallback for when we can't allocate a register, for instance
<pixelherodev> Actually, I think the *only* thing it needs to do is use stack as fallback, so it might be fine already, depending on whether we have that
<shakesoda> you've got something register free?
ur5us has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
aarvay has quit [Quit: Connection closed for inactivity]
daex has quit [Ping timeout: 265 seconds]
<pixelherodev> shakesoda: SPU II has no general-purpose registers
<pixelherodev> Stack pointer, instruction pointer, flag register, base pointer <- four registers only
<fengb> Wasm has no registers
bens has joined #zig
<pixelherodev> huh
<pixelherodev> good to know
<fengb> Well it has locals that can be thought of as registers. So infinite registers?
<shakesoda> i suppose that makes sense
<fengb> Depends on your POV :P
<pixelherodev> Found the SPU-II issue
<pixelherodev> There's some x64-specific code being generated even when arch != .x86_64
<pixelherodev> Okay, back to where I was pre-rebase :)
aarvay has joined #zig
squeek502_ has quit [Ping timeout: 256 seconds]
squeek502 has joined #zig
tdeo has joined #zig
tdeo has quit [Remote host closed the connection]
tdeo has joined #zig
tdeo has quit [Remote host closed the connection]
tdeo has joined #zig
tdeo has quit [Remote host closed the connection]
tdeo has joined #zig
<andrewrk> my goodness azure, what is your problem now
<andrewrk> you are so needy
<pixelherodev> andrewrk: any reason not to host our own CI?
<andrewrk> opportunity cost
<pixelherodev> Not worth the time?
<andrewrk> right this minute I'm working on stage2. I'm not going to drop it and work on the CI
<pixelherodev> Agreed
<pixelherodev> On that note, I should figure out the codegen issue for SPU II
<torque> gitlab's ci is ridiculously easy to set up on custom hardware
<pixelherodev> There's easier (and better) too, but it's still an investment in time
<pixelherodev> Not just short-term either
<pixelherodev> It means you have to maintain it long-term
<daurnimator> torque: lies. outside of x86_64 is essentially broken
<daurnimator> oh looks like https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/725 may have finally been merged?
<torque> idk, we've been running it on raspi 4's at work for a while
<torque> also, I suspect this is probably only needed for the docker integration based on the mr description
<torque> since it's written in go there shouldn't be anything stopping the basic shell runner from working on any arch go supports?
<torque> frankly, the way docker supports different architectures is hot garbage anyway
<daurnimator> torque: we have access to powerful arm64 servers; tried to set up gitlab runner on them for zig; and ran into a whole load of things including that pr i linked
ur5us has quit [Ping timeout: 260 seconds]
craigo has joined #zig
cole-h has joined #zig
<torque> interesting
<andrewrk> oh yeah that was disappointing
aarvay has quit [Quit: Connection closed for inactivity]
marnix has joined #zig
dermetfan has joined #zig
marnix has quit [Ping timeout: 246 seconds]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
nikita` has joined #zig
cole-h has quit [Quit: Goodbye]
matti has quit []
matti has joined #zig
_Vi has joined #zig
dermetfan has quit [Ping timeout: 272 seconds]
<danyspin97> is there any way to iterate over files in a dir?
<ifreund> danyspin97: see Dir.iterate()
<danyspin97> ifreund: thanks!
marnix has joined #zig
dermetfan has joined #zig
<danyspin97> ifreund: I am reading the std.fs tests, and Dir.iterate is almost clear to me
<danyspin97> but I can't understand how to create a Dir from a path
<ifreund> std.fs.cwd().openDir()
<danyspin97> and without cwd?
<danyspin97> i.e. open /tmp/mydir
<squeek502> still use cwd() and pass an absolute path
<danyspin97> ah, I see
<danyspin97> a little counterintuitive though
<squeek502> yeah seems to be a source of confusion for a lot of people
<squeek502> as i understand it, its to better support platforms like WASI that don't have a concept of an absolute path
<ifreund> this, and to encourage use of relative paths wherever possible
<ifreund> note that fs.cwd() is basically free on most platforms
<ifreund> you can even call it at comptime on some
<ifreund> on everything except windows and wasi infact
<danyspin97> std.fs.cwd().openDir(path)
<danyspin97> std.fs.cwd().openDir(path, OpenDirOptions{})
<danyspin97> I assumed it was std.fs.cwd(path)
marnix has quit [Ping timeout: 240 seconds]
marnix has joined #zig
waleee-cl has joined #zig
<danyspin97> why is the compiler complaining here? https://git.sr.ht/~danyspin97/benice/tree/master/src/LoadRules.zig#L52
marnix has quit [Ping timeout: 240 seconds]
<danyspin97> (it says that there is no addType function)
<squeek502> danyspin97, you need to do const Rules = @import("Rules.zig).Rules;
<squeek502> you're getting the file's namespace rather than the pub const Rules struct within it
<danyspin97> Ah yea
<danyspin97> but shouldn't have the compiler complained before?
<danyspin97> when I declared `rules: *Rules`
<squeek502> no, files are valid structs as well
<danyspin97> ah, I see
<ifreund> danyspin97: note that you can totally use toplevel fields in files and then import and use them as `cons Rules = @import("Rules.zig");`
<squeek502> was just about to link a similar example, zls does that as well: https://github.com/zigtools/zls/blob/master/src/document_store.zig#L7
marnix has joined #zig
_Vi has quit [Quit: _Vi]
marnix has quit [Read error: Connection reset by peer]
layneson has joined #zig
marnix has joined #zig
Nypsie has joined #zig
lanodan has quit [Ping timeout: 260 seconds]
layneson has quit [Ping timeout: 240 seconds]
layneson has joined #zig
layneson has quit [Ping timeout: 256 seconds]
lanodan has joined #zig
marnix has quit [Ping timeout: 260 seconds]
layneson has joined #zig
<danyspin97> ifreund: ah, so river wm is yours
<danyspin97> nice project
marnix has joined #zig
layneson has quit [Ping timeout: 240 seconds]
<ifreund> thanks!
marnix has quit [Ping timeout: 240 seconds]
<danyspin97> I haven't tried it yet because the AUR package does not work
<danyspin97> with zig master
marnix has joined #zig
<ifreund> ah yeah, I decieded to stick with 0.6.0 to make packaging and contributing easier
<danyspin97> yea, that's nice
<danyspin97> I'll package it for exherbo when zig compiles there for me
<danyspin97> I guess I can add a (kind of) eclass for zig packgaes
<ifreund> that'd be cool, though I've haven't actually done an 0.1.0 release yet
jmiven has quit [Quit: reboot]
<ifreund> I daily drive river and it works quite well, but there are a couple more features I want before a first release
jmiven has joined #zig
marnix has quit [Ping timeout: 256 seconds]
bsrd has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 has joined #zig
dingenskirchen1 is now known as dingenskirchen
<fengb> 0.1 is the new 1.0 :P
<ifreund> indeed :P
<ikskuh> fengb: so you say i should release dunstblick 0.1 now? :D
Nypsie has left #zig ["WeeChat 2.9"]
<danyspin97> ikskuh: any link? :D
marnix has joined #zig
Nypsie has joined #zig
<ifreund> ikskuh: I see that zig finally overtook c++ :D
letoram has quit [Ping timeout: 260 seconds]
<danyspin97> the site isn't working though
tdeo has quit [Remote host closed the connection]
tdeo has joined #zig
letoram has joined #zig
Ashpool has joined #zig
<ikskuh> danyspin97: yeah, i forgot to patch that up
<ikskuh> should do that later *grin*
<ikskuh> ifreund: it will continue that way until i'm done
<ikskuh> also: it works for certain values of "works" :D
<ikskuh> has a lot of TODOs still and may crash at the first unexpected event, but hey. it works!
<ikskuh> latest push: 50.7% zig code
<ifreund> ikskuh: I'm not sure I'm grasping the vision of dunstblick, how do you plan to use this?
<ikskuh> aaah
<ikskuh> are you okay with spoilers for my next showtime talk? :D
<ifreund> sure :D
<ikskuh> i figured that dunstblick may be the right project for a talk
<ikskuh> i create a lot of self-made IoT devices
<ikskuh> small scale (lpc1786 or smaller) or large scale (RPI, ...)
<ikskuh> also i have a lot of services deployed on several machines
<ikskuh> my vision for dunstblick is to access all those systems with a very resource-gentle UI system
<ikskuh> web stack is too bloatet imho for that, it also requires you to write a lot of web servers and html/js frontends
<ifreund> neat, this is making a lot more sense with that use-case in mind
<ikskuh> so the idea of dunstblick is that you can easily discover applications in your local network and attach a interface to them
<ikskuh> for example: i have a rack with RGB LEDs built-in
<ikskuh> and i want to set the color/animation for those
<ikskuh> open up dunstblick, attach to "LED Control", change some colors, done
<ikskuh> same workflow for everything else
<ifreund> sounds quite handy
<ikskuh> the network-controllable power board? sure thing :D
<ikskuh> attach, flip some checkboxes, done :D
<ifreund> what all do your IoT devices do?
<ikskuh> right now, not that much :D
<ikskuh> i have these two i told you about, but i also have my stereo as IoT
<ikskuh> it's just an RPI+Amp
<ifreund> nice
<ikskuh> and i would like to control the media playing there not via SSH anymore :D
<ikskuh> another example: you could make a generic pulseaudio volume control
<ikskuh> throw that on all your machines and you can now control volume of your computer with your smartphone
<ikskuh> have a weather service sampling data from your local weather station? covered :D
<ikskuh> (i should add that conversation to the repo :D )
<ikskuh> and maybe write that down in a less conversation-style some time
<ikskuh> but i plan to make dunstblick also available as a normal application development UI system without networking
<ifreund> that would certainly help people grasp what dunstblick can do
<ikskuh> yeha
st4ll1 has quit [Ping timeout: 240 seconds]
st4ll1 has joined #zig
<danyspin97> cool project ikskuh
<ikskuh> thanks :)
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<ikskuh> ifreund, could you test dunstblick later? i would like to get my dependency list up to date :)
<ikskuh> i reduced it a lot
dermetfan has quit [Ping timeout: 272 seconds]
<ifreund> ikskuh: sure, probably have time this evening
<ikskuh> nice
marnix has quit [Ping timeout: 260 seconds]
Ashpool has quit [Read error: Connection reset by peer]
Ashpool has joined #zig
marnix has joined #zig
KKRT has joined #zig
dermetfan has joined #zig
Ashpool has quit [Remote host closed the connection]
cole-h has joined #zig
marnix has quit [Ping timeout: 240 seconds]
tdeo has quit [Read error: Connection reset by peer]
tdeo has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
Akuli has joined #zig
riba has joined #zig
<pixelherodev> ikskuh: what *is* dunstblick?
<ikskuh> working!
<ikskuh> it's my UI framework which is now 50% written in zig :)
<ifreund> haze gaze is my current translation to english
<ikskuh> ah :D
<ikskuh> it's a german wordplay
<ikskuh> dunst is haze, mist or fog
<ifreund> mist look?
<leeward> cloudy clouds?
<ikskuh> probably haze is the most fitting
<fengb> Why are we gazing at Haze?
<ifreund> i love the sound of haze gaze tbh
<ikskuh> blick is "look" as in "the look she gave me"
<leeward> I thought this was a no-hazing club.
<ikskuh> but: there's a german word "Dunstkreis"
<ifreund> like a ring of haze?
<ikskuh> which dict.cc translates as "society" which is right, but also completly wrong :D
<ikskuh> dunstkreis is the set of people with which you have regular contact
marnix has joined #zig
<ikskuh> like your friends, workplace, ...
<ikskuh> so the question "to which dunstkreis do you belong?" could be answered with "I'm one of thoe Zig people"
<ifreund> ok kreis makes sense, but I don't get the dunst part
<ikskuh> i cannot explain it more, it's a pretty specific german word
<ikskuh> but the bigger project is called "dunstwolke", so "misty cloud"
<ikskuh> which is a kind of (computer) cloud which is defined by your immediate (computer) surrounding
<ikskuh> and dunstblick is just a variation of dunstwolke
<ikskuh> "ikskuh --explain dunstblick" completed
<ifreund> oh I understand what a dunstkreis is now, just don't follow the logic behind the Kompositum
<ikskuh> aah, well. the project is way bigger than dunstblick alone ;)
<ikskuh> so dunstblick itself doesn't really make sense :D
<ifreund> no, but it sounds cool
<ikskuh> that's what i figured as well
<ikskuh> so i've gone with it :D
<ikskuh> i wonder if the @fieldParentPtr stuff is good enough to do a UI library with it
<ikskuh> without getting too inconvenient
<andrewrk> ikskuh, have you seen the foo.cast(T) pattern?
<andrewrk> it's pretty reasonable IMO
<ifreund> i mean, gtk is written in C
<ifreund> I'm sure you can pull something off
Nypsie has left #zig ["WeeChat 2.8"]
<andrewrk> there are 2 functions in the above example because I introduced a non 1-to-1 correspondance between the type and the tag
<ikskuh> andrewrk, no i haven't yet
<andrewrk> in practice it looks like: if (widget.cast(ScrollBar)) |sb| sb.moveToBottom();
<andrewrk> or just widget.cast(ScrollBar).?.moveToBottom();
<andrewrk> honestly starting to think about closing #130 with no plan for dynamic dispatch at all
<andrewrk> if somebody made a GUI lib with reasonable API it would seal the deal
nikita` has quit [Quit: leaving]
<shakesoda> i've been doing gui where the widgets are just enum/int typed with a unique id/index for whatever data they have. it doesn't have different actual types for widgets, they are just layout items
<shakesoda> i should port that to zig
<shakesoda> it's a derivative of this, and the huge comment on top probably explains it better than i will https://github.com/geetrepo/oui-blendish/blob/master/oui.h#L44
<andrewrk> I think I've solved result locations in a clean way in self hosted
<fengb> 🎉
<andrewrk> meanwhile azure is shitting its pants
<ikskuh> <andrewrk> if somebody made a GUI lib with reasonable API it would seal the deal
<ikskuh> i am afraid :D
<ikskuh> it might be my job to kill #130
<ifreund> do it! in the words of andrew kelly, "abstraction is overrated"
<shakesoda> needless abstraction is the cause of most software complexity
<ifreund> yup
riba has quit [Ping timeout: 260 seconds]
marnix has quit [Ping timeout: 246 seconds]
<pixelherodev> andrewrk: result locations solved *already*?! *Wow* you're moving quickly :P
<andrewrk> yeah hope you're ready for some "fun" rebasing :P
* pixelherodev sobs
<pixelherodev> Mind giving me like
<pixelherodev> six hours to finish up the PRs before you merge that?
<andrewrk> 7 files changed, 972 insertions(+), 695 deletions(-)
<pixelherodev> Wait no, that'd just mean *you'd* have to rebase
<pixelherodev> Whelps
<andrewrk> 0 codegen.zig changes fwiw
<andrewrk> it's mostly in astgen.zig and related
<ifreund> man I can't wait to get to use stage 2
<pixelherodev> Oh sick
<pixelherodev> That means I probably don't have to rebase
<pixelherodev> No linker changes?
<andrewrk> none
<pixelherodev> Perfect
waleee-cl has joined #zig
<pixelherodev> ikskuh: Okay stupid question, but do you mind encoding an instruction for me? :P
<ikskuh> yeah, i'm at the phone right now :D
<ikskuh> ask some binary editor or something :D
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
<pixelherodev> ikskuh: heh, heh, uh, yeah
<pixelherodev> Shouldn't 0x088E (little endian) be a load16???
<pixelherodev> I wanted to do a proper encoding (`@bitCast(u16, Instruction{})`) but it hits a TODO in stage1 :(
dingenskirchen has quit [Quit: dingenskirchen]
<pixelherodev> It can't do that at compile time I think
<pixelherodev> Might work if I make it var?
* pixelherodev shrugs
dingenskirchen has joined #zig
<pixelherodev> Huh, yep!
<pixelherodev> Woot, it works now!
<pixelherodev> Woot, it fully works!
<pixelherodev> Generates a valid ELF, which the emulator can run!
<ikskuh> NICE
<ikskuh> what was the test program?
<pixelherodev> Pushed ;)
<pixelherodev> You can take a look your - oh wait no
<pixelherodev> It's not in the test suite
* pixelherodev facepalms
<pixelherodev> Let me just fix that
<pixelherodev> It calls a function killEmulator() which is `asm volatile("undefined0");`
<ikskuh> :D
<andrewrk> tfw you have a ZIR instruction called coerce_result_block_ptr
<pixelherodev> lol
<pixelherodev> I love that the GOT calls are one instruction :)
ur5us has joined #zig
<andrewrk> honestly I think our debug builds are going to have quite reasonable perf
<pixelherodev> Definitely
<ikskuh> andrewrk: that's good to hear :)
<pixelherodev> Uhh, `LLVM ERROR: 64-bit WebAssembly (wasm64) is not currently supported` ??
<andrewrk> wasm64 doesn't exist
nvmd has joined #zig
<pixelherodev> Right, I have no idea why it thinks it should be targeting that
<andrewrk> the CI gods are angry today
<pixelherodev> Maybe it's because I messed up when adding to std.Target?
<pixelherodev> I'd run the tests locally but potato
KKRT has quit [Quit: KKRT]
<ikskuh> pixelherodev: what is os "spu_2"?
<pixelherodev> Wait what?
<pixelherodev> I didn't mark it as an os!
<ikskuh> huh
<ikskuh> wait, i've read that wrong
<pixelherodev> In self.os.tag?
<pixelherodev> The switch thingy there?
nvmd has quit [Quit: Later nerds.]
nvmd has joined #zig
<ikskuh> pixelherodev: btw, we can just integrate a 100% zig written assembler for spu mk2 :D
nvmd has quit [Client Quit]
nvmd has joined #zig
<ikskuh> ifreund: still awake for some testing?
<ifreund> ikskuh: lets do it, cloning the repo
<ikskuh> wait a sec
<ikskuh> still ripping out stuff :D
<ifreund> heh
<ikskuh> less code → better
<ifreund> of course
<ifreund> I think river should never break 10k LoC
<ifreund> I'm at 4k right now but am missing a few major features
<ifreund> suckless wouldn't be all that impressed I know, but it significantly less that e.g. sway
<ifreund> *it is
<ikskuh> i already have 6018 LOC C++ for dunstblick and 11496 loc zig :D
* ikskuh is scared
<fengb> 8k on Fundude D:
<fengb> Oh wait, 4k is a giant test
<ifreund> oh, yeah I guess river might be a little under 4k then if I exclude tests
<ifreund> I don't have very many though to be honest
<ikskuh> ifreund: you can clone now, only external dependency is sdl2, don't forget to checkout submodules
<fengb> I'm sad that my toy emulator has as many lines as your real project :(
<ifreund> well, my line count is going to jump up a good bit when I implement damage tracking
<ifreund> complexity as well
<ikskuh> i'm excited to see if it will build on first try or not :D
<ikskuh> and even more: *work*
<ifreund> ikskuh: hmmm https://paste.rs/YkP
<ikskuh> eerrrrrm
<ifreund> I think my zig build is a few days old
<ikskuh> or too new :D
<ikskuh> i'm going to update mine and check
<ikskuh> okay, i'm at current from website
<ifreund> just rebuilt master and it seems to have made it to the c++ code
<ikskuh> oho
<ifreund> ikskuh: alright, this is where I'm at https://paste.rs/PDF.png
<ikskuh> okay nice!
<ikskuh> you did "zig build run", right?
<ikskuh> ah, both run and normal build
<ikskuh> open another terminal and start calculator and minimal from the cache dir :)
<ifreund> heh, calculator looks funny at this scale https://paste.rs/VJc.png
<ikskuh> but: the zig experience is real :D
<ikskuh> it works :d
<ifreund> minimal seems to work as well
<ikskuh> wonderful :)
<ifreund> yes, running a experimental zig networked gui framework thing inside an experimental zig wayland compositor
<ifreund> andrewrk should be proud of us :D
<ikskuh> with an experimental compiler :D
<leeward> Does wayland itself still count as experimental?
<andrewrk> wow
<ifreund> leeward: the core protocol? no. the ecosystem? yes
<leeward> Fair enough.
<ikskuh> ecosystem is definitly experimental
<ikskuh> i'm using it for some time now, but i will probably go back to x11+i3
Akuli has quit [Quit: Leaving]
<ikskuh> i've lost some valueable parts of my workflow
<ifreund> ikskuh: curious, what in particular?
<ikskuh> screen sharing, mostly
<ikskuh> ad-hoc sharing from any program (obs, discord, jitsi, ...)
<ifreund> yeah that works (i did it for showtime) but is still experimental
<ikskuh> also sway glitches keyboard input
<ikskuh> repeated key presses when none are happening
<ikskuh> lost keys
<ikskuh> broken input states (meta key doesn't react anymore)
<ifreund> interesting, I never noticed any weirdness there in sway myself
<ifreund> I wonder if it would happen in river for you as well
<ikskuh> how often do you send your machine to standby? :D
<ikskuh> it often loses info when awaking from standby
<ifreund> hmm, not regularly
<ikskuh> for me it's the default mode
<ifreund> that'd probably be worth reporting though
<ifreund> It's certianly something that should be solved
<ikskuh> yeah
<ikskuh> but i cannot reproduce it
<ikskuh> so i can only say "it happens"
<ikskuh> not why, not when
<ikskuh> it's just a gut feeling atm
<ifreund> no fun :(
<ikskuh> yeah
<ikskuh> and i have no time for making nice bug repots
<leeward> Is there a version of @truncate that chops off the least significant bits?
<ikskuh> truncate + shift :D
<leeward> @intCast(uSmaller, v >> (bigger - smaller)) ?
<ikskuh> @truncate, but yeah :D
<ikskuh> i know that someone once build for android with zig. does anyone remember who that was?
<andrewrk> ikskuh, it was akavel
<ikskuh> thanks :)
<ikskuh> because dunstblick needs both a windows and an android client :D
<andrewrk> oh, I'm remembering the wrong thing. I know what you're talking about now
<andrewrk> don't remember that other person
<ikskuh> no worries
<ikskuh> i think i got enough info :)
<ikskuh> i found a nice project building a android apk without java :D
<ikskuh> which is a good starting point
<ikskuh> > Requesting permissions in the JNI "oh you have to do that in Java" or other dumb stuff like that. I am completely uninterested in your opinions of what is or is not possible. This is computer science. There aren't restrictions. I can do anything I want. It's just bits. You don't own me.
<ikskuh> if i get this to compile with "zig cc" instead of the NDK clang
<ikskuh> we can build android apps with zig :D
doesntgolf has joined #zig
doesntgolf has quit [Quit: doesntgolf]
doesntgolf has joined #zig
cole-h has quit [Ping timeout: 256 seconds]
dermetfan has quit [Ping timeout: 272 seconds]
<andrewrk> nice
<andrewrk> it's not uncommon to see a successful test output this in stage2: [info] (compiler): Update completed in 0 ms
<andrewrk> that's a debug build.