ec changed the topic of #elliottcable to: a π•―π–Šπ–“ 𝖔𝖋 π•―π–Šπ–™π–Šπ–—π–’π–Žπ–“π–Šπ–‰ π•―π–†π–’π–˜π–Šπ–‘π–˜ slash sΝ”ΜžuΝ•Ν™pΝ™Ν“e̜̺rΜΌΜ¦i̼̜oΜ–Μ¬rΜ™Μ™ c̝͉α»₯Μ§Ν˜αΈ·Μ‘Ν™Ε£Ν“Μ€ || #ELLIOTTCABLE is not about ELLIOTTCABLE
<ljharb> ec: it's impossible to have a Promise of a Promise
<ec> ljharb: yah aware
<ljharb> ec: to implement that in userspace you'd have to have a full implementation of Promise - and then `await`ing it would turn it right back into a real one
<ec> just trying to think thru why this would need first-class handling
<ljharb> (also `Promise.resolve`-ing it)
<ec> so it seems like Lwt handles this
<ec> although it's handling was broken until fairly recently? afaict, Lwt 4.0.0?
<ec> but yeah: a bound function that raises, has the exception caught, and rolled into the Promise, basically
<ec> jfhbrook: does this look at all like what you're talking about?
<jfhbrook> unclear
<jfhbrook> it doesn't look very much like async/await
<jfhbrook> but also ocaml's syntax is fucked up so who knows
<jfhbrook> what I'm talking about is an "await" keyword that unpacks a Promise or raises its internal exception
<ec> no no not the async/await bit
<ec> just promises themselves handling exceptions
<ec> in which case: I don't see why it'd be any different for syntactic bind
<ec> it's basically a trivial transformation?
<ec> oh gotcha
<jfhbrook> if "syntactic" bind is the same as "scala for comprehensions" then for comprehensions have no syntax for accessing the "other side" of a container type with two sides
<jfhbrook> ie if "<-" is pronounced "then"
<jfhbrook> there's no analog for "catch"
<ec> mmhmm
<ec> well thing is, it's pattern-matching
<ec> ```ocaml
<ec> match+ expr with
<ec> | pat1 -> case1
<ec> | pat2 -> case2
<ec> | exception E1 -> case3
<ec> | exception E2 -> case4
<ec> ```
<ec> no different than anywhere else in OCaml
<jfhbrook> that's pattern matching though
<ec> ?
<ec> yes?
<ec> i'm missing something
<jfhbrook> like my snippet demonstrates using scala pattern matching to access the insides of a Try, but that's not what I want
<ec> in OCaml match/let are basically slightly different syntaxes for the same thing
<jfhbrook> I'm talking about syntactic sugar a la for comprehensions in scala or do syntax in haskell with support for matching both successes and failures, or lefts and rights, or whatever
<ec> oh, I know nothing about comprehensions
<jfhbrook> do you know do syntax in haskell? it's analogous
<jfhbrook> not totally the same but the important parts are
<ec> nope! Haskell has always just flowed off my back like water
<ec> basically: it looks like Lwt threads handle exns the way JavaScript Promises do, which I'd have assumed, but it's nice to have it verified; and the new syntax seems to support them too, in the same way as the rest of the language
<ec> but don't have a special, exception-specific syntax?
<jfhbrook> well there doesn't seem to be any special syntax
<jfhbrook> at all
<jfhbrook> https://en.wikibooks.org/wiki/Haskell/do_notation this demos do syntax fairly well
<ec> confused
<ec> `match+` / `let+` is the new special syntax
<ec> or rather, not-special
<jfhbrook> the snippets in the linked issue do not contain a let+
<ec> really need to take a second look at Haskell now that I'm much less afraid of types. ugh.
<ec> not sure when or how I'll find the time for that ;_;
<ec> so let never handles exceptions β€” you need either a try/catch matcher (`try <expr> with <matchexpr>`), or a monadic match (`match+ <expr> with <matchexpr>`, which doesn't look like it's landed yet anyway, due to some concerns with exhaustiveness checking in the case of GADTs)
<ec> but that's no different than it was outside of using a monad like Promise, at least in OCaml
<ec> still very confused about what's broken here, but want to understand :P
<ec> so in OCaml, `let` is very explicitly a half-assed `match` β€” you can use the same sort of destructuring, but it's going to yell at you if you try to do so in any case that may have more than one match
<ec> that's no different here β€” calling some effect-typed code in a `let`'s body will propagate the effect in the same way that calling it in a `try` and not adding a handler for that effect
<ec> man I need to clone and build this and try it out
<jfhbrook> those seem fine in and of themselves
<jfhbrook> but none of those have syntactic sugar for chaining monads
<jfhbrook> so like maybe a more concrete example w/ the for comp
<jfhbrook> so if you did, say, for { a <- List(1,2,3) b <- List(4,5,6) } yield a + b; that would desugar into List(1,2,3).flatMap(a => return List(4,5,6).map(b => a + b))
<ec> put in backticks for the lords' sake omg hahaha
<jfhbrook> scala and haskell both have special syntax for nested maps and flatMaps
<ec> my client is gooey 'n sticky 'n sugary
<ec> is that applying `b <- List(4,5,6) ` to the result of `a <- List(1,2,3)` or what
<jfhbrook> applying?
<ec> and yah with you otherwise
<ec> the sugar-to is very clear, the sugar is not. can you walk me through this syntax? `for { a <- List(1,2,3) b <- List(4,5,6) } yield a + b`
<jfhbrook> it's generating List(5, 6, 7, 6, 7, 8, 7, 8, 9)
<ec> is <- assignment, or,
<jfhbrook> again, it desugars to `List(1, 2, 3).flatMap(a => List(4,5,6).map(b => a + b))`
<jfhbrook> "unpacking"
<ec> yah got that lmao
<ec> go on w/ exceptions
<jfhbrook> well this straight up has no exception support
<jfhbrook> that's my point
<jfhbrook> it's just a way to take a M[U] and a M[V] and an expression (U, V) => W and getting you a M[W]
<jfhbrook> in this case
<ec> yes …
<ec> but from what you're showing me, that's a direct bind, like `let`, with no handling of cases
<jfhbrook> I mean
<jfhbrook> maybe that's my point
<ec> Like, I'm confused what you're asking w.r.t. OCaml β€” it looks like you keep pointing at syntaxes that explicitly don't handle edge-cases, i.e. that will warn in type-inference, like that `for` syntax or the `let+` syntax
<jfhbrook> but it's not doing pattern matching
<ec> and being like "why can't you handle the edge-cases with these"
<ec> well, you can't, they're shortcut β€” you've gotta use a syntax that, like, literally has a place to type the various cases. like `match+` or whatever Haskell's equiv is
<jfhbrook> well no I'm asking if a) ocaml has a syntax analogous to what I'm describing and if so b) if it has an answer for the use case that async/await is able to handle but this isn't
<ec> let me give a concrete example
<jfhbrook> the answer to (a) is clearly no
<jfhbrook> take the one I gave you
<jfhbrook> how would you describe that transformation w/ let
<jfhbrook> anyway I don't know what ocaml's deal is, this is a more general observation that "that kind of sugar" doesn't support a thing that async/await handles nicely (error states) - again I have no idea what ocaml offers in this space, it sounds like it doesn't have do or for but that you can fake it with other features
<ec> I don't know at all!
<ec> re: the async/await thing, the only difference I see β€” or rather Q, β€” is just whether it converts an exn wrapped into an algebraic type, back into an effect, at the desugar-point, rite?
<ec> and the haskell/ocaml differences re: the syntax, I'm poking around with now
<ec> I literally can't speak authoritatively about it until I *try* it lmao, so!
<jfhbrook> the effect being the exception?
<ec> yah yah
<jfhbrook> so await will throw any error that an instance of Promise encapsulates, if any
<ec> effects are typed as more general than just exceptions in upcoming ocaml; same time-frame as this new syntax
<jfhbrook> so away Promise.reject(new Error('bruh')) will raise that error
<ec> again haven't been able to use it yet, but it's been uh β€” widely disseminated
<jfhbrook> await*
<jfhbrook> `await Promise.reject(new Error('bruh'))`
* ec nods
<jfhbrook> but `<-` in scala/haskell has no such behavior
<ec> I got that much
<ec> but I'm unsure why that's not implementable in userspace
<jfhbrook> in a world where there was an implementation of Promise[T] then `result <- Promise[T].reject(Error('bruh'))` just won't loop over because the promise is of "length 0"
<jfhbrook> well in python and scala it's a keyword
<jfhbrook> obviously you can use .map and .flatMap as you wish
<ec> oh, maybe that's what I'm completely missing here
<jfhbrook> and presumably you could write some chainable API that has "for-like semantics"
<ec> the whole point here is that `let+` or `let*` or whatever are just … functions
<jfhbrook> and scala has macros
<jfhbrook> but no those are keywords, not functions
<jfhbrook> though! scala is ruby-ish in the way it interprets arguments
<jfhbrook> ie, `foo` is `foo()`, `foo "bar"` is `foo("bar")`
<jfhbrook> oh and `a foo b` is `a.foo(b)`
<jfhbrook> actually I think that middle one is untrue - `foo` is a fn call and `a foo b` is a method call, I think single arg still requires you to call it
<jfhbrook> in fact `foo("bar")` is calling foo, then calling the returned callable with the arg "bar", ie it's "actually" `foo()("bar")`
<jfhbrook> well in certain cases anyway
<pikajude> foo()()("bar")
<jfhbrook> I gotta find this I've forgotten the details but someone tracked down a spectacular case of this
<ec> `foo()()()("bar")`
<jfhbrook> so List("a", "b", "c").toSet() + "d" returnes "falsed"
<jfhbrook> because .toSet() is being interpreted as .toSet()() because a bare method is assumed to be called and the () is a call on the returned Set, which is a callable that returns the boolean of whether a value is in the set, so false
<pikajude> javascrala?
<pikajude> wait, so in scala you *can't* use parentheses?
<pikajude> unless they're necessary
<ljharb> my favorite is asking scala devs how many meanings `_` has
<jfhbrook> in certain cases pikajude yes
<ljharb> (don't google it)
<ec> 1
<jfhbrook> it's on the order of magnitude of the amount of ways that `this` can be set
<ljharb> jfhbrook: way more
<ljharb> ec: i mean, that's a good price is right answer
<ljharb> jfhbrook: `this` has 5 meanings, 7 if you could strict vs sloppy
<ljharb> *count
<ljharb> `_` in scala, iirc, has 18 meanings, depending on context
<pikajude> that's kinda cool
<ljharb> also my second favorite is asking in scala how i can use types to accept a char but forbid an int
<ljharb> and the answer is "oops, it's still java /me backs into a corner"
<jfhbrook> well for this: it can be window or it can be the object the function is attached to, except there's a special function syntax where inside it this is defined to the scope outside it, and in the window or object cases you can override it with call or apply or permanently bind w/ bind
<jfhbrook> so that's 1, 2, 3, 4/5, 6
<pikajude> what's the difference between a char and an int
<jfhbrook> wait, eighteen??
<pikajude> πŸ€”
<jfhbrook> in what language XD
<ljharb> jfhbrook: yeah 1) sloppy call, 2) strict call, 3) call with .call/apply, 4) a.b syntax, 5) inside an arrow function, 6) calling a .bind function, i think
<ljharb> jfhbrook: in scala
<jfhbrook> that's more than I thought
<ljharb> so i may have misremembered the count
<ljharb> either way i believe the precise term is "a buttload"
<ljharb> pikajude: a char is a letter, an int is a number
<ljharb> pikajude: if the language is encouraging you to focus on the implementation details, then it's a leaky abstraction and has failed at being a higher-level language :-p
<jfhbrook> oh I got one for you
<jfhbrook> ok so
<pikajude> help, my abstraction is leaking!
<jfhbrook> check this out: I've been getting triplebyte spam on facebook like crazy, and
<pikajude> what's that file extension
<jfhbrook> if you zoom in really close, it's .c
<jfhbrook> but yeah exactly - in python it's True
<ec> where's the closing bracket
<pikajude> oh
<jfhbrook> there's no open bracket
<ec> where's the opening bracket
<pikajude> the exoskeleton won't activate because the program doesn't compile
<pikajude> i'm here to help
<ljharb> "syntax error" because `activate_exoskeleton` doesn't exist
<ljharb> do i win a job?
<ec> "do I win employment" lmfao
<jfhbrook> it's also true in nodejs
<ec> @ljharb where *do* you work, I can't recall
<ljharb> it's a syntax error in node :-p
<ljharb> ec: airbnb
<jfhbrook> well like this is really stupid becauuuuuse
<pikajude> i appreciate the people that continue making dumb advertisements like this
<pikajude> they provide good content for us
<jfhbrook> I think what they're TRYING to test for is, the accepted good practice is to always choose a small delta and test for less than that size, because ieee floats are such that for non-trivial numerical algorithms you just won't get there
<ljharb> i mean, they're also showing that they haven't learned anything from heartbleed or whatever, because they're omitting curly braces on their conditional blocks
<jfhbrook> but this test totally fails at that because either the answer happens to be no in c but you wouldn't necessarily know that
<jfhbrook> because in 2/2 random interpreters it evals to true
<pikajude> yeah but who's going to try to buffer overflow an exoskeleton control program
<ec> like that sounds like a pretty juicy target tbh
<ljharb> lol yeah
<jfhbrook> *hacker voice* I'm in
<ljharb> Pacific Rim 3: The Hackening
<ec> RCE on a hulking invulnerable robot? possibly with somebody I dislike *inside* of it? yes???
<jfhbrook> hack the planet!!
<ec> Extremely Hacker Voice
<ljharb> it's in that place i put that thing that time
<jfhbrook> oh I saw hackers for the first time not even a week ago
<jfhbrook> or maybe just over a week ago
<jfhbrook> this month certainly!
<pikajude> that's true, you could totally activate the "fuck up the dude inside the suit" subroutine
<pikajude> that robotics engineers always tend to write
<jfhbrook> the triplebyte ads part of my brain is like fuck a tiny puzzle
<jfhbrook> and tries to solve it even if the whole thing is a waste of my time
<jfhbrook> so I notice when they're particularly dumb
<ec> I've never seen it
<ec> does it live up? should I?
<jfhbrook> I mean I didn't have too many expectations
<ec> I *did* see that horrible '80s nostalgia action movie yesterday w/ partner
<ec> it was. not as bad as expected. but most went over my head.
<jfhbrook> it's simultaneously nothing like hacking and yet actually hackers kinda are like that irl
<jfhbrook> kung fury? lol
<jfhbrook> anyway hackers is just kinda fun and dorky and a little cyberpunk and they're all good kids, like in a lot of ways it's a feel-good teen comedy y'know?
<jfhbrook> it's free on prime
<jfhbrook> well "free"
<jfhbrook> if you already pay for prime you don't have to pay for additional fees
<jfhbrook> oh the guy that plays the main character either is a bad actor or was going for a really weird stilted aloof vibe
<ec> lol at ocaml things
<ec> when you're browsing branches and casually come across twenty-year-stale ones
<ec> yesiknowitalkaboutocamltoomuchSHUDDUP
<ec> welp thanks to your question I now know how to build and install an opam switch using OCaml's trunk source, instead of one of the sanctioned distribs
<ec> it was easier than I expected, but basically undocumented, which is pretty much The OCaml Storyβ„’
<jfhbrook> what is an opam switch
<jfhbrook> also why not send them some docs or at least blog it
<ec> shmeh
<ec> might open an issue on opam asking if I'm doing it right
<ec> opam, like cargo I think, is kinda a holistic combination of a couple build-tool categories
<ec> rn it's basically like npm + nvm
<ec> package repository, for definitions of β€˜package’ that include the language itself
<ec> an `opam switch` is a compiler-state β€” OCaml version, compiler patches applied / variants, libraries installed, yadda yadda.
<ec> now let's see if lwt and dune build on OCaml trunk!
<ec> eventually I might actually be able to try this shit lmao
<jfhbrook> yeah sbt is like that too, you fire it up and it loads your version and your packages and then lets you run tasks from there
<jfhbrook> dunno that it's that sophisticated though
<jfhbrook> well
<jfhbrook> sbt is in scala, it's a crazy domain specific language that makes no sense
<jfhbrook> but your sbt files are actual scala
<jfhbrook> so it's more npm + nvm + grunt/gulp/webpack I guess
<jfhbrook> current frontend app wraps webpack
<jfhbrook> that's actually going to be a pure node app Soon
<jfhbrook> very much looking forward to that
<jfhbrook> on the analytics pipeline end I think I've found a super easy sell for rewriting everything to use aws lambda + api gateway and fill out anything else that isn't an amazon product with an amazon product
<jfhbrook> eventually all that's left is some jenkins jobs if we do this right
<jfhbrook> well, jenkins jobs, spark job deploy artifacts, cloudformation templates, a chalice project for the actual lambda hook code
<jfhbrook> but backend is getting sold on this idea pretty quick
<jfhbrook> I should try to find the time to add DLQ support, chalice uses some weird abstractions though
<pikajude> does the purposeful slowdown of every successive ios version also apply to macos
<ljharb> it doesn’t even apply to iOS, that’s just news hype
<pikajude> oh, ok
<pikajude> i wonder what's wrong with my machine then
<ljharb> i mean, all OSs get slower over time, as hardware wears down and programs get hungrier
<pikajude> yea
<pikajude> indeed
Sgeo has joined #elliottcable
Sgeo_ has quit [Ping timeout: 250 seconds]
_whitelogger has joined #elliottcable
<pikajude> man i love being able to take sick days
<jfhbrook> you weren't before?
<jfhbrook> we have unlimited pto thanks to the editorial union
<pikajude> oh no just a general observation
<jfhbrook> I think I wanna unionize kinja tech but it's an uphill battle
<pikajude> we have limited pto
<pikajude> sunday and monday i had about a 36 hour anxiety attack
<pikajude> so now i'm sitting at home wrapped in a blanket with some cocoa
<pikajude> (the cocoa isn't in the blanket)
<pikajude> too bad i'm oncall this week
<pikajude> somewhat unlucky
<jfhbrook> where do you work these days?
<jfhbrook> you were at facebro for a while yeah?
<pikajude> facebook
<pikajude> yeah
<pikajude> it's nice there
<pikajude> can i just say though, setting up mobile device emulators is ass
<jfhbrook> yeah but we have unlimited pto
<pikajude> yeah but i have no use for pto because i don't leave my apartment
<pikajude> life goals
<jaawerth> how does unlimited pto actually work
<jaawerth> does it just always have to be approved?
<jaawerth> I suppose I could google this
<jfhbrook> well
<jfhbrook> it depends on the company :) what does unlimited pto even mean etc
<jaawerth> yeah, it's just this is the third time I've heard it in a single week
<jaawerth> my sister is interviewing at a place that also boasts that and I'm like man I thought I had it pretty easy
<jfhbrook> so our official according-to-hr policy is "unlimited pto lol" afaict
<jaawerth> I have mixed PTO, but unlimited rollover and working remotely is easy, so I end up with more time than I can realistically use anyway
<jfhbrook> I *believe* that's because that's what's in the GMG editorial contract
<jaawerth> ahh
<jaawerth> I assume you newed approval to take more than, say, 2 weeks off at once
<jfhbrook> you can google the pre-bankruptcy version of the contract
<jaawerth> haha, I will
<jfhbrook> well, in tech, in practice, it's up to your manager, but we have a google calendar you're supposed to put your time off in, if only so your coworkers know when you'll be gone
<jaawerth> sure, and the manager can call fowl if you abuse it so it really just relies on people paying attention
<jaawerth> it's not too dissimilar here
<jaawerth> while our PTO is metered, we don't actually care much if you, say, take a half day and don't put in the time
<jaawerth> or "work remotely" for 2 hours of actual work as long as it isn't a regular thing and your shit gets done
<jaawerth> and I have such a huge backlog of time off that I won't be able to use it before I leave this company so it might as well be unlimited
<jfhbrook> yeah, so I actually think that "unlimited pto" is not a great policy, I'd rather see something like 6 weeks a year
<jfhbrook> which is a lot and nobody would ever use it but you could point to that and say, see, I'm not slacking
<jaawerth> yeah I can see it being a double-edged sword
<jfhbrook> well places w/ unlimited pto nobody ever takes time off
<jaawerth> people feel less bad putting you into pressure situations where you convince yourself now is not a good time to schedule your vacation
<jfhbrook> right
<jaawerth> which is kinda what I did to myself, lol
<jaawerth> that and take great advantage of our remote-friendly policies in lieu of an actual day off
<jfhbrook> I do end up taking probably 4 weeks off over the course of a year
<jfhbrook> well maybe 5
<jfhbrook> I do a week in the spring, 2.5-3 for thanksgiving and mostly dr's appts the rest of the year
<jfhbrook> sick days, etc
<pikajude> nice
<pikajude> i take a lot of mental health days
<pikajude> well i guess "a lot" is subjective
<pikajude> more than most people i know do
<ljharb> how many is a lot
<pikajude> more than any of my coworkers
<pikajude> 1 every two weeks on average
<pikajude> ish
<ec> 5 weeks minimum time off.
<ec> best policy.
<ljharb> 1 every 2 weeks is a not-insignificant amount
<pikajude> yep
<pikajude> well it's not a day off
<ljharb> altho, i work from home 1 day every week, and that's certainly partially usable for mental health
<pikajude> it's a work from home day
<ljharb> ah k
<ljharb> well then that's fine
<ljharb> we have "no meeting wednesday" so most everyone WFH that day
<ec> if you get to the end of the calendar year without reaching 5 weeks on the shared calendar, revoke their git and DB creds for (5-N) weeks before New Years'
<ec> :P
<pikajude> we have no meeting wednesday as well
<ec> gtfout the office and spend time w/ ur life :P
<pikajude> so everyone wfh on wednesday
<pikajude> i've been a lot better this half than last one
<pikajude> but the past month has still been a struggle