ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
chris447 has joined #ocaml
chris447 has left #ocaml []
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
mye has joined #ocaml
myx has quit [Ping timeout: 255 seconds]
emmanuelux has quit [Quit: emmanuelux]
ollehar has joined #ocaml
gnuvince has joined #ocaml
ollehar has quit [Quit: ollehar]
yacks has joined #ocaml
m4b has joined #ocaml
<m4b>
hello; i was on here on friday asking about caml_initialize taing up 50% of the program time according to gprof, for a vm I am writing; on the suggestion of a kind user here, I switched out record types I was using to represent 32-bit instruction segments, and changed the memory model from hashtables of arrays, to patricia trees of arrays; unfortunately, the changes have resulted in no speedup whatsoever, and caml_initialize is still
<m4b>
taking up the majority of the program time. I would be very grateful if someone could (1) explain what exactly that function call does, and (2) how I might optimize my program; the code is here: http://hpaste.org/82586
pkrnj has joined #ocaml
flx_ has joined #ocaml
flux has quit [Ping timeout: 245 seconds]
flx_ is now known as flux
ahokaomaeha has joined #ocaml
m4b has quit [Ping timeout: 264 seconds]
cyball1 has quit [Ping timeout: 248 seconds]
ahokaomaeha has quit [Read error: Connection reset by peer]
ahokaomaeha has joined #ocaml
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
Tobu has quit [Read error: Connection reset by peer]
<oriba>
hmhh, it says, it was already done
<oriba>
ah ok :-)
Tobu has joined #ocaml
<oriba>
so it looks like I then can use 3.11.2 and 4.00.1 for development :-)
yacks has joined #ocaml
cyball2 has joined #ocaml
<oriba>
but I need to install packages with opam then.... it seems... will try it :-)
<Kakadu_>
don't forget to reinstall libraries for both versions
<oriba>
hmhhh
<oriba>
aha
<oriba>
switch to one version, install libs, switch to other version, install libs?
<oriba>
(I could use the original version in other shell without opam)
cyball1 has quit [Ping timeout: 276 seconds]
<oriba>
how do I seem which ocal is swithced on?
<Kakadu_>
ocamlc -v?
<oriba>
hehe
<oriba>
ah, there is Advanced_Usage in the docs...
<oriba>
for switching
dwmw2_gone is now known as dwmw2
<oriba>
crazy, it installs 3.11.2, when switching to it...
ocp has joined #ocaml
<oriba>
hey, even 4.00.1 is installed by opam, when switching, it installs it again...
<oriba>
hmhh... or the 4.00.1 is from ocamlbrew, and not the same as that of OPAM?
<oriba>
Will explore that later
<oriba>
Kakadu_, flux even I need to explore this more, this all was very helpful already. thanks :-)
oriba has quit [Quit: oriba]
yacks has quit [Read error: Operation timed out]
mcclurmc has quit [Ping timeout: 264 seconds]
tani has quit [Quit: Verlassend]
yacks has joined #ocaml
rixed has quit [Ping timeout: 245 seconds]
hkBst has quit [Ping timeout: 248 seconds]
Icarot has joined #ocaml
Icarot has quit [Client Quit]
hkBst has joined #ocaml
ahokaomaeha has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
anderse has joined #ocaml
mcclurmc has joined #ocaml
adotbrown has quit [Ping timeout: 248 seconds]
reynir has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 256 seconds]
Yoric has joined #ocaml
thomasga has quit [Quit: Leaving.]
tane has joined #ocaml
leoncamel has joined #ocaml
<anderse>
I'm playing around with the idea of rewriting some of our ruby http-services in ocaml for fun and hopefully some performance gains, is there any ocaml http service that you know could be suitable for tiny services?
<zorun>
anderse: ocsigen is pretty complete, but maybe a tad overkill for your needs
<zorun>
otherwise, I've heard of CoW (Caml on the Web) for manipulating structured data commonly found on the web (XHTML, JSON, etc)
<adrien_oww>
there's ocaml-http
<adrien_oww>
and of course ocamlnet
<anderse>
the first thing im looking at is more or less a distributed hash of json, so it extremly simple service
<anderse>
i started looking at ocaml-cohttpserver but since im completely new to the ecosystem i thought i might ask here :)
Icarot has joined #ocaml
Rotek has joined #ocaml
Rotek has quit [Client Quit]
csmrfx has joined #ocaml
<anderse>
an unrelated question, would you suggest jane street's core or batteries for someone starting out with ocaml but who has quite high stability requirements?
<adrien_oww>
both are stable and well-tested
<csmrfx>
sounds bit strange, those "high stability requirements"
<anderse>
sorry, i mean, i dont want to be the only one using a certain feature in production and stumbling on a bug which no one has seen before - but perhaps there are no library level bugs in core or batteries!
<csmrfx>
we all do!
<csmrfx>
but... how do you know what exactly creates stability in your app, etc. etc.
<anderse>
ive come to think that stuff which is widely adopted is generally safer if you have no clue, and more info is found on google etc
<anderse>
i guess what i wanted to know is "is anyone actually using both of these?"
<csmrfx>
sounds more like belief than fact
<anderse>
yeah, i built most of my life around it, belief
<csmrfx>
hehe, the little software engineer in me wants specs!
<djcoin>
csmrfx: using something that has users seems to me like a good criteria
<csmrfx>
But still we dont know what would "stability" imply in this context
<anderse>
as someone who mostly does ruby, no segfaults would be a nice start ;)
<csmrfx>
anderse: try jruby!
<csmrfx>
no segfaults
<djcoin>
csmrfx: ?
<anderse>
i know, we do alot of xml data processing and our jruby-branch performed worse, otherwise we'd already be on it
<nicoo>
csmrfx: No; instead, you have giganormous GC pauses ;)
<csmrfx>
strange, jruby and jvm both have improved performance lately
<csmrfx>
nicoo: ;)
<anderse>
csmrfx: i think it boils down to the libxml backend to our library being faster than the java implementation
mcsquiggedy has joined #ocaml
<nicoo>
anderse: And JNI isn't an option ?
<csmrfx>
anderse: there is no think, only *know*
<anderse>
csmrfx: you have not been inside of my head, that is one thing which is clear!
<anderse>
nicoo: im sure, we've didnt have any pressing reason to migrate so we didnt spend any of time reworking the library
<anderse>
this thing rewriting some stuff in ocaml is mostly because it think it seems fun, no facts, just thinking - dont tell the other guys at my startup ok? ;)
ahokaomaeha has joined #ocaml
<nicoo>
:)
ahokaomaeha has quit [Read error: Connection reset by peer]
ahokaomaeha has joined #ocaml
Fullma has joined #ocaml
rixed has joined #ocaml
cdidd has joined #ocaml
SanderM has joined #ocaml
hkBst has quit [Read error: Connection reset by peer]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
Icarot has quit [Remote host closed the connection]
yacks has quit [Read error: Connection reset by peer]
q66 has joined #ocaml
mattrepl has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
leoncamel has quit [Ping timeout: 252 seconds]
hkBst has quit [Ping timeout: 256 seconds]
travisbrady has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
mcsquiggedy has quit [Read error: Operation timed out]
cago has left #ocaml []
SanderM has quit [Remote host closed the connection]
ttamttam has quit [Quit: ttamttam]
hkBst has quit [Ping timeout: 248 seconds]
hkBst has joined #ocaml
travisbrady has quit [Quit: travisbrady]
hkBst has quit [Ping timeout: 248 seconds]
travisbrady has joined #ocaml
Sergey has joined #ocaml
mcsquiggedy has joined #ocaml
hkBst has joined #ocaml
tane has quit [Quit: Verlassend]
thomasga has joined #ocaml
ocp has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
darkf has quit [Quit: Leaving]
yacks has quit [Ping timeout: 244 seconds]
Kakadu_ has quit [Ping timeout: 244 seconds]
Icarot has joined #ocaml
ttamttam has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
ttamttam has quit [Quit: ttamttam]
tac has joined #ocaml
ocp has joined #ocaml
Icarot has quit [Ping timeout: 244 seconds]
Yoric has joined #ocaml
paolooo has joined #ocaml
Cyanure has joined #ocaml
ocp has quit [Quit: Leaving.]
gnuvince has quit [Ping timeout: 255 seconds]
ttamttam has joined #ocaml
osa1 has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
paolooo has quit [Quit: Page closed]
q66 has quit [*.net *.split]
rixed has quit [*.net *.split]
mika1 has quit [*.net *.split]
dezzy has quit [*.net *.split]
fayden has quit [*.net *.split]
rwmjones has quit [*.net *.split]
_habnabit has quit [*.net *.split]
TDJACR has quit [*.net *.split]
TDJACR has joined #ocaml
tane has joined #ocaml
q66 has joined #ocaml
rixed has joined #ocaml
dezzy has joined #ocaml
fayden has joined #ocaml
rwmjones has joined #ocaml
_habnabit has joined #ocaml
anderse has quit [Quit: anderse]
<companion_cube>
I used opam switch for ocaml4.00.1, which works fine, except that the 'Num' module does not seem to be compiled :s
<companion_cube>
does anyone know why?
<thelema>
companion_cube: ls `ocamlc -where`/num*
<thelema>
I have it in my opam 4.00.1
<companion_cube>
ls: cannot access /home/simon/.opam/4.00.1/lib/ocaml/num: No such file or directory
<companion_cube>
hm sorry, forgot the *
<companion_cube>
hmm, so I need to find why ocamlbuild cannot link to 'num.cmxa'
<thelema>
num isn't part of stdlib, so you have to include num.cmxa on command line
<companion_cube>
wow, the lib is "num", but the library is "nums"
<companion_cube>
-_-
<thelema>
the tag is "use_num", I think
<thelema>
or maybe use_nums"
<thelema>
the modules are Num and Ratio, in the library nums
<companion_cube>
I added -lib nums and it works
<companion_cube>
thank you
<adrien>
companion_cube: use ocamlfind!
<adrien>
:P
<companion_cube>
I do
<companion_cube>
-use-ocamlfind :p
<adrien>
ocamlfind list | grep -i num
<adrien>
:-)
mcclurmc has quit [Ping timeout: 245 seconds]
milosn has quit [Remote host closed the connection]
<companion_cube>
I tried ocamlfind query num
<companion_cube>
but this points to a different place...
nze has joined #ocaml
milosn has joined #ocaml
mye has joined #ocaml
<nze>
How can I query ocaml toplevel for currently bound values?
<nze>
also, how does the library path work? can I introspect it?
<nze>
most importantly, where do I get this kind of info? the book by Chailloux et al didn't get me very far...
<thelema>
I don't think there's any hook at the moment to query that, although it should be possible to add to the toplevel
<thelema>
the library path works as any other library path; a list of places to search for module files
<thelema>
that's the code that adds to the load path, but I don't see a way to get at the Config module
<thelema>
the default search path is just Config.standard_library, which you can print by "ocamlc -where"
<thelema>
nze: what are you trying to include?
dwmw2 is now known as dwmw2_gone
<nze>
thelema: i installed ocurl through opam and now i'm trying to use it
<thelema>
if you've done the necessary opam magic for the toplevel (ocaml -I $OCAML_TOPLEVEL_PATH)
<thelema>
you should be able to do #require "ocurl";;
<thelema>
and then just use ocurl
<thelema>
err, maybe also #use "topfind";; (before #require)
<thelema>
and apparently ocurl's findlib package name is just curl, so #require "curl";;
<nze>
yeah, that does the job neatly, thanks
<thelema>
you're welcome
ottbot has quit [Ping timeout: 252 seconds]
<nze>
looking at ocamlc -where, ocaml -I +../curl does the job
mye has quit [Quit: mye]
m4b has joined #ocaml
<m4b>
mfp: hello, I took your advice (thank you!), and removed all the instruction types from the program and work with just arrays of integers; replaced the hashtables of arrays with patricia trees of arrays; and when I don't call Array.copy to return a fresh, non-aliased array, the program is really fast; unfortunately, it looks like I need Array.copy in order to not alias; I even changed the register model to a list of 8 elements, in case
<m4b>
the aliasing was coming from there, but no effect; do you have any suggestions for a way to get around this problem?
osa1 has quit [Ping timeout: 245 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
mye has joined #ocaml
nze has quit [Ping timeout: 248 seconds]
malc__ has joined #ocaml
ocp has joined #ocaml
ocp has quit [Client Quit]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
m4b has quit [Ping timeout: 256 seconds]
Navska has joined #ocaml
mye has quit [Quit: mye]
ottbot has joined #ocaml
mye has joined #ocaml
Snark has quit [Quit: Quitte]
<Navska>
Bonjour ! Je viens de commencer le caml (prépa) et j'avoue que je rame un peu ! Si quelqu'un pouvais me filer un coup de main à propos d'un algo ce serait sympa merci !
<adrien>
hi, this channel is english-speaking but #ocaml-fr exists too
<thelema>
Navska: #ocaml-fr
<thelema>
Navska: also, don't ask to ask, just ask.
m4b has joined #ocaml
ottbot has quit [Ping timeout: 255 seconds]
_andre has quit [Quit: leaving]
<m4b>
mfp
<m4b>
mfp if you've got some time, I'd like to get your opinion on how, if possible, to remove the array.copy function that is being called (and which is responsible for the huge amount of caml_initialize calls), and still get non-aliased objects
<orbitz>
mfp responds randomly
<thelema>
m4b: copy on write?
<m4b>
eh, whoops; what is the whisper or talk command?
mcsquiggedy has quit [Ping timeout: 252 seconds]
<thelema>
m4b: /m
<m4b>
thelema: thank you; i'm not sure I understand your suggestion, copy on write. the problem is i have a vm; it runs fast now, when I replaced the memory model from hashtables of arrays to patricia trees of arrays, _when_ I remove a necessary Array.copy function to prevent aliasing; I need to not have aliased objects, but with that one line, the caml_initialize is called 3 billion times for 1 million executions of the main loop
<thelema>
does each execution of the main loop modify 3000 memory locations?
<m4b>
thelema: no that's the weird part; each execution is equivalent to one instruction execution. if I remove array.copy, the program runs incredibly fast.
<m4b>
thelema: it is a "program" load operation; it loads the program, which is an array in the patricia tree, to be loaded into the 0x0 location in the patricia tree
<m4b>
orbitz: i would, but I need to return non-aliased arrays
<thelema>
memory is your entire memory image?
<m4b>
thelema: the memory parameter (in the memory functions and the function execute1) is the patricia tree of arrays.
metasyntax has joined #ocaml
osa1 has joined #ocaml
<thelema>
the array is what?
<m4b>
thelema: the array is an array of integers (32-bit instructions); in other words a program in machine language
<thelema>
so your memory is a patricia tree of these arrays, meaning that the memory is indexed by the id of the program?
<thelema>
anyway, try getting rid of the arrays and having the patricia tree be a little bit bigger to hold all the instructions directly.
Navska has left #ocaml []
<m4b>
thelema: it would have to be a patricia tree of patricia trees then...?
<thelema>
no, just a patricia tree of integers
<thelema>
I don't get how memory is indexed, can you explain this?
<m4b>
thelema: that doesn't make any sense; the instructions update "arrays", i.e., arrays of program instructions; the entire thing holding all of these arrays is, in this case, a patricia tree of arrays
<thelema>
really? ok then, yes - a patricia tree of patricia trees
<thelema>
or maybe an array of patricia trees, depending on the indexes of the programs
<m4b>
updating a single value would require returning the whole object, correct?
<thelema>
yes, but only a small portion of the object would be modified; so the rest would be used unchanged
<thelema>
only the path to the modified value
<m4b>
hmmmm
<thelema>
better than copying the whole array
<malc__>
m4b: erm. do you realize that your array contains poitners to integers?
<malc__>
y;t;n
<m4b>
no, why does it contain pointers to integers?
<malc__>
because int array is not specialized
<thelema>
malc__: yes, because int32, don't worry about it.
<m4b>
what does "int array is not specialized" mean?
<malc__>
well, ocaml does special magic for double arrays
<malc__>
so they are just a contigous region of memory containing doubles
<m4b>
it's not an array of doubles; they're just arrays of ints
<malc__>
anything else is boxed
<thelema>
malc__: err, Int32 is boxed, int is unboxed.
djcoin has quit [Ping timeout: 248 seconds]
<malc__>
thelema: ints in array are boxed too
<thelema>
malc__: and looking again, there's no int32 here.
<thelema>
malc__: not at all.
<malc__>
orly
<m4b>
ok, so (1) do I want boxed or unboxed versions, (2) what should the type of array be of to get the desired boxed or unboxed?
<m4b>
thelema: correct, no int32
<malc__>
m4b: you want bigarrays really
myx has joined #ocaml
<m4b>
malc__: so if I change the arrays to big arrays, you are saying that the necessary array.copy will be ok, and caml_initialize won't be called a billion times?
<thelema>
malc__: no need if ints suffice, and bigarray won't solve copying problem
<m4b>
thelema: yes, that's what i thought
<thelema>
m4b: if you use an immutable structure like patricia trees for your arrays, then you won't have to copy the whole array to avoid changing the original
<m4b>
malc__: from documentation, big arrays are used for efficient sharing between c and fortran code; since my code is doing none of that, I didn't think necessary
<m4b>
thelema: it's worth a shot; however, would something like a map be more ideal in this case?
<thelema>
m4b: the patricia tree you're using is exactly a map
<malc__>
m4b: Bigarrays have blitting
<m4b>
thelema: I know, but balanced binary trees have log n lookup, insertion, and the patricia trees have linear in size of key, i believe?
<thelema>
m4b: linear in size of key is log n for compact keys
<thelema>
for keys 0..n-1
<m4b>
thelema: this is an extremely interesting discussion, unfortunately I have to leave for about 1 hour; I will be back, hopefully you
<m4b>
will be around
<osa1>
I have a pretty-printer written using Format module using mostly printf function, how can I print that to a string ?
<thelema>
osa1: val pp_set_formatter_output_functions : formatter -> (string -> int -> int -> unit) -> (unit -> unit) -> unit
<thelema>
or val str_formatter : formatter
<thelema>
A formatter to use with formatting functions below for output to the stdbuf string buffer. str_formatter is defined as formatter_of_buffer stdbuf.
<thelema>
yes, str_formatter is better
<thelema>
and then val flush_str_formatter : unit -> string
<osa1>
thelema: str_formatter is a formatter, to which function should I pass it to set it as buffer ?
m4b has quit [Ping timeout: 260 seconds]
<osa1>
ok
<osa1>
thelema: sorry I don't understand, do you have an example of str_formatter ?