flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
seafood has joined #ocaml
seafood has quit [Client Quit]
Morphous_ has joined #ocaml
marmotine has joined #ocaml
Morphous has quit [Connection timed out]
netx has joined #ocaml
Ched- has quit [Read error: 110 (Connection timed out)]
Ched- has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
seafood has joined #ocaml
marmotine has quit ["Quitte"]
Jeff_123 has quit [Read error: 110 (Connection timed out)]
palomer has joined #ocaml
<palomer> http://ocaml.pastebin.com/m2678129e <-- how can I do something like this?
<palomer> ie, I want to specify that baz satisfies interface foo
<palomer> I want to do this so I can debug my type errors
Jeff_124 has joined #ocaml
hsuh has joined #ocaml
hsuh has quit [Remote closed the connection]
Kopophex_ has joined #ocaml
Kopophex has quit [Read error: 110 (Connection timed out)]
Kopophex has joined #ocaml
Associat0r has quit []
Kopophex_ has quit ["Leaving"]
Kopophex_ has joined #ocaml
<flux> atleast you can do it via baz_type, but it means you need to write out the types of the additional methods: class type baz_type = object inherit foo method bloo : int end
<flux> I suppose you could do let _ = fun () -> (new bar :> foo) after the class definition :)
<flux> type-level assertion..
Kopophex has quit [Read error: 110 (Connection timed out)]
Kopophex_ is now known as Kopophex
palomer has quit [Read error: 110 (Connection timed out)]
palomer has joined #ocaml
Kopophex has quit ["Leaving"]
Axioplase is now known as Axioplase_
pango has quit [Remote closed the connection]
pango has joined #ocaml
bluestorm has joined #ocaml
filp has joined #ocaml
johnnowak has joined #ocaml
Jedai has joined #ocaml
rwmjones has joined #ocaml
Tetsuo has joined #ocaml
netx has quit [clarke.freenode.net irc.freenode.net]
tsuyoshi has quit [clarke.freenode.net irc.freenode.net]
svenl has quit [clarke.freenode.net irc.freenode.net]
johnnowak has quit [clarke.freenode.net irc.freenode.net]
seafood has quit [clarke.freenode.net irc.freenode.net]
authentic has quit [clarke.freenode.net irc.freenode.net]
dabblego has quit [clarke.freenode.net irc.freenode.net]
jdev has quit [clarke.freenode.net irc.freenode.net]
petchema has quit [clarke.freenode.net irc.freenode.net]
\banlist has quit [clarke.freenode.net irc.freenode.net]
mattam has quit [clarke.freenode.net irc.freenode.net]
Axioplase_ has quit [clarke.freenode.net irc.freenode.net]
jonafan has quit [clarke.freenode.net irc.freenode.net]
rwmjones has quit [clarke.freenode.net irc.freenode.net]
Jedai has quit [clarke.freenode.net irc.freenode.net]
pattern has quit [clarke.freenode.net irc.freenode.net]
jeremiah has quit [clarke.freenode.net irc.freenode.net]
structured has quit [clarke.freenode.net irc.freenode.net]
ikatz has quit [clarke.freenode.net irc.freenode.net]
mbishop has quit [clarke.freenode.net irc.freenode.net]
gaja has quit [clarke.freenode.net irc.freenode.net]
xevz has quit [clarke.freenode.net irc.freenode.net]
orbitz has quit [clarke.freenode.net irc.freenode.net]
ozzloy has quit [clarke.freenode.net irc.freenode.net]
jynxzero has quit [clarke.freenode.net irc.freenode.net]
Oatschool has quit [clarke.freenode.net irc.freenode.net]
bla has quit [clarke.freenode.net irc.freenode.net]
cmeme has quit [clarke.freenode.net irc.freenode.net]
filp has quit [clarke.freenode.net irc.freenode.net]
pango has quit [clarke.freenode.net irc.freenode.net]
Jeff_124 has quit [clarke.freenode.net irc.freenode.net]
smimou has quit [clarke.freenode.net irc.freenode.net]
Chile` has quit [clarke.freenode.net irc.freenode.net]
acatout has quit [clarke.freenode.net irc.freenode.net]
ulfdoz has quit [clarke.freenode.net irc.freenode.net]
Tetsuo has quit [clarke.freenode.net irc.freenode.net]
Morphous_ has quit [clarke.freenode.net irc.freenode.net]
ppsmimou has quit [clarke.freenode.net irc.freenode.net]
Naked has quit [clarke.freenode.net irc.freenode.net]
bluestorm has quit [clarke.freenode.net irc.freenode.net]
Sapan has quit [clarke.freenode.net irc.freenode.net]
fbvortex has quit [clarke.freenode.net irc.freenode.net]
gildor has quit [clarke.freenode.net irc.freenode.net]
haelix has quit [clarke.freenode.net irc.freenode.net]
hcarty has quit [clarke.freenode.net irc.freenode.net]
Sparkles has quit [clarke.freenode.net irc.freenode.net]
l_a_m has quit [clarke.freenode.net irc.freenode.net]
flux has quit [clarke.freenode.net irc.freenode.net]
palomer has quit [clarke.freenode.net irc.freenode.net]
jlouis has quit [clarke.freenode.net irc.freenode.net]
Mr_Awesome has quit [clarke.freenode.net irc.freenode.net]
mfp has quit [clarke.freenode.net irc.freenode.net]
shortc|desk has quit [clarke.freenode.net irc.freenode.net]
Ched- has quit [clarke.freenode.net irc.freenode.net]
Smerdyakov has quit [clarke.freenode.net irc.freenode.net]
Ugarte has quit [clarke.freenode.net irc.freenode.net]
szell` has quit [clarke.freenode.net irc.freenode.net]
rby_ has joined #ocaml
Tetsuo has joined #ocaml
rwmjones has joined #ocaml
Jedai has joined #ocaml
johnnowak has joined #ocaml
filp has joined #ocaml
bluestorm has joined #ocaml
pango has joined #ocaml
palomer has joined #ocaml
Jeff_124 has joined #ocaml
seafood has joined #ocaml
Ched- has joined #ocaml
netx has joined #ocaml
Morphous_ has joined #ocaml
pattern has joined #ocaml
jlouis has joined #ocaml
jeremiah has joined #ocaml
svenl has joined #ocaml
tsuyoshi has joined #ocaml
orbitz has joined #ocaml
cmeme has joined #ocaml
structured has joined #ocaml
l_a_m has joined #ocaml
smimou has joined #ocaml
ppsmimou has joined #ocaml
Mr_Awesome has joined #ocaml
authentic has joined #ocaml
Sapan has joined #ocaml
Axioplase_ has joined #ocaml
ikatz has joined #ocaml
jonafan has joined #ocaml
mfp has joined #ocaml
dabblego has joined #ocaml
jdev has joined #ocaml
Smerdyakov has joined #ocaml
mbishop has joined #ocaml
Ugarte has joined #ocaml
ulfdoz has joined #ocaml
fbvortex has joined #ocaml
mattam has joined #ocaml
petchema has joined #ocaml
\banlist has joined #ocaml
haelix has joined #ocaml
Sparkles has joined #ocaml
hcarty has joined #ocaml
Naked has joined #ocaml
shortc|desk has joined #ocaml
gildor has joined #ocaml
flux has joined #ocaml
szell` has joined #ocaml
jynxzero has joined #ocaml
bla has joined #ocaml
Oatschool has joined #ocaml
ozzloy has joined #ocaml
xevz has joined #ocaml
gaja has joined #ocaml
acatout has joined #ocaml
Chile` has joined #ocaml
johnnowak has quit []
rby has quit [Connection timed out]
seafood has quit []
rby_ is now known as rby
love-pingoo has joined #ocaml
guillem has joined #ocaml
Linktim has joined #ocaml
seafood has joined #ocaml
coucou747 has joined #ocaml
<bluestorm> rwmjones: mostly as a style exercise, i tried to refactorize your pa_bitmatch code with "conciseness" in mind. I'm aware that you'll probably dislike it (in particular i'm very bad at writing comments, so i only reused yours), but found this interesting actually. The result is http://bluestorm.info/ocaml/tmp/pa_bitmatch.ml.html (remove .html for the plain code file)
* rwmjones looks
<rwmjones> bluestorm, got an example of the new syntax?
<bluestorm> hm
<rwmjones> oh I see, you mean you refactored the implementation?
<bluestorm> yes
* rwmjones fires up diff ...
<bluestorm> syntax is much too subjective :p
<rwmjones> bluestorm, it's a bit tricky because that's based on quite an old version of pa_bitmatch.ml :-(
<bluestorm> hm
<bluestorm> 1.9 is too old ?
<rwmjones> compared to SVN, yes :-)
<rwmjones> I rewrote a ton of stuff when I was at the Red Hat Summit two weeks ago
<bluestorm> :p
OChameau has joined #ocaml
<rwmjones> 14 separate commits since 1.9
<bluestorm> must have been about the time when i was like "why is rwmjones not showing on IRC ?" :p
<rwmjones> yeah, I'm not around much at the moment, Red Hat Summit followed by holiday ... be back in earnest some time next week
<rwmjones> yes
<rwmjones> bluestorm, I added fixed offsets, quite a useful feature for automatic translation of C structures
<rwmjones> eg:
<rwmjones> { foo : 8 : offset(160) }
<rwmjones> means an 8 bit field at 160 bits offset from the start (the first 160 bits are not matched)
Jeff_124 has quit [Read error: 104 (Connection reset by peer)]
<rwmjones> however there are some restrictions, eg. you can't currently go backwards
<rwmjones> but offsets can be computed, which is quite interesting
<rwmjones> & it generates efficient code depending on how much can be known at compile time
<bluestorm> hm btw, i earlier had an error that your (very useful) test suite didn't catch, iirc i mixed up extract_bitstring and extract_remainder
<rwmjones> having a locfail function is very useful ...
Linktim_ has joined #ocaml
<bluestorm> (wasn't that ironic ?)
<rwmjones> ? no
<bluestorm> hm
<bluestorm> in case you're interested, it would be quite easy to match up with the SVN version
<bluestorm> (as you mainly added new code)
Linktim has quit [Connection timed out]
Linktim has joined #ocaml
<rwmjones> bluestorm, I just committed the locfail change. The others make sense, eg. use of the assoc-list to match qualifiers. If you have a patch ...
<flux> has it been tried to do wireshark-style packet decoding with pa_bitmach?
<flux> hm, infact writing wireshark-extensions in ocaml could be fun :)
<rwmjones> flux, kind of ... see
<rwmjones> the original motivation for bitmatch was to allow wireshark extensions to be written safely, also for partition / disk image decoding tools to be written without the usual range of security holes implicit in C code
<rwmjones> me & Jim Meyering (one of the GNU devs) have discussed these issues quite a bit
<flux> and the application of using it to peek inside virtual machines came as a suprised, I guess
<rwmjones> yes
<flux> libpcap.ml seems reasonably succinct
<flux> I wonder how iptables bindings with bitmatch would look like :)
<flux> (the structures you need to handle with iptables are very non-api-like)
netx has quit [Remote closed the connection]
seafood has quit []
<rwmjones> flux, it'd be slow ... iptables needs to be fast, hence specialized structures and lots of hand-optimized C code
Linktim_ has quit [Read error: 110 (Connection timed out)]
<flux> rwmjones, well, not if you're just configuring it
<flux> well, you still want to be reasonably fast
<flux> but it's not critical
<rwmjones> bluestorm, you say you mixed up those two extract_* functions and the test didn't pick it up ... can you be more specific?
<bluestorm> hm
<bluestorm> the problem is that i didn't kept the faulty code but i may try to recreate the situation
<rwmjones> bluestorm, I'm not quite sure if you were using extract_* functions directly?
<rwmjones> which of course you're not supposed to do :-)
<bluestorm> rwmjones: http://bluestorm.info/ocaml/tmp/pa_bitmatch.ml.diff is a diff against the SVN version
<bluestorm> ( .ml.html avaialable as usual )
<bluestorm> rwmjones: my camlp4 code outputted an extract_remainder instead of extract_bitstring, and the test suite didn't complain (wich is not really surprising because this kind of error must be hard to catch)
tomh has joined #ocaml
<rwmjones> thanks, I'll take a look momentarily
<bluestorm> hm rwmjones
<bluestorm> i may split that up in smaller patches for each function
<rwmjones> bluestorm, and diff -u :-)
<bluestorm> ok
<bluestorm> i found how to make the extract_* issue happen again, but it's in term of my code (a two lines change)
<bluestorm> basically, in http://bluestorm.info/ocaml/tmp/pa_bitmatch.ml.html , at line 390, you can change the "let bitstring .." definition with let bitstring _ = remainder () (effectively replacing those extract_bitstring with extract_remainder) and the test suite still pass
<rwmjones> bluestorm, aiui we need a test for 'foo : -1 : bitstring' really consuming the rest of the match
<bluestorm> and i guess foo : -1 : string too
<rwmjones> bluestorm, ok I applied 1-3 (thanks!)
petchema has quit [Read error: 104 (Connection reset by peer)]
<rwmjones> bluestorm, as for 4, I applied the part which uses construct_failure function in the antiquotation
<rwmjones> however the rest of the patch (and 5) is all a bit mixed up and hard to understand
<bluestorm> i'll eventually try to do something cleaner
Linktim has quit ["Quitte"]
Associat0r has joined #ocaml
rwmjones has quit [Read error: 113 (No route to host)]
hkBst has joined #ocaml
sponge45 has joined #ocaml
rwmjones has joined #ocaml
RobertFischer has joined #ocaml
Associat0r has quit []
Associat0r has joined #ocaml
Yoric[DT] has joined #ocaml
jlouis has quit ["Leaving"]
jlouis has joined #ocaml
vpalle has joined #ocaml
<vpalle> Hi, does anyone here know of a book or some papers about implementing interpreters in ocaml?
seafood has joined #ocaml
<Smerdyakov> Hm... I don't see why you'd need any treatment that's so in-depth.
<vpalle> I have a few books touching the subject, but all the example code is in scheme, which is okay, but I'd prefer ocaml..
<Smerdyakov> Most OCaml users find interpreter implementation obvious, I think.
<Tetsuo> vpalle, try Xavier Leroy lecture notes.
<vpalle> Sure, but It would be nice if there actually were an indepth book using ocaml..
<Smerdyakov> It's kind of weird that there are any books at all.
<vpalle> Tetsuo: thx, I'll take a look
<Yoric[DT]> vpalle: google compiler and OCaml.
<Yoric[DT]> There's a good tutorial somewhere around the web.
* Yoric[DT] can't remember where.
<vpalle> Smerdyakov: why? isn't a nice way to study language features, by actually implementing them..
<Smerdyakov> vpalle, I don't so much agree. Most languages should be domain-specific, such that they're not suitable for their own implementation.
<vpalle> Yoric[DT]: ok, I'll try that too
<bluestorm> vpalle: http://caml.inria.fr/pub/docs/u3-ocaml/index.html has some formal approach of a Core ML interpreter
<Yoric[DT]> Smerdyakov: I'd say that trying is still a good way to learn.
<vpalle> Smerdyakov: but in order to graps the concepts of domain-specific languages, and all the basic stuff such as recursion, closures and what not, you would need some experience in implementing them..
<Smerdyakov> Yoric[DT], I'm just surprised that people feel they can't figure this all out on their own.
<vpalle> yeargh well, guess I need a bigger brain :)
<Yoric[DT]> :)
rwmjones has quit [Read error: 113 (No route to host)]
hoopy has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
seafood has quit []
<Yoric[DT]> Smerdyakov: since you're the one who suggested Build Interceptor, do you have any experience using it?
<Smerdyakov> No.
<Yoric[DT]> ok
sporkmonger has joined #ocaml
Linktim has joined #ocaml
sporkmonger has quit []
sporkmonger has joined #ocaml
sporkmonger has quit []
rwmjones has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
munga has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
guillem has quit [Remote closed the connection]
<rwmjones> bluestorm has gone :-(
<rwmjones> RobertFischer also gone :-(
<orbitz> i'm here!
filp has quit ["Bye"]
rwmjones has quit [Read error: 113 (No route to host)]
<hcarty> ls
<orbitz> cd
<\banlist> hi, is there an efficient 160 bit datatype in OCaml for one function hashing sha1?
<\banlist> e.g. int160
<flux> string?
<\banlist> flux, the string wastes space, 2 characters by byte, it's more than 320 bits
<\banlist> s/by/per
<\banlist> s/one/one way/
<flux> \banlist, I meant using them as a binary container
<flux> so it is one char per byte; plus the length
<flux> well
<flux> I suppose you could just use arrays
<flux> or write some C code
<\banlist> how many bits are a primitive int in OCaml?
<flux> 31 bits
<flux> or 63 bits
<flux> but if you use a structured data type (like array), it will be a pointer + data
<\banlist> array or struct of 6 ints = 186 bits
<\banlist> :(
<flux> array of 5 int32's -> 160 bits
<flux> how many hashes are we talking about if you're thinking about the space overhead of one sum?
<\banlist> e.g. for 200'000 files, 200'000 hashes
<flux> a few megabytes
<\banlist> the problem is when there are dozens of millions of files
marmotine has joined #ocaml
<\banlist> many of them are splitted mboxes
Yoric[DT] has joined #ocaml
<flux> I don't think the overhead is going to be overwhelming with for example that array of 5 int32's -approach
<flux> (I do hope its storage is optimized properly, though..)
jeremiah has quit [Read error: 104 (Connection reset by peer)]
guillem has joined #ocaml
munga has quit ["Leaving"]
filp has joined #ocaml
jeremiah has joined #ocaml
Kopophex has joined #ocaml
sporkmonger has joined #ocaml
<palomer> constraint 't expression_skel = #['t] expression <--what's the syntax for this?
<palomer> constraint 't expression_skel = #'t expression also gives a syntax error
guillem has quit [clarke.freenode.net irc.freenode.net]
vpalle has quit [clarke.freenode.net irc.freenode.net]
cmeme has quit [clarke.freenode.net irc.freenode.net]
vpalle has joined #ocaml
<Smerdyakov> What are you trying to do?
guillem has joined #ocaml
cmeme has joined #ocaml
filp has quit ["Bye"]
Kopophex_ has joined #ocaml
<palomer> I'm trying to state that 't expression_skel is a subclass of 't expression
Kopophex has quit [Read error: 60 (Operation timed out)]
<Smerdyakov> Not expressible in OCaml
OChameau has quit ["Leaving"]
<palomer> for semantic or syntactic reasons?
<Smerdyakov> I don't understand the question. You just can't do it.
RobertFischer has joined #ocaml
Kopophex_ is now known as Kopophex
leoncamel has joined #ocaml
Axioplase_ is now known as Axioplase
<flux> ocamlrt apparently never got finished
<flux> or much maintained?
<flux> last change in the darcs repository is from Oct 2007, last change in code.google from Dec 2006..
<hcarty> I don't know if any of last year's summer projects are maintained
<hcarty> I saw a little activity on the OVT Google Code site
<flux> OVT?
<hcarty> OCaml Visualization Toolkit
<hcarty> Some Cairo-based graphics in OCaml
<flux> fun, I have almost something like that
<flux> ..cairo-based plotting :)
<hcarty> I tried OVT, but it only supported some very basic functions, so I just wrapped the PLplot library and have been using that
<Yoric[DT]> flux: OCamlRT looked good.
<Yoric[DT]> Now, we need to get Chris King to reactivate it :)
kelaouchi has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
RobertFischer has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
Jedai has quit [Read error: 113 (No route to host)]
<RobertFischer> Cedric's Problem in OCaml: http://enfranchisedmind.com/blog/2008/07/01/cedrics-problem-in-ocaml/ Thoughts on my implementation?
szell` has quit [clarke.freenode.net irc.freenode.net]
Smerdyakov has quit [clarke.freenode.net irc.freenode.net]
Ugarte has quit [clarke.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
Ugarte has joined #ocaml
szell` has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
sporkmonger has quit []
structured has quit [Read error: 104 (Connection reset by peer)]
Tetsuo has quit [Remote closed the connection]
vpalle has quit [clarke.freenode.net irc.freenode.net]
hkBst has quit [clarke.freenode.net irc.freenode.net]
ozzloy has quit [clarke.freenode.net irc.freenode.net]
orbitz has quit [clarke.freenode.net irc.freenode.net]
vpalle has joined #ocaml
hkBst has joined #ocaml
orbitz has joined #ocaml
ozzloy has joined #ocaml
jlouis has quit [Remote closed the connection]
guillem has quit [Remote closed the connection]
pango has quit [Remote closed the connection]
pango has joined #ocaml
pango has quit [Client Quit]
pango has joined #ocaml
Axioplase is now known as Axioplase_
psnively has joined #ocaml
Linktim has quit ["Quitte"]
hkBst has quit ["Konversation terminated!"]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
Jeff_123 has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
psnively has quit []
coucou747 has quit ["bye ca veut dire tchao en anglais"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
RobertFischer has joined #ocaml
<pango> RobertFischer: your program doesn't stop at max_int, and gives 8877690 results instead of 5638170
<RobertFischer> pango: Really?
<pango> write the "simplest implementation that works" and compare the results :)
<RobertFischer> Yeah, I'll do that. I'm curious to know what the bug is.
jlouis has joined #ocaml
<pango> the results are correct up to max_int, it's just that the program goes on
<pango> indeed stopping at an arbitrary number is a difficult part of the problem
<RobertFischer> I just need to fix my termination check, then.
<RobertFischer> That's not that tricky. I just tried to get clever.
<pango> it's tricky to do efficiently, which is probably another way to say the same thing ;)
<RobertFischer> pango: Yeah, that's true.
<RobertFischer> Weird. Why is that String.compare function not detecting the string representation of two strings, where one is bigger than the other?
<RobertFischer> Sorry -- bad words.
<RobertFischer> Why is the String.compare function giving weird results of the string representation of two numbers, where one is bigger than the other?
seafood has joined #ocaml
sponge45 has quit ["Download Gaim: http://gaim.sourceforge.net/"]