<aldebrn>
Google gave me some good results, thought I'd ask here too: anyone have any experience using a distributed iterative linear solver (preconditioned conjugate gradient) from Ocaml? either a stand-alone 3rd party solver or one directly in ocaml?
<yziquel>
hi. i'd like to have a type 'a t = 'a option ref * ('b * ('b -> 'a)). But I'd like the type to be only 'a t, and not 'a 'b t... is it possible?
Associat0r has joined #ocaml
<Alpounet>
existential types may be of help yziquel
willb has quit [Connection timed out]
alexyk has joined #ocaml
willb has joined #ocaml
ched_ has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
<yziquel>
Alpounet: type t = exists 'b. ('b -> int) gives me a syntax error. How do you write an existential type?
<Alpounet>
I've only seen them in record types, so far
<Alpounet>
there are message on the ML with pretty good explanations
<wysek>
it does not work because of some other code
<wysek>
:)
<julm>
could you pastebin it?
<Camarade_Tux>
wysek, gah, sorry, I was wrong, must still be too tired here
<wysek>
actually it's too big
<wysek>
:(
<julm>
could you reduce it to a sample that still fails?
<wysek>
ok, it works now
<julm>
okay :)
<wysek>
seems like Camarade_Tux has pointed me to the right direction
<wysek>
thanks
<wysek>
:)
<wysek>
just to make sure you don't die of curiosity:
<wysek>
in some .mli I had:
<wysek>
val decide : 'a abcast_instance -> int -> (int * 'a) list -> unit
<wysek>
it compiles now after I changed to:
<wysek>
val decide : 'a abcast_instance -> int -> 'a proposal -> unit
<wysek>
('a here is abcast_msg)
<julm>
ok
<wysek>
actually I'm not sure why there was an error. I think these types are the same
<wysek>
aren't they?
* Camarade_Tux
was most probably wrong, eyes failing
<Yoric[DT]>
They definitely look similar.
<Camarade_Tux>
Yoric[DT], btw, is batteries' List.concat tail-rec ?
<Camarade_Tux>
the documentation says : "Tail-recursive (length of the argument + length of the longest sub-list)." but why the comment in parens then ?
<Yoric[DT]>
iirc, it is
<Yoric[DT]>
Well, even a tail-recursive function has its complexity :)
<Camarade_Tux>
ok, I was wondering because it's the same comment as in inria's List.concat ;)
<Camarade_Tux>
"Not tail-recursive (length of the argument + length of the longest sub-list)."
_zack1 has quit ["Leaving."]
<Camarade_Tux>
argh, it uses non-regular lists, I can't just steal the code ='(
marmottine has quit ["mv marmotine Laurie"]
<Yoric[DT]>
Yeah, the code is somewhat hacky.
<Yoric[DT]>
Inherited from extlib.
th5 has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Associat0r has joined #ocaml
sporkmonger has joined #ocaml
sporkmonger_ has joined #ocaml
komar__ has joined #ocaml
Associat0r has quit []
<Camarade_Tux>
seems to be working but it's too short to be real
<Camarade_Tux>
(my list_concat btw)
eevar2 has quit [Remote closed the connection]
eevar2 has joined #ocaml
_andre has joined #ocaml
sporkmonger has quit [Read error: 113 (No route to host)]
mpwd has joined #ocaml
Narrenschiff has joined #ocaml
willb2 has quit [Read error: 104 (Connection reset by peer)]
willb2 has joined #ocaml
Alpounet has joined #ocaml
sporkmonger_ has quit []
komar__ has quit [Read error: 113 (No route to host)]
<Camarade_Tux>
tested it on pretty long lists and seems to work ok, if anyone wants to have a look at it : http://paste.lisp.org/display/82127
<Camarade_Tux>
(I should have lowered the stack limit because instead of managing to get stack overflows, I managed to get out of memory killers)
<Camarade_Tux>
it even seems to be faster than inria's List.concat
komar__ has joined #ocaml
sporkmonger has joined #ocaml
seafood_ has joined #ocaml
Associat0r has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
Associat0r has quit []
Associat0r has joined #ocaml
komar__ has quit ["WeeChat 0.2.6.2-ohshi"]
komar_ has joined #ocaml
Associat0r has quit []
schme has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
willb2 has quit ["Leaving"]
_zack has joined #ocaml
willb has joined #ocaml
eevar2 has quit ["Leaving"]
bombshelter13_ has joined #ocaml
jmou has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
th5 has quit []
<Camarade_Tux>
List.rev must be terribly slow, in my list_concat, a final call to List.rev is responsible for 60% of the total runtime :o
alexyk has joined #ocaml
<thelema>
Camarade_Tux: it's as fast as it can be, but there's a lot of allocation & GC involved in reversing a list and throwing away the old one.
<thelema>
especially if your old list doesn't fit in the minor heap - major collections are expensive
<Camarade_Tux>
thelema, I profiled it and... gprof tells me 90.4% of the time is spent in the gc :o
mpwd has quit []
<thelema>
yup, that's the problem with reversing big lists. normally short-lived data stays in the minor heap, but a big list won't fit
<thelema>
Bluestorm and I built a version of List.fold_right that works around this problem. Maybe you could implement List.concat in a similar way
<thelema>
in the limit, the performance isn't changed, but the constant factos is much reduced for medium-big lists
<thelema>
I'm surprised you found it in ocaml-community
<thelema>
I didn't know anyone paid attention.
<Camarade_Tux>
thelema, google :)
<Camarade_Tux>
I knew it from before though
<thelema>
:)
Yoric[DT] has joined #ocaml
alexyk has left #ocaml []
willb has quit [Read error: 110 (Connection timed out)]
willb has joined #ocaml
eevar2 has joined #ocaml
willb has quit [Read error: 54 (Connection reset by peer)]
willb has joined #ocaml
alexyk has joined #ocaml
ikaros has joined #ocaml
eevar2 has quit ["This computer has gone to sleep"]
Yoric[DT] has quit ["Ex-Chat"]
mishok13 has quit ["Stopping IRC chat... [OK]"]
Narrenschiff has quit []
jmou has quit [Read error: 60 (Operation timed out)]
ary1 has joined #ocaml
ary1 has left #ocaml []
jmou has joined #ocaml
willb has quit [Read error: 104 (Connection reset by peer)]
willb has joined #ocaml
_zack has quit ["Leaving."]
alexyk has quit [Read error: 113 (No route to host)]
mpwd has joined #ocaml
_zack has joined #ocaml
alexyk has joined #ocaml
jeanbon has joined #ocaml
alexyk has quit []
jeanbon has quit ["."]
jlouis_ has quit ["leaving"]
jlouis has joined #ocaml
jlouis has quit [Client Quit]
jlouis has joined #ocaml
_zack has quit ["Leaving."]
willb has quit [Read error: 104 (Connection reset by peer)]
willb has joined #ocaml
jeanbon has joined #ocaml
jeddhaberstro has joined #ocaml
jmou is now known as julm
Amorphous has quit [Read error: 104 (Connection reset by peer)]
willb has quit [Read error: 110 (Connection timed out)]
willb has joined #ocaml
Amorphous has joined #ocaml
Snark has quit ["Ex-Chat"]
stmi has joined #ocaml
Ched has joined #ocaml
ched_ has quit [Read error: 104 (Connection reset by peer)]
stmi has quit [Remote closed the connection]
stmi has joined #ocaml
willb has quit [Read error: 104 (Connection reset by peer)]
willb has joined #ocaml
psnively has joined #ocaml
psnively has left #ocaml []
jeff_s_ has left #ocaml []
<shazam>
what's the easiest way to find out if a string is a substring of another?
<shazam>
ahh, ExtString.String.exists
ikaros has quit ["Leave the magic to Houdini"]
Narrenschiff has joined #ocaml
Associat0r has joined #ocaml
* shazam
wonders if it's UTF8 friendly
<julm>
shazam: according to rfc2279 « The Boyer-Moore fast search algorithm can be used with UTF-8 data. »; and if [ExtString.String.exists] is serious, it uses Boyer-Moore
Narrenschiff has quit []
authentic has quit [hubbard.freenode.net irc.freenode.net]
aij has quit [hubbard.freenode.net irc.freenode.net]
gl has quit [hubbard.freenode.net irc.freenode.net]
aij has joined #ocaml
authentic has joined #ocaml
gl has joined #ocaml
alexyk has joined #ocaml
alexyk has left #ocaml []
Associat0r has quit []
Yoric[DT] has joined #ocaml
<kaustuv>
Before searching in Unicode, you had better make sure all your
<kaustuv>
... strings are normalized
<shazam>
normalized? what does that mean?
willb has quit [Read error: 104 (Connection reset by peer)]
<julm>
nfkc is fine
<kaustuv>
Unicode has combining characters, variant forms, etc. etc. etc.
<mrvn>
shazam: you can write ö and ö or o with two dots on top. normalized brings both of them into a common form.
<mrvn>
kaustuv: it doesn't force one to write type annotations.
<kaustuv>
hcarty: Awesome!
<hcarty>
The "official" repo should be live soon, once I track down a strange error in the web interface
<kaustuv>
You joined the cairo team?
<hcarty>
kaustuv: And Olivier has patches to add and is interested in staying involved
<kaustuv>
This is great news. Thanks!
<hcarty>
Yes, more or less. I have an account at fd.o now and commit access for the cairo-ocaml repo
<hcarty>
You're welcome. I am excited about it as well.
<hcarty>
It would be wonderful to get this in to good shape (update to support recent-ish Cairo; add findlib support officially) and make a proper release
Associat0r has joined #ocaml
<Yoric[DT]>
That would be nice.
<Yoric[DT]>
And a proper graphics combinator library on top of Cairo, too :)
<Camarade_Tux>
and an ice cream too :)
Associat0r has quit []
mgodshal1 has joined #ocaml
<julm>
Camarade_Tux: instead of screaming, what about doing that ohloh stuff?
<Camarade_Tux>
julm, hmm, right
<Camarade_Tux>
I have to admit I'm heavily slacking, I'm planning an internet game of duke nukem 3D now...
<shazam>
I always wondered...can cairo be used for making a game?
<shazam>
like a side scroller?
shazam is now known as palomer
<hcarty>
palomer: It probably could
* Yoric[DT]
wonders about the performance.
<hcarty>
It would likely require a LOT of pre-rendering
Ched has quit [Read error: 104 (Connection reset by peer)]
Ched has joined #ocaml
mgodshall has quit [Read error: 110 (Connection timed out)]
<julm>
Camarade_Tux: who's in a hurry for this after all ;)
<hcarty>
It is used for some if not all of the Gnome games. But I don't think any of those have significant animation.
<hcarty>
Yoric[DT]: I'm finding my way though FrGui now, and it has an FrCairo library
<palomer>
so you can't just can't just constantly flip the buffer?
<Yoric[DT]>
Sounds good :)
<hcarty>
It's very basic, just enough for FrGui interaction. But hopefully it will grow in to more :-)
<palomer>
s/can't just/
<hcarty>
palomer: I doubt it, unless one or more of the proposed hardware-accelerated backends make it in to Cairo
<hcarty>
You could use Cairo for the initial rendering and keep those rendered sprites around.
<hcarty>
If it were combined with OpenGL, SDL or something similar then it could probably be made fast enough.
slash_ has joined #ocaml
* Camarade_Tux
think Yoric[DT] can't live that close to him in Paris
komar_ has quit ["WeeChat 0.2.6.2-ohshi"]
<Camarade_Tux>
(checking the ohloh map)
komar_ has joined #ocaml
* Yoric[DT]
is trying to locate Camarade_Tux.
<Camarade_Tux>
I'm not on the map (quite surprised btw), but near Port-Royal ;)