comglz has quit ["AddToFunc ExitFunction I Exec exec sudo halt"]
asmanur_ has quit [Read error: 110 (Connection timed out)]
coucou747 has quit ["bye ca veut dire tchao en anglais"]
seafood has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
rhar has quit ["This computer has gone to sleep"]
vpalle_ has quit [Read error: 110 (Connection timed out)]
Axioplase is now known as Axioplase_
Ched- has quit [Read error: 110 (Connection timed out)]
Ched- has joined #ocaml
tar_ has joined #ocaml
Mr_Awesome has joined #ocaml
matt` has joined #ocaml
rhar has joined #ocaml
matt` has left #ocaml []
Kopophex_ has joined #ocaml
Kopophex has quit [Read error: 110 (Connection timed out)]
Axioplase has joined #ocaml
cyrax has joined #ocaml
cyrax has quit ["Leaving"]
sporkmonger has joined #ocaml
Kopophex_ is now known as Kopophex
jeddhaberstro has quit []
seafood has quit []
Kopophex has quit [Read error: 110 (Connection timed out)]
Kopophex has joined #ocaml
Jedai has quit [Read error: 110 (Connection timed out)]
rhar has quit ["Leaving"]
sporkmonger has quit []
sporkmonger has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
Kopophex has quit [Read error: 110 (Connection timed out)]
Kopophex_ has joined #ocaml
Snark has joined #ocaml
Asmadeus has joined #ocaml
jderque has joined #ocaml
Kopophex_ has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
how can i define a static class variable in ocaml ?
<flux>
class foo = let bar = ref 0 in object method baz = incr bar; !bar; end;;
jderque has left #ocaml []
bluestorm has joined #ocaml
bluestorm has quit [Client Quit]
<Anarchos>
flux i thought to something like that. and it works again for a static function, i see
Axioplase has quit ["annyeon!"]
<Anarchos>
i don't understand why modern compilers are bootstrapped
m3ga has joined #ocaml
rwmjones has joined #ocaml
Demitar has joined #ocaml
asmanur_ has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
jlouis has quit ["Leaving"]
Yoric[DT] has joined #ocaml
jlouis has joined #ocaml
<Anarchos>
i have function calls following the scheme C -> CAML ->C -> CAML ; in each C function, i embrace the callback to caml with {leave/enter}_blocking_section, so how can i call two times the caml interpreter ?
lde has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
<Yoric[DT]>
Does anyone know where I can find a reference for the bytecode language?
<Anarchos>
Yoric[DT] i guess there is none
<Yoric[DT]>
:/
* Yoric[DT]
was thinking about giving students a project related to that language.
<Anarchos>
look for 'caml abstract machine'
<Yoric[DT]>
But that's going to be harder if they need to dig into the source code to understand it.
<Anarchos>
or better 'categorical abstract machine'
<Anarchos>
and 'the zinc experiment', which is an earlier interpreter
<Yoric[DT]>
Is it still the CAM?
<Yoric[DT]>
I thought that had changed.
<Anarchos>
Yoric[DT] it has, but the CAM is a good start for students, no ?
<Myoma>
I was told they no longer used the CAM and I thought that's a shame
<Yoric[DT]>
Anarchos: Sure. Still, you need a compiler to CAM to be able to test your code.
<Anarchos>
sure
seafood has joined #ocaml
seafood has quit [Client Quit]
vpalle has joined #ocaml
m3ga has quit [Read error: 110 (Connection timed out)]
guillem_ has joined #ocaml
bluestorm has joined #ocaml
<rwmjones>
anyone used http://bisect.x9c.fr/ or can recommend another code coverage tool?
<rwmjones>
Yoric[DT], I'm fairly certain I read a document which was a ref for the bytecode language somewhere online
asmanur_ has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
rwmjones: nice find.
<Yoric[DT]>
Well, if you stumble upon that document again, I'm interested.
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
seafood has joined #ocaml
<bluestorm>
Yoric[DT]: you're aksing about the ocamlc bytecode ?
<Yoric[DT]>
Indeed.
<bluestorm>
i think there are pretty detailed descriptions in 1) the OcamlJava project 2) the OcamlJIT work of Basile ...vytch
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<rwmjones>
is it safe to modify an int32 or int64 (I mean, from C code)?
<Yoric[DT]>
bluestorm: thanks.
<bluestorm>
Yoric[DT]: i found http://cristal.inria.fr/~starynke/ocamljit.html but not attached documentation, and i'm not sure with one of the brazillons of OCamlJava subprojects is pertinent
<bluestorm>
Camarade_Tux: you just got the x9c search award :-'
<Yoric[DT]>
Camarade_Tux: bluestorm: thanks, exactly what I was looking for.
<bluestorm>
btw Camarade_Tux , now that you've showed us your skills, you should consider adding the links to the ocamljava wiki
<Camarade_Tux>
bluestorm, I nearly managed not to find the wiki =P
m3ga has joined #ocaml
Demitar has quit ["Burn the land and boil the sea. You can't take the sky from me."]
m3ga has quit [Read error: 104 (Connection reset by peer)]
jderque has joined #ocaml
m3ga has joined #ocaml
asmanur has joined #ocaml
guillem_ has quit [Remote closed the connection]
lde has joined #ocaml
vpalle_ has joined #ocaml
guillem_ has joined #ocaml
<Camarade_Tux>
I updated ocamljava's wiki but it would be good to have it elsewhere, it there any page to centralize such links ?
<bluestorm>
hum
<bluestorm>
wiki.cocan.org maybe ?
<Camarade_Tux>
is there any already created page for that sort of links ? I can't find one
<bluestorm>
i haven't found either
vpalle has quit [Read error: 110 (Connection timed out)]
<bluestorm>
you could create a subpage of "Technical ressources"
<bluestorm>
something like hm
<bluestorm>
i haven't a good name yet but we could put there details related to the inner ocaml machinery
<bluestorm>
(such as the technical and informative posts in the mailing list)
<bluestorm>
"Deep OCaml" might be a bit to catchy :-'
seafood has quit []
<Camarade_Tux>
Advanced (OCaml) documentation ?
<Myoma>
but what about caml light?
<rwmjones>
ocaml internals?
* Yoric[DT]
seconds rwmjones.
Smerdyakov has quit ["BRB"]
<bluestorm>
rwmjones: "ocaml internals" would probably not be appropriate for, say, a discussion of "private" types
<bluestorm>
(but maybe that only means that the advanced implementation detail and the advanced typing system details do not belong to the same category)
Smerdyakov has joined #ocaml
cyrax_ has joined #ocaml
vpalle_ is now known as vpalle
Myoma has quit [Read error: 113 (No route to host)]
guillem_ has quit [zelazny.freenode.net irc.freenode.net]
bluestorm has quit [zelazny.freenode.net irc.freenode.net]
Asmadeus has quit [zelazny.freenode.net irc.freenode.net]
jynxzero has quit [zelazny.freenode.net irc.freenode.net]
mbishop has quit [zelazny.freenode.net irc.freenode.net]
haelix has quit [zelazny.freenode.net irc.freenode.net]
guillem_ has joined #ocaml
bluestorm has joined #ocaml
Asmadeus has joined #ocaml
mbishop has joined #ocaml
haelix has joined #ocaml
jynxzero has joined #ocaml
coucou747 has joined #ocaml
mrvn has joined #ocaml
<mrvn>
moin
<mrvn>
Can I have circular depends between modules? Maybe if each .ml only depends on the other .mli?
rstites_ has joined #ocaml
rstites__ has joined #ocaml
<Yoric[DT]>
nope
Anarchos has joined #ocaml
<bluestorm>
mrvn: you have to remove them : you may factorize the interdependencies in a third module, or remove the dependency on one side by passing function as additional parameters
<mrvn>
or pass the string and offset contained in one record to the other module instead of the full record. :)
asmanur has quit [Read error: 110 (Connection timed out)]
<mrvn>
Kind of sucks though that you can't have 'Int32.to_string i' and 'String.to_int32 s' pairs.
<bluestorm>
mrvn: in that case it looks like a better idea to put the record declaratoin in a third module
<bluestorm>
with your two modules depending on it
<mrvn>
Nah, the record does more that just string and offset.
<Anarchos>
mrvn try Printf.sprintf "%ld"
<mrvn>
Anarchos: That was just an example.
<Anarchos>
and Int32.of_string
<bluestorm>
mrvn: well in the long run, if you can meaningfuly convert in both directions, that probably means there is a common structural subset that could be defined "before" any of those modules
<mrvn>
What is a good way to convert an Int32 to char[4] in little endian order?
<bluestorm>
bitwise operations ?
<mrvn>
shifting, anding and char_of_int? Seems like a lot of code for uint32_t t = htonl(x); memcpy(str, &t, 4);
<bluestorm>
well if you want something more optimized, you can use a C routine
<bluestorm>
but i would go the simple route first
<mrvn>
Ocaml seriously needs a default internet library that has such functions and basic protocols. :)
<Yoric[DT]>
I agree with mrvn, it would be nice to have things such as 'Int32.to_string' and 'String.to_int32'.
<mrvn>
let byte_of_int32 i n = char_of_int (Int32.to_int (Int32.rem (Int32.shift_right i (n * 8)) (Int32.of_int 256)))
<mrvn>
block.buf.[block.pos + 0] <- byte_of_int32 i 0;
<mrvn>
block.buf.[block.pos + 1] <- byte_of_int32 i 1;
<mrvn>
block.buf.[block.pos + 2] <- byte_of_int32 i 2;
<mrvn>
block.buf.[block.pos + 3] <- byte_of_int32 i 3;
batcoder-7 has joined #ocaml
<mrvn>
Does that look alright?
<Yoric[DT]>
mrvn: are you using bitstring?
<batcoder-7>
anyone here toyed with the qtcaml is it anywehre near useable ?
* Yoric[DT]
has no idea.
<bluestorm>
mrvn: a for loop would probably be helpful here :p
<mrvn>
Yoric[DT]: not yet
<bluestorm>
hm
<bluestorm>
and you should use a bitwise and instead of the modulo
<Yoric[DT]>
I'm sure that could be helpful for you.
<bluestorm>
if you're concerned about speed
<mrvn>
bluestorm: if not there then for Int64 at least
<mfp>
mrvn: have you seen the IO module from extlib?
rstites has quit [Read error: 110 (Connection timed out)]
<mfp>
it's got write_ui16, write_i16, write_i32, write_real_i32, write_i64, write_double, etc., which can write to a string
<Yoric[DT]>
Or the improved version from Batteries Included :)
vpalle_ has joined #ocaml
<mrvn>
mfp: That looks promising.
<mfp>
Yoric[DT]: I thought you'd only released a lazy list module & Enum?
rstites_ has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
mfp: well, I need to release the improved IO.
<Yoric[DT]>
I haven't had time to release many things yet.
<Yoric[DT]>
But there are lots of stuff in the svn.
rstites__ has quit [Read error: 110 (Connection timed out)]
<mfp>
yeah I see
<mfp>
you've also moved to ocamlbuild? there's a _tags there
<Yoric[DT]>
Yep.
<mfp>
hmm why are the diff parts released separately?
<mfp>
just while it's in development?
<mrvn>
mfp: Too bad it doesn't also interface with Unix.file_descr
<batcoder-7>
hmm i hope that qtcaml turns out pretty good, ocaml needs more bindings then gtk etc
<bluestorm>
Yoric[DT]: btw, i *very recently* noticed that i'm officialy due to some work on the numeric module
<bluestorm>
batcoder-7: we don't have much information available yet
<Yoric[DT]>
bluestorm: what do you mean?
<mfp>
mrvn: create a channel from the file_descr
<bluestorm>
Yoric[DT]: there is a trac file with progress and things like that
<mfp>
mrvn: Unix.in_channel_of_descr
<Yoric[DT]>
Numeric modules, improved IO, improved Genlex, a boolean module, a char module, a few additions to random, a new stream module, more option stuff, the beginning of a parser combinator library, etc.
<mfp>
and out_channel_of_descr
<Yoric[DT]>
bluestorm: I don't quite understand what you mean.
<bluestorm>
batcoder-7: we won't know much more until the end of the summer of code, then people hopefully will get more communicative
<mrvn>
mfp: I guess the little extra line is not worth adding a dependency on Unix for extlib.
<Yoric[DT]>
Did I forget to give you credits or something?
<batcoder-7>
bluestorm: ocaml needs more gui toolkits for sure
<mrvn>
Couldn't find any "md5" in file:///usr/share/doc/ocaml/docs/ocaml.html/libref/index_values.html
<bluestorm>
batcoder-7: i'm actually even more excited by other projects
<bluestorm>
but yes
<bluestorm>
batcoder-7: if you haven't considered it yet, there are python/perl/java/ruby - ocaml bindings, and each of these language supports Qt
<batcoder-7>
oh crap theres a wxocaml
<mfp>
cryptokit also includes SHA1 SHA256 RIPEMD160, and the MACs
<bluestorm>
so you could use OCaml for the real stuff, and a scripting language for the GUI
<batcoder-7>
2004 but it looks like its pretty complete
<batcoder-7>
bluestorm: kinda ghetto but yea would work
<batcoder-7>
bluestorm: but then i might as well just using the scripting language for the whole app ;)
<bluestorm>
depends on the app
<batcoder-7>
none of my stuff is processor intense just simple stuff more or less
<mrvn>
Another stupid question and then I'm done. What is a simple way to get an Int64.t hash of a string? Would you use Digest and then use the first 8 byte?
<mrvn>
What is hashtbl using?
<mfp>
are you asking how Hashtbl.hash is implemented?
<mfp>
or the hash table itself?
<mrvn>
mfp: yes. What is it using internally to hash.
<mfp>
it uses the caml_hash_univ_param primitive, which knows how to walk value blocks
<mfp>
you can use the Hashtbl.Make functor if you want to use other equal/hash functions
<mrvn>
Nah. I need the hash function. :)
ygrek has joined #ocaml
<batcoder-7>
bluestorm: well most things that are c++, first have to be wrapped into a C lib then ocaml, so i can see how thats just yea troublesome and maybe not worth it
<mfp>
so, you need polymorphism?
<mrvn>
batcoder-7: why? wouldn't it be better to go directly to ocaml OO?
<batcoder-7>
huh ?
<bluestorm>
mrvn: i'm not sure you can directly map C++ OO and Ocaml OO
<mrvn>
You could map C++ classes to ocaml classes maybe.
<bluestorm>
actually i tried once, and get stuck in the interclass dependencies
<bluestorm>
but wasn't really hard trying
<batcoder-7>
i think it would be VERY difficult
<mfp>
you'd need to go through the C ABI anyway
<mrvn>
Probably can't be done for every code but most should work.
<bluestorm>
actually
<bluestorm>
Qt has a way to do call methods of the class in a weird manner
<bluestorm>
you don't have to use C++ to do that
<bluestorm>
(i don't know the name anymore, Smoke maybe)
<mrvn>
The only problem I see is the c++ name mangling.
<batcoder-7>
that is KDE
<batcoder-7>
not qt
<bluestorm>
hm
<batcoder-7>
but yea smoke
<bluestorm>
we have used it to call Qt methods from an OCaml program
vpalle has quit [Read error: 110 (Connection timed out)]
<batcoder-7>
but maybe it works for pure qt too
<batcoder-7>
^^^
<mrvn>
Anyone here used ocamlfuse before?
<batcoder-7>
i think it does casue the python binding uses it ;)
<bluestorm>
but generating ocaml-eadible classes for the whole Qt headers is quite difficult
<batcoder-7>
hmm maybe your right bluestorm just use a scripting that already has the binding, by the time you get it all connected it would prolly be the same speed / perfroamnce
<mrvn>
Maybe ocaml needs its own gui toolkit designed to fit the ocaml OO structure?
<bluestorm>
most of the GUI data is in the weird XML files anyway
<mrvn>
We don't have enough GUI toolkits yet anyway. :)
<bluestorm>
so batcoder-7 i'd expect the in-code GUI layer to be quite thin
<batcoder-7>
thats if you use that functtion most gui toolkits allow you to handwrite as well
<batcoder-7>
mrvn: No more lol
<batcoder-7>
theres like 5 good ones and 400 failed ones
<mrvn>
problem is convincing others about the badness of the 400 failed ones.
<batcoder-7>
i think qt/qx is better thne GTK
<batcoder-7>
but i guess gtk is still not bad
<mrvn>
Somehow the gtk gui in mldonkey always flickers. Might be the bindings or the use but it sucks.
<batcoder-7>
i think the binding is ok
<batcoder-7>
but i always hear that the app is slow etc
<batcoder-7>
never used it honestly
<mrvn>
If you have a table then changing a cell in that table seems damn complicated to impossible. Seems to cause bad redraws.
<mrvn>
batcoder-7: compared to say rtorrent it is a cpu hogger.
<batcoder-7>
rtorrent ocaml ?
<mrvn>
no.
<batcoder-7>
ah
<mrvn>
c/c++
<batcoder-7>
yea
<batcoder-7>
cl right ?
<batcoder-7>
yea cl
<mrvn>
But there is no reason C/C++ should be better for a P2P client. The hashing, checksumming, compression and encryption is all done in C for speed reasons and the rest should work nice either way.
<batcoder-7>
sure
<batcoder-7>
i liertally never write CPU intense apps
<mrvn>
gildor: will you switch to 3.0 (quilt) format post lenny?
<gildor>
mrvn: don't know yet, quilt is still something to learn for me
<mrvn>
gildor: luckily you don't even need to learn quilt to use it in a deb.
<gildor>
gildor: there was a discussion between zack and buxy about malformed quilt series that prevent the use of the package format
<gildor>
i don't know enough thing at this time to understand what was the problem, so I was thinking that things can be related
<mrvn>
as you have no patches yet the list can hardly be malformed :)
<mrvn>
Lets see if I can get uuidm to work now.
<gildor>
indeed, expect for virt-top and virt-mem, which use them
* rwmjones
?
code17 has joined #ocaml
rwmjones has quit ["Closed connection"]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
asmanur has joined #ocaml
<mrvn>
gildor: Cannot find file Uuidm.cmxa
<mrvn>
gildor: Did you forget to build native code?
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
munga_ has quit [Read error: 113 (No route to host)]
code17 has quit ["Leaving."]
code17 has joined #ocaml
cyrax has joined #ocaml
jderque has left #ocaml []
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
cyrax_ has quit [Read error: 110 (Connection timed out)]
marmotine has joined #ocaml
det has quit [Remote closed the connection]
eelte has joined #ocaml
* mrvn
wishes Nap.Make has a val iter_from_to (key -> 'a -> unit) -> key -> key -> 'a t -> unit
<mrvn>
and fuzzy searching, finding the next smaller key.
coucou747 has quit [Read error: 110 (Connection timed out)]
<bluestorm>
mrvn: Set would be closer to the features you're looking for
Kopophex_ has joined #ocaml
<bluestorm>
and it's probably possible to use Set as a map, isn't it ?
<mrvn>
No. In that regard Set and Map are the same.
<mrvn>
And I actualy have a "key -> data" mapping that I store.
hsuh has joined #ocaml
<bluestorm>
well
<bluestorm>
with two Set.split you can easily get your "from_to" behavior
<mrvn>
I actualy have a B-tree on disk. The key is a { parent : id_t; obj : id_t } and to get an directory listing for example I need { parent = dir_id; obj = *; }
<bluestorm>
and with one Set.split and Set.[min/max]_elt, your fuzzy search
det has joined #ocaml
<mrvn>
Each node in the B-Tree should be small enough to just use a (key * data) list I think.
<bluestorm>
hm
<mrvn>
But you are right. I could build a (key * data) Set
<bluestorm>
what about a hashtable ? (do you need persistency ?) Hashtbl.find_all looks relevant
<mrvn>
bluestorm: can't do fuzzy search.
<bluestorm>
(but if you need strange comparison and ordering features, i think Set is the best you can have in the stdlib)
<bluestorm>
hm
<bluestorm>
there is also that big "Data structure library", Reins
<bluestorm>
may be something useful inside
<mrvn>
For directory listing I need all leafes of the tree between { dir_id; 0 } and { dir_id; ~0 }. Both of which are highly unlikely to exist.
<mfp>
mrvn: how many items do you have per node? binary (or even linear) search over an array should be faster (better locality)
<mrvn>
bluestorm: doubtfull. this is kind of special for the FS I'm building.
<mrvn>
mfp: blocksize / avg item size
<bluestorm>
you're writing a FS in Ocaml ? interesting
<mrvn>
bluestorm: with ocamlfuse
hsuh has left #ocaml []
<mrvn>
mfp: Could be 3276.8 items max.
Yoric[DT] has quit [Remote closed the connection]
<mrvn>
mfp: Problem with arrays is that I need to insert keys in the middle sometimes.
<mfp>
which ops do you need for the in-mem representation, besides find, bounded iteration & fuzzy search
<mfp>
arrays no good then
Yoric[DT] has joined #ocaml
<mrvn>
For ndoes I need to find the key <= the new one, maybe split the node it points to in two and then recurse. For leafes insert or replace the data item the key points to.
<mrvn>
For lookup I need either a range or the next smaller key.
<mfp>
it seems bluestorm's suggestion (Set) fits the bill
<mrvn>
One thing I'm a bit fuzzy on how to do it is how to handle key collisions. A file is stored as '{ parent = directory_id; object = Int64.of_int (Hashtbl.hash name); } -> (file_id, name)' (for lack of a 64bit hash). The hash might not be unique so the key is not unique and then inserting becomes tricky.
<mfp>
do you really need Hashtbl.hash : 'a -> int there? (as opposed to a string -> string hash function)
<bluestorm>
mrvn: you could use (as Hashtbl does) a list of results
<mrvn>
The on disk structure has 64bit for the hash value of the name.
<bluestorm>
it's a bit heavier in memory, but the common case read access is very cheap
<mrvn>
In the node I just have 'key -> next node' entries, which means { directory_id; name_hash; } -> next node
<mfp>
let hash64 s = String.sub (Digest.string s) 0 8;;
<mrvn>
mfp: still might collide.
<bluestorm>
(i guess you should experiment to see what kind of collision rate you have on real data before doing tricky guesses)
<mfp>
sure
<mrvn>
I will probably assume md5 does not collide on filenames and give an error if someone tries to create a file that collides.
<mrvn>
And who cares if "touch <name that collides with name1>" works and touches "name1"?
<mrvn>
Although that is easy to prevent too.
det has quit [Remote closed the connection]
<Camarade_Tux>
I've not followed everythin but doesn't that mean that some files will be unaccessible ?
<mrvn>
Camarade_Tux: can you give me an example of 2 filenames that have the same md5sum?
<Camarade_Tux>
hum, wait a bit, I have a website name to remember
<mrvn>
or more precisely have the same lower 8 bytes in the md5sum as the hash would only use 64bit.
<mrvn>
d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70 and d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd436c919c6dd53e23487da03fd02396
<thelema>
anyone know which hash ext3 uses for its indexed directories?
<mrvn>
tae I think.
eelte has quit ["bye ca veut dire tchao en anglais"]
<mrvn>
But I think in ext3 a colission just takes the next free slot and a search continuous until an empty slot.
<thelema>
I just suggest maybe that hash has a good balance of CPU vs. collisions for filenames.
<Camarade_Tux>
hum, could not find it (it was meant to crack passwords and indeed cracked my weakest password)
<mrvn>
Problem is that I have a B-Tree and not a simple array. Now say I have 3 keys that collide. Key 1 is in Leaf1 (last item), Key2 is in Leaf2 (first item). When I insert Key3 do I recurse into Leaf1 or Leaf2?
<mrvn>
Idealy I would like Key1, Key2, Key3 to be sorted by real name in the tree.
<thelema>
mrvn: either. Pick one and stick with it.
<thelema>
and don't worry about collisions too much unless you expect lots of them. The common case should be no collision.
det has joined #ocaml
<mrvn>
I guess I could just ignore the order of the real names. Just means I have to check all colliding keys before I can give a negative result on a lookup. And the collision probablility is like 1/2^64.
<batcoder-7>
that thing makes it easy for c++ libraries ot be used in lua
<batcoder-7>
so you can wrap lua stuff around c_++ stuff
<batcoder-7>
a binding in a way
<flux>
well, there are some binding-generator utils around, but I don't think they support lua - unless swig does it
<flux>
and I'm not sure swig supports "from ocaml"
<batcoder-7>
no no it doesnt have to support lua ;)
<batcoder-7>
i was just thinking of a way to make a QT bidning to ocaml easily
<batcoder-7>
lua does it with tolua++ a c++ bindings generator thing
<flux>
well, you might want to wait a while
<flux>
there's a jane street project for doing just that
<flux>
(summer of code)
<flux>
qt is tricky anyway, because it has a preprocessor of its own
<flux>
I think, anyway
<flux>
(that it's tricky, I know it has its own preproc ;))
<batcoder-7>
i saw qtcaml
<batcoder-7>
but i didn't know if it was really being worked on
<batcoder-7>
then it will have everything
<mrvn>
are ocaml chars uint8_t or int8_t or arch specific?
<flux>
I suppose they, with the rest of the projects, should be giving their end reports any day now
<batcoder-7>
ocaml has gtk and wxwidgets (srota useable)
<flux>
yeah, but atleast gtk is hand-written
<batcoder-7>
not sure if thats a good thing ;)
<batcoder-7>
i mean im sure its a great library
<flux>
results like that would neve rcome from a autogenerator
<batcoder-7>
oh yea, the auto generator is just a base
<bluestorm>
batcoder-7: there is a scheme-in-OCaml, but i'm not sure it provides easy binding with the OCaml side
<batcoder-7>
yea
<batcoder-7>
well we will see how qtcaml turns out
<batcoder-7>
and i will update wxOcaml
<bluestorm>
however i'm not sure a "lua for ocaml scripting" or such provide so much value
<bluestorm>
i can understand the need from C, C++
<bluestorm>
but OCaml seems reasonably useful as a scripting language too
<batcoder-7>
bluestorm: sure yea
<batcoder-7>
python/lua is a *bit* faster
<bluestorm>
and if it means crafting DSLs, we can use Camlp4 for that
<batcoder-7>
i meant development faster, for scripting anyways
<batcoder-7>
ah wxocaml just uses the wxc lib
jlouis has quit ["Leaving"]
Kopophex_ has quit [Read error: 110 (Connection timed out)]
Kopophex_ has joined #ocaml
jderque has joined #ocaml
cyrax has quit [Client Quit]
jlouis has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
newpers has joined #ocaml
newpers has left #ocaml []
Associat0r has quit []
<mrvn>
man statfs: Nobody knows what f_fsid is supposed to contain (but see below).
<mrvn>
:)
Snark has quit ["Ex-Chat"]
m3ga has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]>
:)
batcoder-7 has quit [Read error: 60 (Operation timed out)]
batcoder-7 has joined #ocaml
batcoder-7 has quit [Client Quit]
jeddhaberstro has joined #ocaml
<mrvn>
How do I fsync() in ocaml?
<Camarade_Tux>
for in/out_channels, you have Pervasives.flush/flush_all iirc, for the Unix module, I don't know
<mrvn>
no fsync(fd) in Unix
<Camarade_Tux>
_maybe_ Unix.tcdrain ; from the description I'm not sure it flushes output : "Waits until all output written on the given file descriptor has been transmitted."
<mrvn>
That will call C tcdrain(fd). Not sure if that works on non terminals or has the effect of fsync(fd)
<mrvn>
I guess I better create my own C stub for fsync()
det has quit [Read error: 104 (Connection reset by peer)]
asmanur_ has joined #ocaml
Kopophex_ has quit [Read error: 110 (Connection timed out)]
Kopophex_ has joined #ocaml
<Camarade_Tux>
so would some people be interested in gathering more actively the interesting links that are posted on the mailing-list (but not only) ? I've gone through most of the cwn (but only as in 60%) and collected several pages but I'm sure I've missed some
<Camarade_Tux>
(plus I'm now completely dead)
* Camarade_Tux
goes to bed
asmanur has quit [Read error: 110 (Connection timed out)]
marmotine has quit ["mv marmotine Laurie"]
<pango_>
mrvn: I don't think Unix module I/Os are bufferized that's why there's no fsync() provided. In OCaml, when you need bufferization you use channels abstraction
<mrvn>
fsync() and flush() do different things.
<mrvn>
I have to make sure the data has actually written to disk.
<pango_>
oh, then I read your question too quickly
<mrvn>
converting the file_descr to a channel and flushing that would probably do nothing.
hkBst has quit [Read error: 104 (Connection reset by peer)]
rwmjones has joined #ocaml
seafood has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
yziquel has joined #ocaml
<yziquel>
hi
<yziquel>
got a problem with packaging a modification of a debian package of an ocaml package...
<yziquel>
didn't get the help i need on #debian
Amorphous has joined #ocaml
<yziquel>
anyone willing to help me out, perhaps off-channel?
<mrvn>
what package?
<yziquel>
ocamlnet
<yziquel>
which contains netclient
comglz has joined #ocaml
<mrvn>
Build-Depends: cdbs ==> probably don't want to help.
<yziquel>
yes, that's the issue, i guess: cdbs.
<mrvn>
but describe what your problem is anyway.
<yziquel>
i want to add some feature to http_client, for personal use. downloaded the source package. made a dpatch. when doing pbuilder build, the patch doesn't get included, even though the (cdbs) debian/rules should apply it. even when I apply the patch manuall, pbuilder build sorts of rejects it, and i get a package without my patch. that's the issue.
<mrvn>
did you add the patch to debian/patches/00list?
<yziquel>
yep
<yziquel>
in first line
<yziquel>
is cdbs a mayhem?
<mrvn>
and you are giving pbuilder your source to build?
<yziquel>
huh. as far as i understand your question, yes.
<mrvn>
try building without pbuilder first
<yziquel>
i take the debian source package, and apply the patch.
<yziquel>
just a ./configure, make?
<mrvn>
debuild
<yziquel>
looking at man page
<mrvn>
or for a start "debian/rules patch" and see if it applies your patch correctly.
<mrvn>
Grrr, I hate bootstraping. I need a block to store the infos which blocks are free. So I look into the infos which blocks are free and OOPS.
Asmadeus has quit ["poof"]
<yziquel>
debian/rules patch includes the patch.
<mrvn>
then debuild should too.
<yziquel>
looking at man page
<mrvn>
and pbuilder probably downloads a fresh debian source
<mrvn>
debuild works fine without any arguments.
<yziquel>
running debuild.
<yziquel>
thanks for this info. now i'm with errors which belong to me...
<yziquel>
ok. enough for today. goodnight
yziquel has left #ocaml []
tar_ has joined #ocaml
bluestorm has quit [Remote closed the connection]
guillem_ has quit [Remote closed the connection]
Kopophex has quit [Read error: 60 (Operation timed out)]
redocdam has joined #ocaml
Kopophex has joined #ocaml
jderque has left #ocaml []
shapl has joined #ocaml
shapl has left #ocaml []
tar_ has quit []
tar_ has joined #ocaml
asmanur_ has quit [Read error: 110 (Connection timed out)]