<def-lkb>
you can restart the process, but merlin will cache all cmi files loaded, which is why the heap usage will grow
<flux>
all those libraries take 39 megabytes, not counting the separate stubs directory
<def-lkb>
until it reach a state where all cmi files are used are in memory
<flux>
maybe they take more memory when decoded to memory
<def-lkb>
core.cmi takes 18Mib on the disk, 240 once unpacked in memory (with 64bit representation)
<def-lkb>
miB*
<adrien>
flux: the html backend is probably in gtk+3 so no
<flux>
ok, so 10x the size is to be expected
<adrien>
but I don't think lablgtk would have to do anything particular for that
<flux>
adrien, right
<flux>
I guess I'll go forward with my isolation plans and then see how ocsigen makes this thing work
<def-lkb>
Yep, around that. I don't see how to workaround this memory consumption… Maybe with somethings like ancient to cache data on disk…
<flux>
def-lkb, I think it's not really a problem, but it is one of my bigger processes on my machine. well, on top #8 :)
<adrien>
def-lkb: (un)compress the data on-the-fly?
<adrien>
with some lzsomething
<flux>
it would probably give poorer performance and complicate the code for little benefit
<def-lkb>
adrien: to some extent, this is already happening (for path substitution)
<adrien>
='(
divyanshu has joined #ocaml
<def-lkb>
adrien: yeah… change the serialization format, use a fuse module to provide transparent decompression, mmap in ocaml process generating compatible representation
<adrien>
:P
<adrien>
at that rate, tell people to setup zram
<def-lkb>
yes, but sadly ocamlheap has to be traversed by the GC from time to time, this is not a sweet spot for zram
<def-lkb>
… that's why I was suggesting ancient, to put the data set outside the heap :P
claudiuc has joined #ocaml
<flux>
hmm, I wonder if it would be beneficial to tag pure data for GC
<flux>
wouldn't it allow avoiding GC for some branches of data then, if it already knows it's self-contained
<flux>
or perhaps searching for cliques would be a performance killer
<def-lkb>
I wonder too… But having to deal with such low-level considerations is not a good sign.
<def-lkb>
Actually in merlin case, it would be much easier if there was a way to have "lazy unmarshalling"
<ygrek>
GC cannot avoid some branches.. it has to mark _everything_ that is reachable
<def-lkb>
You won't improve GC performance, heap topology etc, but just fix the problem of paying only for what you use.
<flux>
so will GC be unworkable in scenarios where accessing some memory has a large cost, even if the app itself doesn't access the memory for a while?
<adrien>
def-lkb: merlin uses Marshal?
<def-lkb>
adrien: to read cmi
<flux>
I mean, there must be ways around that.. in OCaml it's Ancient, but it's quite explicit and error-prone, isn't it?
<adrien>
ah
<adrien>
Marshal is fairly bad imh
<adrien>
o
<adrien>
well, by today's standards that is
<flux>
json!
<adrien>
its compression step is very simple, not very efficient, and prevents proper compression with something else (since you cannot disable it)
<flux>
bson!
<def-lkb>
-> sharing lost
<adrien>
C³son
<def-lkb>
adrien: yet we observe a 10-fold in memory consumption when unpacking, so it's not really the problem
<flux>
def-lkb, it it because you lose sharing?
<flux>
but you regain some of that by string consin?
<def-lkb>
(though when loading core on a tuned compiler, 95% of the time is spent unmarshalling on C-side)
<adrien>
def-lkb: could be better :P
<def-lkb>
flux: json and bson would lose sharing, marshal preserves it
<flux>
right, if you don't abuse the format :)
<def-lkb>
:)
<flux>
{ "id" : "42", .. } and something like { "reuse_id" : "42"; .. }
<flux>
oops, slipped an ocamlmism there ;)
<def-lkb>
so about pure data GC… you will probably be interested by SCC, not cliques. this has a linear cost, an external heap could be dedicated for that purpose. then you do a topological ordering and ref counting on SCC: this way you don't need to traverse every branch, provided you have a way to directly traverse the DAG formed by SCC
<def-lkb>
(you'll probably want a special representation for "tree-like" parts, using some indexing to avoid marking every node)
<def-lkb>
flux: doesn't looks like compact serialization :)
maattdd has joined #ocaml
<companion_cube>
def-lkb: do .cmi share sub-modules signatures?
divyanshu has quit [Quit: Computer has gone to sleep.]
<companion_cube>
if a module signature is duplicated
<def-lkb>
companion_cube: not really
<companion_cube>
arf
divyanshu has joined #ocaml
<companion_cube>
it's time for module-alias... ^^
<def-lkb>
that's why there is work on module aliases now
<def-lkb>
yep :)
<companion_cube>
hope that will help merlin too
<def-lkb>
that will, for sure ;)
<companion_cube>
\o/
<companion_cube>
and it will reduce binaries' sizes, hopefully
<flux>
hmm, isn't the actual code still shared, though?
<flux>
and interfaces don't end up in the binaries in the first place?
Kakadu has joined #ocaml
<companion_cube>
the code is shared, but interfaces can take quite a lot of space
<companion_cube>
flux: they do (at least in libraries)
<def-lkb>
nested modules also complicate dead-code elimination
<def-lkb>
so you often end up paying in size for things you don't use at all
zpe has joined #ocaml
mika1 has joined #ocaml
paolooo has quit [Ping timeout: 245 seconds]
AltGr has joined #ocaml
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
Simn has joined #ocaml
<elfring>
Some systems provide a command like "cat" to display file contents. Would you like to suggest a portable way for such a task with OCaml?
<adrien_o1w>
if you have some heavy file manipulation stuff to do, look at ocaml-fileutils
adrien_o1w is now known as adrien_ow
adrien_ow is now known as adrien_oww
<gasche>
otherwise simply open_in, Buffer.add_channel in a loop, Buffer.contents
<adrien_oww>
no!!!!!
q66 has joined #ocaml
<adrien_oww>
val add_channel : t -> Pervasives.in_channel -> int -> unit
<adrien_oww>
and output_buffer
<adrien_oww>
and you'll eat memory
<gasche>
yeah, in fact add_channel is not the right function to use here
<gasche>
I thought the actual problem was to build the OCaml string, not just to print the content
Thooms has joined #ocaml
<gasche>
(because add_channel fails when less chars are available, it's better to use input + add_substring)
<companion_cube>
can't you just use a string as buffer and alternatively call "input" and "output" on the respective channels?
<adrien_oww>
gasche: you can get the length of the in_channel
<adrien_oww>
Pervasives.in_channel_length iirc
<companion_cube>
which reminds me of the ugly BatIO.in_channel_of_string
<companion_cube>
(ugly ugly ugly)
avsm has joined #ocaml
arjunguha has joined #ocaml
Vinnipeg has quit [Remote host closed the connection]
Axord has left #ocaml []
Axord has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
ontologiae has joined #ocaml
AltGr has left #ocaml []
dsheets has joined #ocaml
<ygrek>
Sys.command "cat"
michel_mno is now known as michel_mno_afk
<adrien_oww>
:)
michel_mno_afk is now known as michel_mno
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NoNNaN has quit [Ping timeout: 265 seconds]
Hannibal_Smith has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
ebzzry has joined #ocaml
siddharthv_away is now known as siddharthv
avsm has quit [Quit: Leaving.]
talzeus has quit [Remote host closed the connection]
ygrek has joined #ocaml
NoNNaN has joined #ocaml
Simn has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
ggole has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
zzing has joined #ocaml
Simn has joined #ocaml
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Thooms has quit [Ping timeout: 240 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
talzeus has joined #ocaml
arjunguha has joined #ocaml
talzeus_ has joined #ocaml
lunaryorn has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
talzeus has quit [Ping timeout: 265 seconds]
thomasga has joined #ocaml
jwatzman|work has joined #ocaml
ygrek has joined #ocaml
dsheets has quit [Excess Flood]
dsheets has joined #ocaml
justinfront has joined #ocaml
AltGr has joined #ocaml
divyanshu has joined #ocaml
lostcuaz has joined #ocaml
lostcuaz has quit [Client Quit]
<justinfront>
if I want to learn Ocaml and I learn practically best when working with graphics as it inspires me more would you advise this link ? http://caml.inria.fr/pub/docs/oreilly-book/pdf/chap5.pdf I have just been reading Ocaml from the very beginning and I did try modifying someone elses code but really I am a complete newbie with Ocaml. Or is there a better way to create graphics with Ocaml?
<justinfront>
Oh that uses X11 which I don't like using when on a mac :(
<justinfront>
well I am guessing it does.
<Kakadu>
You can try to OCamlSDL
<knz>
hi all
<adrien>
justinfront: you can safely start with Graphics and X11 for now; there are other libraries you can use once you know more about ocaml
jwatzman|work has quit [Quit: jwatzman|work]
ontologiae has joined #ocaml
<justinfront>
my mac is quite old X11 really is not good. I am from flash/haxe background. Suspect SDL would be quite a bit of work?
<justinfront>
hate using X11 apps on mac, I don't feel it's a good approach to graphics.
<smondet>
justinfront: LablGL comes with Glut bindings, I remember using that when I had a mac
<justinfront>
that's what ocamleditor uses but I did not work out how to get that to make. Maybe LablGL is a good approach if I can get it to run.
jwatzman|work has joined #ocaml
<justinfront>
or was it another one?
RMacy has joined #ocaml
<justinfront>
ah it was this one LablGtk-2.16.0
<justinfront>
how would that compare to LablGL
<smondet>
LablGL are open GL bindings
<smondet>
LablGTK are GTK bindings
<smondet>
the name "labl" is historical
darkf has quit [Quit: Leaving]
<smondet>
I don't know the status of GTK itself on MacOSX
divyanshu has quit [Quit: Computer has gone to sleep.]
divyanshu has joined #ocaml
siddharthv is now known as siddharthv_away
paolooo has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
siddharthv_away is now known as siddharthv
arjunguha has joined #ocaml
RMacy is now known as RMacy|Away
RMacy|Away has quit []
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nlucaroni has joined #ocaml
arjunguha has joined #ocaml
mmachenry has quit [Quit: Leaving.]
<adrien_oww>
gasche: about the thread on the beginners list, tell the poster to send again to the caml-list and to include a full log of configure + build
<adrien_oww>
maybe as a file hosted somewhere else if it is large
mmachenry has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
mmachenry has quit [Client Quit]
mmachenry has joined #ocaml
RMacy has joined #ocaml
<gasche>
adrien_oww: done
willb1 has quit [Read error: Operation timed out]
araujo has quit [Ping timeout: 255 seconds]
aurynj has joined #ocaml
RMacy is now known as RMacy|Away
siddharthv is now known as siddharthv_away
RMacy|Away has quit []
willb1 has joined #ocaml
mika1 has quit [Quit: Leaving.]
lunaryorn has quit []
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
divyanshu has joined #ocaml
RMacy has joined #ocaml
xianxu has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
angerman has quit [Quit: Gone]
mmachenry has quit [Quit: Leaving.]
shinnya has joined #ocaml
divyanshu has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
mmachenry has joined #ocaml
RMacy is now known as RMacy|Away
RMacy|Away is now known as RMacy
RMacy has quit []
nikki93 has joined #ocaml
wwilly_ has quit [Quit: Ex-Chat]
cdruzac has joined #ocaml
<knz>
hi guys
<knz>
trying to define functors over parametric types
<knz>
I have a module type T = sig type 'a t; val f : 'a -> 'a t end
nikki93 has quit [Remote host closed the connection]
siddharthv_away is now known as siddharthv
siddharthv is now known as siddharthv_away
mmachenry has quit [Quit: Leaving.]
jbrown has joined #ocaml
zzing has quit [Ping timeout: 265 seconds]
avsm has quit [Quit: Leaving.]
yacks has quit [Quit: Leaving]
manizzle has joined #ocaml
zzing has joined #ocaml
Kakadu has joined #ocaml
nikki93 has joined #ocaml
paolooo has joined #ocaml
oriba has joined #ocaml
q66 has quit [Quit: Leaving]
q66 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
asmanur has quit [Ping timeout: 265 seconds]
<oriba>
how to use cookies with OCamlnet? I have a post-request and get back a reidrect, and somehow a cookie is used. Any ideas? Example code?
asmanur has joined #ocaml
AltGr has left #ocaml []
avsm has joined #ocaml
nikki93 has joined #ocaml
claudiuc_ has joined #ocaml
paolooo has quit [Ping timeout: 245 seconds]
jbrown has quit [Remote host closed the connection]
claudiuc has quit [Ping timeout: 265 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
mmachenry has joined #ocaml
SneakerXZ has joined #ocaml
<SneakerXZ>
How does F# comapre to OCaml? Just .NET runtime?
<Kakadu>
SneakerXZ: not only
<Kakadu>
SneakerXZ: It can be long holy war topic
<mrvn>
SneakerXZ: green
<SneakerXZ>
Kakadu: I don't want to fight, I just want to know facts.
<Kakadu>
F# has different object model because it's difficult to implement amazing OCaml object in .NET
<Kakadu>
OCaml objects model*
<mrvn>
I think f# only does speculative garbage collection and has a stop-the-world GC.
<Kakadu>
F# uses generics when OCaml uses functors
<SneakerXZ>
Kakadu: Ok, nice. That what I wanted to hear.
<Kakadu>
because of .NET F# has reflection out of box
<SneakerXZ>
If I want to learn OCaml, where should I start?
<dsheets>
ocaml has something like generics in parametric polymorphism
<Drup>
F# is in pratice unusable in non-windows environment.
<mrvn>
.oO(At the begining :)
<Kakadu>
SneakerXZ: tutorial on ocaml.org
<SneakerXZ>
Kakadu: And after that? It won't cover everything.
<Drup>
(because mono is crap)
<SneakerXZ>
or will it?
avsm has quit [Quit: Leaving.]
<mrvn>
SneakerXZ: then you come back
<Kakadu>
SneakerXZ: Real World OCaml book
<Kakadu>
SneakerXZ: and of course reading tutorials on one thread and writing some code in another :)
<SneakerXZ>
mrvn: Hehe, ok.
<mrvn>
SneakerXZ: implement tic-tac-toe, list sorting, a red-back tree and a few other examples and then you will know what to ask for next.
<cdruzac>
SneakerXZ: If you're new to functional programming, I'd suggest you work through the 99 problems
<SneakerXZ>
Ok, I have still two questions. Is OCaml suitable for web development? Is there IDE or anything like that with type checking and completion?
<oriba>
SneakerXZ, OCaml-ORA-Book and Jason Hickey's Book on OCaml.
<SneakerXZ>
cdruzac: I know Scala, but what is 99 problems?
<Kakadu>
SneakerXZ: Or you can implement project which you want very much but is postponed by you long time
<cdruzac>
SneakerXZ: err... Scala lets you do whatever you want, that doesn't really tell us how comfortable you are with functional programming
<cdruzac>
at least, I saw someone write basically crummy Java in Scala...
<SneakerXZ>
cdruzac: Well, I haven't tried to use it as another Java but actually use functional things from Scala
<SneakerXZ>
not everything but something
<SneakerXZ>
but anyway back to my last question, is OCaml suitable for web development? Is there IDE or anything like that with type checking and completion?
<cdruzac>
ok fair enough. The 99 problems might be too basic then, but I found it helpful when I learned functional programming
<Drup>
to pick a nice analogy
<Drup>
SneakerXZ: what you said is just like saying "I know some french, there is lot's of french word in english and I know english well"
<Kakadu>
SneakerXZ: Ocsigen is best web framework I have ever seen
<Drup>
:]
<Drup>
SneakerXZ: on the IDE side, look for merlin
dsheets has quit [Ping timeout: 240 seconds]
<SneakerXZ>
ok, thanks
ygrek has quit [Ping timeout: 246 seconds]
<mk270>
sneakerxz: depends what sort of web development - do you mean server-side, interfacing with databases and talking http?
mmachenry has quit [Quit: Leaving.]
<SneakerXZ>
mk270: web applications, web pages
<Drup>
mk270: you can do both in ocaml anyway :)
<mk270>
drup: oh i know :)
<mk270>
drup: i wrote a mongrel2 backend in ocaml - it was fine
<mk270>
sneakerxz: yes, i think there's some html generation stuff in mirage too
ia0 has quit [Remote host closed the connection]
<mk270>
at any rate, there are things that that some of these frameworks do that i just don't want them to do (like syntax extensions that know about xml)
<Drup>
no html generator in mirage afaik
<Drup>
just convenient syntax extensions
<mk270>
drup: ok - i was thinking of cohttp or something
<Drup>
cohttp is just a library to talk http
<mk270>
drup: i'll stick with the inconvenience, thanks
<mk270>
cow? I honestly can't remember
<Drup>
cow is a set of preprocessor
ia0 has joined #ocaml
<Drup>
which I classify as "convenient syntax extensions"
<mk270>
yes
<Drup>
nothing fancy with the type system, as tyxml
<mk270>
we're not pretending to agree about "convenient" :)
<Drup>
mk270: ok, that's indeed arguable :D
zzing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mmachenry has joined #ocaml
ggole has quit []
<mk270>
SneakerXZ: would be interesting to see the writeup of anything you thought was missing from ocaml's www dev support
<SneakerXZ>
mk270: Well, I don't know OCaml so it is hard for me to write such as writeup
<Drup>
you will :p
<mk270>
ah ok :)
<mk270>
what sort of stuff are you looking for?
<mk270>
the thing that bit me most recently was XPath support
<SneakerXZ>
mk270: In case of web development I don't have anything specific. I also would like to write my language for education reasons (to learn write entire compiler) so I am looking for languages that I could use for that. And today Facebook released their programming language Hack and it has compiler written in OCaml so it is why it got my interest.
<jwatzman|work>
SneakerXZ: slight nit (I work on Hack :)) -- the OCaml bit is just a static typechecker. The runtime for Hack is our HHVM runtime, which is written in C++
<SneakerXZ>
jwatzman|work: I don't want to write runtime that would be just too much work. :-) Compiler is enough.
<SneakerXZ>
jwatzman|work: But I really like thing you build at Facebook, I guess I will try apply there soon.
xianxu has quit [Quit: leaving]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
claudiuc_ has quit [Ping timeout: 240 seconds]
michel_mno is now known as michel_mno_afk
zzing has joined #ocaml
lostcuaz has quit [Ping timeout: 245 seconds]
lostcuaz has joined #ocaml
dsheets has joined #ocaml
nikki93 has quit [Remote host closed the connection]
jonludlam has joined #ocaml
claudiuc has joined #ocaml
RMacy has joined #ocaml
avsm has joined #ocaml
mmachenry has quit [Quit: Leaving.]
mmachenry has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
claudiuc_ has joined #ocaml
tnguyen has quit [Ping timeout: 255 seconds]
michael_lee has quit [Quit: Ex-Chat]
claudiuc has quit [Ping timeout: 245 seconds]
demonimin has quit [Ping timeout: 240 seconds]
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #ocaml
tnguyen has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
rand000 has joined #ocaml
jbrown has joined #ocaml
nikki93 has joined #ocaml
oriba has quit [Quit: Verlassend]
ollehar1 has joined #ocaml
ollehar1 has quit [Client Quit]
RMacy is now known as RMacy|Away
RMacy|Away has quit []
ulfdoz has joined #ocaml
_andre has quit [Quit: leaving]
Simn has quit [Ping timeout: 246 seconds]
Simn has joined #ocaml
nikki93 has quit [Remote host closed the connection]
jl2 has joined #ocaml
nikki93 has joined #ocaml
cdruzac has quit [Quit: Leaving]
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
shinnya has joined #ocaml
jl2 has quit [Quit: Leaving]
jlarocco has joined #ocaml
zpe has joined #ocaml
justinfront has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 240 seconds]
axiles has quit [Remote host closed the connection]
thomasga has joined #ocaml
avsm has joined #ocaml
venk has quit [Read error: Connection reset by peer]
venk has joined #ocaml
mmachenry has quit [Quit: Leaving.]
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
avsm has quit [Ping timeout: 240 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
jwatzman|work has joined #ocaml
nlucaroni has quit [Quit: leaving]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
Hannibal_Smith has joined #ocaml
RMacy has joined #ocaml
Simn has quit [Quit: Leaving]
RMacy has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has quit [Ping timeout: 240 seconds]
Kakadu has quit [Quit: Konversation terminated!]
rand000 has quit [Quit: leaving]
SneakerXZ has quit [Quit: SneakerXZ]
nikki93 has joined #ocaml
jbrown has quit [Remote host closed the connection]
jwatzman|work has quit [Read error: Connection reset by peer]
jwatzman|wor has joined #ocaml
BiDOrD has quit []
BiDOrD has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
thomasga has joined #ocaml
IbnFirnas_ has quit [Read error: Connection reset by peer]