alexyk has quit [Read error: Connection reset by peer]
philtor has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
ymasory has joined #ocaml
papers has quit [Ping timeout: 246 seconds]
alexyk has joined #ocaml
tauntaun has quit [Ping timeout: 240 seconds]
arubin has joined #ocaml
tauntaun has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
myu2 has quit [Remote host closed the connection]
alexyk has quit [Read error: Connection reset by peer]
surikator has joined #ocaml
alexyk has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
<surikator>
hi! anyone versed in JoCaml? I'm trying to generalize the lock defined in the manual to a more general one which can be labelled by strings, so that I could write lock("foo") and lock("bar") and use these as two different locks, but I'm not getting there.
alexyk has quit [Read error: Connection reset by peer]
korya has quit [Quit: Leaving]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
joewilliams is now known as joewilliams_away
lopexx has joined #ocaml
lopex has quit [Ping timeout: 255 seconds]
mehdid has quit [Read error: Operation timed out]
mehdid has joined #ocaml
ymasory has quit [Quit: Leaving]
dnolen has joined #ocaml
myu2 has joined #ocaml
smerz has quit [Quit: Ex-Chat]
arubin has quit [Quit: arubin]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
raphss has joined #ocaml
<raphss>
hi, i need help setting up ocaml on windows
<raphss>
is there anyone with some experience willing to help?
surikator has quit [Quit: surikator]
surikator has joined #ocaml
explodus has quit [Ping timeout: 276 seconds]
fabjan has joined #ocaml
<wchicken3>
is there an equivalent to a symbol in ocaml?
<wchicken3>
like ruby or lisp symbols
lopexx has quit [Ping timeout: 246 seconds]
raphss has quit [Quit: Page closed]
<flux>
wchicken3, the closes might be polymorphic variant, ie. `symbol. although typically plain variants are used for similar purposes.
<wchicken3>
flux: ok, I'll look into that. I'm still a novice with the type system (which I realize is the heart of ML in general)
dnolen has quit [Quit: dnolen]
explodus has joined #ocaml
<flux>
wchicken3, btw, polymorphic variants are an ocaml feature, so in general symbolic manipulation is done with variants in ML-family languages
explodus has quit [Ping timeout: 276 seconds]
vivanov has joined #ocaml
Yoric has joined #ocaml
ulfdoz has joined #ocaml
ikaros has joined #ocaml
philtor has quit [Ping timeout: 246 seconds]
ygrek has joined #ocaml
Cyanure has joined #ocaml
Vinnipeg has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
Yoric has quit [Client Quit]
vivanov has quit [Ping timeout: 255 seconds]
vivanov has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
<vivanov>
i have several threads accessing one mutable variable (a hash table). the 1st thread is changing the variable (adding,replacing entries) and the other threads are only reading the values (find entries). can anything bad happen here - for example, the first thread just started to write and if other attempt to read will there be an error? or if all attempt to read at once -- will there be an error? do i need to use lock and sync the two threads?
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
Vinnipeg has quit [Remote host closed the connection]
mariolone has joined #ocaml
mariolone has left #ocaml []
<flux>
well, you need to consider the cases when the task is switched when the code is inside the hash table code.. it depends on the code of the hash table if it happens to be safe or not.
<flux>
if ocaml had true multi-core threading I would say that that is definitely unsafe, but currently there is a small chance that is is safe. but I wouldn't try my luck..
<flux>
actually, scratch that. if you have native threads, the new thread can be scheduled onto a new processor even if the previous one i snot running anymore. if you don't have a memory barrier (which is provided by using mutexes), you can have problems regardless of how the code is written.
<flux>
in any case, hash table, or typically other data structure either, don't have internal locking, as that would just slow down the general case
<vivanov>
so i better use a lock to sync any access to the hash table (replace, add , find)?
<flux>
yes
<vivanov>
ok i see thanks very much
<flux>
if you want to avoid locking for finds, it may be possible to use Map
<vivanov>
?
<flux>
then you still need to lock for the root of the data structure
<vivanov>
Map module?
<flux>
yes
<flux>
but Maps can never be modified, only new maps based on old ones can be created
<flux>
so if you want to use them in a similar way as Hashtbl, you need to have a reference to it and lock access to that reference
<flux>
but atleast you can for example take a copy of the map inside the lock and then perform tons of finds on it without locking
<vivanov>
i see - thanks
<flux>
risking the chance of getting outdated information of course, but maybe it isn't supercritical in this case
<flux>
but, off to work
<vivanov>
ok thanks very much
Cyanure has quit [Remote host closed the connection]
Yoric has joined #ocaml
boscop has joined #ocaml
surikator has quit [Quit: surikator]
avsm has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Snark has joined #ocaml
Cyanure has joined #ocaml
<vivanov>
flux: does what you said hold for simple case - references? do i need to use a lock when several threads are reading the contents of a reference? do references have internal locks in them?
<flux>
vivanov, I guess you would need to use mutexes for memory coherence reasons. references don't have internal locks in them. but as they are just one integer, in single-core x86 environments the reference will get updated atomically.
lopex has joined #ocaml
<vivanov>
i see -- thanks a lot
<gildor>
hcarty, thelema: is this possible that someone with good knowledge of Batteries gives a talk about it at this year OCaml Meeting ?
<gildor>
kaustuv: ^^^
Cyanure has quit [Remote host closed the connection]
edwin has joined #ocaml
<mrvn>
I think references are atomic in ocaml. Only one ocaml thread ever runs and the switch doesn't happen in the middle of a reference update.
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
strlen has quit [*.net *.split]
avsm2 has quit [*.net *.split]
BiDOrD has quit [*.net *.split]
<thelema>
gildor: maybe one day. Probably not this year for me.
<ygrek>
"need to use mutexes for memory coherence reasons" ??
strlen has joined #ocaml
avsm2 has joined #ocaml
BiDOrD has joined #ocaml
<flux>
ygrek, say you have two cpus with caches. it is not guaranteed at all times that their caches are synchronized.
<flux>
..atleast not on all architectures
<thelema>
mutexes don't solve this problem
<flux>
mutexes, as provided by pthreads, provide memory barriers
<ygrek>
"caches not synchronized" means not all threads will see update of variable if they read it immediately after it is written, but if threads are not synchornized relying on seeing any updates from other thread is race condition anyway
<ygrek>
i.e. Thread.create (fun () -> n := 2) and Thead.create (fun () -> if !n <> 2 then ... ) is racy not because of cache coherence
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
<flux>
ygrek, well, it would be racy still even if you added mutexes
<ygrek>
yes
<gildor>
thelema: I hope that kaustuv can make it, batteries is an important piece of code in the OCaml world
dnolen has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
<kaustuv>
gildor: thanks for the invite, but I don't think I'm the right guy to ask to speak about Batteries. I'm only a user. You should ask one of the other devs (mfp, elehack, etc.)
<kaustuv>
nice. The first year I'm actually in France on the day of the meeting.
<gildor>
hope to see you there
myu2 has quit [Remote host closed the connection]
<gildor>
concerning a possible talks, the slot are quite short (30 minutes with questions)
<gildor>
kaustuv: and having a user POV on batteries is worth (to my mind)
<gildor>
kaustuv: moreover you have some commits in the batteries' github -- which makes you at least a user++
<thelema>
kaustuv: how's your perspective on batteries any different from mine? I use it and make changes to it too.
<gildor>
kaustuv: if you know someone that can do a talk (and can come to the meeting), don't hesitate to tell me
<kaustuv>
Well, thanks for the suggestion. I will think about it.
<kaustuv>
But as to the difference in perspectives, I think the main thing is that as a user I don't necessarily feel committed to the future of the project. It's kind of like making suggestions to someone about raising their kids vs. raising your own kid.
<thelema>
kaustuv: well, would you mind encouraging others to use this useful library you found and helped improve?
<gildor>
kaustuv: I don't want to convince you to do a talk, but you can also see this as a testimonial how to raise a kid
<thelema>
It isn't perfect, but it's quite handy
<gildor>
kaustuv: no commitment, just a user/parent report
<thelema>
kaustuv: anyway, if you do it, thanks. if not, no problem.
<kaustuv>
Are there no committers to Batteries in France or even in Europe?
<gildor>
kaustuv: agreed with thelema, I hope to find at least one guy to do it
<kaustuv>
I'll talk to you guys over e-mail.
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 276 seconds]
Yoric_ is now known as Yoric
ikaros_ has joined #ocaml
ikaros has quit [Ping timeout: 276 seconds]
lamawithonel has joined #ocaml
Oejet has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
dnolen has quit [Quit: dnolen]
myu2 has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
Oejet has quit [Ping timeout: 276 seconds]
oriba has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
BiDOrD has quit [Ping timeout: 246 seconds]
lopex has quit []
robertosucks has joined #ocaml
<robertosucks>
Hello, i want to learn my second language and i was think in a function language,Ocaml is good for what kind of application?
<hcarty>
robertosucks: OCaml is good for many kinds of applications. It is a reasonably general-purpose programming language.
<robertosucks>
hcarty, what OCaml has different from Haskell?
<gildor>
robertosucks: probably not the best for number crunching
<gildor>
robertosucks: no laziness by default
<gildor>
(compared to haskell)
<gildor>
robertosucks: and probably faster (average)
<gildor>
robertosucks: at least easier to optimize than Haskell
<robertosucks>
i only know Python so i want to learn a functional.i am a bit confused between Haskell and OCaml
<hcarty>
robertosucks: Either would be good to learn. OCaml is probably a bit easier to transition to.
<hcarty>
robertosucks: Based on comments others have made
<gildor>
Some concepts in Haskell would require a lot of work to learn (coming from Python)
<gildor>
e.g. IO monad
<gildor>
in OCaml you can stay for a long time with standard concept for I/O (though monadic style operations exist)
<robertosucks>
gildor, can you recommend a me a tutorial or book in OCaml?
<robertosucks>
there is good opensource project that use OCaml?
<hcarty>
robertosucks: It would probably also help to learn and use some of Python's functional components. I know that helped me in the transition from Perl to OCaml.
<robertosucks>
ok i will
<hcarty>
robertosucks: That gives you some opportunities to try a concept in a language you know and the new language, as a point of comparison.
<robertosucks>
what are the advantages of using a function language instead of a imperative one?
<gildor>
robertosucks: I think that it leads to less bugs, IHMO
<gildor>
and it is more terse
<hcarty>
robertosucks: It also offers a different way of thinking about problems.
robertosucks has quit [Quit: Saindo]
BiDOrD has joined #ocaml
<thelema>
hcarty: odd - I transitioned right from perl to ocaml, mostly because I was enjoying perl's functional features.
ygrek_ has quit [Ping timeout: 246 seconds]
ygrek_ has joined #ocaml
yezariaely has joined #ocaml
<hcarty>
thelema: I did the same, more or less. I started using Perl's functional features thanks to the Perl 6/Pugs noise.
sepp2k has joined #ocaml
<hcarty>
I enjoyed them immensely, and started looking for something with more static checks
<thelema>
Yes, once I found map and grep, I came up with all sorts of excuses to use them in my code
yezariaely has left #ocaml []
avsm has quit [Quit: Leaving.]
joewilliams_away is now known as joewilliams
ymasory has joined #ocaml
kaustuv_ has joined #ocaml
Yoric has quit [Quit: Yoric]
Cyanure has joined #ocaml
jarray52 has joined #ocaml
Cyanure has quit [Read error: Operation timed out]
Cyanure has joined #ocaml
philtor has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 255 seconds]
emmanuel_ has joined #ocaml
emmanuel_ has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 246 seconds]
lopexx has joined #ocaml
lopex has quit [Ping timeout: 250 seconds]
avsm has joined #ocaml
lopexx has quit []
lopex has joined #ocaml
oriba has quit [Quit: Verlassend]
boscop has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
avsm has quit [Quit: Leaving.]
tauntaun has joined #ocaml
philtor has quit [Ping timeout: 246 seconds]
mnabil has joined #ocaml
avsm has joined #ocaml
surikator has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
jarray52 has left #ocaml []
enthymeme has joined #ocaml
willb has quit [Ping timeout: 260 seconds]
npouillard has quit [Ping timeout: 264 seconds]
npouillard has joined #ocaml
willb has joined #ocaml
Snark has quit [Quit: Ex-Chat]
Cyanure has quit [Quit: Quitte]
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
ulfdoz has joined #ocaml
seafood has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
smerz has joined #ocaml
lamawithonel has joined #ocaml
surikator has quit [Ping timeout: 260 seconds]
seafood has quit [Ping timeout: 240 seconds]
<hcarty>
thelema: What is the current state of odb.ml's handling of dependencies + version requirements?
Oejet has joined #ocaml
<thelema>
it handles >, >=, = and version numbers of the form d1.d2.d3.d4....
<thelema>
it doesn't detect upgrade possibilities yet, just checks the findlib version against requirements
<thelema>
also, there's no support for versioned packages - all it can do is download and install a single version
<hcarty>
thelema: Ok, so it will verify that (for example) Camomile is >=0.7.0, but it won't recompile Batteries if you install a new version of Camomile?
<thelema>
yes
<hcarty>
Ok, thanks
<gildor>
thelema: maybe you can limit odb.ml to the simplest task of initial installation
<gildor>
thelema: and have a second stage full blown odb application (that can be built using odb.ml) to do more complex task
<thelema>
gildor: someone else can build the perfect ocaml package manager. I'll confine myself to building something simple that automates simple tasks
<thelema>
s/simple/common/
<gildor>
thelema: in this case, you should maybe not care about version number...
<gildor>
and just not published versions that conflict (decided on server side)
<thelema>
Maybe just adding a "replace old packages" option will suffice if the server packages all work together
<gildor>
thelema: another option is to incorporate the version in the served file name (e.g. oasis0.2.0.odb-info)
<gildor>
and have a field provide=oasis
tauntaun has quit [Quit: Ex-Chat]
<gildor>
so you know that you should remove oasis0.1.0 that also provide oasis to replace it wiht this new version
<thelema>
gildor: hmm, I don't think I like that solution, as a dependency on oasis would require downloading all info files oasis*
<gildor>
probably not a big deal...
<thelema>
I'd rather not worry about this corner case - if people want exactly a certain version, they can download and install it themselves
<gildor>
ok
<gildor>
but I think you should not bother about version checking, it will keep your code simple and report complexity on the server side
<gildor>
(version checking on the client sideà
<gildor>
)
<hcarty>
gildor: How would you know to update the client side libraries when an upstream library version changes?
<gildor>
hcarty: you always update everything to be in sync with the server
<gildor>
i.e. if you have install ocaml-expect and camomile, you always download ocaml-expect.info and camomile.info
<gildor>
if the version of one of them change, it triggers the redownload of the matching tarball + rebuild of rev deps
<thelema>
gildor: I'm going to avoid keeping track of what odb has installed
<gildor>
thelema: so you don't want an update mechanism ?
<thelema>
Update is possible w/o keeping track of what odb is installed - just try to update *all* findlib packages
<hcarty>
thelema: You could compare the foo.info version number with the version number from findlib
<gildor>
thelema: you will have to keep a map between findlib packages and source packages
<thelema>
gildor: the map is (fun x -> x)
<thelema>
I'll just have to filter out subpackages
<gildor>
ocaml-expect findlib package is expect
<thelema>
and the odb package name is expect too.
<gildor>
what about lablgtk ?
<gildor>
which holds lablgl and lablgtk
<thelema>
well, it doesn't have an official findlib package
<gildor>
the 1:1 mapping with findlib is not always true
<hcarty>
I think lablgtk2 does now... but I could be wrong.
<thelema>
hcarty: ah, great!
<thelema>
gildor: updating lablgl will fail to find a package, updating lablgtk will have the side effect of updating lablgl