code logs -> 2007 -> Wed, 19 Sep 2007< code.20070918.log - code.20070920.log >
--- Log opened Wed Sep 19 00:00:01 2007
00:09 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Goddamn plague.]
00:13 You're now known as TheWatcher[T-2]
00:15 You're now known as TheWatcher[zZzZ]
00:32 Netsplit DeepThought.NY.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: Vornicus, MinceR, @Thaqui, ReivZzz, jerith, @Chalain
00:32 MinceR [~mincer@Nightstar-21862.nik.bmf.hu] has joined #code
00:32 mode/#code [+o Thaqui] by ChanServ
00:32 Netsplit over, joins: Thaqui
00:32 Netsplit over, joins: ReivZzz
00:32 Vornicus [~vorn@64.252.103.ns-11691] has joined #code
00:33 Vornicus is now known as NSGuest-1126
00:35 NSGuest-1126 is now known as Vornicus
00:37 Chalain [~chalain@Nightstar-4184.res.logixcom.net] has joined #code
00:37 jerith [~jerith@Nightstar-21563.slipgate.za.net] has joined #code
00:38 jerith is now known as NSGuest-1129
00:47 * McMartin plays with OCaml
00:47
<@McMartin>
Hilarity with abstract types.
00:47
<@McMartin>
I'm writing a "factory method" that converts a primitive type into what a certain abstract type secretly is.
00:47
<@McMartin>
The function to do this is:
00:47
<@McMartin>
let convert x = x;;
00:48
<@McMartin>
And that is how you do type-casting in a language with type inference.
00:49
< Vornicus>
...okay.
00:49
<@McMartin>
(The actual cast is in the stated signature elsewhere.)
00:57 ReivZzz is now known as ReivClass
01:19
< MinceR>
gn
01:44
<@McMartin>
val test : (ByteStream.StringStream.t -> 'a) -> ('a -> string) -> string -> unit
01:45
<@McMartin>
I'm glad I didn't have to declare that.
01:56
<@ToxicFrog>
o.O
01:56
<@ToxicFrog>
I should play with ML someday, but then I see stuff like that and it scares me.
01:57
<@ToxicFrog>
What does that actually mean? I mean, the first two chunks look like they declare a function that maps functions with a given signature to functions with a different signature, but then there's two more -> and I get lost.
02:29 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has left #code [Leaving]
02:36
<@McMartin>
TF: The part you're missing is that ML functions only usually bother with one argument, because you can express multiple arguments with chained invocations.
02:37
<@McMartin>
And, in fact, use this to do partial evaluation.
02:37
<@McMartin>
That is a function that takes two functions and a string and returns nothing.
02:38
<@McMartin>
The first function takes a user defined type and returns... something. The second is a function that converts that something into a string. The third is an annotation.
02:38 * McMartin is reimplementing Python's struct module in OCaml so that he could perhaps in the future actually use OCaml for something.
03:19
<@McMartin>
Woohoo! Byte-exactness!
03:19
<@McMartin>
Even for floating point!
03:19
<@McMartin>
No support for unsigned quad words on the OCaml side, but even Python doesn't guarantee quadword support of any kind, so.
03:25 GeekSoldier|Bed [~Rob@Nightstar-5191.pools.arcor-ip.net] has quit [Ping Timeout]
03:27
<@ToxicFrog>
Floating point is the persistent ball of ;.; in my Lua struct implementation.
03:29
<@McMartin>
So, yeah
03:29 * McMartin works on building a makefile to demonstrate everything.
03:30
<@McMartin>
This is, of course, comically imperative code.
03:33
<@ToxicFrog>
Heh.
03:33
<@ToxicFrog>
The thing that always messes me up in pure-functional is the lack of state.
03:33
<@ToxicFrog>
Or, rather, the lack of explicit state.
03:33
<@McMartin>
Nnnnormally that's not a problem for me.
03:33
<@McMartin>
However, when one is writing I/O code and one is not using Haskell, one is mostly out of luck.
03:33 * ToxicFrog is all about the mutable data structures
03:39 * ToxicFrog grabs Java and shakes it until the ability to mutate the class tree falls out
03:40
<@McMartin>
Ew
03:40
<@McMartin>
Morphing is evil and wrong
03:47
<@ToxicFrog>
Well, Doing It Right involves subclassing String.
03:47
<@ToxicFrog>
...and then rewriting the compiler.
03:47
<@McMartin>
... or just using StringBuilders everywhere in your code?
03:47
<@ToxicFrog>
StringBuilders?
03:48
<@McMartin>
The non-constant version of String?
03:48
<@ToxicFrog>
All I want is to add one method to String. Is that so hard?
03:48
<@McMartin>
Which method would that be?
03:48
<@ToxicFrog>
(hint: yes, if you want the strings generated by string literals and every goddamn library function that returns strings to be able to use it)
03:48
<@ToxicFrog>
reverse().
03:49
<@ToxicFrog>
And, yeah, I can always do class ReversableString extends String, but that doesn't help me write someRandomLibraryFunction().toString().reverse()
03:49
<@McMartin>
... and writing a static method somewhere else that takes a String and returns a new one isn't good enough for this?
03:49
<@ToxicFrog>
Well, yes, I can do that, but that's ugly.
03:50
<@McMartin>
I see nothing wrong with TFUtil.reverse(someRandomLibraryFunction().toString()) -- or at least, nothing worse than what you bring upon yourself from writing in Java to begin with.
03:50
<@McMartin>
If you want pretty code write in Scheme~
03:50
<@ToxicFrog>
Sadly, my prof is a dick.
03:51
<@McMartin>
http://www.stanford.edu/~mcmartin/misc/camlstruct.tgz
03:52
<@McMartin>
The function "test" with the scary type signature is in camlread.ml.
03:52
<@ToxicFrog>
(and I find that foo.reverse(bar.baz) is less intuitively obvious than bar.baz.reverse)
03:53
<@ToxicFrog>
Anyways. I don't actually need this, it would just be nice to have.
03:56
<@McMartin>
(I note, in passing, that OCaml has horrific syntax and the Wrong Holes in its type system, but has the Good and Portable compilers.)
03:58 * McMartin is going to use this so that there's an OCaml-based library for SVAF.
03:58
< Vornicus>
what are its holes?
03:58
<@McMartin>
The comparators and the hash function are magic.
03:58
<@McMartin>
And can fall down as a result on user-defined types.
03:59
<@McMartin>
However, + and - are not magic and so if you want to do math on floating point numbers you must use +. and -. instead.
03:59
< Vornicus>
ow.
03:59
<@McMartin>
Yeah.
03:59
<@McMartin>
Also, int is "As much of an integer as I can fit into my tagged memory model."
03:59
<@McMartin>
So on most systems that means an int is 31 bits.
04:00
<@McMartin>
My little struct module handles the necessary conversions under the hood for that.
04:00
<@McMartin>
(There are other types for 32- and 64-bit No I Mean It integers.)
04:00
< Vornicus>
Ruby also has that, but does transparent conversion to longs.
04:00
< Vornicus>
er, bigintegers.
04:00
<@McMartin>
ML is Brutally Statically Typed.
04:01
<@McMartin>
But it can get away with it due to polymorphism of madness and type inference.
04:01
<@McMartin>
The upshot of that is that it basically never needs to do a classical method dispatch.
04:25 GeekSoldier|Bed [~Rob@Nightstar-5191.pools.arcor-ip.net] has joined #code
04:26 GeekSoldier|Bed is now known as GeekSoldier|work
04:39 * McMartin starts commenting his code.
04:39
<@McMartin>
"This implementation is imperative like whoa, but what the heck, so are channels."
06:28 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has joined #code
06:28 mode/#code [+o Thaqui] by ChanServ
06:30 NSGuest-1129 [~jerith@Nightstar-21563.slipgate.za.net] has quit [Quit: leaving]
06:30 jerith [~jerith@Nightstar-21563.slipgate.za.net] has joined #code
07:02 Vornicus is now known as Vornicus-Latens
07:17 GeekSoldier|work [~Rob@Nightstar-5191.pools.arcor-ip.net] has quit [Ping Timeout]
08:31 Vornotron [~vorn@69.0.81.ns-26780] has joined #code
08:32 Vornicus-Latens [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout]
08:36 GeekSoldier|work [~Rob@Nightstar-5191.pools.arcor-ip.net] has joined #code
08:40 ReivClass is now known as ReivOut
09:01 You're now known as TheWatcher
09:31 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
09:32 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
09:32 mode/#code [+o ToxicFrog] by ChanServ
11:09 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
12:45 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has left #code [Leaving]
13:22 ReivOut is now known as Reiver
13:44 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
13:44 mode/#code [+o gnolam] by ChanServ
14:48 Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has joined #code
14:48 mode/#code [+o Pi] by ChanServ
14:55
< MinceR>
r4wr
15:12 GeekSoldier|work is now known as GeekSoldier
15:14 Reiver is now known as ReivZzz
15:37 GeekSoldier [~Rob@Nightstar-5191.pools.arcor-ip.net] has quit [Ping Timeout]
16:21 GeekSoldier [~Rob@Nightstar-5191.pools.arcor-ip.net] has joined #code
16:32 Vornotron is now known as Vornicus
18:42 GeekSoldier [~Rob@Nightstar-5191.pools.arcor-ip.net] has quit [Ping Timeout]
18:43 GeekSoldier [~Rob@Nightstar-4842.pools.arcor-ip.net] has joined #code
18:48 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Ping Timeout]
19:12
< EvilDarkLord>
Any apache gurus around?
19:34 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
19:34 mode/#code [+o gnolam] by ChanServ
19:35 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has joined #code
19:35 mode/#code [+o Forj] by ChanServ
19:54 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
20:07 GeekSoldier is now known as GeekSoldier|bed
21:14 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has joined #code
21:14 mode/#code [+o Chalcedon] by ChanServ
23:01 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has joined #code
23:01 mode/#code [+o Thaqui] by ChanServ
23:41 You're now known as TheWatcher[t-2]
23:44 You're now known as TheWatcher[zZzZ]
23:49
< MinceR>
gn
--- Log closed Thu Sep 20 00:00:08 2007
code logs -> 2007 -> Wed, 19 Sep 2007< code.20070918.log - code.20070920.log >