<g-w1>
how did you become a better programmer? just by writing code?
<lemmi>
isn't complaining and wishing a lot the normal way to get better at things?
<lemmi>
writing code? can't be that simple, can it?
<andrewrk>
g-w1, yep just by exploring my interests
<andrewrk>
probably I learned the most when I did something a second time
<andrewrk>
it's a lot easier to read other peoples' writings and advice about technical stuff if you already tried to do it yourself first and ran into the problems firsthand
<g-w1>
agreed! that has happened to me multiple times. thanks for the insights
Falconerd_ has quit [Quit: Falconerd_]
<g-w1>
small patch coming up for array type size needing to be comptime and correct source location for redundant comptime
<g-w1>
ah nvm, array size already works since its in typeExpr. i will just fix the src location hten
<g-w1>
*then
olabaz has left #zig ["WeeChat 2.3"]
xackus has quit [Read error: Connection reset by peer]
xackus_ has joined #zig
<andrewrk>
g-w1, I nabbed it real quick
<g-w1>
oop, looks like you were too fast :P
<g-w1>
could the body of typeExpr be just `return comptimeExpr(gz, scope, .{ .ty = .type_type }, type_node);` ?
<andrewrk>
yes it could
<g-w1>
ok, not important, but something for me to keep in mind
gazler_ has joined #zig
gazler has quit [Ping timeout: 252 seconds]
<recalloc>
More fanning: really appreciate the design pattern in std where one struct (e.g. Random or Allocator) is provided by multiple engines to let the user decide which to use instead of a single default :)
<recalloc>
I know when I worked in Python there's simply an out-of-the-way dont-worry-how-it-works random.Random, but knowing I can in-place substitute the Algo when I want to has just the best feeling
xackus_ has quit [Read error: Connection reset by peer]
xackus__ has joined #zig
earnestly has quit [Ping timeout: 252 seconds]
<andrewrk>
that's just good ol' object oriented programming :)
<oats>
andrewrk: it's been really inspirational seeing your work on zig over the last couple years, stuff like this has helped keep me going working on my degree :)
xackus has joined #zig
xackus_ has joined #zig
xackus__ has quit [Ping timeout: 240 seconds]
xackus has quit [Ping timeout: 240 seconds]
<andrewrk>
:)
zenkuro has quit [Ping timeout: 268 seconds]
<recalloc>
More a complement on zig's stl than core language design. It feels much cleaner than most other stdlib's I've personally used
xackus has joined #zig
xackus_ has quit [Ping timeout: 265 seconds]
xackus has quit [Ping timeout: 252 seconds]
<andrewrk>
thanks! btw have you had a chance to play with hash maps yet? I feel like the std lib hash maps are pretty excellent
<andrewrk>
std.AutoHashMap(K, V)
<andrewrk>
that's something I sorely missed in C
<shachaf>
Does the standard library being MIT-licensed mean approximately every program compiled with Zig needs to include the copyright notice?
<andrewrk>
no you don't need to do that
<shachaf>
Why not, if you're linking the standard library?
<andrewrk>
the license governs what you can do with the source files, not compiled artifacts
<andrewrk>
what you're not supposed to do is copy zig and delete the license, or fork zig and delete the license
<andrewrk>
basically, if you're using zig source code, don't try to hide that it comes from zig
<shachaf>
Wait, really? MIT license doesn't mean you have to include a copyright notice with compiled copies?
<shachaf>
That doesn't sound like the standard interpretation. It would be good if the license made that clear.
<waleee-cl>
but I'm not seeing the heaps of licenses that would be the implication on eg. my phone or elsewhere.
<recalloc>
Really appreciate std.StaticBitSet, though! Really appreciate how types-as-comptime-values lets the compiler decide what uint type makes most sense for the bitarray size.
<waleee-cl>
(the phone has exactly 3 licenses that I found, 2 of them for video codecs)
<waleee-cl>
ok, that was a lie. Apparently loads more if you had activated the developer mode
<waleee-cl>
* loads more was listed
<shachaf>
My Android phone has a very long list of third-party licenses.
<waleee-cl>
yeah, I discovered that now. I hadn't checked post-enabling dev mode on mine
r0bby has joined #zig
zenkuro has joined #zig
v0idify has quit [Ping timeout: 240 seconds]
v0idify has joined #zig
sord937 has joined #zig
notzmv has quit [Ping timeout: 252 seconds]
ur5us_ has quit [Ping timeout: 240 seconds]
zenkuro has quit [Ping timeout: 252 seconds]
zenkuro has joined #zig
mikdusan1 has joined #zig
mikdusan has quit [Ping timeout: 268 seconds]
notzmv has joined #zig
mikdusan1 has quit [Ping timeout: 268 seconds]
[wtf] has joined #zig
notzmv has quit [Ping timeout: 252 seconds]
cole-h has quit [Ping timeout: 240 seconds]
mikdusan1 has joined #zig
meinside has quit [Quit: Connection closed for inactivity]
leon-p has quit [Quit: leaving]
mikdusan1 has quit [Quit: WeeChat 3.0.1]
earnestly has joined #zig
mikdusan has joined #zig
recalloc has quit [Ping timeout: 246 seconds]
recalloc has joined #zig
mikdusan has quit [Ping timeout: 252 seconds]
mikdusan1 has joined #zig
jokoon has joined #zig
Guest72431 has joined #zig
ur5us_ has joined #zig
ur5us_ has quit [Ping timeout: 276 seconds]
Guest72431 is now known as notzmv
ur5us_ has joined #zig
notzmv has quit [Read error: Connection reset by peer]
notzmv has joined #zig
ur5us_ has quit [Ping timeout: 250 seconds]
codingstream has quit [Ping timeout: 246 seconds]
dyeplexer has joined #zig
lonjil has quit [Quit: No Ping reply in 180 seconds.]
lonjil has joined #zig
klltkr has joined #zig
Amun_Ra has quit [Quit: Gdyby mi się chciało tak jak mi się nie chce…]
<fengb>
“maisiliym: Creator of sajban - Li suffers from an intolerence to idiocy. Therefore, he does not address people, only ideas. Hence, any bad feelings are unwarranted.”
<fengb>
lol
<klltkr>
:D
jokoon has quit [Quit: Leaving]
<ifreund>
wait, this is another wayland compositor I didn't know about?;2;13~
<klltkr>
Not a very good one!
<ifreund>
klltkr: your project? Not using wlroots is a bold sep
<klltkr>
Yeah, my project
<ifreund>
and you've even got your own scanner, neat
<klltkr>
I suspect I'll give up at some point and use wlroots if I continue on. Years ago I started a Common Lisp compositor, the ulubis mentioned in our friend's issue (https://github.com/malcolmstill/ulubis), that was pre-wlroots so I already knew the steps required to get very basic drm/kms stuff working
<ifreund>
well, if you're not aware I maintain idiomatic zig wlroots and libwayland bindings, might be worth checking out
<ifreund>
I'm curious to figure out what choices you made with your scanner though
<klltkr>
I'm happy to answer any questions
<ifreund>
oh damn, you have your own wayland protocol implemenation as well
<klltkr>
I've always felt that the wlroots stuff couples too many things together. To me the backend stuff should be a separate library (i.e. a toolkit for rendering and input handling that targets X11 / Wayland and DRM) and that could be quite separate from code that simplifies the wayland bits
<klltkr>
Yeah, I was basically experimenting with a "pure" (you can't get that pure, i.e. static binary, because you will always end up needing OpenGL)
<ifreund>
I don't disagree, I've toyed with the idea of rewriting the "wayland bits" in zig with a pure-zig wayland implemenation while still using the backend parts of wlroots
<ifreund>
yeah linking mesa is always the issue :/
<klltkr>
You could in theory do a pure compositor if you implemented all of libdrm (or at least enough to get pageflips) and libgbm to get pixel buffer into which to draw
<klltkr>
*pure software compostior
<ifreund>
which would be awesome, but ultimately not very usable for the typical modern desktop
<klltkr>
It would be an interesting exercise
<klltkr>
Yeah
<klltkr>
I might take another look at wlroots and see if I can just extract the backend bits
<ifreund>
klltkr: I'm pretty sure wlroots is modular enough that you can choose not to use the wayland protocol bits
<ifreund>
romangg is doing exactly this for KwinFT currently
<klltkr>
It'll still make me use wl_list though won't it :D
<ifreund>
this will be updated to use std.meta.FieldEnum() when 0.8.0 releases, which will be a bit cleaner still
<klltkr>
I'm not familiar with std.meta.FieldEnum()
<ifreund>
it gives you an enum with variants for every field of a struct, which would mean list.Head() could take that enum instead of the field name as a string
<klltkr>
Ah cool
<Nypsie>
klltkr: Nice wasm interpreter you got there as well :)
<klltkr>
Sometimes I wonder if Wayland needs a single server implementation, let's call it X12 for arguments sake, and it simply provides a special-cased window manager protocol that forwards on messages to a manager client. Save everyone reimplementing all of this behaviour over and over again, and as side benefit decouple stuff so it that e.g. the window manager can crash and be restarted without losing the entire session. At the end of the day I want to draw
<klltkr>
some silly effects on screen and play around with user interaction but get caught up in understanding how everything works
<ifreund>
klltkr: I think wlroots goes a long ways towards simplifying the job for server authors and reducing code-duplication. A fully-featured window manager protocol has the disadvantage of increasing the number of round-trips required to display things on the screen, I don't think anyone's given it a very serious attempt yet.
<companion_cube>
just someone please rewrite a modern X server :/
<ifreund>
I do have a layout protocol for my compositor that allows a select client to determine the layout of the views on the screen
<ifreund>
companion_cube: nah, the server's not the only problem, the protocol sucks too
<companion_cube>
maybe with a new codebase it'd even be possible to improve the protocol without throwing 40 years worth of code out the window
<companion_cube>
(just realized yesterday that yet another thing I use, `dot -Txlib`… uses X)
<klltkr>
ifreund: yeah, you'd end up chatting more on the protocol but the messaging I don't think is the bottleneck and the latency for unix domain socket will be what, some tiny fraction of your 16 ms render budget
<klltkr>
ifreund: a layout protocol sounds interesting
<ifreund>
it's very centered around dwm-esque dynamic tiling, but it's as efficient in terms of round-trips as leon-p and I were able to get it
<klltkr>
companion_cube: yeah, Wayland is definitely correct (in my opinion) in what it does and what it fixes. My feeling is that people have issues with Wayland because each compositor is essentially a reimplementation of a bunch of core functionality and then people get upset because they can't copy and paste. wlroots attempts to tackle that by providing a library, where I'm starting to think a single implementation of a server that environments / managers
<klltkr>
can hook into to might be cool (and give you that cool thing where you can write (an incredibly basic) X11 window manager in a few dozen lines of code)
<klltkr>
Nypsie: thank you! It's currently broken on the latest 0.8.0; my goal for the day is fixing that
<mq32>
klltkr: how usable is it already?
<companion_cube>
klltkr: it's a long debate I guess.
<companion_cube>
it's kind of sad people are ok with throwing away X, but not stuff like posix, which is much worse
<ifreund>
posix is also much harder to throw away than X
<ifreund>
like I'd be all over that if I saw a reasonable way to do so
<klltkr>
mq32: I think (can't say 100% for sure) that it will run any MVP (i.e. the base specification without any of the extensions). I.e. I think I'm correctly implementing all of the opcodes in that almost all of the official testsuite stuff passes for execution. What I don't have implemented fully is the validation step
<fengb>
How is posix much worse than X?
<ifreund>
I for one don't think it is, I think posix isn't great but X is a lot worse
<mq32>
klltkr: okay, cool. so i can run zig programs? *grin*
<klltkr>
mq32: I would love to know if you could!
<mq32>
hmm
* mq32
writes foxwren on the list of deps for dunstwolke *grin*
<klltkr>
mq32 I was allocating arraylists with the arena allocator and being a but naught by holding onto previously allocated chunks, with the change it seems like those old chunks are being overwritten with 0xaa (which is good but it means I need to make it correct!)
<klltkr>
I was trying to do a bit of refactoring to see if I could get the same optimisation andrewrk got in https://github.com/ziglang/zig/issues/8220 (i.e. getting a branch prediction slot for each op instead of a single jump point and jumping directly)
<klltkr>
Because it's pretty slow at the moment
<klltkr>
mq32 what is dunstwolke?
<mq32>
an experimental OS of mine
<klltkr>
Nice
<mq32>
at least, that's the final goal
<mq32>
and i require all apps to be run in wasm as they should be movable in-flight between nodes
<klltkr>
It's funny that you say that because I was thinking of trying to stick it in a basic OS and also stick it in a Wayland compositor :)
<mq32>
and that requires stuff like wasm
<klltkr>
Interesting
<mq32>
where memory is allocated in a very controlled manner
<ifreund>
dunstwolke is an OS now? neat
<mq32>
ifreund: it always was!
<mq32>
dunstblick is the UI system
<ifreund>
so distributed OS thing?
<mq32>
but there are a lot of components i'm thinking about ^^
dyeplexer has quit [Remote host closed the connection]
<B767B_>
hello :-)
<B767B_>
I am a new to zig (started learning this week) and so far I love it :-)
<Nypsie>
Welcome :)
<B767B_>
Never enjoyed programming as much since Turbo Pascal 6.0 :-D
<B767B_>
I got a very simple problem though: how can I read keypresses from a terminal (Linux/bash)? Maybe I am too stupid to google correctly for it...
<andrewrk>
it's a bit of a tricky problem, very difficult to do portably
<B767B_>
I am fine if I get it runnning on linux for the moment. If possible at all.
isolier has joined #zig
<andrewrk>
I don't remember what the options are for doing this, but I bet someone else here does
<Nypsie>
Oh, I just realized the link you gave is Zig as well haha
<Nypsie>
Anyway, that example requires you to link libc, which mine doesn't
<B767B_>
That sounds like a big plus not to have to link libc.
<Nypsie>
There's some touchups that the example could use, such as resetting the original termattributes on error using errdefer, but I suppose it gets the general idea accross :)
<mq32>
andrewrk: took me half the evening tracking down that bug
<andrewrk>
that's why I took extra care to code it squeaky clean in stage2
<fengb>
Thanks!
<mq32>
i thought so :)
<mq32>
stage2 is code that is written with the knowledge of how to reach the goal
<mq32>
but: I'm using this MMIO wrapper now and it's pretty great
<mq32>
i am likely to revoke my views on volatile and could just live with @volatileLoad and @volatileStore
<andrewrk>
that's interesting to know
<andrewrk>
there are a lot of edge cases having to do with volatile as a pointer attribute
<mq32>
↑ see my bug report :D
<blueberrypie>
i just found out my employer has preapproved donation matching for zig software foundation. noice. bye gh sponsors
<mq32>
cool
<andrewrk>
sweet! thanks blueberrypie
<andrewrk>
we should probably announce in the release notes that this may newly be available to various employers
<g-w1>
why newly available? because of the zsf?
<blueberrypie>
i'm not sure how it works but my employer uses benevity for managing gift matching. I assume that other employers who use benevity will also support matching donations as well
<g-w1>
ahh i see
codingstream has joined #zig
codingstream has quit [Quit: WeeChat 3.0.1]
codingstream has joined #zig
<andrewrk>
yeah it's because we signed up for benevity and did all their paperwork
<andrewrk>
had to drive to the bank and get some stupid paper form for that
B767B has quit [Remote host closed the connection]
B767B has joined #zig
B767B has quit [Remote host closed the connection]