ulfdoz has quit [Read error: 110 (Connection timed out)]
avsm has joined #ocaml
Yoric has quit []
yakischloba has joined #ocaml
RaceCondition has joined #ocaml
avsm has quit ["Leaving."]
onigiri has joined #ocaml
Oxyd_ is now known as Oxyd
caligula_ has quit [Excess Flood]
clog has joined #ocaml
clog has joined #ocaml
caligula_ has joined #ocaml
zhijie has joined #ocaml
optiz0r has left #ocaml []
_unK has quit [Remote closed the connection]
Narrenschiff has quit []
mal`` has quit [K-lined]
tmaedaZ0 is now known as tmaedaZ
onigiri has quit []
djanderson has joined #ocaml
tmaedaZ is now known as tmaedaZ0
tmaedaZ0 is now known as tmaedaZ
johnnowak has joined #ocaml
Alpounet has quit [Read error: 104 (Connection reset by peer)]
Alpounet has joined #ocaml
<johnnowak>
hello all. i understand ocaml 3.12 has some sort of first-class module system. if my understanding is correct, where might I find information on it?
djanderson has quit [Client Quit]
johnnowak has quit []
Oxyd has quit ["leaving"]
joewilliams has quit [Remote closed the connection]
smimou has quit [Read error: 110 (Connection timed out)]
ski_ has quit ["Lost terminal"]
boscop has joined #ocaml
johnnowak has quit []
johnnowak has joined #ocaml
Narrenschiff has joined #ocaml
johnnowak has quit [Client Quit]
ulfdoz_ has joined #ocaml
alexyk has joined #ocaml
naufraghi has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
ikaros has joined #ocaml
alexyk has quit []
zerny has joined #ocaml
alexyk has joined #ocaml
<Camarade_Tux>
flux: a few months ago, you linked me to a quite long paper about optimization but I can't find it anymore, do you still have a link for it (it was free, only asked you to register)
<flux>
camarade_tux, hmm.. something about metaheuristic algorithms..
<flux>
camarade_tux, I got it linked from modeemi.fi/~flux/software/ganame
<flux>
Integer literal exceeds the range of representable integers of type int
<flux>
I guess it's 64-bit only then
<julm>
hm
<flux>
mm no
<flux>
popcompile.ml: 1098match s with P.B1 -> 0xFF | P.B2 -> 0xFFFF | P.B4 -> 0xFFFFFFFF(* XXX *)
<julm>
change the first F to 7 maybe
<julm>
or simply max_int
<mrvn>
or -1
<julm>
hm
<mrvn>
-1 will become 0xFFFFFFFF when it gets untagged.
<julm>
'kay
alexyk has joined #ocaml
<boscop>
what's the easiest way to manipulate image with ocaml?
<Camarade_Tux>
manipulate in what way? there is camlimages for instance
<Camarade_Tux>
(regarding what you asked in another channel: use the 'close_fds' command so that you can open your pdf files)
<boscop>
getpixel/setpixel
<Camarade_Tux>
camlimages should do it
<boscop>
ok
jeddhaberstro has joined #ocaml
<boscop>
"Last update on Fri Oct 1 2004." o.O
<boscop>
why are all the ocaml libs so old?
Tomsik has quit ["Thus spoke Tomsik"]
<julm>
because they're so good? no need to change them?
<Camarade_Tux>
you've never looked at libjpeg I take it, it had one update in ten years
<boscop>
julm, hardly believeable, but if it's true, good!
<Camarade_Tux>
and camlimages is complete (well, there have been a few patches since then but that's it)
zerny has quit [Read error: 110 (Connection timed out)]
algo_ has joined #ocaml
<algo_>
Did anyone happen to write a command line program to get the current price of certain stock?
Oxyd has joined #ocaml
pimmhogeling has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux>
I think there are several services that let you download stocks in a json format, if you use one, have a look at ocaml-json
<Camarade_Tux>
(iirc that's how it's named)
<orbitz>
jsonw ill save teh world
<orbitz>
i was watchin ga thing on protocol buffers, pretty neat
ttamttam has joined #ocaml
<algo_>
orbitz: what is so cool about protocol buffers? Isn't it just some library related to binary encoding of XML?
yakischloba has joined #ocaml
<orbitz>
algo_: no
<orbitz>
algo_: it's a library for serializing data in multiple langauges to a really compact binary format
<orbitz>
algo_: it handles versioning and everything for you too
ttamttam has quit ["Leaving."]
<boscop>
can ocamlimages draw text on images?
<boscop>
with font and color?
Submarine has joined #ocaml
<Camarade_Tux>
do you want to save the image or only display it?
<boscop>
save
tmaeda is now known as tmaedaZ
<Camarade_Tux>
I haven't used camlimages a lot so I dont really know, but you can also have a look at sdlcaml (or is it camlsdl?) and glcaml (or is it camlgl?)
tmaedaZ is now known as tmaeda
<algo_>
orbitz: ah, the versioning is in particular interesting, I suppose.
<orbitz>
algo_: Yeah, I'm not sure exactly how it does it, but it pretty much means you can have heterogenius versions of your app on the network and they can still communicate
<algo_>
What is the most effective way to learn Ocaml, assuming I already can program Haskell very well?
<algo_>
I basically want to be able to understand the Coq code base in detail.
* orbitz
shrugs, I don't know, just writing it has always been the best language-agnostic way to learn one I think
<ksson>
algo_: you should be able to read Ocaml code already
<orbitz>
It's more than just reading the syntax though
<algo_>
ksson: yes, the reading is quite OK, but I have the impression that the entry point of an Ocaml program is called start, is that correct?
<ksson>
algo_: no
<Camarade_Tux>
no
<algo_>
Ok, is it then just the first actual instruction which is not a declaration?
<ksson>
any toplevel expression in any charged module is executed
<Camarade_Tux>
you have a set of toplevel expressions and they are all executed
<Camarade_Tux>
gasp, too slow ='(
<ksson>
:)
<algo_>
And all the let stuff is executed in order?
<ksson>
yes
<ksson>
and functions are *not* mutually recursive by default, as in Haskell
<algo_>
I know how to read Ocaml types, etc. Now, the only difficult part is the French in the source code ;)
<ksson>
hehe :)
<Camarade_Tux>
indeed they are not
<algo_>
There is something like letrec for that I suppose?
<ksson>
yes
<orbitz>
Do you guys write a lot of ocde with ;;'s everywhere? I always go for teh let () = ...
<algo_>
And you all use Emacs?
<julm>
not me;;
<Camarade_Tux>
no ^^
<orbitz>
I use emacs
<julm>
ViM
<Camarade_Tux>
8 instances of vim running in desk 2
<ksson>
vim here
<ksson>
and i hate the ";;" :)
<boscop>
I use emacs, but I'm just starting with ocaml
<boscop>
just downloaded tuareg-mode :)
<julm>
Camarade_Tux: do you know :tabnew ?
<algo_>
So, no magic IDE for OCaml?
* orbitz
<3 TRAMP
<orbitz>
algo_: I think therei s soem support in eclipse
<julm>
vim/emacs best
<algo_>
orbitz: I used that a few years ago with Haskell. At that point in time it was a joke,
<algo_>
.
<Camarade_Tux>
julm: I put them side to side
<orbitz>
algo_: well, Eclipse is a joke :)
<algo_>
orbitz: I liked Netbeans when doing Java development.
<Camarade_Tux>
julm: on the screenshot, I used :sp in one of the vims ;-)
<orbitz>
algo_: I used Eclipse when i had to write java, but i still wrote it in Emacs, I just used Eclipse as my code brwoser
<Camarade_Tux>
(so that actually makes 7 instances)
<algo_>
You have 8 windows on 12**x800?
<algo_>
I would need an upgrade for my eyes on that ;)
<algo_>
Which Ocaml mode for Emacs do you use?
<julm>
his eyes regularly hurt IIRC
<Camarade_Tux>
I have no problem with DejaVuSansMono\ 6 but I almost can't read anything else: if the font is serif, I can't read it *at* *all*, even if it's 12 or 14 or even bigger
<julm>
don't ask why..
<boscop>
algo_, tuareg-mode
<algo_>
I can read it, but I don't want to read it, because it tires me :)
<yakischloba>
does Map.Make do the compare upon insertion ('add')?
<algo_>
Can you write let x = 1;y=2+x; in y in OCaml without using let multiple times and without inlining everything?
<algo_>
Is there any complicated algorithm implemented in OCaml? By complicated I mean like planarity testing complicated.
<julm>
let x = 1 in let y = 2 + x in y
<algo_>
julm: that uses let multiple times.
<julm>
let x = 1 and y = 2 + 1 in y
<flux>
:)
<Camarade_Tux>
you can't ;-)
<algo_>
Any piece of OCaml code seems to use so many redundant lets. It seems something which is trivial to fix.
<ksson>
yakischloba: does Map.Make call the compare function upon insertion ? yes
<julm>
let rec x = 1 and y = 2 + x in y
<Camarade_Tux>
I actually prefer that to a shorter form, I find it easier to read
<mrvn>
algo_: Taking a bunch of gene sequence find a most likely evolutionary tree for them.
<yakischloba>
ksson: ok. so the item is inserted in the correct order and not just sorted when iter or something is called
<julm>
does not work that last sentence
<algo_>
mrvn: hmm, I don't really think that counts. I know about that.
<mrvn>
algo_: that is rather complicated
<ksson>
yakischloba: ocaml Maps are trees
<ksson>
yakischloba: to find the position where the new element is inserted, it has to compare
<yakischloba>
ok
<mrvn>
algo_: or finding intron patterns in a gene sequenze and folding them.
<mrvn>
algo_: by the way, lets don't cost time
demitar has joined #ocaml
<algo_>
mrvn: the former I learnt in a particular class at university and I didn't think that was anything complicated. I don't know how the algorithm for intron patterns works to base an opinion on it.
<algo_>
mrvn: Coq is also a quite nice demonstration that OCaml can be used for at least something useful.
<mrvn>
algo_: exponential complexity
<algo_>
mrvn: that by itself does not say anything about the complexity of the algorithm.
<mrvn>
I constructed a worst case of 2^(n/8)
<mrvn>
But in usual cases you just need quite a lot of ram
<julm>
* is also a quite demonstration that OCaml can be used for at least something useful.
<mrvn>
The hard part is that you find quite a lot of results and then have to single out the once that look good.
<julm>
+nice
<algo_>
mrvn: e.g. in Java, when people are confronted with a difficult problem they usually implement some stupid algorithm, which dies when n goes to some slightly bigger value.
<mrvn>
algo_: Can anything good come out of a sentence starting with "in Java"?
<algo_>
mrvn: not really. I haven't written Java since 1.5, because I figured that out quite fast.
<orbitz>
haha
<julm>
in Java, there is nice people
<julm>
-is+are perhaps?
<orbitz>
In java there are 5 minute GC's
<julm>
the island..
<orbitz>
I love when java and erlang people get together talking abotu writing high throughput low latency sfotware and the java peopel complain abotu 5 minute gc's and erlang people just sort of look confused that such a thing exists
TaXules has quit ["#zzz"]
TaXules has joined #ocaml
<mrvn>
orbitz: sorry, couldn't ridicule you. Was waiting for th java GC to let me type something.
<orbitz>
hahaha
<orbitz>
jus tbuy an azul box, all problems = solved
dbrumley has joined #ocaml
<dbrumley>
hi. is this an appropriate channel to ask ocamlmktop-related questions?
<maskd>
yes
<dbrumley>
i've recently compiled a project using ocamlmktop, and I get a .top file. However, whenever I run the top, nothing evaluates. Is this a common problem?
<dbrumley>
e.g.
<dbrumley>
let f = 2+3;;
<dbrumley>
returns the prompt '#' with no results
<julm>
(julm : in Java, there [are] nice people <- my mistake, not so nice for the East Timoreans)
<det>
5 minute GCs, seriously ?
itewsh has joined #ocaml
<orbitz>
det: yep, at my old job we had to buy an Azul box to handle it
<orbitz>
det: minute long GC's aren't unheard of too. another old job had that issue
<det>
how long ago was this? how large was the heap ?
<mrvn>
Luckily ocaml has an incremental GC
<orbitz>
det: minute long gc's was within the las tyear
<orbitz>
det: 5 minute GC's was in 2006 - 2007
<det>
how large of a heap though
<orbitz>
5 minute gc place was trying to push 4 - 5 GB
<det>
was it swapping ?
<orbitz>
no, just doin ga ful gc
<det>
how can the "azul box" help ?
<orbitz>
det: Azul boxes run java natively and do a lot of tricks to have pauseless GC
<det>
it is a processor for java bytecode?
<orbitz>
Yes
<orbitz>
Not sure if it' slimit to Java bytecode, but they have implemetned their onw rpocessors, and they sell an appliance
<det>
This sounds suspicious
<orbitz>
how so?
<det>
that it could beat JIT to intel hardware
<orbitz>
it's not about perforamnce of serial code
<orbitz>
Azul is made for highl concurrent java apps with GC issues
<orbitz>
a single code path will probably execute 3 - 4x slower on an Azul box
<mrvn>
so it has a different JVM with better GC?
<orbitz>
They do GC in hardware
<yakischloba>
they do stuff like
<yakischloba>
instead of naively locking in synchronized regions
<orbitz>
they also do a gc but don't defragmen the heap until you access th eobject
<yakischloba>
there are hardware assists to catch when data corruption actually occurs, and it will roll back etc
<orbitz>
yakischloba: well that is different than teh gc ting. they have speculative lock elision
<mrvn>
are they multicore?
<orbitz>
yes
<orbitz>
biggest machien has ~1000 cores
<orbitz>
and ~1TB RAM
joewilliams has joined #ocaml
<orbitz>
Each chip has 48 cores, and i think it' something like 24 chips per CPU platter
<mrvn>
If it is too slow, throw more cores at it
<orbitz>
Well the idea is, you've written this massively concurrent application in Java without realizing Java cannot handle that
<orbitz>
so rather than rewrit eyoru app, you spend half a million dollars on an Azul box, and Everything Just Works (tm)
<mrvn>
Nut at least it is JAVA[tm]
<orbitz>
Diagnostics on Azul are f'ing sweet though
<mrvn>
-nut
<orbitz>
they give you a lot of visibility into your application
<yakischloba>
i am looking for something like C++ multimap…i have pairs of things, i need a list-like-thing sorted by the key upon insertion
<mrvn>
yakischloba: Map
<yakischloba>
mrvn: but I need to access only the pairs up to some condition. The key is a time, and every time i look at the data I only want to touch pairs who's time is < now
<yakischloba>
it doesnt seem that Map gives me a 'hd' or anything
<mrvn>
yakischloba: then you want a priority queue. A heap is a good solution for that
<mrvn>
Set has a min_elt
<yakischloba>
hmm
<mrvn>
Does Batteries have a priority queue?
<yakischloba>
i dont know. i am hesitant to jump into batteries being so new to ocaml
<orbitz>
isn't battrie a nightmare to install too?
<mrvn>
.oO(apt-get install ...)
<det>
A Map would work fine for what you want, it's too bad the interface only provides fold and no get_item :/
<mrvn>
you could fold and throw an exception when you are done.
<Camarade_Tux>
orbitz: wasn't hard before and now, it should be even easier
<yakischloba>
ah. i see
<mrvn>
is the time unique?
<yakischloba>
unfortunately i don't think I can guarantee it.
<yakischloba>
i think fold w/ the exception is the most simple solution for me..
<mrvn>
Put (time, data) into a Set and use min_ekt.
<mrvn>
min_elt.
<mrvn>
I'm assuming (time, data) will be unique.
<yakischloba>
also not possible for me to guarantee
<mrvn>
then add an unique int to it.
<mrvn>
Can one fold over a Map and remove the elements in the fold?
<ksson>
yes
<ksson>
because maps are persistent :)
<ksson>
you never change the original map
<flux>
mrvn, basically you pass the map twice to the folding fuction
<mrvn>
right, I thought only Set was.
<flux>
I do wonder how hashtbl behaves
<flux>
but best to do it the safe way
<mrvn>
flux: I would think they behave badly when it needs to resize.
<ksson>
there was a thread on the caml-list about this
<ksson>
but i don't remember ...
<mrvn>
The stdlib really should have phantom types for that.
<ksson>
i think the outcome was that it's safe to do it, but it's not in the spec, so it's bad to do it anyway :)
<mrvn>
ksson: I don't see how it could be unless it keeps a copy of the initial array.
<ksson>
mrvn: yeah, i guess you're right
<ksson>
don't remember exactly
<flux>
mrvn, but hey, if it resizes an array, it will replace it, no?
<flux>
mrvn, so the old array is still there, if you have a refrence to it..
<mrvn>
yep. Inserting elements might add them to the items being folded though.
<mrvn>
But only till it resizes
<flux>
actually now that I think of it, removing elements might reorder them in a bucket
dbrumley has quit ["Leaving"]
<flux>
so removing element might remove another element from the fold
<mrvn>
flux: the iterator should have a reference to the bucket
<flux>
mrvn, yes, but say the bucket is [Some 1; Some 2; Some 3; Some 4] and at 2 you remove 1, it might become [Some 4; Some 2; Some 3; None]
<flux>
(I don't know if it works this way)
<ksson>
no, it doesn't reorder
<mrvn>
lists are functional so that doesn't matter
<flux>
ah, ok
<flux>
quite obviously now that I think of it
algo_ has quit ["Page closed"]
stan_ has joined #ocaml
onigiri has quit []
stan_ has quit [Client Quit]
stan_ has joined #ocaml
joewilliams has quit [Remote closed the connection]
stan_ has quit [Client Quit]
stan_ has joined #ocaml
Yoric has quit []
stan_ has quit [Client Quit]
lokydor has joined #ocaml
lokydor has quit ["leaving"]
lokydor has joined #ocaml
ttamttam has joined #ocaml
lokydor has quit [Client Quit]
lokydor has joined #ocaml
onigiri has joined #ocaml
Narrenschiff has quit []
avsm has joined #ocaml
pimmhogeling has joined #ocaml
itewsh has quit [Client Quit]
alexyk has quit []
demitar has quit [Read error: 110 (Connection timed out)]
demitar has joined #ocaml
onigiri has quit []
pimmhogeling has quit [Read error: 110 (Connection timed out)]
<yakischloba>
i am trying to use a mutable instance variable to hold a file_descr but i dont always want to create the real one when i instantiate the object. is there some file_descr that represents perhaps −1 or some way to coerce −1 into a file_descr or something so i can set it as that temporarily?
<flux>
no. you should wrap the filedescriptor inside an option type.
<yakischloba>
oh, right. ok thanks
<Camarade_Tux>
if your variable is named foo, you can define:
<Camarade_Tux>
let foo () = match !foo with | Some x -> x | None -> assert false
<Camarade_Tux>
and then use (foo ()), makes it lighter
<flux>
..if it's otherwise difficult to organize the code in such a way that you can handle the None better
<yakischloba>
k
<Camarade_Tux>
yeah, for cases where you don't have a value for foo at the beginning of your program and will only set it once
<Camarade_Tux>
(and don't want to add a parameter to each and every function in your program)
yziquel has joined #ocaml
<mrvn>
Maybe a better type would be lazy
<mrvn>
let fd = lazy (Unix.open "foo" ...)
<Camarade_Tux>
would work too
<Camarade_Tux>
I've been using 'a option ref for a connection and didn't want to do something wrong (I've never used lazy)
<mrvn>
What I'm missing is Lazy.unforce
derdon has joined #ocaml
<derdon>
hello
<derdon>
"OCaml comes with lots of fun and interesting modules (libraries of useful code)."
<derdon>
which of them are fun?
<mrvn>
let the = fun _ -> begin () end
<mrvn>
It's a pun since "fun" is also a keyword in ocaml.
<derdon>
mrvn: what do the keywords "begin" and "end"?
<Camarade_Tux>
basically, they're like ( and )
<derdon>
ok
<derdon>
I think I should omit this pun in my translation because it doesn't work in German
demitar_ has joined #ocaml
demitar has quit [Read error: 110 (Connection timed out)]
* thelema
is about to implement weighted maximum matching in general graphs, unless someone knows an ocaml implementation already
jeddhaberstro has quit [Client Quit]
ygrek has quit [Remote closed the connection]
<thelema>
anyone here used pycaml?
demitar_ has quit ["Ex-Chat"]
ksson has quit ["leaving"]
_zack has quit [Read error: 113 (No route to host)]
Submarine has quit ["Leaving"]
_JFT_ has joined #ocaml
Yoric has joined #ocaml
_JFT_ has quit []
ttamttam has quit ["Leaving."]
ulfdoz has quit [Read error: 110 (Connection timed out)]
valross has joined #ocaml
Yoric has quit []
djanderson has quit []
derdon has quit []
joewilliams has joined #ocaml
<yziquel>
thelema: why?
<thelema>
yziquel: because I found a python library to do the crazy matchin thing I was going to implement.
<thelema>
I think I've figured out the incantations needed to call a function out of a module
<yziquel>
yziquel: oh... i'm very interested.
<thelema>
in pycaml or in weightex maximal matching
<thelema>
*weighted
<yziquel>
thelema: pycaml, sorry.
<thelema>
short version: there's functions to wrap your data as python objects
<thelema>
to get the function, you pyimport_importmodule the module
<thelema>
get its dict, and pull the function object out of the dict by name
<thelema>
and then call the function object with pyeval_callobject (function_object, args)
<thelema>
args is just a packed tuple
<yziquel>
thelema: good to know. i'll have a try again with pycaml...
<thelema>
hmm, except I just realized that I wasn't really creating a python sequence as I need to ...
<thelema>
oh well, after Aikido.
onigiri has joined #ocaml
onigiri has quit [Remote closed the connection]
yakischloba has quit ["Leaving."]
joewilliams has quit ["Leaving..."]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]