The Official Status Thread
-
status: fuck auto-appended email footers!
-
@Tsaukpaetra Unrelated. I just checked that thread between you and that special soul and I must say the ending was very anti-climatic.
-
@stillwater said in The Official Status Thread:
the ending was very anti-climatic.
Sorry to disappoint.
-
@Tsaukpaetra But boy am i fucking glad you don't have to deal with it anymore. Huge audible satisfying sigh.
-
Status: WTF are you doing, WSUS?
-
Status: Just did the summation of all my medical bills for last year - total sum was about 940€. Half of that will be paid back by my state (the wonders of being a civil servant) - the other half I could get back from my insurance. But my insurance has this incentive that if you don't bother them with any bills you'll get back a sizable portion of the year's fees. This year I got back 750€ (in September, however) so I guess I'll once again spare them the hassle of dealing with my bills?
Yes, I know this 50/50 thing is weird.
-
Status: Trying to figure out how to detect if a process has exited in Go.
Windows is apparently magical, because I can still retrieve a dead process (somehow).
Not only that, the OS-specific implementation variable named
isdone
does not notice that the process is gone.I'm flabbergasted.
-
@Tsaukpaetra said in The Official Status Thread:
I'm flabbergasted.
Dunno why. Go's shit, we all know that.
In Rust of course it's even harder.
-
@pie_flavor said in The Official Status Thread:
In Rust of course it's even harder.
Well, of course I can
Wait()
it, and see if it's exited that way. But that will hang the entire program until it actually exits the process.In C++, I just
WaitForSingleObject
and see if it's timed out, like so:bool Game::IsAlive() { DWORD ret = WaitForSingleObject(pi.hProcess, 0); return ret == WAIT_TIMEOUT; }
In C#, I just use
Process.HasExited
.In Linux, apparently I send signal 0 and see if that succeeded or not.
But in Go, it looks like I'm going to have to hand-roll it to actually do the needful...
-
@Tsaukpaetra said in The Official Status Thread:
status: fuck auto-appended email footers!
I'll set my signature to that if you're not careful.
-
@Tsaukpaetra said in The Official Status Thread:
In Linux, apparently I send signal 0 and see if that succeeded or not.
Personally I'd check for the relevant information in
/proc/<pid>
. Or, more likely, since the process I'm interested in is my own child process, I'll handle theSIGCHLD
that gets sent when a child process exits usingwaitpid(-1, &status, WNOHANG)
and update my internal structures (and do any other processing) at that time.I wouldn't use
waitpid()
just to check if the process is alive though, since if it turns out it isn't I must then immediately handle the exit status, and update my internal administration (since the PID is no longer valid).
-
@PleegWat said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
In Linux, apparently I send signal 0 and see if that succeeded or not.
Personally I'd check for the relevant information in
/proc/<pid>
. Or, more likely, since the process I'm interested in is my own child process, I'll handle theSIGCHLD
that gets sent when a child process exits usingwaitpid(-1, &status, WNOHANG)
and update my internal structures (and do any other processing) at that time.I wouldn't use
waitpid()
just to check if the process is alive though, since if it turns out it isn't I must then immediately handle the exit status, and update my internal administration (since the PID is no longer valid).There can be issues there too (at least on windows). That pid may have been recycled and now you're waiting on some unknown process. I vaguely remember () that Raymond wrote about that...
-
@PleegWat said in The Official Status Thread:
I wouldn't use
Yeah, see, my problem is, I was directed to Go because multiplatform look at the pretties and simplicities.
Making multiple platform-specific versions obviates this whole exercise.
In theory I should be able to start a process and check if it's still running, regardless of platform. This shouldn't be a hard thing to do. And it isn't, apparently, so long as I'm willing to freeze the program waiting for the child process to exit.
-
@Tsaukpaetra Have you tried Rust yet? Rust is much more fun.
-
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra Have you tried Rust yet? Rust is much more fun.
I don't want fun, I want simple, small, and Works.
If I wanted fun, I'd go play Dwarf Fortress.
-
@Tsaukpaetra Java will do you right. Aside from the small.
-
@Tsaukpaetra That's also Rust.
-
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra That's also Rust.
Well, you're too late. Already spent three weeks learning Go. Come back when there's more money to reverse and switch directions again.
-
@dcon said in The Official Status Thread:
That pid may have been recycled and now you're waiting on some unknown process.
Ew. That's explicitly impossible on linux because a process is kept in zombie state until it has been waited for by the parent. Also if there are no matching processes to wait for (EDIT: Which are your direct child proceses) you'll get
ECHILD
.@Tsaukpaetra said in The Official Status Thread:
In theory I should be able to start a process and check if it's still running, regardless of platform. This shouldn't be a hard thing to do. And it isn't, apparently, so long as I'm willing to freeze the program waiting for the child process to exit.
Agreed, you don't want to worry about platform specifics if you're doing multiplatform. And you should be able to handle child processes exiting in an event loop pattern or language-provided event loop.
-
-
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Already spent three weeks learning Go.
I had three weeks to switch languages and reimplement the Master Server Client. The language touted was Go, and so Go was chosen.
-
@Tsaukpaetra There's like six threads around here documenting how shit Go is, and most of that is relentlessly comparing it to Rust.
-
@pie_flavor said in The Official Status Thread:
most of that is me relentlessly comparing it to Rust.
Yes?
-
@Tsaukpaetra Nah, @Gąska helps too.
-
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra Nah, @Gąska helps too.
For values of "helping" including
Look ma, I'm helping
?
-
@pie_flavor said in The Official Status Thread:
helps
Well, feel free to convert the current project into Rust then:
The function I'm currently working on is the
IsAlive()
check.It's really only there to confirm whether a supposedly-started game server is still actually running and should be waited on (or killed if connection timed out back to the Master Server).
-
@Tsaukpaetra said in The Official Status Thread:
@pie_flavor said in The Official Status Thread:
In Rust of course it's even harder.
Well, of course I can
Wait()
it, and see if it's exited that way. But that will hang the entire program until it actually exits the process.If you read the description under the link, you'd know that Rust's
try_wait()
isn't actually waiting. That it's literally the function that exists specifically to handle your use case of checking whether a process exited (and with what code), nothing more, nothing less. Poorly named, yes, but I blame Linux for that.
-
@Gąska said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
@pie_flavor said in The Official Status Thread:
In Rust of course it's even harder.
Well, of course I can
Wait()
it, and see if it's exited that way. But that will hang the entire program until it actually exits the process.If you read the description under the link, you'd know that Rust's
try_wait()
isn't actually waiting. That it's literally the function that exists specifically to handle your use case of checking whether a process exited (and with what code), nothing more, nothing less. Poorly named, yes, but I blame Linux for that.I mean
Wait()
in Go.
-
@Tsaukpaetra now it makes more sense. It wasn't clear at all in that post.
-
@Tsaukpaetra In any case, I found some magic sugar code that in theory starts a wait elsewhere that blocks the elsewhere but not my code, and seems to be working (at least on Windows) as expected:
go func() { make(chan error) <- cmd.Wait() }()
-
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra Nah, @Gąska helps too.
@bb36e said in So I tried Go the other day:
Thread summary: Go sucks because Java has checked exceptions
The threads are mostly Ben being a fan of Go, you and @Gąska being fans of Rust, and everyone else (myself included) basically either "IDK, but looks dumb" or "IDC". So that's 2:1 with a pretty lousy signal to noise ratio, I wouldn't trust that a lot either.
I've personally wanted to check out Rust for a long time now "whenever I get around to it" (which is apparently never) as I like its premise, but Gąska's explanation of how it's great for everything except it can't bind Qt because the inheritance hierarchies that uses actually made me less interested. If possible I prefer things multi-paradigm instead of "we don't like that kind of inheritance, so you don't get it."
-
@Tsaukpaetra said in The Official Status Thread:
@pie_flavor said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Already spent three weeks learning Go.
I had three weeks to switch languages and reimplement the Master Server Client.
"You've had three weeks, there's no time to switch languages now" is how we've got the entire Internet stuck with JavaScript.
-
@Gąska And, according to lore, "it already had ten users" is how
make
treating tabs and spaces differently changed from a bug to a feature.
-
@topspin said in The Official Status Thread:
The threads are mostly Ben being a fan of Go, you and @Gąska being fans of Rust, and everyone else (myself included) basically either "IDK, but looks dumb" or "IDC". So that's 2:1 with a pretty lousy signal to noise ratio, I wouldn't trust that a lot either.
I've personally wanted to check out Rust for a long time now "whenever I get around to it" (which is apparently never) as I like its premise, but Gąska's explanation of how it's great for everything except it can't bind Qt because the inheritance hierarchies that uses actually made me less interested.
Wise choice. You'd hate every second of it. Rust is (TRIGGER WARNING: CAR ANALOGY) like a super sports car - absolutely amazing, until you have to park on a high curb (which, to the great surprise of those who are used to parking on high curbs everyday, is rarely needed for most people).
If possible I prefer things multi-paradigm instead of "we don't like that kind of inheritance, so you don't get it."
Do you want to turn it into another Rust topic? Because I'm totally gonna turn it into another Rust topic if you keep getting the reasons for that design choice wrong.
-
@Gąska said in The Official Status Thread:
Do you want to turn it into another Rust topic?
This thread basically doesn't even have a topic to drift from, so
if you keep getting the reasons for that design choice wrong.
Rust's choice or my "choice" you mentioned above? Because you just said yourself it's amazing "until you have to park on a high curb", and I prefer not being restricted like that, if possible. With the actual car analogy that is of course a reasonable trade-off.
Also, without going full Blakey, GUIs aren't exactly in the "rarely needed for most people" category.
-
@topspin said in The Official Status Thread:
if you keep getting the reasons for that design choice wrong.
Rust's choice or my "choice" you mentioned above?
Rust's choice.
Also, without going full Blakey, GUIs aren't exactly in the "rarely needed for most people" category.
GUIs - no. But making GUI apps - sure. Especially since almost everything is a web app now, even desktop apps - and they don't need GUI code in the traditional sense. Also, there's millions of people worldwide working on extremely popular end-user GUI applications who haven't created any button or textbox in years - the so-called backend developers.
-
@topspin said in The Official Status Thread:
This thread basically doesn't even have a topic to drift from, so
Which is why I get upset when it starts having a topic, especially multi-page trolling.
But I'm not a mod so I merely lament how I have work but can't not undo it.
-
@Gąska said in The Official Status Thread:
@topspin said in The Official Status Thread:
if you keep getting the reasons for that design choice wrong.
Rust's choice or my "choice" you mentioned above?
Rust's choice.
What's the reason then which I got wrong?
Also, without going full Blakey, GUIs aren't exactly in the "rarely needed for most people" category.
GUIs - no. But making GUI apps - sure. Especially since almost everything is a web app now, even desktop apps - and they don't need GUI code in the traditional sense.
I can only say "Ewwe" to that, factual correctness notwithstanding
Also, there's millions of people worldwide working on extremely popular end-user GUI applications who haven't created any button or textbox in years - the so-called backend developers.
Many: yes. Most: no. But ok, that's pedantry.
-
@topspin said in The Official Status Thread:
@Gąska said in The Official Status Thread:
@topspin said in The Official Status Thread:
if you keep getting the reasons for that design choice wrong.
Rust's choice or my "choice" you mentioned above?
Rust's choice.
What's the reason then which I got wrong?
Math. Specifically, type theory.
Also, without going full Blakey, GUIs aren't exactly in the "rarely needed for most people" category.
GUIs - no. But making GUI apps - sure. Especially since almost everything is a web app now, even desktop apps - and they don't need GUI code in the traditional sense.
I can only say "Ewwe" to that, factual correctness notwithstanding
Truth to be told, I couldn't agree more.
Also, there's millions of people worldwide working on extremely popular end-user GUI applications who haven't created any button or textbox in years - the so-called backend developers.
Many: yes. Most: no. But ok, that's pedantry.
Most programmers don't have to write any GUI code in the traditional sense as part of their job. In addition to that, many work only in the backend.
-
@Gąska said in The Official Status Thread:
Math. Specifically, type theory.
Subtyping by inheritance is well-founded, though?
-
@topspin not in conjunction with some of the other type system features Rust has. I can't remember right now what it was exactly, but there's something about inheritance that makes the current method resolution algorithm screw up in some corner cases. Or something. Might also be related to how self-referential structures (objects that have members that are/contain references to other members) are impossible to express in safe Rust right now. IIRC both these issues are being worked on right now.
-
Status: Googling for grumpy cats in a desperate attempt to remember who @anotherusername stole his avatar from. I'm pretty sure their username contained a C or an L.
-
@Lorne-Kates posted the link to the talk/slideshow that it was from, a few weeks back.
https://what.thedailywtf.com/topic/26010/firefox-alienating-its-users/118
-
@anotherusername someone here had the same avatar idea as you, five years ago. I just can't remember their username.
-
Status: So it appears that the Master Server Client implementation is now minimally functional (on Windows).
Now to copy it over to my Linux machine and see if it actually behaves the same way...
-
@Tsaukpaetra did you died?
-
@Gribnit said in The Official Status Thread:
@Tsaukpaetra did you died?
... No? I'm curious what pieces of information you have to arrive at that?
-
@Tsaukpaetra I've actually been rewriting it in Rust because I was that phenomenally bored. Surprise surprise, it's a lot cleaner.
Struggling to figure out what the fuck this means:t, err := template.New("Response").Parse("{{define \"ResponseBody\"}}" + bodyTemplateDict[path] + "{{end}}") if err != nil { w.Write([]byte(err.Error())) return } t, err = t.Parse(`{{define "Response"}}<html> <head><title>{{ .Title }}</title></head> <body>{{template "ResponseBody" .}}</body> </html>{{end}}`)
Is there a purpose at all to the first template?
-
@pie_flavor said in The Official Status Thread:
Is there a purpose at all to the first template?
Mostly so I don't need to add the boilerplate of the second template to the primary body templates. Could easily by copy-pasta'd in.
-
@Tsaukpaetra You were about to test on Linux after developing on Windows