flux__ changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
dark_light has quit [Remote closed the connection]
omnipath has joined #ocaml
omnipath has left #ocaml []
descender has quit [Remote closed the connection]
magnus-- has joined #ocaml
chessguy has joined #ocaml
chessguy2 has joined #ocaml
dark_light has joined #ocaml
chessguy has quit [Connection timed out]
chessguy2 has quit [Client Quit]
exa has quit [Remote closed the connection]
Smerdyakov has quit ["Leaving"]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
magnus-- has quit [Read error: 110 (Connection timed out)]
<flux__> hmm.. that Col language extension for ocaml featured in lambda-the-ultimate.org (well, atleast it's mentioned) seems pretty nice
<flux__> although it makes me almost feel bad how much code it generates (/needs to generate) :-)
<flux__> I wonder if it will be more maintained than the sexp language extension, which was pretty cool but didn't work fine with camlp4o
<flux__> col is listed here: http://martin.jambon.free.fr/ocaml.html - and its documentation (well, sort of) at http://martin.jambon.free.fr/col-doc.html
mikeX has joined #ocaml
Snark has joined #ocaml
Submarine has joined #ocaml
Amorphous has quit [Success]
Snark has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
Snark has joined #ocaml
Morphous is now known as Amorhous
Amorhous is now known as Amorphous
Revision17 has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
__DL__ has joined #ocaml
smimou has joined #ocaml
Daweos has joined #ocaml
mikeX has quit ["leaving"]
m3ga has joined #ocaml
mikeX has joined #ocaml
bzzbzz has quit [Client Quit]
Tachyon76 has joined #ocaml
Daweos has quit []
m3ga has quit ["disappearing into the sunset"]
Nargg has joined #ocaml
schlick has joined #ocaml
<schlick> Anyone care to help me think on some source code analysis stuff?
<Smerdyakov> RULE #1 OF IRC: Just Ask Your Question
<dylan> hehe, declarative conversation.
<schlick> I'm currently hung up on how one would check for this error at compile time. In compilation unit A, you allocate some memory, and initialize it as, say, integer 0's. Then you pass it to compilation unit B, which expects it to be initialized as character ".". The same thing could, I think, happen with a compiled garbage collected language by passing a reference to something of the wrong type.
<Smerdyakov> schlick, isn't that a simple type error, as integer isn't character?
<schlick> Yes that would be a "simple type error". How one would go about checking for it with the two separate compilation (or more precisely, analysis) units is what I'm hung up on. It seems there'd have to be some way of communicating "the other guy has got integers in this array at the moment".
<Smerdyakov> In ML, every cross-compilation unit link goes through typed interfaces.
<schlick> You could catch it by the pointer/reference type passed as a argument, I suppose, but if inside the memory block the initial pointer (passed as the argument) was one type, and (down the line in the data structure) it points at another type, that the two compilation units disagree on, I don't see how you'd check for it statically.
<Smerdyakov> Type correctness guarantees that types in interfaces are completely accurate.
<Smerdyakov> There is no possibility for "hidden errors" found by looking deeper into data structures.
<schlick> I can see how the initial pointer/reference can be checked (since the linking information contains that, no doubt), but not anything else.
<Smerdyakov> Please give me a complete example in an ML-like setting that you think demonstrates your concern.
<schlick> It's more a issue for a manually memory managed setting like C where you can't really depend on references and garbage collection (the garbage collector still has to get written somewhere). I think what would happen in a language like ML is each "type" would be handled separatly, you couldn't (implicitly, I guess, since it's garbage collected) allocate a block of mixed types.
<schlick> It's hard for me to map one to the other mentally.
<Smerdyakov> So you're talking about an unsafe source-level language?
<Smerdyakov> Of course there are no guarantees with an unsafe language....
<schlick> I'm not sure there's anything inherantly "unsafe" about manual memory management and pointers. You have to go through all sorts of contortions to make sure pointers aren't invalid, or don't become invalid, since you don't have references, but I haven't hit any cases where I can't think of a way you just /can't/ do that.
<Smerdyakov> "Unsafe" means that the compiler doesn't verify that your program won't have a runtime type error.
<schlick> I haven't, however, reasoned out how you can pass arbitrary data structures around on the heap and make sure no mistakes are made, namely because the only information that is passed, that I know of, is that necessary to make sure the bitwise representation of the two compilation units is agreed on, which revolves around the "first" pointer (the one passed as a argument). The rest is lost as far as I know.
<schlick> argument). The rest is lost as far as I know, and I don't know how to "pass that along".
<Smerdyakov> There is a metric tonne of research work on type systems for manual memory management.
<schlick> And yes, I know about the difference between strong/weak type systems.
<Smerdyakov> See the calculus of capabilities, alias types, linear types, separation logic, ....
<schlick> Well, I know of the "try to treat the heap as stack" stuff, which doesn't seem to be a workable general solution. I don't know of anything that handles "how do I glue these two binaries together while making sure the heap they pass around stays sane".
Tachyon76 has joined #ocaml
<schlick> By "heap as type", I'm referring to things like region inference. Unavoidable leaks are not cool.
<Smerdyakov> Then follow the references I just gave to be enlightened.
<schlick> Heap as stack, rather.
<schlick> Linear types I know a little about. I'm pretty sure that doesn't relate to this problem. The others I'm not sure about.
<schlick> Looks like calculus of capabilities is tied to region inference too.
<Smerdyakov> No.
<Smerdyakov> Calculus of capabilities is expressive enough to encode region-based management, and also much mroe.
<schlick> Hmm.
<schlick> Uniqueness types related to any of this?
<Smerdyakov> Yes
<schlick> I guess I'll be reading about it for a while. I don't think what I'm baffled by is that you can show that things are handled properly so much as how you would communicate in source code "this is what I'm passing to you" and "this is what I expect" on the two "halves". I guess you could include the full spec of what you expect to be in the unit of heap type-wise, when allocating, and on the "half" you pass it to.
<schlick> when allocating, and on the "half" you pass it to.
<Smerdyakov> I must go now.
Snark has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
love-pingoo has quit ["Connection reset by by pear"]
_jol_ has joined #ocaml
adam__ has quit ["BitchX: the headache medicine"]
schlick has left #ocaml []
_jol_ has quit ["leaving"]
magnus-- has quit [Read error: 110 (Connection timed out)]
ktne has joined #ocaml
<ktne> hello
<ktne> anyone here familiar with Aardappel?
ktne has quit [" HydraIRC -> http://www.hydrairc.com <- 100,000+ downloads can't be wrong"]
magnus-- has joined #ocaml
_JusSx_ has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
khaladan has joined #ocaml
slipstream-- has joined #ocaml
finelemon has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
finelemo2 has quit [Read error: 110 (Connection timed out)]
kral_ has joined #ocaml
kral_ is now known as kral
finelemon has quit [Read error: 110 (Connection timed out)]
finelemon has joined #ocaml
chessguy has joined #ocaml
Tachyon76 has quit [Read error: 110 (Connection timed out)]
Schmurtz has joined #ocaml
__DL__ has quit [Read error: 104 (Connection reset by peer)]
shawn has quit ["This computer has gone to sleep"]
kral has quit ["Live fast, die young."]
shawn has joined #ocaml
_JusSx_ has quit [Read error: 113 (No route to host)]
lde has joined #ocaml
love-pingoo has joined #ocaml
Axioplase has joined #ocaml
<Axioplase> hi !
<Axioplase> quick question.. I'm matching some single chars.. and weirdly, the line |'\''-> is told to be an unused case... is that normal ?
<zmdkrbou> do you have a "| _ -> " line before this one ?
<Axioplase> nope..
<Axioplase> the | _-> pattern is 20 lines below
mikeX has joined #ocaml
<Axioplase> and it's the first time I try to match the quote (of course)
<zmdkrbou> Axioplase: can you paste the code to pastebin.com or something like that ?
<Axioplase> ho god no
<Axioplase> I match it twice
<zmdkrbou> hehe :)
<Axioplase> I must have overwritten one of both, since I didn't have the warning before refactoring the code.
<Axioplase> ok got it :)
chessguy has quit [" Try HydraIRC -> http://www.hydrairc.com <-"]
mikeX has quit ["leaving"]
Axioplase has quit ["leaving"]
Submarine has quit ["Leaving"]
<love-pingoo> class c =
<love-pingoo> object
<love-pingoo> method a (c:c) = 1+c#b
<love-pingoo> method b ?(n=0) m = n+m
<love-pingoo> end
<love-pingoo> anybody knows how to hint caml to have him accept that recursive class definition ?
<love-pingoo> the subtyping makes him fail
<Smerdyakov> We call compilers and other non-living objects "it" in English, not "him" or "her."
<love-pingoo> Smerdyakov: yeah, I noticed afterwards..
<love-pingoo> but Caml is so... attaching :)
<Smerdyakov> I don't know anything about OCaml OO, so I can't help. :(
<Smerdyakov> Maybe I can help you realize that you don't really want to be using OO? :)
Skal has quit [Remote closed the connection]
<dylan> love-pingoo: class c = object (self : 'self) method a (c : 'self)...
<dylan> love-pingoo: also, the ocaml manual has a section on this, called binary methods.
<dylan> or some such.
<love-pingoo> hmm I managed to have it accepted by specifying the type of the #b method in the call within #a
<love-pingoo> your solution doesn't work :(
<love-pingoo> oops sorry, it does work
<love-pingoo> that's weird
<dylan> Smerdyakov: It seems a use is found for ocaml's OO in http://pauillac.inria.fr/~remy/work/virtual/..
<dylan> Now, ocaml with first-class modules... That would not require OO for any case.
<smimou> inherintance...
<smimou> -n
<dylan> include. ;)
<smimou> hum :)
<smimou> dynamic linking ?
<dylan> hmm?
<smimou> I mean run-time resolution of functions
<smimou> I'm not so good at OO terminology
<dylan> does ocaml OO actually do that, and how is that useful?
<smimou> ocaml does that
<dylan> but how is that useful?
<smimou> that's an other question :)
<dylan> now, I like invoking methods based on a string in dynamic languages, but I expect to not be allowed such things in ocaml. :)
<smimou> heh
<dylan> http://www.ocaml-programming.de/rec/IO-Classes.html is a cool usage of ocaml's object system.