<ELLIOTTCABLE>
Modern JavaScript™ looks way, waaaaay too much like C++ or Java, but hey, whatever, gotta go with the flow. -_-
<incomprehensibly>
i h8 it
* ELLIOTTCABLE
shrugs
<purr>
¯\(º_o)/¯
<ELLIOTTCABLE>
I still love it, because I can see through all the syntactic noise
<incomprehensibly>
ELLIOTTCABLE: is flow better/different than typescript
<ELLIOTTCABLE>
but I totally understand how people can hat it.
<ELLIOTTCABLE>
yes and yes. massively.
<incomprehensibly>
k
<ELLIOTTCABLE>
typescript is like CoffeeScript, doomed-as-fuck to die
<incomprehensibly>
haha
<ELLIOTTCABLE>
whereas Flow is layered *on top* of Whatever JavaScript Is Today™, as comments
<ELLIOTTCABLE>
and instead of trying to force you to write Typed Programming Code™, as if this were Java or whatever, it goes to *great lengths* to attempt to allow you to ‘type’ already-existing JavaScript phoenomena
<ELLIOTTCABLE>
i.e. in that paste, see the very last thing
<ELLIOTTCABLE>
that is me expressing ‘An object, that is the return-value of a constructor function, but that is callable, because it's actually a Function.’
<ELLIOTTCABLE>
which is something a real, strictly-typed language would never let you do
<gkatsev>
TS is definitely not like coffeescript. It's much more directly analogous to js and much more of a superset. It isn't layered on top like flow but it isn't completely doomed like cs
<ELLIOTTCABLE>
(tbh you'd never *need* to do, this is a very Specific To JavaScript Being Weird™ thing, but, whatever)
<ELLIOTTCABLE>
gkatsev: I'd argue that CS was also a superset, and had all of the nice qualities.
<gkatsev>
valid js isn't necessarily valid cs
<ELLIOTTCABLE>
pretty sure any transpiled language that isn't just ‘transpiling features we're all agreeing on’ is doomed, at this point. being burned by CoffeeScript has made me very pessimistic about transpilation.
<ELLIOTTCABLE>
hence why I won't touch decorators or anything yet.
<ELLIOTTCABLE>
incomprehensibly: but really: feedback?
<ELLIOTTCABLE>
am I using Collection properly, there?
<ELLIOTTCABLE>
I vaguely feel like I should be writing, like, `type WalkFunction<Node,Collection<Node>>`
<ELLIOTTCABLE>
is that a thing in typing systems? or am I thinking about it wrong? :x
<ELLIOTTCABLE>
this stuff always makes me feel like an absolute idiot. >:
<ELLIOTTCABLE>
(I have this strong suspicion that I, personally, will never *get* typing, until I come to it from the other direction (with an AM degree and a solid foundation in set theory or something) … because that was basically my experience with programming itself in the early days)
<incomprehensibly>
ELLIOTTCABLE: ah coments
<incomprehensibly>
ELLIOTTCABLE: would that gist be inside a couple of /* */ boys then
<ELLIOTTCABLE>
er, not necessarily
<ELLIOTTCABLE>
so the workflow right now, is since ES6 needs to be transpiled *anyway*, we write the typing-noise without comments
<incomprehensibly>
ELLIOTTCABLE: CS was definitely not a superset
<incomprehensibly>
right
<ELLIOTTCABLE>
and then it gets compiled in the same Babel step as ES6/ES7 features
<incomprehensibly>
just in the strict set-of-programs sense
<ELLIOTTCABLE>
and the output code is ES5, with such comments inside it, so the typing informationa can be picked up by dependencies
<incomprehensibly>
anyway i will peek at your collections now
<incomprehensibly>
ELLIOTTCABLE: idk i really feel like just writing some programs using haskell, or c# generics, or rust generics
<incomprehensibly>
and writing types that match your program shapes
<incomprehensibly>
will make you "get" it
<incomprehensibly>
is babel like gulp/grunt/whoever
<ELLIOTTCABLE>
er, nah
<ELLIOTTCABLE>
babel is kinda a half-assed-genericified, parsing infrastructure
<ELLIOTTCABLE>
like you can't take Babel and write an arbitrary plugin that changes how given JavaScript code is parsed; they refuse to open it up to that label
<incomprehensibly>
ok
<ELLIOTTCABLE>
but assuming you talk to the Babel team first, and you have a Big Important Thing that people care about (like Facebook having Flow :P), you can leverage it to create a new language on top of JS
<ELLIOTTCABLE>
basically, it's ‘new ES features’ + ‘React’ + ‘Flow’, right now.
<ELLIOTTCABLE>
and there's some talk about a CoffeeScript reimpl on top of it, but that's waaaaaaay more not-babel-y than anything that exists on top of it right now (at the moment, Babel input is still largely … well, JavaScript.)
<ELLIOTTCABLE>
idk I don't really get it
<ELLIOTTCABLE>
but it's mad-useful
<ELLIOTTCABLE>
and is just kinda The Way of JavaScript, since like 2014, as far as I can tell.
<ELLIOTTCABLE>
eeeeeverything goes through Babel (and then, yeah, things like Grunt or Gulp or Browserify or WebPack sit infront of Babel)
<incomprehensibly>
we use some of those things but not babel here at work :p
<ELLIOTTCABLE>
(and there's other non-Babel steps, like dependency-resolution, tree-shaking, minification, etc.)
<ELLIOTTCABLE>
Babel is necessary if you write anything except manual, plain ES5, I guess; and people seem pretty universally ready to accept that
<ELLIOTTCABLE>
which I would never have expected, but it seems to have happened, in the large?
<ELLIOTTCABLE>
it's *such* a big deal, that I get the feeling that the entire shape of How JavaScript Advances has become dependent on it
<ELLIOTTCABLE>
maybe ljharb can voice in here, but I almost get the impression that TC39 or whatever has said “Fuckit, people are fine with transpiling, and there's so many engines that are never going to agree on anything *anyway* … so we're just gonna start throwing individual features out into the crowd whenever we feel like they're individually ready, and not worry
<ELLIOTTCABLE>
about whether or not engines are ever going to actually implement them. People will just transpile them in if they like them.”
<ELLIOTTCABLE>
four major versions behind *anyway*)
<ELLIOTTCABLE>
so instead of it being like “when is Ruby 2.0” coming out (translation: when are the Important Engines going to deign to implement 2.0), it's more like “has the community widely accepted <particular feature> yet” (translation: have a meaningful number of people turned on <particular feature> in their transpiler yet, since every single engine is like
<ELLIOTTCABLE>
2. so, Flow throws a bunch of errors every time I use `collection<node>` (I lowercased all the type-params, your-haskell-style).
<ELLIOTTCABLE>
not sure if this is a Flow limitation, which is kinda my next place to go and ask questions, or if I'm just totally not understanding how to use higher-kinded types
<ELLIOTTCABLE>
it *definitely* *absolutely* doesn't like function<node, collection<node>>( ... )
<pikajude>
yeah no flow's type system is shit on a crusty roll
<ELLIOTTCABLE>
throws a syntax shit-fit.
<pikajude>
trust me
<ELLIOTTCABLE>
but the gist, it *understands* it just says is wrong.
<ELLIOTTCABLE>
pikajude: click? tell me what you thinK
<ELLIOTTCABLE>
should be pretty obvious what I'm doing there.
<pikajude>
yeah what's the problem
<ELLIOTTCABLE>
I mean, … well, basic problem is It Doesn't Work; but more relevantly, beyond ‘maybe Flow just can't HANDLE MAH TYPES’, there's a lot of “I still have no idea what I'm doing”
<pikajude>
what do you mean it doesn't work
<ELLIOTTCABLE>
so I want to make sure that that code shows that I do, in fact, know what I'm doing,
<ELLIOTTCABLE>
and *then* deal with the Flow bit
<ELLIOTTCABLE>
pikajude: reload, added output
<pikajude>
yeah clearly it doesn't allow partially-applied type functions as type arguments
<ELLIOTTCABLE>
partially-applied type functions?
<pikajude>
that'll do it
<ELLIOTTCABLE>
hell, back up. type functions?
<pikajude>
so you're defining a type Foo<node, collection>
<pikajude>
and then you're using collection<node> within the body of that
<pikajude>
or datatype, whatever it's called
<pikajude>
meaning collection is "type -> type"
<pikajude>
not just "type"
<ELLIOTTCABLE>
ummm
<pikajude>
but when you define generics in flow, you can only provide type arguments of type "type" not "type -> type"
* ELLIOTTCABLE
repeats that in his head a dozen times
<pikajude>
so if i read your earlier code right
<pikajude>
you can't take "collection" as a parameter
<pikajude>
you'll have to either define different WalkFilterbacks for every collection you want to use
<pikajude>
or take a fully-applied collection type as a parameter instead
<pikajude>
are you following me ELLIOTTCABLE
<ELLIOTTCABLE>
the first bit, yes
<ELLIOTTCABLE>
that's obviously what type polymorphism exists to avoid, of course, but I get you
<ELLIOTTCABLE>
the second one, I … don't follow
<pikajude>
what's the second one
<ELLIOTTCABLE>
write one of the abitrary lines from that gist, in the way that you mean in the second sense, as an example?
<ELLIOTTCABLE>
“take a fully-applied collection type as a parameter instead”
<pikajude>
well wherever you use "collection<node>", you would instead be using "collection"
<ELLIOTTCABLE>
type WalkFunction<node,collection> = (root?: node, ...callbacks: WalkCallback<node,collection>[]) => collection<node>
<ec>
I love everything about life and everything about everything
<ec>
I can't decide if I act like incomprehensibly whenever I talk about math or sex because 1. I've self-trained to do so through long association (“These topics are the time to use these mannerisms!”), or 2. because I just *feel* like incomprehensibly usually feels, when I talk about these things (“These topics make me happy, and when people are happy,
<ec>
they act like incomprehensibly”)
<ec>
but I definitely turn from a grumpy, sarcastic asshole into a bouncy child whenever sex or math?CS are on the table.
<ec>
:P
<pikajude>
sex is some weird shit
<ec>
abstract algebra is some weird shit
<ec>
(and notably, both become *more* weird when you instantiate ‘shit’)
<yorick>
what kindof bot is purr? the sandbox is broken
<ec>
yorick: hm?
<ec>
purr: !kindof
<ec>
-kindof
<ec>
purr: WHAT KINDOF BOT ARE YOU
<yorick>
ec: see query
<ec>
yorick: purr is trivally expolitable, lol
<purr>
lolol
<yorick>
ec: well that's terrible
<ec>
yeah, he needs to be in a vm or something
<yorick>
oftn-bot had the "I solemnly swear" backdoor too
<ec>
I guess if his really-not-that-obscure exploits are becoming common knowledge,
<ec>
I should probably put him in a docker container sooner than later …
<ec>
but goddamn I'm lazy?
* ec
tries to think whether or not any private keys exist on the server he's on
<yorick>
ec: tell me about the other exploits ^^
<ec>
lmao
<ec>
I get told a new one approximately every three months by some consientious citizen
<ec>
higher-kinded types … or installing docker on my server …
<ec>
… higher-kinded types … or installing docker on my server.
<ec>
mehhhhhhhhhhhh
<yorick>
ec: systemd containers
<ec>
doesn't docker *use* those?
<ec>
fuck my back hurts, and I'm hungry, but I don't want to pack up my workspace and depart starbucks until I'm an expert on All Of Type Theory
<ec>
:P
<ec>
“Excuse me, I may need to sleep here for a few years ... that cool?”
<ec>
also, I'd like to pre-pay for 5,000 Starbucks breakfast sandwiches.
wraithgar has joined #elliottcable
<ec>
A WILD WRAITHGAR
<ec>
pleas halp 2 type-theory?
<pikajude>
put him in a nixos container :^)
<ec>
idk nix
<ec>
pikajude: have you heard of gx?
<pikajude>
no
<pikajude>
unless you're talking about yugioh
<ec>
lawl
<ec>
no
<ec>
it's like copying nix, as a package manager, but for <insert programming language here>, and dumping the entire thing on top of IPFS
<ec>
it's a really neat idea, although not very fleshed-out last I looked
<ec>
talked to the devs for a while, which was cool
<ec>
raised a lot of awesome questions for me
<ec>
and made me want to move to Boston and work for Facebook / with them
<ec>
:P
<ec>
but. anyway.
<ec>
it sounds like lots of systems have type-functions *without* having HKT?
<ec>
can explain how that is thang?
<incomprehensibly>
HKT = *first-class* type functions
Sgeo has joined #elliottcable
<incomprehensibly>
according to this stack overflow
<incomprehensibly>
scala added HKT at some point
<incomprehensibly>
before which you were unable to make a type parametrized by a type-function
<incomprehensibly>
(as you are doing now)
<incomprehensibly>
and then you were ablet o
<incomprehensibly>
-kindof
<incomprehensibly>
2:28 PM <•pikajude> yeah no flow's type system is shit on a crusty roll
<ec>
incomprehensibly: did I mention I love you
<incomprehensibly>
:x
<incomprehensibly>
ec: love u too bab
<ec>
6:07 PM <incomprehensibly> HKT = *first-class* type functions
<ec>
ahhah
<ec>
nailed it
<ec>
y r u so good at my brain
<ec>
okay, well, that's a dumb question, given N years of history as pretty-close friends
<incomprehensibly>
ah lambda cube is neat, somehow i'd always refused to actually learn what it was but it's p simple
<incomprehensibly>
but i believe that having parametrized types, but no HKT, is like
<incomprehensibly>
*halfway* up one dimension of the lambda cube?
<incomprehensibly>
ec: i want 2 chat with you more today : ~ ) but i am about to leave work and hang out with my girlfriend who lives in the city i work in for ~1hr and then bike+train for 2 hrs and then have dinner with my family and then i can chat again
<ec>
what
<ec>
that was too dense of a sentence
<ec>
oh
<ec>
you *literally* want to talk to me later
<ec>
lol drive safe incomprehensibly
<purr>
loling
<ec>
oh
<ec>
oh oh oh
<incomprehensibly>
can't drive
<ec>
oh
<ec>
so I went to text you something exciting
<ec>
and then saw that the last time I had texted you, was to tell you that something-exciting
<ec>
derp
<incomprehensibly>
family's car i was borrowing was deemed too feeble to drive all the way from my home to my job
<incomprehensibly>
daily
<ec>
where is your job
<ec>
ugh tell me later
<incomprehensibly>
i live in slc
<ec>
or call while on transit? idk.
<incomprehensibly>
job is in provo
<incomprehensibly>
45 mi
<ec>
oh god
<ec>
you're spending tiem in provo now
<ec>
r u okay
<ec>
do u need halp
<incomprehensibly>
it's the silicon slopes
<ec>
i have many hugs 2 give
<incomprehensibly>
i am ok
<incomprehensibly>
haha
<ec>
also say hi to your SO for me, if they know who I am
<incomprehensibly>
ok
<incomprehensibly>
haha she does vaugely
<incomprehensibly>
vaguely
<incomprehensibly>
anyway my job is cool because
<incomprehensibly>
it's not like 3-4 people who learned php on the job
<incomprehensibly>
shoveling shit back and forth
<ec>
U R DOING A *REAL* REAL JOB!?
<ec>
I r so jealous
<incomprehensibly>
well it's an internship
<incomprehensibly>
for 12 wks
<ec>
where? anywhere I've heard of?
<ec>
what techs?
* incomprehensibly
whispers
<incomprehensibly>
using:
<incomprehensibly>
angular and node/express most directly atm
<incomprehensibly>
but like
<pikajude>
-_-
<incomprehensibly>
touching java and php + mysql services
<incomprehensibly>
the node/express part is like JUST an angular-app-server
<incomprehensibly>
does nothing
<incomprehensibly>
so yeah mainly doing an angular frontend
<incomprehensibly>
but i will hopefully be doing db stuff too
<incomprehensibly>
at some point
<incomprehensibly>
pikajude: haha
<ec>
pikajude: what
<pikajude>
we also use node and express at my job
<ec>
I *am* node and express
<ec>
I was a bot all along
<ec>
an experiment in developing programming-languages via socialized machine-learning, gone so, so wrong
<ec>
(in retrospect, when it developed a ‘personal brand’ is precisely that inflection-point)
<incomprehensibly>
ok i will be back in a few hours
<incomprehensibly>
good bye i love you
<ec>
<3'atsrhdtjfym
<ec>
pikajude, incomprehensibly, etceteras:
<ec>
can you help me formulate a conceptualization of how HKT are *beneficial*?
<pikajude>
you could write that code you wanted to write
<ec>
like I get that if Map can be utilized in the abstract, without reducing it to a concrete type, whee yay okay I can express this a bit better … but if I'm going to pitch this to the Flow team, I need a better example, and a better argument, than that
<pikajude>
haskell has monads which allow you to write code that can act as an abstract sequence of steps in an arbitrary context
<ec>
and my extensive googling today hasn't really turned up much other than a bunch of Haskellites masturbating over monads in the general direction of largely-unimpressed Rusteers
<pikajude>
what's the argument against higher-kinded types?
<ec>
basically, yeah, I guess. difficult, require serious conceptualization and a new shape to the framework.
<pikajude>
iirc monads require hkt
<pikajude>
to be an instance of Monad something has to be a hkt
wraithgar has quit [Ping timeout: 244 seconds]
<ec>
also to be honest, the last thing I want to do when trying to drive real-world change, is mention ‘monad.’ :P
<ec>
feel like that's a great way to get myself dismissed out-of-hand by most people
<pikajude>
facebook uses haskell
<ec>
to be fair, not so much *these* people
<ec>
they are, after all, writing a static type analyzer
<ec>
but.
<pikajude>
well there are only like 3 language features without which your language becomes unusable IRL
<pikajude>
but there are all kinds of neat things you can do with HKTs in haskell
<pikajude>
like functor
<pikajude>
Functor sorry
<pikajude>
functor is just a word
<pikajude>
Functor is a typeclass
<pikajude>
and fmap
<pikajude>
just map over some "thing" in this datastructure
<pikajude>
or shit, not even a thing
<pikajude>
map over the state of a continuation
<pikajude>
i mean, the question "what are functors good for" is a pretty trivial one to answer: map over a list, map over a result type with a failure state, function composition, etc etc
<pikajude>
and one thing you can do with a monad is write an entire block of imperative code where potential failures are implicitly handled *and* short-circuit the code
<pikajude>
which is p neat
<pikajude>
ofc im the furthest thing from a type theorist