ChanServ changed the topic of #elliottcable to: drugs
Sgeo has joined #elliottcable
cloudhead has quit [Ping timeout: 240 seconds]
yorick has quit [Remote host closed the connection]
<whitequark> alexgord_: ooooh that's a hot topic with ocaml
<whitequark> I mean you wish you could extend sum types
<whitequark> but the problem is, sane pattern matching requires exhaustiveness analysis, meaning if you can arbitrarily extend enums, it kinda loses half of its good quantities
<alexgordon> whitequark: I was thinking about this
<whitequark> alexgordon: well you see
<whitequark> if you don't have a subtyping relationship between them, it's fine
sharkbot has quit [Remote host closed the connection]
<whitequark> or pointers to them
Determinist has joined #elliottcable
<alexgordon> ah
sharkbot has joined #elliottcable
<alexgordon> 90% of the time, I pass in an enum as a value to a function
<alexgordon> enum constant
<alexgordon> possibly in some kind of bitmask
<alexgordon> I don't think enums have to be fancy :P
<whitequark> well sure then
* alexgordon leaves the big problems to the big french brains @ ocaml
<whitequark> well, this wouldn't work in ocaml
<whitequark> because if you have Top, it doesn't have a well-defined type
<alexgordon> which line?
<whitequark> could be either EdgeAlignment or BoxAlignment.
<alexgordon> oh
<alexgordon> well it *does* because it's BoxAlignment
<whitequark> no
<whitequark> expression "Top" doesn't have a well-defined type
<alexgordon> yeaaaah but you can bend the rules a little for a constant expression like this
<whitequark> yes. it also comes in useful for, say, integer literals
<alexgordon> enums have few if any operations on them
<whitequark> one: pattern matching :p
<alexgordon> usually you either put it into a variable of a specified type, or you pass it to a function argument of a specified type
<whitequark> type inference
<whitequark> but, yeah, without global inference, it's possible to make that generic-literal trick
<whitequark> in some cases you would be forced to explicitly annontate what type you want there, though. that's sad.
<alexgordon> not really, if it's only the minority of cases
<whitequark> e.g. in ocaml (and other langs with ML inference) you can write any expression without mentioning types explicitly even once*
<alexgordon> as long as the compiler errors out and it's well specified, I don't see a problem making the programmer specify a type if it's not absolutely clear
<whitequark> * unless 1) you use modules for separate compilation 2) you use GADTs, but GADTs are a special kind of evil
<alexgordon> I think you're overthinking
<whitequark> e.g. match Top with Top | Bottom -> true | Left | Right -> false
<whitequark> wouldn't compile as is
<alexgordon> whitequark: but you don't usually see code like that
<alexgordon> more often you have
<alexgordon> instead of matching on Top you have an argument whose type is specified by the function's type signature
<whitequark> sure
<whitequark> it's more of an elegance argument than practicality one
<whitequark> could also affect generated code.
<alexgordon> but are you thinking that enums are objects?
<alexgordon> if Top is a 0 whatever its type, then there's no problem, no?
<whitequark> uh
<whitequark> wat?
<whitequark> then it's not enums, then it's constants with integer values
<whitequark> and you don't have type safety for them, which is obviously a shitty idea
<alexgordon> lol no, I'm not saying it shouldn't be typechecked
<whitequark> ok, so
<whitequark> in the match above the problem is not in the lhs part ("Top")
<whitequark> it's just that type of lhs is not well-defined
<whitequark> the problem is in exhaustiveness check of the rhs part
<alexgordon> ah I see
<alexgordon> I still don't think it's that much of a problem
<alexgordon> because you would always have some explicit type information for the thing you're matching on
<alexgordon> depends on how much inference the language allows I guess
<alexgordon> I could see it being a problem in Haskell, but not in Java
<whitequark> hm?
<whitequark> explicit type information?
<whitequark> see the example above, it would translate almost identically to even Java
<whitequark> switch(Top) { case ...:
prophile has quit [Quit: The Game]
prophile has joined #elliottcable
prophile has quit [Quit: The Game]
gozala has quit [Quit: Connection closed for inactivity]
alexgord_ has quit [Quit: Computer has gone to sleep.]
alexgordon has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
eligrey has quit [Quit: Leaving]
<glowcoil> whitequark: haha gadts are a special kind of evil?
<whitequark> well
<whitequark> they have a pretty high WTF factor
<glowcoil> they've always seeed off to me but it seems like you'd know more than i do about how they interact iwth shit
<glowcoil> what happens that's WTF?
<whitequark> well, you see, GADTs is basically
<whitequark> simply-typed lambda calculus in a box
<whitequark> it's a tool for embedding languages closely based on simply-typed LC
<whitequark> and in fact, quite a few problems can be reduced to that
<whitequark> but the problem is, if you need to deviate from whatever rigid idea your GADT typechecker has about correctness, you're *fucked*
<whitequark> let's say that I do not consider myself to be really dumb and I studied PL theory for 2+ years, yet when I tried to use GADT for exactly the thing GADT was supposed to be used, I utterly failed
<whitequark> it was in ocamltrader we were writing with devyn
<whitequark> I fucked with GADTs for two weeks, trying to encode a DSL in a type-safe way
<whitequark> I've consulted no less than three people on #ocaml, some of which worked on the language itself
<whitequark> well, in the result, I got nothing
<glowcoil> whitequark: mm
<whitequark> basically I got stuck when I wanted to express a function with signature forall a. a -> a t (for example) in that GADT framework
<glowcoil> yeah it seemed like an arbitrary addition of power that didn't really do enough
<glowcoil> or whtadver
<glowcoil> whatever*
<glowcoil> also phantom types seem kind of icky
<whitequark> it seems to be possible, but in some very specific set of circumstances
<glowcoil> what does that function type mean?
<whitequark> and basically I tried for weeks to figure out how to do it, but all I got was extremely confusing type errors
<whitequark> well
<whitequark> think packing an arbitrary scalar in a container
<whitequark> "t" is a container type with a single parameter
<glowcoil> oh oh oh ocaml has backwards type-application syntax from haskell's
<whitequark> right
<glowcoil> i was thinking, if a is * -> * then how the hell can it be an argument
<glowcoil> haha
<whitequark> "int list array" kinda reads well
<whitequark> opposed to "array list int", say
<whitequark> though I don't really buy this argument :p
<glowcoil> haha
<glowcoil> yeah
<glowcoil> i like the analogy
<glowcoil> to functions
<glowcoil> although:
<glowcoil> that really exposes how much haskell is not really consistent/full of perfect analogies like that in the end anyway
<purr> <alexgordon> elliottcable: I've seen C++ code more attractive than you
prophile has joined #elliottcable
<whitequark> sooo
<whitequark> made a thing.
<whitequark> for my broken notebook hinge.
<glowcoil> neat
<glowcoil> haha
<glowcoil> like handmade out of wood?
yorick has joined #elliottcable
<whitequark> no, CNC-made out of wood
<whitequark> yes, I wrote that by hand. no, it is actually readable after you work with gcode for a few months
<whitequark> kinda like APL
<whitequark> except it's less write-only
cloudhead has joined #elliottcable
<glowcoil> whitequark: haha idk, i'd argue APL is one of the most naturally readable languages there is
<glowcoil> once you get to know it lol
<purr> lol
prophile has quit [Quit: The Game]
prophile has joined #elliottcable
Sgeo has quit [Read error: Connection reset by peer]
prophile has quit [Quit: The Game]
PragCypher has joined #elliottcable
alexgordon has joined #elliottcable
alexgordon has quit [Client Quit]
alexgordon has joined #elliottcable
<purr> * whitequark read that as "dick-shaped break-down"
prophile has joined #elliottcable
alexgord_ has joined #elliottcable
gozala has joined #elliottcable
PragCypher has quit [Ping timeout: 252 seconds]
PragCypher has joined #elliottcable
<joelteon> wow
<joelteon> working from home is a dream
<joelteon> come true
eligrey has joined #elliottcable
<purr> <s5fs> nexxy: i also hear a dragon lives there but i haven't found the commit
eligrey has quit [Ping timeout: 265 seconds]
prophile has quit [Quit: The Game]
<joelteon> so guys
<joelteon> if ssl_verify_client is optional
<joelteon> are people who visit my website going to be prompted to provide a client certificate
<joelteon> because that seems REALLY annoying
<purr> <sephr> yeah I had to change my opinion so I could disagree with you
eligrey-space has joined #elliottcable
eligrey-space has quit [Ping timeout: 265 seconds]
eligrey-space has joined #elliottcable
<alexgord_> having one of those urges to build compilers
<alexgord_> glowcoil: help me get through it
PragCypher has quit [Quit: Leaving]
eligrey-space has quit [Remote host closed the connection]
eligrey-space has joined #elliottcable
<purr> <prophile> to be honest i think it's all downhill after kidney cracker
eligrey-space has quit [Remote host closed the connection]
eligrey has joined #elliottcable
Sgeo has joined #elliottcable