<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>
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>
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: 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
<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?
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?