--- Log opened Mon Feb 17 00:00:24 2020 |
00:20 | | Kindamoody is now known as Kindamoody[zZz] |
01:05 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has joined #code |
01:33 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has quit [Connection reset by peer] |
01:42 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has joined #code |
02:02 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
02:02 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
02:50 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
03:12 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
03:12 | | mode/#code [+o Reiv] by ChanServ |
03:22 | | Degi [Degi@Nightstar-bt9o73.dyn.telefonica.de] has quit [Ping timeout: 121 seconds] |
03:22 | | Degi [Degi@Nightstar-vb43r3.dyn.telefonica.de] has joined #code |
05:04 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
05:05 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds] |
05:14 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has quit [Connection closed] |
05:16 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has joined #code |
05:28 | | Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has joined #code |
05:29 | | mode/#code [+qo Vorntastic Vorntastic] by ChanServ |
05:33 | | Derakon is now known as Derakon[AFK] |
06:06 | | celticminstrel [celticminst@Nightstar-0p84vo.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:02 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
07:02 | | mode/#code [+o himi] by ChanServ |
08:54 | | Kindamoody[zZz] is now known as Kindamoody |
10:48 | <@sshine> | this is the third time I'm finding a precedence bug in two weeks. |
10:48 | <@sshine> | return if $min eq '*' and $max eq '*'; |
10:49 | <@sshine> | which interprets as (return if $min eq '*') and $max eq '*'; because 'and' is the statement-level-precedence operator, and '&&' is the one with the sane precedence. |
10:51 | <~Vorntastic> | Augh |
10:53 | | * sshine has applied for two jobs and has just got offered both of them |
10:54 | <~Vorntastic> | Yay |
10:55 | <@sshine> | one is as a compiler dev for etorox.com doing blockchain contract DSLs where they're open to me doing a PhD (but I don't have an MSc yet, so I'd have to finish that on the side), and the other is doing infrastructure for the Danish National Genome Center that was established last year. the former comes with a pay rise of 3%, and the latter comes with a pay drop of probably 20%. |
10:57 | <@sshine> | morally, if I have to scrutinize, eToro seems like a gambling site, and the Genome Center is governmental, and the Danish government has been kind of screwy about people's private medical data on one instance. |
10:59 | <@sshine> | but I get to code Haskell half of my time! Haskell is the reason I got to bed too late last night, and it's what I read about on my phone while commuting. so in a sense it's kind of a dream job when I get to make compilers at least half the time. |
11:09 | | Kindamoody is now known as Kindamoody|out |
13:26 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has quit [Connection closed] |
13:30 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has joined #code |
13:55 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has quit [Connection reset by peer] |
14:00 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has joined #code |
14:22 | | catalyst [yaaic@Nightstar-f94.84l.138.72.IP] has quit [Connection closed] |
14:30 | | catalyst [yaaic@Nightstar-k78ijh.dab.02.net] has joined #code |
14:40 | | catalyst2 [yaaic@Nightstar-295h3e.cpe.teksavvy.com] has joined #code |
14:42 | | catalyst [yaaic@Nightstar-k78ijh.dab.02.net] has quit [Ping timeout: 121 seconds] |
14:57 | | ErikMesoy1 is now known as ErikMesoy |
14:58 | < ErikMesoy> | At work I'm waiting between external assignments, so I'm teaching Python to one of the new hires, and he's remarked how this is clearly a language written by people who were sick and tired of writing the same thing over and over again, so they shorthanded it. |
14:59 | < ErikMesoy> | Today I showed him the dictionary comprehension, and he amended his previous remark: this is clearly a language written by people who were sick and tired of writing _many_ things over and over again. |
15:05 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
15:05 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
15:07 | | celticminstrel [celticminst@Nightstar-0p84vo.dsl.bell.ca] has joined #code |
15:07 | | mode/#code [+o celticminstrel] by ChanServ |
15:59 | | JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code |
15:59 | | JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [NickServ (RECOVER command used by JustLurk)] |
15:59 | | JustLurk is now known as JustBob |
15:59 | | mode/#code [+o JustBob] by ChanServ |
16:01 | | JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code |
16:01 | | JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [NickServ (RECOVER command used by JustLurk)] |
16:01 | | JustLurk is now known as JustBob |
16:01 | | mode/#code [+o JustBob] by ChanServ |
16:10 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
16:57 | | Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
16:59 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:21 | | celticminstrel [celticminst@Nightstar-0p84vo.dsl.bell.ca] has quit [Ping timeout: 121 seconds] |
17:22 | <&[R]> | Woo! PXE boot is finally working again |
17:25 | | Kindamoody|out is now known as Kindamoody |
17:30 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has joined #code |
17:30 | | mode/#code [+o celticminstrel] by ChanServ |
17:39 | | mode/#code [+o ErikMesoy] by ChanServ |
18:10 | | Derakon[AFK] is now known as Derakon |
18:53 | | * ToxicFrog bites and bites and bites javascript |
18:53 | <&ToxicFrog> | I have an existing codebase here with a bunch of large and gnarly synchronous functions. |
18:54 | <&ToxicFrog> | The underlying API has changed such that I need to call a function that returns a Promise<T>. |
18:54 | <&ToxicFrog> | There is no way to block on a promise; instead you need to convert the entire call stack to async (which I'm not sure is possible in this codebase) or use .then |
18:55 | < Emmy> | lovely |
18:56 | < Emmy> | I myself semi-regularly work on redesigning the UI of an application which frequently does something like this: |
18:56 | < Emmy> | $call mdlStartReport |
18:57 | < Emmy> | in which the module mdlStartReport has only one function: sub main() |
18:57 | < Emmy> | sub main says: $call mdlGeneral.StartReport |
18:58 | < Emmy> | the sub StartReport then actually does $load frmOpenReport; frmOpenReport.show |
18:59 | < Emmy> | and then that form actually does the useful things like preparing which chapters to include in said report, setting language and such... |
18:59 | <&[R]> | You don't need to change the entire stack, just the function that handles the promisee AIUI |
18:59 | < Emmy> | needless to say, I am not limiting myself to the UI any more. :P |
19:00 | <&ToxicFrog> | [R]: sadly this is not the case; if that function is declared async all of its callers need to be as well, all the way up the stack. |
19:01 | <&[R]> | Just read the MDN |
19:02 | <&[R]> | That's not entirely true, but async has a really stupid side effect of making the function return a Promise no matter what, which could really fuck things up (also explains some behavior I saw) |
19:02 | <&ToxicFrog> | Similarly, there's no simple way to replace `return getFooSync()` with `getFooAsync.then(...)`, because now the function returns nothing, and its caller needs to be restructured to handle the fact that the function that previously returned something useful now fires off a callback sometime in the future and returns instantly. |
19:02 | <&[R]> | That makes the entire thing much less useful D: |
19:03 | <&[R]> | Yeah |
19:03 | <&[R]> | node used to have futures, but they removed that for unexplained reasons D: |
19:07 | | Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has joined #code |
19:07 | | mode/#code [+qo Vorntastic Vorntastic] by ChanServ |
20:03 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
20:03 | | mode/#code [+o Reiv] by ChanServ |
20:13 | <&McMartin> | Meanwhile, in C++ blocking on them is the *only* thing you can do on a future |
20:34 | <@celticminstrel> | Well, you can also pass it to a different thread tho. |
20:39 | <&McMartin> | yeah, but if you're trying to limit your thread count... |
20:40 | <&McMartin> | With wait_for you can kind of make a spinlocking version of select, I guess |
20:42 | <&McMartin> | I remember that the C+11 async library reminded me of that one time in Dwarf Fortress development where they tried to add poison and antidotes for poison, but there were blocker bugs in the antidote code so they shipped the poison and held off on shipping the antidotes |
20:43 | <&McMartin> | when_any is still in std::experimental, it looks like |
20:48 | <&ToxicFrog> | I now have to decide whether I want to try to rewrite this disaster to be async-friendly, or modify cordless(1) to have a friendly UI |
20:58 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
20:58 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
20:58 | | mode/#code [+o Reiv] by ChanServ |
21:13 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
21:19 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
21:19 | | mode/#code [+o Reiv] by ChanServ |
21:36 | < catalyst2> | I've ditched C++ forever* |
21:38 | <@Reiv> | what |
21:38 | <@Reiv> | Surely not |
21:38 | <@Reiv> | I thought it was your Font of Dark Sorcery :o |
21:39 | <~Vorntastic> | I think catalyst can probably create dark sorcery wherever she goes |
21:41 | <&McMartin> | Eventually want to start keeping bits of your soul for yourself |
21:42 | <@Reiv> | Hm, this is true enough |
21:44 | < catalyst2> | The problem is that Rust is really good |
21:45 | < catalyst2> | And actually replaces C++ |
21:45 | <&McMartin> | And for me the problem is that the problems I faced turn out to consistently be better solved via More Judicious Use Of C rather than relying on C++'s capabilities |
21:46 | | * TheWatcher readsup |
21:47 | <@TheWatcher> | Nah, give your soul over to the Old Dark Gods of Computing~ |
21:47 | <@TheWatcher> | Join us! Join us!~ |
21:51 | < catalyst2> | C is nowhere near powerful enough to do what I want |
21:52 | <&McMartin> | Yep. We were, I think, standing back to back when we were C++ sibs and now we have each walked straight forward :) |
21:52 | <&McMartin> | I keep wanting to use Rust for things and it keeps not being the tool for the problem at hand |
21:52 | <&McMartin> | I keep facing problems where the solution may be summarized as "less work should be done" |
22:07 | | bluefoxx [fuzzylombax@Nightstar-gmbj85.vs.shawcable.net] has quit [Ping timeout: 121 seconds] |
22:14 | < catalyst2> | :D |
22:14 | < catalyst2> | That's generally true |
22:14 | < catalyst2> | I just find Rust fits my representation and abstraction needs very closely |
22:15 | <&McMartin> | Yep! It does for me when I'm in that space too |
22:16 | <&McMartin> | But, like, at work lately I've mostly been writing filters to massage data streams that come in mostly-fixed-size packets |
22:16 | <&McMartin> | This Is C Town |
22:17 | < catalyst2> | And since they added the ? operator it feels very nice to use |
22:17 | <&McMartin> | (And then my coworkers are writing in Swift these days, so "be transparently importable by Swift" is an important feat that C can perform and neither C++ nor Rust can without lots of help) |
22:17 | <&McMartin> | ? operator is the greatest |
22:17 | <&McMartin> | I want it in my assembelrs |
22:18 | < catalyst2> | C is still what you want for interfacing with other languages unless you're lucky enough to be running on a VM I suppose |
22:18 | <&McMartin> | Yeah. Apple put an impressive amount of work into getting Swift to also bend to ObjC's object model but only when needed |
22:18 | <&McMartin> | And ObjC really *is* a strict superset of C |
22:19 | <&McMartin> | This makes doing OO wrappers around the C parts easy if I need it. |
22:19 | <~Vornicus> | C Town is also the name of a shitty grocery store in the northeast |
22:19 | <&McMartin> | It involves kicking garbage down the well, never to be collected |
22:20 | <~Vornicus> | I was at one getting soda for that evening's D&D game (and was surprised at how expensive it was) when I learned that Michael Jackson had died |
22:35 | <@Reiv> | What is the ? operator |
22:35 | <&McMartin> | The one that makes NULL work more like SQL. |
22:35 | <@Reiv> | Okay that is a valuable feature yes |
22:35 | <@Reiv> | So Rust has it? |
22:35 | <&McMartin> | I mean, everything "has" it; it's what we call "syntactic sugar" |
22:36 | <@Reiv> | right |
22:36 | <@Reiv> | what? |
22:36 | <@Reiv> | I mean unless I've missed a thing in Java... |
22:36 | <&McMartin> | You can always say, instead of `a = b?.c`, `if (b == null) { a = null; } else { a = b.c; }` |
22:37 | <&McMartin> | But I just remembered another thing Rust has that's more unique to it and I forget if it is also a ?-based spelling or if it was !-based |
22:38 | <&McMartin> | Ah, that was try! |
22:38 | <&McMartin> | Which is also great and sort of one level of power up from ? |
22:38 | <&McMartin> | The problem with nullable types, after all, is that if you return null on error, that just tells you "lol dedz", it doesn't actually tell you what, if anything, went wrong |
22:39 | <&McMartin> | So ideally you'd like to return either your result type or a value of a *completely different* type, which conventionally would be some kind of error-describing type. |
22:40 | <&McMartin> | So Rust *also* has a macro for "call this function which returns either a value of type T or a value of error type E. If it's type T, assign it to the result of this expression, making it be of type T instead of Result<T, E>. Otherwise, *return the error type from this function*" |
22:40 | <&McMartin> | Obviously, you must be in a function that itself returns a Result with a compatible error type, but that's not difficult to enforce when your stdlib has a standard error type. |
22:40 | <&McMartin> | That macro, named try!, has pretty much convinced me that exceptions are a costly hack~ |
22:40 | | bluefoxx [fuzzylombax@Nightstar-gmbj85.vs.shawcable.net] has joined #code |
22:41 | <&McMartin> | I never liked exceptions much to begin with, for reasons that are too obscure and too lengthy to fit in this margin |
22:41 | <&McMartin> | But try! is what convinced me that they're also broadly unnecessary. |
22:41 | < catalyst2> | It also works for Option |
22:41 | <&McMartin> | Oh neat. |
22:41 | <&McMartin> | I know it needed refinement |
22:42 | <&McMartin> | I remember back when the function you were in needed to not only match E, but also had to match T, which made try! almost invariably unusable |
22:43 | < catalyst2> | What ? lets you do is unobtrusively pass errors up the stack whilst also explicitly processing them |
22:43 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
22:43 | < catalyst2> | There's also a bunch of error mapping methods that help you massage things into the right errors as well |
22:43 | <&McMartin> | (the fits-in-the-margin version is that exceptions are better than returning error codes, but they carry A Terrible Cost, while try! removes the Terrible Cost and in a very real way fixes the problems with bare error codes) |
22:44 | < catalyst2> | try! isn't good enough though |
22:45 | < catalyst2> | It's too obtrusive when you attempt to use it in practise, in the same way that writing types before variable names is |
22:45 | <&McMartin> | Yup. |
22:45 | <&McMartin> | https://doc.rust-lang.org/edition-guide/rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html shows the back to back for why this is so :) |
22:46 | < catalyst2> | But I think in the end iterator patterns and ? swung it for me |
22:46 | < catalyst2> | Rust's iterators are everything the STL should be |
22:46 | <&McMartin> | And yeah, I'd forgotten that Rust's ? was the full result-based version |
22:46 | <&McMartin> | That is well above the competition where it is generally `Option`-only. |
22:47 | < catalyst2> | Under the guise of pointer types |
22:47 | < catalyst2> | Basically, I think Rust recently reached the threshold of being better enough than C++ for me |
22:48 | | * McMartin nods |
22:48 | <&McMartin> | It reached that point earlier for me but that's because I was doing less with it, and I've used Rust less since because I've been doing *so* much less C++ that the things Rust does better are things I haven't needed :) |
22:49 | < catalyst2> | =) |
--- Log closed Mon Feb 17 22:49:33 2020 |
--- Log opened Mon Feb 17 22:57:41 2020 |
22:57 | | TheWatcher [chris@GlobalOperator.Nightstar.Net] has joined #code |
22:57 | | Irssi: #code: Total of 35 nicks [28 ops, 0 halfops, 0 voices, 7 normal] |
22:57 | | mode/#code [+o TheWatcher] by ChanServ |
22:57 | | Irssi: Join to #code was synced in 15 secs |
23:03 | < catalyst2> | https://github.com/jtempest/adventofcode2019_rust/blob/master/aoc/src/ocr/mod.rs |
23:04 | < catalyst2> | Iterators as ranges is everything I want |
23:07 | < catalyst2> | Just having a macro for declaring test functions is also awesome |
23:30 | | * McMartin nods |
23:38 | | * Reiv eyes that, realises he understands none of it, will keep his trap shut~ |
23:47 | | Vorntastic [uid293981@Nightstar-h2b233.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
--- Log closed Tue Feb 18 00:00:35 2020 |