ifreund changed the topic of #river to: river - a dynamic tiling wayland compositor || https://github.com/ifreund/river || channel logs: https://libera.irclog.whitequark.org/river/
elshize has quit [Ping timeout: 252 seconds]
elshize has joined #river
elshize has quit [Ping timeout: 252 seconds]
elshize has joined #river
waleee has quit [Ping timeout: 252 seconds]
elshize has quit [Quit: WeeChat 3.0.1]
snakedye has quit [Read error: Connection reset by peer]
snakedye has joined #river
elshize has joined #river
snakedye has quit [Ping timeout: 250 seconds]
novakane has joined #river
novakane has quit [Remote host closed the connection]
novakane has joined #river
snakedye has joined #river
notzmv has quit [Read error: Connection reset by peer]
snakedye has quit [Quit: Quit]
snakedye has joined #river
<snakedye> ifreund any idea why I'm getting an error?
<ifreund> lol, does rust have the same crappy integer coercion rules as C? I got a compile error for passing a u32 where an i32 was expected
<ifreund> snakedye: I changed the argument order of push_view_dimensions, putting the serial last for consistency
<ifreund> I thought that would be fine as it caused a compile error in rivertile...
snakedye has quit [Ping timeout: 252 seconds]
novakane has quit [Quit: WeeChat 3.2]
novakane has joined #river
leon-p has joined #river
notzmv has joined #river
<elshize> ifreund: there's really no automatic type conversion in rust. there's some type coercion for references and pointers (say mutable coerces to immutable) but nothing like in c
<ifreund> elshize: yeah, I think snakedye must have manually added a cast in order to pass the u32 serial as the i32 x coordinate
<ifreund> Rust is definitely a step up in strictness over C, but I don't think it's as strict as Zig
<ifreund> it lets you coerce integers to floating point numbers
<ifreund> and it lets you do division on signed integers without specifying the trunc vs floor behavior
<leon-p> Once you used zig, you really can't go back to implicit conversion. I even use -Wconversion -Wsign-conversion -Wfloat-conversion in C now :D
<elshize> ifreund: you can't implicitly convert an int to float in rust
<elshize> as far as I know, any division will round towards zero, but I'm not 100% on this
<elshize> I haven't done much Zig, but for what it's worth, Rust is the most strict out any languages I've learned so far.
<elshize> but again, can't compare to zig
<ifreund> elshize: ah looks like I was wrong about rust allowing int to float conversion, it's been a while since I've written any
<ifreund> one thing I think zig does better than rust is overflow handling
<ifreund> in rust while using the standard +/-/* operators integer overflow causes a panic in debug builds but is well-defined to be two-complement wrapping overflow in release builds
<ifreund> which is the worst of both worlds as you can't rely on overflow but compiler optimizations based on the fact that overflow won't happen in release builds are impossible
<elshize> hmm, I didn't know that it wouldn't panic in release build
<ifreund> there are super verbose foo.wrapping_add(bar) alternatives to tell rust to always allow wrapping overflow
<elshize> the documentation does not state that
<ifreund> ttps://rust-lang.github.io/rfcs/0560-integer-overflow.html
<ifreund> oops, lost an h at the beginning https://rust-lang.github.io/rfcs/0560-integer-overflow.html
<ifreund> I guess it's not strictly debug/release but checks on/checks off which correlates to debug/release if I'm not mistaken
<elshize> I just tried it in release and it panics on overflow too
<ifreund> anyhow, zig solves this by having two sets of operators, +/-/* and +%/-%/*%, the latter being two's complement wrapping overflow
<ifreund> ok, so that means the optimize is even more restricted by default in release rust builds
<elshize> I mean, it's a safety feature if I understand it right. you may argue that the default one should be wrapping or not, but if it's not wrapping, what else should it do on overflow if not panic?
<ifreund> panic in safe build modes, UB in unsafe build modes
<elshize> well, rust has only a safe build mode :)
<ifreund> does it enable all the same safety checks present in debug builds?
<elshize> yes
<elshize> you can explicitly use "unsafe" blocks or functions to do something potentially unsafe
<ifreund> the existence of debug_assert() tells me that's not true :P
<elshize> some checks could be optimized out by the compiler if it knows it to be safe
<elshize> well, debug_assert is a macro in the std library
<ifreund> elshize: the default release profile listed here disables overflow checks: https://doc.rust-lang.org/cargo/reference/profiles.html
<elshize> it's weird, because I literally now checked on the playground that it panics on overflow... strange
<elshize> I'll check it out later locally to make sure. either my knowledge or this documentation is outdated :)
<elshize> but I gotta jump into a meeting, be back later
<ifreund> o7
trav64707 has joined #river
ifreund has quit [Ping timeout: 255 seconds]
emersion has quit [Ping timeout: 255 seconds]
travankor has quit [Ping timeout: 255 seconds]
trav64707 is now known as travankor
ifreund has joined #river
emersion has joined #river
<elshize> ifreund: you're right! it is off by default.
waleee has joined #river
<elshize> I guess a good thing is that you can set it to whatever you want in your project but yeah, seems like they turn it off by default in release mode.
<elshize> ifreund: so how do the + - * operators in zig work in this respect? the check is on when you compile in safe mode and UB otherwise?
<elshize> I think if you really wanted, you could create your own profiles in rust to have release and release-safe or something
<leon-p> ifreund: I think handling .down mode when resetting state needs some further discussion
<ifreund> elshize: yep, panic in debug/release-safe and UB for the optimizer to exploit in release-fast/release-small
<leon-p> Sending button leave events would require us to store a list of all active buttons, because multiple can be pressed at once
<leon-p> and some random application will get the "real" button release events, because when we send the faux events the buttons are still pressed
<leon-p> unless we store a list of future events to ignore
<ifreund> let me refresh my memory of this code
<ifreund> leon-p: I don't think we should send button release events, they aren't being released
<ifreund> we should only send wl_pointer.leave
<ifreund> which in river is handled by wlroots when we call our passthrough() function
<leon-p> in that case, unless I missed something, the PR should be ready
<ifreund> awesome, I'll give it a review when I have a minute. Hopefully today
<leon-p> fwiw the resize bug I had disappeared on its own. Weird, because the code I have now is not that different from what I had then, but i'll take it.
<ifreund> which bug was that? Glad it's gone though :D
<leon-p> There was some resize craziness if you resized a window, switched the tag, switched back and then released the button over the same window and finally tried moving it
<leon-p> the window would then move to the bottom right corner at warp speed
noopdecoder has joined #river
noopdecoder has quit [Client Quit]
<ifreund> yeah fixing that was part of the point of this new approach no?
<ifreund> anyhow I should focus on studying, I've got an exam mondy
<elshize> ifreund: what's the exam on? anything interesting?
<ifreund> elshize: media psychology :D
<ifreund> I'm studying CS but choose psychology as my "application subject" cause why not
<elshize> oh my
<elshize> is this undergrad program?
<ifreund> yeah, still haven't finished my bachelors
<ifreund> should be done in the next year or so if everything works out though
<elshize> nice, just don't let it distract you from work on river
<ifreund> exactly, gotta keep my priorities straight :D
<ifreund> to be fair though, river did far more than the university to get me my current job
<elshize> yeah, I can see how it could
<novakane> well you're like one of the ten people paid to writing zig so yeah :P
<elshize> I myself was just contacted by someone who found me through github and work I've been doing
<elshize> and I heard some similar stories all around
<ifreund> yep, I just got an email offering me a job ~6 months ago
<elshize> though I gotta say that my phd program tought me a lot, or rather gave me time to live semi-comfortably for a few years learning things myself :P
<ifreund> Yeah, I'd say 90% of what I've learned since starting my bachelor's has been learned on my own time outside of the lectures, which are almost entirely theory
snakedye has joined #river
<elshize> ifreund: I definitely found all the theory helpful once I did academic research and got into more of that side of things; but college did not prepare me to be a software dev, that's for sure.
<novakane> yeah your learn a lot with practice on your own time, though I wish I had a more serious environment to learn theory and some good basis
<elshize> I can't complain about that, but I wish I took learning more seriuosly back then :D
<leon-p> realistically, you are not going to learn /that/ much doing a bachelors. They are designed to give you as much of the basics as possible in the shortest amount of time (which turns out to be three years on average). You are not expected to actually remember everythong. Hell, I barely remember my first semester courses at all, all I still recall is how to taylor some functions and some theo. math stuff.
<leon-p> The idea is that you get used to the way of thinking. When you specialize (meaning writing your bachelors theses and doing a masters program) is the time to start memorizing things :D
<elshize> I find that it gave me the awareness about certain things, even if I don't remember many things, I now know what I can't remember instead not knowing that there's something to know if that makes sense :P
<leon-p> totally
<novakane> yeah still better than leaving school at 18 to works in totally unrelated job :P
<leon-p> you also remember all the good books for when you need to look stuff up
<elshize> novakane: that depends!
<leon-p> novakane: you'll have less money shortages that way though
<elshize> now that I'm done, I don't regret spending over 10 years at a university. but that's not for everyone.
<leon-p> It really isn't. The hardest part is getting used to working on your own. If you have that down, university can be a rewarding experience.
<elshize> I find that the passion for what you do is more important. if you find something you're passionate about, you'll learn quickly, at least from my own experience
<leon-p> the problem is that you also need to learn things you are not passionate about
snakedye has quit [Ping timeout: 250 seconds]
<elshize> yeah, that's always the case though. in any job, there are things you don't like but msut be done
<novakane> sure, personally at 18 I became carpenter, and I wish I could tell my young self to keep with school and go with computer things tbh
<novakane> not always easy to know what you want at this age
<elshize> that's very true.
<leon-p> novakane: on the other side, I am deeply in awe of anyone who can build things out of wood in a visually appealing way.
<elshize> even after college, I didn't know what I wanted to do
<elshize> I was going to be a writer but wasn't good at it so stuck with computers :D
<leon-p> but isn't that the idea of going to university, having a few more years to think about it and in the best case scenario get stuck being a post-doc, so you'll never have to reach a solution? :D
<elshize> wasn't happy at my job though, I decided to move across the ocean for a phd and was lucky that it worked out.
<novakane> leon-p: yeah I loved this job, it's a beautiful job, but I saw way too many accidents for not a great paid at the end of the month
<elshize> in my case, I was fed up with academia at the end, so a post-doc was out of question ;p
<elshize> that's something I feel very lucky about, that what I _want_ to do pays very well.
<elshize> not everybody is in such a good position, sadly
<leon-p> understandable, although it depends on your field, institution and university. I am not that far yet, but from my experience with student jobs I think that being part of a smaller smaller research groups is probably my dream job
<leon-p> but I am a physicist, not a computer scientist, so my options are a bit different
<leon-p> for example, I absolutely have to do at least a masters, because a bachelors in physics is totally worthless :P
<elshize> leon-p: of course, it really depends. my research group was too small I think (by the end, there were only two of us) and we lacked resources; also I got more and more frustrated how in order to publish work, they always wanted a loooot of content, but also allowed very few pages to fit it in. but that I'm sure depends on the area of research
<elshize> I did my masters because everybody did, nobody respected bachelor's degrees at that time (I did mine in Poland)
<elshize> but in US I see many people having BS, it's normal. depends on many factors I guess
<leon-p> anyway, I think we are out of low-hanging fruit. So when 341 is merged, river will be pretty close to a release. Sadly we are not enough people yet to have a release party :P
gwizon has joined #river
<novakane> well just need all wayland community :P
<elshize> leon-p: how large are usually parties you go to? I think a dozen people is plenty :)
notzmv has quit [Ping timeout: 240 seconds]
novakane has quit [Quit: WeeChat 3.2]
novakane has joined #river
gwizon has quit [Remote host closed the connection]
notzmv has joined #river
leon-p has quit [Quit: leaving]
leon-p has joined #river
elshize has quit [Quit: WeeChat 3.0.1]
novakane has quit [Quit: WeeChat 3.2]
snakedye has joined #river
peregrinator has joined #river
<snakedye> ifreund: thanks, serial was error
<snakedye> But I will miss transparency 😔