IRC Logs for #io Saturday, 2016-04-16

*** petr has quit IRC01:07
*** petr has joined #io01:07
*** TheMonkey has joined #io02:06
*** ElMonkey_ has quit IRC02:10
*** bb010g_ has quit IRC02:38
*** bb010g has joined #io02:44
*** whaletechno has joined #io04:57
*** soveran has joined #io06:12
*** soveran has quit IRC06:12
*** soveran has joined #io06:12
*** soveran has quit IRC06:39
*** soveran has joined #io06:39
*** soveran has quit IRC06:39
*** soveran has joined #io06:39
*** soveran has quit IRC06:42
*** soveran has joined #io06:52
*** soveran has quit IRC06:56
*** soveran has joined #io07:04
*** bb010g has quit IRC07:59
*** soveran has quit IRC10:22
*** Fate has joined #io14:06
*** Fate has quit IRC14:31
*** soveran has joined #io16:09
*** soveran has quit IRC16:09
*** soveran has joined #io16:09
pdurbinjer: always a pleasure chatting with you: http://irclog.greptilian.com/sourcefu/2016-04-16#i_168284 :)18:31
jerpdurbin, =]18:38
jerif i can help explain things, i'd be happy to18:38
jerwithout getting too mathy18:38
pdurbinjer: awesome. I'll take a raincheck though, please, because I have a sink to unclog. :)18:40
jerheh no worries18:42
jeri've got elixir code asking me to finish it atm :)18:42
pdurbinheh. well, I love hearing from polyglots like you and aditsu18:43
jeri'll just explain sum and product types then bugger off completely =]18:46
jeryou can scrollback / read log later =]18:46
jera sum type is exactly what the name suggests, the summation of types. that is to say, if you've got a data type like:18:46
jerdata Maybe a = Nothing | Just a18:46
jerthat's a sum type. It's also a monad, but ignore that for now.18:46
jerits limits are the sum of Nothing and Just a18:47
jera product type is like a C struct; struct { int a; int b; int c; };18:47
jerwhere the type is actually a * b * c <-- in type theory speak18:48
jerthat is to say, the type represents the limits of a, multiplied by the limits of b, multiplied by the limits of c18:48
jerwhich produce a * b * c possible values for the type18:48
jerwhereas in the sum type example above, you can think of that as: Nothing + Just a18:48
jerlimit of Nothing is actually nothing, but let's call it 1 for the sake of argument; 1 + a18:49
jersome other names for a sum type include disjoint unions, tagged unions, variant records18:51
jerC has tagged unions -- union { int a; char c; }; <-- that union is guaranteed to have a memory layout that is large enough to hold the largest element inside it, and then the storage is shared18:52
jera class, an object, etc are all product types18:53
jeri.e., io objects, are product types18:53
jerio has no notion of union types built in18:54
jerhowever, you could write it in the language itself18:54
pdurbinhuh. so C already has both product types and sum types (or at least tagged unions). I thought these were some new thing18:54
jerC's support is rather limited18:54
jerbut yeah18:54
*** soveran has quit IRC18:55
pdurbinand why are they exciting? what is their practical purpose?18:55
jerbecause often times, we don't need a product type18:56
jerproduct types are harder to reason about, since their correctness means all state known inside that storage must be accurate18:56
jernot so with a sum type18:56
jeronly the part of the type you're interested in must be correct18:56
*** soveran has joined #io18:56
jerthe rest can happily be undefined, because you have no access to it18:56
pdurbinhmm. ok18:57
jerso if for instance, you have: data Maybe a = Nothing | Just a ... and some code let x = Just 42 ... you'll get back a Maybe Int18:57
jeryou don't care how Nothing is represented, because it's not important to your instance of the type18:57
jerwhereas if i did: struct maybe { void* a; bool nothing; }; then i'd have to check nothing is false before i could rely on a18:58
pdurbinjer: now you've got aditsu interested: http://irclog.greptilian.com/sourcefu/2016-04-16#i_168300 :)18:58
jerexactly18:58
jer=D18:58
jerthere are more accurate descriptions, but that's a good general understanding18:59
jeranyway, back to getting this a/b engine done19:00
jerwell, the storage for it anyway, the engine itself lives client side and is done19:00
*** Kosha has joined #io19:16
*** Kosha has quit IRC19:54
*** debris` has quit IRC21:10
*** prologic has joined #io21:12
prologichnnn?21:12
*** debris` has joined #io21:17
pdurbinstupid sink21:17
*** bear has joined #io21:19
*** debris` has quit IRC21:26
*** soveran has quit IRC21:30
*** soveran has joined #io21:39
*** soveran has quit IRC21:39
*** soveran has joined #io21:39
*** debris` has joined #io21:43
*** bb010g has joined #io21:50
*** soveran has quit IRC22:42
*** soveran has joined #io23:43
*** soveran has quit IRC23:43
*** soveran has joined #io23:43
*** soveran has quit IRC23:47

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!