<flux>
function String.index does already exist, though
<flux>
it raises an exception though, in the problem case..
<flux>
(that is, no '.' found)
<flux>
but in that case you could just return num_of_string s
<robocop>
ha, yes, thanks.
smimou has quit ["bli"]
travisbrady_ has joined #ocaml
travisbrady has quit [Read error: 104 (Connection reset by peer)]
angerman has quit []
clog has joined #ocaml
schme has quit [Read error: 113 (No route to host)]
th5 has joined #ocaml
Komar_ has joined #ocaml
Komar_ has quit [Read error: 104 (Connection reset by peer)]
_zack has quit ["Leaving."]
komar_ has joined #ocaml
smimou has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
th5 has quit []
smimou has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
Ched has joined #ocaml
Axioplase has joined #ocaml
rjack has quit ["leaving"]
Ched has quit [Remote closed the connection]
Ched has joined #ocaml
Lomono has joined #ocaml
travisbrady has joined #ocaml
travisbrady_ has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
angerman has joined #ocaml
bombshelter13_ has quit [Client Quit]
bombshelter13_ has joined #ocaml
mattam has quit [hubbard.freenode.net irc.freenode.net]
rumbleca has quit [hubbard.freenode.net irc.freenode.net]
haelix has quit [hubbard.freenode.net irc.freenode.net]
Demitar has quit [hubbard.freenode.net irc.freenode.net]
mattam has joined #ocaml
rumbleca has joined #ocaml
Demitar has joined #ocaml
haelix has joined #ocaml
rumbleca has quit [hubbard.freenode.net irc.freenode.net]
haelix has quit [hubbard.freenode.net irc.freenode.net]
mattam has quit [hubbard.freenode.net irc.freenode.net]
Demitar has quit [hubbard.freenode.net irc.freenode.net]
mattam has joined #ocaml
rumbleca has joined #ocaml
Demitar has joined #ocaml
haelix has joined #ocaml
_andre has joined #ocaml
jeanbon has joined #ocaml
rjack has joined #ocaml
seafood has quit [Success]
ikaros has joined #ocaml
<Yoric[DT]>
Does anyone know if asmdynlink is maintained ?
<kaustuv>
Yoric[DT]: Damien Doligez says it's obsolete and not maintained.
<Yoric[DT]>
ok
<Yoric[DT]>
Thanks.
* Yoric[DT]
wonders whether either ocamlrun (or better, the native code generator) has been ported to GPUs.
jknick has quit [Read error: 113 (No route to host)]
smimou has quit ["bli"]
travisbrady_ has joined #ocaml
travisbrady has quit [Read error: 104 (Connection reset by peer)]
Axioplase has quit ["Lost terminal"]
thelema has quit [Read error: 60 (Operation timed out)]
mikeX has joined #ocaml
mikeX has quit [Client Quit]
<flux>
I doubt that kind of processing is suitable for GPUs
<Yoric[DT]>
Well, nowadays, GPUs can do just about anything.
<flux>
but are they good at doing it?
<flux>
serially taking instructions and performing operations per that
<flux>
I was under the impression the strengths of GPUs lied elsewhere
<Yoric[DT]>
Not necessarily, but since you probably have at least one seriously unused GPU on your computer whenever you're running an OCaml application, might as well use it.
<Yoric[DT]>
s/unused/underused/
<kig>
gpus are pretty much parallel Array.init for 4-wide float vectors
<kig>
4-wide float vectors as the core of the instruction set
<kig>
output floats or half-floats or unsigned bytes in widths from 1 to 4
<mrvn>
Anyone here know what it takes to get a patch into ocaml upstream? I want to export some C functions of the Unix module for other C stubs.
<Jedai>
duaneb: The ocaml repl by itself is pretty useless... You must wrap it in a readline input handler or use it in Emacs (with the tuareg mode) for it to be ok.
<duaneb>
:|
<duaneb>
sigh.
travisbrady has joined #ocaml
<duaneb>
I miss hugs :P
<duaneb>
and ghci
* brendan
loves tuareg
<Jedai>
duaneb: well the good point of the OCaml repl is that you can write everything in it you could write in a real ocaml program
<duaneb>
I suppose :P
<duaneb>
but I can't view type signatures?
<duaneb>
meh....
<Jedai>
duaneb: it should be displayed after you define a function
<Jedai>
duaneb: and if you just put a value ;; on the prompt, you'll get its type too
<gildor>
mrvn: what C functions ?
<flux>
duaneb, you may be interested in EnhTop
willb has joined #ocaml
<gildor>
duaneb: ocaml support ASCII internally and have fairly straightforward encoding support
<flux>
duaneb, but if emacs+ocaml is a pretty neat combination :)
|Lupin| has joined #ocaml
<|Lupin|>
hello everyboddy
<gildor>
duaneb: this is just a question of choosing of choosing the most easy standard to implement as "pivot" (i.e. ASCII)
<|Lupin|>
I'm wondering how to write an OCaml module that extends an existng one.
<gildor>
duaneb: but in fact you should consider char as byte and string as array of byte
<gildor>
|Lupin|: module TotoExt = struct include Toto let fext = ... end
<|Lupin|>
So if m1.ml and m1.mli exist, what to write in m2.ml and m2.mli such that if t is a type defined in M1, it is available as M2.t, and the same for values
<gildor>
use "include M1"
<gildor>
(it works for sure for m2.ml, you need to test for m2.mli)
<|Lupin|>
gildor: yes precisely, it does not work in the mli so I am wondering how to do... open in the .mli does not work either...
<|Lupin|>
julm: thanks a lot for the pointer. Too bd it is not possible yet...
<duaneb>
flux: emacs is OK, but it requires dedication
<duaneb>
gildor: yea, but might as well use UTF-32 instead of ascii.
<duaneb>
and then you don't need to worry about ignoring hundreds of thousands of characters
<gildor>
gildor: ASCII (and in fact byte) works for text and binary
<gildor>
duaneb: i mean
<|Lupin|>
Enter the code as it is shown in the box on the right.: _____ [INLINE]
<|Lupin|>
hmm the anti-spam protection of the bug tracker prevents me from signing up... too bad...
<gildor>
duaneb: this allow to manipulate a lot more data that just UTF-32
<gildor>
duaneb: all in all it is a better pivot
<gildor>
(for binary at least)
<gildor>
|Lupin|: so you are probably stuck to rewrite m2.mli using m1.mli (I encounter this situation from time to time and don't like it neither)
<|Lupin|>
gildor: yes, that's what I'll do...
<|Lupin|>
gildor: I've sent an e-mail to the caml-list, though...
<|Lupin|>
who knows, maybe it's gonna wake up people...
<mrvn>
gildor: conversion between errno and Unix.Error
<|Lupin|>
gildor: actually copying the .mli works just fine. It's awful, sure, but it works...
<gildor>
mrvn: what is the function name ?
<|Lupin|>
CU later, everybody
|Lupin| has left #ocaml []
ikaros has joined #ocaml
<mrvn>
unix_error_of_code
<mrvn>
int error_table[] = {
ikaros has quit [Read error: 104 (Connection reset by peer)]
<mrvn>
gildor: I actually need code_of_unix_error, the reverse of unix_error_of_code()
Yoric[DT] has joined #ocaml
jeanbon has left #ocaml []
<mrvn>
gildor: even more specific I want to call an ocaml function from C, catch a possible exception and return the respective -errno.
Axioplase has quit ["/quat"]
sporkmonger has joined #ocaml
<mrvn>
gildor: I figure I also need an let _ = Callback.register_exception "caml unix exception" (Unix.Unix_error ...)
<mrvn>
nm, that one is in unix.ml already
<mrvn>
Args, I just noticed something:
<mrvn>
type stats = Unix.LargeFile.stats =
<mrvn>
{ st_dev : int; (** Device number *)
<mrvn>
st_ino : int; (** Inode number *)
<mrvn>
Inodes are 64bit.
julm has quit [Read error: 60 (Operation timed out)]
julm has joined #ocaml
<gildor>
mrvn: since you need to go through an ocaml function why don't you catch the exception and do what is needed, there !
<gildor>
(i.e. in ocaml rather than in C)
<mrvn>
gildor: How to I get the C errno from Unix.error in ocaml?
<mrvn>
It doesn't really matter where I catch the exception. The problem of converting remains. And I must have a C stub while the ocaml function is user supplied. So catching it in C saves a function call.
<flux>
mrvn, for throwing unix errors there's a function somewhere in ocaml
<flux>
that is, converting errnos to errors
<mrvn>
flux: not throwing, catching.
<flux>
mrvn, well, surely something like Unix.read would make use of such a function?
<mrvn>
flux: no, Unix.read THROWS the exception.
<flux>
yes..
<flux>
mrvn, or you have C code that catches ocaml-code throwing an exception and you want to interpret that?
<mrvn>
The ocaml code throws Unix.ENOENT, my C code catches that and return -ENOENT to libfuse.
<flux>
hmm, ok
<flux>
I suppose you need to make use of the tables ocaml has, then
<mrvn>
Which means return -error_table[Int_val(unix_error)];
<flux>
or brutally provide means to map that information back some other way, say, by generating code during ./configure :)
<mrvn>
flux: The table isn't exported in unixsupport.h.
<flux>
mrvn, make a copy of the table, then?
<mrvn>
flux: who says that will match on the next ocaml update?
<flux>
or, generate a similar table during ./configure
<flux>
it does suck that ocaml doesn't provide proper interfaces for doing that kind of stuff in C
<flux>
maybe a bug report should be filed :)
<mrvn>
I've added an "extern int code_of_unix_error (value error);
<mrvn>
" to unixsupport.h/c now. Going to test that and then file a bug+patch.
<flux>
are you going to write a workaround? of course, doesn't matter if only a few people have access to the code to begin with
<mrvn>
flux: That depends on how long it takes to get a patch into ocaml.
<gildor>
mrvn: exception Unix_error of error * string * string
rjack has quit ["leaving"]
<gildor>
mrvn: so you catch Unix_error(err, _, _), and err is an int value (exception if its EUNKNOWNERR)
<mrvn>
gl: No, err is an Unix.error
<gildor>
mrvn: first step Unix_error -> error as an entry in error_table
<mrvn>
gildor: the problem is that the int value of Unix.ENOENT != C ENOENT
<gildor>
err is a "Int_val" if your prefer
<mrvn>
error_table is private
<gildor>
then you go throuhg error_table to find the right entry
<gildor>
extern error_table, just as in errmsg.c
Camarade_Tux has quit ["Leaving"]
<mrvn>
gildor: does that work outside the unix.cmxa? I would expect the symbol to be hidden.
<gildor>
mrvn: i think you can live without patch for this specific problem
<gildor>
mrvn: test it, but I think it should be ok
<gildor>
mrvn: it would be a problem if there is name clas with other definition
<gildor>
(which can indeed exist)
<gildor>
clas -> clash
<mrvn>
Even if it works nothing says it will work in 3.12. So eventually a patch is needed.
<gildor>
mrvn: just try it, it can work and allow you to not bother with a patch
<mrvn>
gildor: how do I get the size of the table?
<mrvn>
(just to be paranoid andavoid the risk of looking up a value out of bounds)