ec changed the topic of #elliottcable to: #
yorick has quit [Remote host closed the connection]
duckinator has joined #elliottcable
devyn has quit [Ping timeout: 246 seconds]
devyn_ has joined #elliottcable
vil_ has joined #elliottcable
Sgeo_ has joined #elliottcable
Sgeo has quit [*.net *.split]
vil has quit [*.net *.split]
eligrey has quit [Quit: Leaving]
eligrey has joined #elliottcable
devyn_ has joined #elliottcable
devyn_ has quit [Changing host]
devyn_ is now known as devyn
alexgordon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<micahjohnston_> ec: i love you
<micahjohnston_> ec: also let's play minecraft
<micahjohnston_> ec: also that's adorable
<micahjohnston_> ec: also macbook air
<micahjohnston_> ec: also i can finaly musicproduce
<micahjohnston_> becas producing room with keyboard and stuff is accessible with laptop
eligrey has quit [Quit: Leaving]
duckinator has quit [Quit: Nickname collision due to Services enforced nickname change, your nick was overruled]
<devyn> 23:13:09 -!- duckinator [nick@botters/staff/duckinator] has quit [Quit: Nickname collision due to Services enforced nickname change, your nick was overruled]
<devyn> wat
duckinator has joined #elliottcable
sharkbot has quit [Remote host closed the connection]
sharkbot has joined #elliottcable
chris-tina has joined #elliottcable
PragCypher has joined #elliottcable
PragCypher has quit [Quit: Leaving]
chris-tina has quit [Quit: Ex-Chat]
niggler has quit [Ping timeout: 256 seconds]
niggler has joined #elliottcable
PragCypher has joined #elliottcable
alexgordon has joined #elliottcable
chris-tina has joined #elliottcable
eligrey has joined #elliottcable
niggler has quit [Quit: Computer has gone to sleep.]
yorick has joined #elliottcable
gozala_ has quit [Quit: Linkinus - http://linkinus.com]
<alexgordon> I wonder if furrow should have declarations for mutable variables (seems like an oxymoron)
<alexgordon> seems like a good idea
<alexgordon> and can always remove it
<alexgordon> yep, this is definitely a very good idea
<whitequark> a truism?
<whitequark> not an oxymoron
<alexgordon> whitequark: err, yeah
<alexgordon> tautology
<alexgordon> micahjohnston: here?
PragCypher has quit [Quit: Leaving]
chris-tina has quit [Quit: Ex-Chat]
<micahjohnston_> alexgordon: hi
<alexgordon> hi!
<micahjohnston_> hi!
<alexgordon> micahjohnston_: halp me with types
<micahjohnston_> alexgordon: ok
<alexgordon> I want to add glocal type inference to furrow
<alexgordon> xD
<micahjohnston_> glocal?
<micahjohnston_> is that local and global
<micahjohnston_> kinda mished together
<alexgordon> :P
<alexgordon> not quite global
<alexgordon> but more than say C++
<micahjohnston_> ok
<alexgordon> example
<micahjohnston_> i don't actually know a whole ton
<micahjohnston_> ok
<micahjohnston_> ah ok yeah
<alexgordon> kinda tricky because what type is []
<micahjohnston_> yeah
<micahjohnston_> does it error if you say
<micahjohnston_> if: foo = [1, 2, 3]; else: foo = ['a','b','c']
<micahjohnston_> shit syntax
<micahjohnston_> shitsnacks
<micahjohnston_> anyway yeah
<micahjohnston_> control flow graph analysis!
<alexgordon> the way I want to do it is to find the types of all the assignments
<alexgordon> then fold them
<alexgordon> to get a single unified type
<alexgordon> so I guess that could be an error
<micahjohnston_> yeah ok
<alexgordon> or a [T]
<micahjohnston_> if two assignments are incompatible
<micahjohnston_> or just make it supertype including both, if possible
<alexgordon> I mean you could still use say length() on them
<alexgordon> but I'd be inclined to disallow it
<alexgordon> dunno, difficult
<alexgordon> want to avoid boxing anything
<alexgordon> micahjohnston_: there's no bottom / object type, so you definitely can't have a variable that's both (say) String and Int
<alexgordon> er, would that be *top type?
<alexgordon> yeah that's what I meant
<alexgordon> I think I'd be inclined to disallow unifying [Int] and [String] because then you introduce performance problems. All your Ints and Strings have to be boxed into an Any type, then unboxed when you want to get them out. Plus it's just not very useful
<alexgordon> but
<alexgordon> another issue is combining say [3.14, 2.71] and [1, 2, 3]
<alexgordon> [Real] and [Int]
<alexgordon> because [1, 2, 3] will be stored as Ints
<alexgordon> so it has to suddenly be converted to Reals
<alexgordon> so in say
<alexgordon> var foo = [1, 2, 3]
<alexgordon> if foo's type is deduced to be [Real]
<alexgordon> you have to have a coercion
<alexgordon> var foo = __coerce<List<Real>>([1, 2, 3])
<alexgordon> which is a bit silly
<alexgordon> because it would make more sense to just have [1.0, 2.0, 3.0]
<alexgordon> micahjohnston_: so what is the type of [] ? is it some special type? is it just [T]?
* alexgordon asks ghc
<alexgordon> [] :: [a]
<micahjohnston_> well it's easier in ghc
<micahjohnston_> because of the way dataflow can happen
<micahjohnston_> oh yeah just plain old []
<alexgordon> in haskell it would be
<alexgordon> blah True = []
<alexgordon> blah False = [1, 2, 3]
<micahjohnston_> blah :: Boolean -> [Int]
<alexgordon> or Num t
<micahjohnston_> yeah
<alexgordon> so haskell's type inference sees [a] and [Int] and says "that's an [Int]"
<alexgordon> which I find a little weird
<alexgordon> because a [a] isn't necessarily an [Int]
<alexgordon> guess it depends on the context of a
<micahjohnston_> well it's like
<micahjohnston_> blah can evaluate to all of these things
<micahjohnston_> and so they are consistent because one is an empty list of ints and one is a full list of ints
<alexgordon> man type inference is Hard
<micahjohnston_> not weird
<micahjohnston_> [] is an [a] if there's no further info
<alexgordon> micahjohnston_: that's not what I find weird though
<alexgordon> it's that [a] • [Int] → [Int]
<micahjohnston_> well it's not that
<micahjohnston_> it's
<micahjohnston_> [] :: [a] if it's just a [] sitting there
<alexgordon> as far as pattern matching goes, in blah
<micahjohnston_> but if it's the result of a function that can also evaluate to [1, 2, 3]
<alexgordon> blah True is [a]
<alexgordon> blah False is [Int]
<micahjohnston_> no, blah True is [1, 2, 3]
<micahjohnston_> wait
<micahjohnston_> [Int]
<micahjohnston_> because Haskell considers all the cases together
<micahjohnston_> because blah is one value
<alexgordon> talking about the individual cases
<micahjohnston_> blah is a function with a single type
<micahjohnston_> it's
<micahjohnston_> you cannot talk about them in isolation
<micahjohnston_> blah is a function, Boolean -> [Int]
<alexgordon> ok what I mean is
<alexgordon> if blah False didn't exist
<alexgordon> blah True would be [a]
<alexgordon> like if you just had
<alexgordon> blah True = []
<micahjohnston_> that's a nonsensical way to put it
<micahjohnston_> "blah False didn't exist"
<alexgordon> it would be [a]
<micahjohnston_> it's not like
<micahjohnston_> that case exists
<micahjohnston_> if you take that line away
<alexgordon> lol
<purr> lol
<micahjohnston_> then you no longer have any information showing that blah results in [Ints}
<alexgordon> but that's how it works, it generates constraints
<micahjohnston_> you could still write blah :: Boolean -> [Int]
<micahjohnston_> but it would also warn you
<micahjohnston_> that not all cases of datatype are handled
<alexgordon> yeah but without an explicit declaration it would be Boolean → [a]
<micahjohnston_> well sure
<micahjohnston_> but you're thinking about it like the cases of the pattern matching are separate things
<micahjohnston_> when the compiler desugars them to a case..of statement
<alexgordon> but there's a constraint for each case...
<micahjohnston_> no there isn't
<micahjohnston_> they all *have* to be the same type
<micahjohnston_> it gets desugared to
<alexgordon> somewhere in ghc there's a function that goes "okay so the first line is [a] and the second line is [Int], therefore the whole function is [Int]"
<micahjohnston_> blah = \ a -> case a of { True -> asld;fjasd;lfjasdlf;
<micahjohnston_> so it's best to think of it in that way
<micahjohnston_> the different cases are not separate things
<micahjohnston_> they're different possible dataflow branches
<alexgordon> but they are different, in that they inhabit different places in the source file
<micahjohnston_> but yeah i guess you're right that in ghc there's a part that says well this part only has enough information to see that it's a [SOMETHING] and then this part is [Int]
<micahjohnston_> but I don't think you can even put another decl between them
<micahjohnston_> like
<alexgordon> and so the ghc type inference algorithm sees a function with two cases
<micahjohnston_> blah True = asdf
<micahjohnston_> foo ASDF = asfegg
<micahjohnston_> blah False = asdfh
<micahjohnston_> pretty sure that's an error
<micahjohnston_> no, the type inference algorithm sees a case statement
<alexgordon> ok but this is a silly thing to argue
<micahjohnston_> fairly sure
<micahjohnston_> it would see it as
<micahjohnston_> a dataflow branch
<alexgordon> micahjohnston_: it sees a case statement with two branches...
<alexgordon> there are FOUR lights
<micahjohnston_> lights?
<micahjohnston_> oh oh oh
<micahjohnston_> picard?
<micahjohnston_> yeah ok
<micahjohnston_> i remember that
<alexgordon> micahjohnston_: so
<alexgordon> if I go the haskell route
<alexgordon> [] is [T]
<alexgordon> then we have [T] • [Int] → [Int]
<micahjohnston_> well i mean
<micahjohnston_> that's a weird way to put it
<micahjohnston_> but sure
<alexgordon> well
<alexgordon> it's got to be a type
<micahjohnston_> well you can't assign a type to a single branch of a conditional in isolation
<micahjohnston_> because the whole conditional must always evaluate to the same type
<alexgordon> lol
<purr> lol
<alexgordon> maybe not in haskell
<alexgordon> but yeah
<alexgordon> a variable has to have one single type
yorick has quit [Read error: Connection reset by peer]
<micahjohnston_> so yeah just take all the assignments to the variable and unify all their types
<micahjohnston_> i guess yeah
<micahjohnston_> so what you're saying
<micahjohnston_> lol
<micahjohnston_> yep
<alexgordon> prophile: yeah but I don't really like global type inference
<joelteon> fuck i'm mad
<alexgordon> so I'm keeping it simple
<micahjohnston_> joelteon: what happen
<joelteon> RAM is soldered in in the retina MBPs
<micahjohnston_> alexgordon: seems like you should use global type inference
<alexgordon> micahjohnston_: NO
<micahjohnston_> joelteon: oh and you got 4mb or something
<micahjohnston_> gb*
<joelteon> 8GB
<joelteon> i was all prepared for 16
<micahjohnston_> oh ok
<joelteon> now I have to pay newegg a restocking fee
<alexgordon> I swear ghc's error messages are more inscrutable than clang's now
<joelteon> i am this mad
<joelteon> no they aren't
<micahjohnston_> alexgordon: is that a joke
<joelteon> unless you're bad at ghc
<alexgordon> nope
<micahjohnston_> my two favorite compilers are clang and ghc
<joelteon> and good at clang
<joelteon> then that would make sense
<joelteon> i'm good at ghc and bad at clang so the latter causes me trouble
<prophile> I feel like I should start a list of things that alexgordon doesn't hate
<micahjohnston_> haha
<alexgordon> prophile: it will have a type of [a]
<prophile> one page of my logbook ought to do
<prophile> hah
<prophile> [()] is a natural number type
<alexgordon> ghc's error messages are "OMG THESE TYPES ARE INCOMPATIBLE BUT I WON'T TELL YOU ANY MORE"
<joelteon> w0t
<alexgordon> needs some ^ and ~~~ love
<prophile> ghc's error messages are verbose
<prophile> but i don't find them too hard to follow
<prophile> they're an improvement over, say, old gcc versions
<alexgordon> clang says "here are the lines which are incompatible, nicely coloured with the bits that are wrong"
<alexgordon> and I can't help but think that half of that is due to global type inference making it hard to generate good errors
<micahjohnston_> lol what
<purr> lol
<micahjohnston_> that makes no sense
<micahjohnston_> haskell provides more information about where the error happens than clang does
<micahjohnston_> i can see it being confusing
<micahjohnston_> and hard to interpret at a glance
<prophile> the solution is to have a language with only one type
<alexgordon> prophile: right. Tcl
<prophile> bash
<prophile> it's pretty awesome
<prophile> you can emulate it in your own program by just using strings everywhere
<alexgordon> wtf is this
<prophile> :D
<prophile> instance Num String where
<prophile> it's beautiful
<prophile> fromInteger = show
<prophile> abs ('-':x) = x; abs x = x
<micahjohnston_> prophile: omg
<alexgordon> micahjohnston_: so yeah, this is what I'm going to do for the var keyword in furrow https://gist.github.com/fileability/d9a68c0495cf3afeba05
<joelteon> instance Num String where (+) = (++)
<alexgordon> thinking maybe I went too far though, no reason why you shouldn't be able to rebind constants
<alexgordon> NO REASON AT ALL
<joelteon> yeah, if they were constant values they would be called "constants"
<joelteon> oh wait
<alexgordon> it would be a different variable though
<micahjohnston_> joelteon: haha
<prophile> micahjohnston_: are you familiar with the inner workings of the IO monad?
<micahjohnston_> prophile: a lil bit probably
<prophile> with the whole RealWorld# thing?
<joelteon> haha
<alexgordon> prophile: dude the guy wrote a paws interpreter
<joelteon> i have a quote in #haskell about RealWorld# Haskell
<prophile> you may enjoy this then
<prophile> particularly the 'hypothetically' combinator
<micahjohnston_> oh my god wreck it ralph is the best movie
<micahjohnston_> prophile: yeah
<micahjohnston_> (re realworld)
<joelteon> wrack it relph
<alexgordon> so I searched github for "love truncheon" and found this O_O https://github.com/Jegp/codeheaven/blob/25ebae960965f37c29b97895b7418a6af80c7dcd/www/404.html
<micahjohnston_> prophile: hm what does it actually do
<micahjohnston_> alexgordon: that is familiar
<prophile> micahjohnston_: in practice, I don't actually know!
* prophile finds out
<micahjohnston_> alexgordon: as in
<micahjohnston_> alexgordon: there are lots of euphemisms
<micahjohnston_> like the alphabetical elliottcable ones
<alexgordon> ok, so I just found a haskell file which is 97% bad words https://github.com/liammclennan/tweetthis/blob/496c8d033168210fa8795b5b1f6fec46e72ee346/Evaluator.hs
<micahjohnston_> lul
<joelteon> what the fuck is a chuftie
<alexgordon> so
<alexgordon> the most popular language for "love truncheon" is XML
<prophile> micahjohnston_: it behaves in some strange ways
<prophile> it's basically deterministic but unpredictable whether any actions actually happen
<micahjohnston_> hahaha weird
* micahjohnston_ will be back in a bit
<micahjohnston_> back