<EliasAmaral>
I think I need a C library :( (But I am not sure)
<Camarade_Tux>
but I thought there was a more recent release of cothreads
<EliasAmaral>
Is this library compatible with Event?
fx_ has quit [Read error: 60 (Operation timed out)]
Associat0r has joined #ocaml
tmaedaZ has quit [Read error: 60 (Operation timed out)]
fx_ has joined #ocaml
<mfp>
EliasAmaral: IIRC cothreads subsumes Event and related modules
tmaedaZ has joined #ocaml
<mfp>
it featured 3(?) engines: Thread, process-based and network
<mfp>
also some STM stuff
<mfp>
it's a pity the site is down
<EliasAmaral>
hm.
_zack has quit ["Leaving."]
<EliasAmaral>
they provide their own Event?
<EliasAmaral>
or they are meant to replace, but with another interface}
<mfp>
I think its own, with binary compatibility between the 3 engines, so you could pick one at link time
<mfp>
"coThreads implements the same API of the standard Threads library as different execution engines (process, netwoker(TODO)), so that a single copy of source code can be compiled and deployed to different environments without modification"
<mfp>
" coThreads is also a super set of the standard Threads library, with extra components (STM etc.), functions (spawn etc.), and features (object-level compatibility etc.)"
<Camarade_Tux>
nah, it's nice to have a smaller avg than min :P
<EliasAmaral>
CL-STM is currently being developed by Hoan Ton-That for the Google Summer of Code 2006. > I fear when I hear this, because we are in 2009
tmaedaZ is now known as tmaeda
<mfp>
with concurrent GCs being so hard to implement, maybe we should focus on code mobility to make message passing + distributed programming easier
<mfp>
following the Erlang route
<EliasAmaral>
message passing is expensive
<EliasAmaral>
it is getting cheaper, but in some areas is still too expensive
<EliasAmaral>
mfp, I think CML have a concurrent GC
<mfp>
EliasAmaral: how well does it scale? how good is the single-core throughput?
<EliasAmaral>
i dunno
<EliasAmaral>
maybe it should be the case of having two gcs
<EliasAmaral>
doing the switch ar compile time
<EliasAmaral>
it that's the problem
<mfp>
remember Doligez & Leroy did write a concurrent GC for Caml Special Light back in the 90s, and they're saying it's too complex ("despite a machine-checked correctness proof") & doesn't scale
<EliasAmaral>
hmm
<mrvn>
EliasAmaral: The hart part then is to detect when some data is shared with other cores.
<EliasAmaral>
why not assume that all data is shared?
<mrvn>
EliasAmaral: And you should switch at runtime or dynamic link time like Linux now does in the kernel.
<mrvn>
EliasAmaral: If all data is shared then no single GC can say when data is unreachable.
<EliasAmaral>
hmmmm.
<mrvn>
EliasAmaral: The speed gain would be if a thread allocates some data, uses it a bit, forgets it and then the GC for that thread can free it without the need to communicate with other GCs.
<EliasAmaral>
why not make a per-thread reference count?
<EliasAmaral>
or make all existing mechanisms to be per-thread
<mrvn>
EliasAmaral: And have 1024 counters for a single float?
<EliasAmaral>
mrvn, oh, it would need to have a gc per core?
<EliasAmaral>
nobody have 1024 cores
<EliasAmaral>
... well
<mrvn>
EliasAmaral: there were such systems in the past and just wait a while.
<mrvn>
Also when do you increase the thread counter? You need to catch when data crosses threads then.
<EliasAmaral>
mrvn, i thought that the interesting part of multi-core is that you can do deallocation in a core
<EliasAmaral>
and use the others to run the program
<mrvn>
EliasAmaral: I don't think that will perform well. While the GC runs the other thread could move pointers around without the GC seeing it. So you would need to write protect pages the GC has already looked at for all cores.
<EliasAmaral>
you would need to protect the pages gc will free, and pages that point to it
<mrvn>
No, every page that contains a mutable pointer. And since the GC doesn't know which do it has to protect all.
<mrvn>
You could probably stop the world and then run bits of the GC on every core, each covering a different minor heap and use IPC to communicate where pointers cross between heaps.
<mrvn>
All the temporary data of threads would be local to the threads heap and no IPC would be needed. Only when data is shared IPC would occur. So you wouldn't loose too much for that overhead.
bluestorm has joined #ocaml
_zack has joined #ocaml
<EliasAmaral>
mrvn, that's when explicit allocation wins
<EliasAmaral>
but it's harder to prove that it doesn't have a bug
<mrvn>
EliasAmaral: Or carefull planning.
<mrvn>
Generally I don't think you can construct a case where (valid) explicit allocation is ever slower. It just is damn complicated to do right.
<EliasAmaral>
maybe the problem is that GCs are too general. maybe a GC that don't works with everything can perform well in a multi-core environment
<orbitz>
mrvn: deepnds on how far away from C it actually is
<mrvn>
orbitz: that would still require a C-to-Cyclone compiler.
<EliasAmaral>
Polymorphism replaces some uses of void *
<mrvn>
orbitz: But Cyclone goes in the right direction. Just I want to make the changes automatically that Cyclone provides manually.
<orbitz>
mrvn: not if C is a proper subset of Cyclone
<EliasAmaral>
it is not, orbitz. there is restrictions on pointer arithmetic
<EliasAmaral>
eg. if you want pointer arithmetic, you have to reclare it as int? instead of int*
<mrvn>
For example Cyclone has fat pointers (pointer with bounds check). But C specs specifically say a pointer is only valid in the allocated region. So making every pointer fat in the compiler is perfectly legal. Compilers just don't do it for speed reasons.
<EliasAmaral>
it seems like a very interesting language. anyone here heard of/likes bitC?
<orbitz>
BitC is dead from what i know
<EliasAmaral>
dead? really? i though it was a wonderful project when i saw it. :(
<orbitz>
being a wonderful project doesn't make it actively developed
<bluestorm>
the main guy behind BitC accepted a job at Microsoft
<bluestorm>
wich specifically asked him to stop working on it
<EliasAmaral>
.... o.o
<EliasAmaral>
how sinister
<bluestorm>
well, MS is doing lots of things in the "next-gen OS" space these days
<bluestorm>
and they have an active research around this
<EliasAmaral>
why a formally-specified low level programming language would hurt microsoft?
<mrvn>
If you can beat the competition then buy them.
<EliasAmaral>
that's because it is open source?
<bluestorm>
Singularity, blah blah
<bluestorm>
EliasAmaral: they're working on the same kind of things
munga has quit [Read error: 60 (Operation timed out)]
<EliasAmaral>
I would love to use a formally-defined kernel
<bluestorm>
so I suppose there were interested in Shapiro's expertise
<EliasAmaral>
it's just that someone have to make it easier to program and faster to run
<EliasAmaral>
something I think I know: a formal specification means nothing without a source code to check
<EliasAmaral>
.. right?
<bluestorm>
hm
<bluestorm>
it's a bit more complicated than the "formal specficitation + informal implementation" dichotomy
<bluestorm>
eg. in some cases you can extract the program from the specification/proofs
<EliasAmaral>
yeah, but you can do this in an efficient way?
<EliasAmaral>
and, if you can extract the program from the specification, the specification itself is the source code.
<bluestorm>
that's a research topic
<EliasAmaral>
it's just that the programming language is now specification-based
<bluestorm>
the answer being "we try to, but it's not easy"
<EliasAmaral>
bluestorm, I mean: microsoft of course wants to hide the code. but, if we talk about specifications, they can't hide it if they want to prove the program is mathematically correct
<bluestorm>
i'm not exactly sure microsoft really want to hide the code
<bluestorm>
they've done it in the past
<EliasAmaral>
unless they can prove the binary is correct without saying how it was produced, this worries me (but at least it's an improvement: with a formal specification one can implement a perfect equivalent)
<bluestorm>
but they might publish the source of their Microkernel if they don't see any disadvantage to it
<bluestorm>
actually, Singularity source code has been released in the past
<bluestorm>
(not under a free software licence, but nonetheless)
<bluestorm>
and Apple also relase source code of it's core kernel and system
<EliasAmaral>
but then they lose that holy grail of "we have the sole implementation of the relevant api". maybe this is the sign that the web already won?
<bluestorm>
hm
<bluestorm>
this is just the kernel
<EliasAmaral>
if this is true, i am just glad chromium is open source. i do not care that chrome have spyware etc, if i can run without
<EliasAmaral>
bluestorm, they should want to protect their userland api too
<bluestorm>
they could still hide the source of further frameworks (around .NET for example)
<EliasAmaral>
to verify a userland library should be easier
<bluestorm>
hm
<bluestorm>
I don't think they are planning to build the whole OS with included precise formal verification
<bluestorm>
they're interested in veryfing the kernel, because it's not-too-big and quite critical
<bluestorm>
but you shouldn't expect a formally specified GUI framework anytime soon, imho
<EliasAmaral>
what about verifying the hardware drivers? a lot of them are based on hardware specs
<EliasAmaral>
bluestorm, yeah. but i would love it nonetheless:)
<Camarade_Tux>
me to deliver again my standard lecture on this topic.
<Camarade_Tux>
bah, \n-fail
Modius has quit [Read error: 60 (Operation timed out)]
ubuntu_ has joined #ocaml
EliasAmaral has quit [Nick collision from services.]
ubuntu_ is now known as EliasAmaral
ViciousPlant has joined #ocaml
Alpounet has quit ["``Do what you think you can't do.'' -- E. Roosevelt"]
Pimm has quit [Read error: 110 (Connection timed out)]
ikaros has quit ["Leave the magic to Houdini"]
_unK has joined #ocaml
ViciousPlant has quit [Read error: 60 (Operation timed out)]
joewilliams has joined #ocaml
<maskd>
that message is depressing
<maskd>
Shared-memory multiprocessors have never really "taken off", at least in the general public.
<maskd>
what would he say today?
EliasAmaral has quit [Remote closed the connection]
<Camarade_Tux>
that my Phenom II X4 prefers multi-processing to multi-threading?
<bluestorm>
maskd: I suppose OCaml maintainers don't have much time to work on multi-processing
<bluestorm>
there are others people working on it (eg. Ocamlm4MultiCore), but progress is slow due to lack of workforce
<maskd>
oc4mc seems promising
<maskd>
but something in mainline would be better
_andre has quit ["leaving"]
_andre has joined #ocaml
Pimm has joined #ocaml
Alpounet has joined #ocaml
caligula_ has joined #ocaml
fx_ has quit [Read error: 60 (Operation timed out)]
caligula__ has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
<palomer>
camlp4 is extremely nice
<thelema>
I'll have to take your word for it.
<bluestorm>
palomer: and you're motivated enough to write a good up-to-date documentation ?
<bluestorm>
(its not so difficult, you only have to adapt the pre 3.10 documentation for a beginning)
* thelema
just wrote PMap.pop
Snark has joined #ocaml
<palomer>
I don't understand the nitty gritty of it
<palomer>
it would be a good exercise though
<palomer>
I don't even understand ocaml to my satisfaction
<thelema>
should PMap.pop return ((key,value),map) or (key, value, map)?
ikaros has joined #ocaml
<palomer>
I'd go with ((key,value),map)
<palomer>
for no particular reason though
<thelema>
yeah, it's totally a style thing, I think
<Camarade_Tux>
key, value, map, takes less memory and allocates less
<thelema>
yes, I know, but you might want the pair of k,v to do something with
<thelema>
although I'll admit that most functions are curried relative to k,v
<thelema>
so you'd have to separate them
<thelema>
(k,v),m matches the semantics of maps as sets of pairs
Tianon has joined #ocaml
<Camarade_Tux>
(otoh I don't know if you want to pop a million of times per second)
ikaros has quit [farmer.freenode.net irc.freenode.net]
Amorphous has quit [farmer.freenode.net irc.freenode.net]
acatout_ has quit [farmer.freenode.net irc.freenode.net]
<thelema>
It's an alternative way to iterate through a map, especially if you might stop in the middle
<thelema>
and need the remaining map for something else
<Camarade_Tux>
yeah, true
<thelema>
My most common use case for pop would be getting some sort of loop started - you do it once to initialize things, and then you use some other iterator to go through the rest
ikaros has joined #ocaml
Amorphous has joined #ocaml
acatout_ has joined #ocaml
Jan_Flanders has joined #ocaml
bacam has quit [Read error: 113 (No route to host)]
Pepe_ has quit [farmer.freenode.net irc.freenode.net]
smimram has quit [farmer.freenode.net irc.freenode.net]
palomer has quit [farmer.freenode.net irc.freenode.net]
infoe_ has quit [farmer.freenode.net irc.freenode.net]
Camarade_Tux has quit [farmer.freenode.net irc.freenode.net]
Boney has quit [farmer.freenode.net irc.freenode.net]
jimmyb2187 has quit [farmer.freenode.net irc.freenode.net]
gildor has quit [farmer.freenode.net irc.freenode.net]
safire_ has quit [farmer.freenode.net irc.freenode.net]
Tianon has quit [farmer.freenode.net irc.freenode.net]
diml has quit [farmer.freenode.net irc.freenode.net]
willb has quit [farmer.freenode.net irc.freenode.net]
Pepe_ has joined #ocaml
Tianon has joined #ocaml
smimram has joined #ocaml
palomer has joined #ocaml
infoe_ has joined #ocaml
Camarade_Tux has joined #ocaml
Boney has joined #ocaml
jimmyb2187 has joined #ocaml
gildor has joined #ocaml
safire_ has joined #ocaml
willb has joined #ocaml
diml has joined #ocaml
jimmyb2187 has left #ocaml []
jimmyb2187 has joined #ocaml
spicey has joined #ocaml
<palomer>
hmmm
<palomer>
I'm using camlp4 to associate every type to a unique integer
<palomer>
the problem is that the reference counter will reset after every source file
<palomer>
how do I fix this?
<palomer>
nevermind, I'll just add a call to generate_unique_id to the source file
<spicey>
I'm slightly confused with ocaml packaging. I'm trying to install lwt under arch linux, and it wishes for a react library (ocamlfind ocamldep -package react fails). react from darcs builds nicely and drops itself under /usr/lib/ocaml/react, yet lwt is still dissatisfied, and I'm scratching my head what does it want - some ocamlfind magic maybe?
<mfp>
spicey: is react included in ocamlfind list after installing it?
<mfp>
(... 's output)
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]
<spicey>
no. and, judging from its build script, it doesn't care about ocamlfind at all
<spicey>
aha, ocamlfind install react META in its folder does the trick
<mfp>
you have to install the cmi, cmxa, etc. too
<spicey>
Those files are mentioned in META, aren't they understood automagically?
<mfp>
nope
<palomer>
how do you do the prototypical "all positive numbers" infinite list in ocaml?
<mfp>
spicey: META only indicates which options to pass to ocamlc/opt depending on the active predicates
<spicey>
mfp, "ocamlfind install react react.cmi" -> ocamlfind: The META file is missing. it looks like it wants only META?
diml has quit [farmer.freenode.net irc.freenode.net]
safire_ has quit [farmer.freenode.net irc.freenode.net]
gildor has quit [farmer.freenode.net irc.freenode.net]
palomer has quit [farmer.freenode.net irc.freenode.net]
smimram has quit [farmer.freenode.net irc.freenode.net]
Boney has quit [farmer.freenode.net irc.freenode.net]
Camarade_Tux has quit [farmer.freenode.net irc.freenode.net]
infoe_ has quit [farmer.freenode.net irc.freenode.net]
willb has quit [farmer.freenode.net irc.freenode.net]
<spicey>
so, the whole point of "ocamlfind install" is just to make a folder under site-lib and copy files there?
<mfp>
yes. It also rewrites some stuff in the META and registers the DLLs if needed.
Smerdyakov has joined #ocaml
<mfp>
s/yes/essentially/
_andre has quit ["Lost terminal"]
Camarade_Tux has joined #ocaml
Amorphous has quit [Read error: 113 (No route to host)]
<mrvn>
re
<Jan_Flanders>
Hi, I'm trying to make a minor adjustment to an existing ocaml source file. Someone in another channel gave me a line to make the adjustment but the compiler says: 'syntax error'. :S
<Jan_Flanders>
This is the offending line : let table = match read_byte ch with 0x89 -> nread 7; "" | 0x47 -> nread 5; "" | 0xFF -> parse_jpg_table ch
<orbitz>
lien 20 does not appear in the orignal file you gave
det__ has quit [Read error: 110 (Connection timed out)]
<spicey>
mfp, trying to use something from lwt in toplevel (namely I wanted just to get to try calling Lwt_unix.sleep), I hit the wall: http://codepad.org/fQZMlBU0 am I doing something completely wrong, or is this because I'm trying to use darcs-version, or something else altogether?
<orbitz>
it is pare of parse_tag
<orbitz>
not parse_jpg_table
<mfp>
spicey: #require "lwt.unix";;
ygrek has joined #ocaml
<orbitz>
Jan_Flanders: oh, i see what you are tryign to show
<Jan_Flanders>
ok good, as it is really in the original. :)
<Jan_Flanders>
I can pastebin the original if you like so we have linenumbers with it
det has joined #ocaml
<Jan_Flanders>
but no syntax colouring as it will take ages
<spicey>
mfp, very nice, thank you (I've never used topfind before)
<Jan_Flanders>
Ah ok. Another thing I noticed as well is that all the other nread's have the ch as well likelet data = nread ch (len - 2) in , while the lines I have say: nread 7
TaXules has quit [Read error: 60 (Operation timed out)]
<orbitz>
you probably need it too then
<Jan_Flanders>
| 0x47 -> (nread ch 5; "") should I put in after each line or is one at the end enough?
<orbitz>
you need to surround each nread with a let _ = nread .. in "" prob easiet way
<orbitz>
i forget if there is an easy way to through out data form a non ()
<Jan_Flanders>
| 0x47 -> (let_ = nread ch 5; "")
<Jan_Flanders>
like that? :s
<Jan_Flanders>
_ means 'don't care'?
<orbitz>
0x47 -> let _ = nread ch 5 in ""
<Jan_Flanders>
ok thnx I'll try
<Jan_Flanders>
File "swfParser.ml", line 1188, characters 15-145: Warning: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: 0
<Jan_Flanders>
let table = match read_byte ch with
<Jan_Flanders>
Just ignore the warning?
slash_ has joined #ocaml
<orbitz>
what do you want to do in the case of another value?
<orbitz>
if so, handle it
<Jan_Flanders>
in the case of another value it should fail
det has joined #ocaml
<orbitz>
Jan_Flanders: then at end | _ -> raise (Failure "ZOMG I DUNNO WTF JUST HAPPEND")
<Jan_Flanders>
maybe it's easier to change the parse_jpg_table function itself?
<orbitz>
what?
<orbitz>
you just need to move the 'in' to the end..
<Jan_Flanders>
ah ok
TaXules has joined #ocaml
<Tianon>
orbitz: regarding throwing out data from a non-unit, just use ignore: ignore ("anything") or ignore (some_function "") -- ignore will return unit
<Jan_Flanders>
it compiles without warnings or errors but the changes apparently break other stuff.
<orbitz>
ah ok
_unK has quit [Remote closed the connection]
<Tianon>
I'm pretty new to OCaml myself, but that's one I know :)
<Jan_Flanders>
Thanks for helping orbitz, but I guess this is a too complicated script
Deformative has quit [Read error: 60 (Operation timed out)]
Alpounet has quit [Read error: 60 (Operation timed out)]
Alpounet has joined #ocaml
<rwmjones>
Jan_Flanders, are you using an editor which understands ocaml, indentation etc? it really helps when writing code ...
<palomer>
emacs!
<rwmjones>
for example, it looks like you're missing a close paren at the end
<rwmjones>
well indeed, emacs + tuareg mode is great
<Jan_Flanders>
no I'm not unfortunately. I was only changing 1 line of code anyway
<Jan_Flanders>
I do use eclipse for java, flashdevelop for actionscript etc. I just use notepad++ for Ocaml
<Jan_Flanders>
But all the Ocaml looks like Chinese to me, I have absolutely not a single clue what it all does. I had hoped I would be able to change just 1 line of code, but even that seems like quite a feat.
<Jan_Flanders>
I code in several others languages but none of them are functional and none have a syntax even near what Ocaml has
<mrvn>
Jan_Flanders: ocaml is functional and use type inference. That usualy means you spend 50% of your time writing code, 50% fixing compiler/type errors and then 10% to fix bugs in your algorithm.
<Jan_Flanders>
I mostly code in haXe which has type inference as well. It's a nice thing when writing code, but when working with someone else it's a pita as you don't know any of the datatypes
<Jan_Flanders>
I usually put in some error just to get a compiler error telling me what datatype it expects
<Jan_Flanders>
orbitz thanks for all the help and effort. :)
<palomer>
I sometimes most of the posts on caml-list come from jon harrop using different names
ygrek has quit [Remote closed the connection]
<palomer>
sometimes think
<Jan_Flanders>
bbl my stomach and brain needs food.
<palomer>
anyone know how to package my ocaml library in a deb?
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
<mrvn>
palomer: take an existing ocaml lib package, rename and edit
valross has joined #ocaml
Snark has quit ["Ex-Chat"]
<palomer>
mrvn, that's what I was thinking
<palomer>
but that involves getting the files in the deb
<mfp>
palomer: nope, you have to take the *source* package