flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
csakatoku has joined #ocaml
Pantoufle has quit [Ping timeout: 260 seconds]
cricri has quit [Remote host closed the connection]
rwmjones has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 252 seconds]
rwmjones has joined #ocaml
nikki93 has quit [Remote host closed the connection]
yminsky has quit [Quit: yminsky]
csakatok_ has joined #ocaml
nikki93 has joined #ocaml
csakatoku has quit [Ping timeout: 246 seconds]
Pantoufle has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<Lajjla> http://hastebin.com/sagisesuli.ml what generates this weird error?
<mrvn> paste sites that require javascript suck
<Drup> you forgot the interesting half ot the error message, I think
technomancy has left #ocaml []
<Lajjla> Drup, ehh, that would be javascrpt sucking, type ctrl+d to view it
<Drup> Lajjla: alos, using Extlib *and* core is a terribly bad idea
<Lajjla> It doesn't display it for some reason
<Lajjla> Drup, ahh, pray explain
<mrvn> please paste it somewhere sane
<Drup> Lajjla: line 9, you forgot a ;;
<Lajjla> mrvn http://hastebin.com/raw/sagisesuli here you go, text/plain at your service
<Lajjla> wow lol, you're right
<Lajjla> one ;
<Lajjla> that complains 10 lines further
<Drup> don't use ;;
<Lajjla> If it was enforced this error would be caught easier. :)
imran_sr has joined #ocaml
<mrvn> Error: Unbound module Float
<Drup> ( also Lajjla, this pastebin service still stuck at ocaml code coloration. )
<Drup> sucks*
<mrvn> ahh, earlier I had: Error: Unbound module Core
<Drup> no really, don't use Core + Extlib
<Drup> first, it doesn't make sense
<Drup> second, they are not very compatible
<Drup> you will have weird stuff all around
<Drup> why would you even do that ? most extlib have a replacement inside Core anyway
tulloch has joined #ocaml
<mrvn> and after fixing that single ; what error do you still have? works fine here
<Drup> mrvn: that was the error ...
<mrvn> 02:18 < Lajjla> that complains 10 lines further
<Drup> Lajjla: don't use batteries + core either, it's worse
kyrylo has quit [Ping timeout: 246 seconds]
<Drup> Lajjla: and since we're at it, Batteries is sort of the successor of Extlib, so it doesn't really make sense to use those together either :p
shinnya has joined #ocaml
<Lajjla> Drup, well, I didn't find anything comparable to String.nsplit in core, do you know one?
<Lajjla> Could be, I know nothing of ocaml at th emoment
<Drup> I don't know Core interals, I don't use it
<rks`> Lajjla: how is that different from String.split ?
tulloch has quit [Ping timeout: 246 seconds]
<Lajjla> rks`, it isn't, I just found it
<Lajjla> I basically googled this morning for 'ocaml split string by token' and it gave me ExtString.String.nsplit
<Lajjla> One has to appreciate that I know pretty much nothing of ocaml at this point
<rks`> Lajjla: you can always use http://ocamloscope.herokuapp.com/
<Lajjla> rks`,that is like hoogle? It searches on type signature?
<Drup> yes
<Lajjla> Sweet
tulloch has joined #ocaml
thomasga has quit [Quit: Leaving.]
tulloch_ has joined #ocaml
tulloch has quit [Ping timeout: 245 seconds]
csakatok_ has quit [Remote host closed the connection]
csakatoku has joined #ocaml
yminsky has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
paolooo has joined #ocaml
csakatoku has joined #ocaml
pango has quit [Ping timeout: 246 seconds]
boogie has quit [Remote host closed the connection]
pango has joined #ocaml
milosn has quit [Ping timeout: 248 seconds]
strobegen has joined #ocaml
Xenasis has quit [Remote host closed the connection]
talzeus has joined #ocaml
talzeus__ has joined #ocaml
boogie has joined #ocaml
talzeus has quit [Ping timeout: 246 seconds]
yminsky has quit [Quit: yminsky]
tulloch_ has quit [Ping timeout: 246 seconds]
toolips has joined #ocaml
toolips has quit [Client Quit]
groovy2shoes has joined #ocaml
yminsky has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
ygrek_ has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
yminsky has quit [Quit: yminsky]
ygrek_ has quit [Ping timeout: 272 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 272 seconds]
paolooo has quit [Ping timeout: 250 seconds]
paolooo has joined #ocaml
strobegen has quit [Quit: Leaving.]
csakatoku has joined #ocaml
divyansr has joined #ocaml
mcclurmc has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
groovy2shoes has quit [Quit: It is now safe to turn off your Groovebot.]
divyansr has quit [Ping timeout: 250 seconds]
boogie has quit [Remote host closed the connection]
bacam has quit [Ping timeout: 272 seconds]
bacam has joined #ocaml
breakds has joined #ocaml
breakds has quit [Remote host closed the connection]
boogie has joined #ocaml
paolooo has quit [Quit: Page closed]
manizzle has joined #ocaml
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
xaimus_ is now known as xaimus
csakatok_ has quit [Remote host closed the connection]
csakatoku has joined #ocaml
Kakadu has joined #ocaml
csakatoku has quit [Ping timeout: 265 seconds]
csakatoku has joined #ocaml
tristero has quit [Ping timeout: 246 seconds]
tristero has joined #ocaml
mcclurmc has joined #ocaml
rwmjones has quit [Ping timeout: 246 seconds]
nikki93 has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
<Kakadu> Guys, is there any difference between `opam remote` and `opam repository`?
Simn has joined #ocaml
bacam has quit [Read error: Operation timed out]
cricri has joined #ocaml
bacam has joined #ocaml
ggole has joined #ocaml
mcclurmc has joined #ocaml
Neros has joined #ocaml
mort___ has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
mort___1 has joined #ocaml
mort___ has quit [Read error: Connection reset by peer]
kyrylo has joined #ocaml
mort___1 has quit [Quit: Leaving.]
mort___ has joined #ocaml
ulfdoz has joined #ocaml
madroach has quit [Quit: leaving]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
mehdid has joined #ocaml
csakatoku has quit [Ping timeout: 246 seconds]
mcclurmc has quit [Ping timeout: 272 seconds]
cricri_ has joined #ocaml
cricri has quit [Ping timeout: 245 seconds]
Arsenik has joined #ocaml
rwmjones has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
nikki93 has quit [Remote host closed the connection]
boogie has quit [Remote host closed the connection]
adr has joined #ocaml
boogie has joined #ocaml
mort___ has quit [Quit: Leaving.]
ollehar has joined #ocaml
boogie has quit [Ping timeout: 245 seconds]
madroach has joined #ocaml
boogie has joined #ocaml
Yoric has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
tulloch has joined #ocaml
milosn has joined #ocaml
kyrylo has quit [Ping timeout: 246 seconds]
gour has joined #ocaml
rand000 has joined #ocaml
mcclurmc has joined #ocaml
cricri_ has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Ping timeout: 252 seconds]
kyrylo has joined #ocaml
wolfnn has joined #ocaml
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
boogie has quit [Ping timeout: 246 seconds]
dram has joined #ocaml
zpe has joined #ocaml
kyrylo has quit [Quit: WeeChat 0.4.2]
kyrylo has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
AndChat372521 has joined #ocaml
thomasga has joined #ocaml
<jpdeplaix> Kakadu: AFAIK none.
rand000 has quit [Ping timeout: 245 seconds]
thomasga has quit [Client Quit]
Fnar has quit [Quit: Client exiting]
thomasga has joined #ocaml
AndChat372521 has quit [Remote host closed the connection]
ygrek has joined #ocaml
AndChat372521 has joined #ocaml
AndChat372521 has quit [Remote host closed the connection]
wolfnn has quit [Ping timeout: 248 seconds]
shinnya has joined #ocaml
AltGr has joined #ocaml
NoNNaN has joined #ocaml
strobegen has joined #ocaml
strobegen1 has joined #ocaml
strobegen has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ulfdoz has joined #ocaml
Kakadu has quit [Ping timeout: 272 seconds]
zpe has quit [Ping timeout: 272 seconds]
zpe has joined #ocaml
tcpc has joined #ocaml
BitPuffin has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
mcclurmc has joined #ocaml
BitPuffin has quit [Ping timeout: 245 seconds]
BitPuffin has joined #ocaml
mcclurmc has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
Kakadu has quit [Read error: Operation timed out]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
zpe has joined #ocaml
Yoric has joined #ocaml
darkf has quit [Quit: Leaving]
Yoric has quit [Ping timeout: 260 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
Neros has quit [Ping timeout: 272 seconds]
tobiasBora has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
Xenasis has joined #ocaml
Neros has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
yminsky has joined #ocaml
Kakadu has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
Neros has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
thomasga has quit [Quit: Leaving.]
mcclurmc has quit [Ping timeout: 272 seconds]
Xenasis has quit [Remote host closed the connection]
Xenasis has joined #ocaml
Xenasis has quit [Remote host closed the connection]
Xenasis has joined #ocaml
thomasga has joined #ocaml
msch has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
Lajjla is now known as mostlyfledby
csakatoku has joined #ocaml
paolooo has joined #ocaml
tobiasBora has joined #ocaml
avsm has joined #ocaml
yacks has quit [Quit: Leaving]
mye has joined #ocaml
mcclurmc has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
csakatoku has joined #ocaml
csakatok_ has joined #ocaml
gour_ is now known as gour
<mehdid> thomasga: around?
<mehdid> or avsm?
<thomasga> mehdid: yes
<mehdid> ah :)
<mehdid> i was wondering which binaries should be installed by opam?
<mehdid> it seems you install opam and opam-admin only?
<thomasga> indeed
<mehdid> but there are other programs under src/scripts
<mehdid> what is the status of those scripts?
mcclurmc has quit [Ping timeout: 265 seconds]
<thomasga> they are all bundled into opam-admin
<thomasga> (apart opam-check which is just useful to run 'make test')
csakatoku has quit [Ping timeout: 245 seconds]
<thomasga> (so no need to install it globally)
<mehdid> k, fair enough
<mehdid> will stick to the default ones then
csakatok_ has quit [Ping timeout: 264 seconds]
wolfnn has joined #ocaml
dram has quit [Ping timeout: 272 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
breakds has joined #ocaml
avsm has quit [Quit: Leaving.]
dr_df0 has joined #ocaml
<dr_df0> hi everyone
dr_df0 has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
avsm has joined #ocaml
dr_df0 has joined #ocaml
manizzle has quit [Ping timeout: 245 seconds]
manizzle has joined #ocaml
thomasga has quit [Quit: Leaving.]
<dr_df0> does anybody knows the tool similar to cscope but for ocaml?
boogie has joined #ocaml
thomasga has joined #ocaml
boogie has quit [Remote host closed the connection]
<dr_df0> i've been trying to setup etag with emacs, but it seems that etags is treating .ml files as lisp sources
boogie has joined #ocaml
<dr_df0> are there any tools like cscope/ctags/etags for ocaml?
mcclurmc has quit [Remote host closed the connection]
paolooo has quit [Quit: Page closed]
yminsky has joined #ocaml
boogie has quit [Ping timeout: 246 seconds]
<Drup> dr_df0: look at merlin
<rks`> I'd say https://github.com/def-lkb/merlin/wiki is more appropriate.
<dr_df0> thanks, I'll look at it
mcclurmc has joined #ocaml
yminsky has quit [Quit: yminsky]
dr_df0 has quit [Ping timeout: 248 seconds]
tulloch has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
nikki93 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
nikki93 has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
<gasche> rks`: if some page is more appropriate than the front page of your project, you have a problem you must fix
manizzle has quit [Ping timeout: 264 seconds]
manizzle has joined #ocaml
<adrien> :)
<rks`> :)
<whitequark> :)
tulloch has joined #ocaml
<adrien> :)-bis
Anarchos has joined #ocaml
<adrien> yypkg.exe built :P
<adrien> windows server 2013 is fun: I can't right-click on a link and "save target as" without the website being part of my "trusted sites"
tulloch has quit [Ping timeout: 246 seconds]
tulloch has joined #ocaml
boogie has joined #ocaml
mort___ has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
Arsenik has quit [Remote host closed the connection]
nikki93 has joined #ocaml
tulloch has quit [Ping timeout: 246 seconds]
Xenasis has quit [Remote host closed the connection]
Xenasis has joined #ocaml
ggole has quit []
shinnya has quit [Ping timeout: 246 seconds]
loxs has joined #ocaml
<loxs> I'm just starting to learn ocaml. I'm following the tutorial by INRIA. It's quite clear (coming from Erlang)
<loxs> but I woner.. what is the |
<loxs> is it only the case delimiter?
<adrien> it separates alternatives
<adrien> type t = A | B | C
<adrien> an element of type t can be either A, B or C
<loxs> and this also is valid for functions as far as I see
<loxs> it delimits the different heads of the function (as we call it in Erlang)
<adrien> "type t = A | B | C" builds a type; in functions and pattern-matchings, you "deconstruct" the type
<adrien> into elements
<adrien> match some_list with | [] -> ... | hd :: tl -> ...
<Drup> there are lots of people comming from Erlang those days, what's happening ? :D
<adrien> check if some_list is [] (i.e. "empty list"); if it's not, check if it can be deconstructed as a head "hd" and a tail "tl"
<adrien> Drup: they're open-minded probably
<loxs> Drup, I guess we all need something fast to write our native "ports" in :)
<Drup> :p
<loxs> adrien. Got it. Thanks
ygrek has quit [Ping timeout: 240 seconds]
<whitequark> can you even use ocaml and erlang in a single address space?
<orbitz> Wow, trying to read some Java code. don't realize how much easier a .mli is for understanding code until you try to read something where it's all squashed together again
<loxs> whitequark - well no, but it's true for different erlang processes as well. they don't have the same address space as far as the programmer is concerned
<orbitz> loxs: ocaml does not have head's like in Erlang
tulloch has joined #ocaml
<loxs> orbitz, doesn't it? from what I see they are quite the same :)
<orbitz> they aren't. you cannot do let f 1 2 = 4; let f 3 4 = 3. in ocaml
<whitequark> List.hd [] ?
<loxs> orbitz, I am not sure what this is trying to do (still too little ocaml knowledge :))
<orbitz> loxs: in erlang f(1, 2) -> 4; f(3, 4) -> 3.
<loxs> oh, you are talking about function heads
<orbitz> yes
<loxs> sorry, I thought you are talking about list heads :)
<orbitz> no
<orbitz> i was responding to 18:36 < loxs> it delimits the different heads of the function (as we call it in Erlang)
<loxs> I'm looking at the 99 problems solved
<loxs> and the solution to the first one is quite like erlang's heads
mcclurmc has quit [Remote host closed the connection]
<loxs> well, of course.. less typing than erlang :)
<loxs> but still quite the same, as far as I am concerned :)
<orbitz> it isn't
tulloch has quit [Ping timeout: 246 seconds]
<loxs> when I think about it now... I'm even more confused :)
<loxs> what does the "function" mean here?
<Drup> loxs: "let f = function ..." ≡ "let f x = match x with ..."
<loxs> oh wow
<loxs> now this begs the question. Why do you need this shortcut? is it extremely popular thing to write?
<orbitz> oh man, erlang -> nif -> ocaml, tha tis probably fun :)
<orbitz> Eric Merrit apparently calls SML from Erlang, not sure if he's doing ports or a nif
<bjorkintosh> what's nif?
<mrvn> loxs: because let foo = function x -> function y -> function z -> is so much to type
<orbitz> loxs: don't need it, but it's convneient
<mrvn> loxs: same reason there is fun too
<rks`> mrvn: I think he meant it the other way around
<orbitz> also easier to write List.map (function | blah -> blargh | blargh -> feklwfe ...)
<rks`> « why do you need "function" when you can do "fun x -> match x with »
<loxs> yes
<loxs> that's what I was asking :)
<mrvn> again just convenience
<orbitz> fun x -> match ... just hapens to be someting yo uwrite a lot
<orbitz> so a shorthand is worth having
<orbitz> i wish they called it fatch though
<orbitz> or snatch
<bjorkintosh> call it that then.
<orbitz> or muntion
<rks`> orbitz: dear.
<loxs> yes, the word "function" is quite confusing here :)
<mrvn> well, I believe function is the core thing and the rest are syntactic suggar.
<orbitz> mrvn: that would make sense
<bjorkintosh> call it 'map', if you don't like 'function'.
<loxs> oh wow, now I understood your previous comment, mrvn. That's so cool :)
tane has joined #ocaml
<orbitz> loxs: Relative to Erlang, ocaml has some principles behind it and is an actual legitimate functional language :)
<loxs> yes, I know it has better foundation
yminsky has joined #ocaml
<orbitz> evening, yminsky
<loxs> which says nothing, as Erlang is huge imho. for what it does
<orbitz> Erlang has lots of great benefits
<yminsky> orbitz: good evening. Well, not evening for me.
<loxs> orbitz, that's why now I plan on using them both :)
cdidd has quit [Remote host closed the connection]
<bjorkintosh> both for what, loxs?
<bjorkintosh> can't you get what you need from o'caml?
zpe has joined #ocaml
<orbitz> You know, even if I had threads I think i'd want functions using them to have special types. Reading code that just magically backgrounds things with a thread i rough
<orbitz> bjorkintosh: As much as I <3 ocaml. the paralleism/concurrency in Erlang blows Ocaml away. Not sure what loxs needs it for, but it's Erlang's bread and butter
<bjorkintosh> i know it is.
<loxs> bjorkintosh, I am not familiar with OCaml, but I suspect it can't match Erlang on things like out-of-the-box clustering, parallellization and "light weight servers"
gour has quit [Quit: WeeChat 0.4.2]
<Drup> loxs: indeed, and I must say the combinaition of both would be interesting
<bjorkintosh> i like having typing.
<loxs> Drup, exactly. I plan to use OCaml for the parts that need sequential speed
<orbitz> Async gives me most of what I want for concurrency at least
<orbitz> linked processes are really nice though. really really nice.
<orbitz> I wish Unix had linked processes
<bjorkintosh> hmm.
<bjorkintosh> is there an OS which does, orbitz?
<orbitz> I don't nkow
<loxs> bjorkintosh, Erlang's scheduler is huge when you have 100k independent actors. For example lots of websockets open. That's my use case.
<bjorkintosh> i see.
<loxs> having erlang to manage things like partitioning, while having OCaml be the "worker" processes has great potential from what I can see
<bjorkintosh> hmm.
<bjorkintosh> i know! camerlang!!
<loxs> hah :)
<bjorkintosh> hear me out: a o'caml for beam!
<loxs> I don't think the language matters much in that VM
<loxs> it will be slow because of the scheduler
<bjorkintosh> sure., but you want ocaml don't you?
<orbitz> anyone workingon github right now? i can't push all of a sudden for no good reason
<loxs> yeah :)
<bjorkintosh> orbitz, github is always dying.
<loxs> ok, back to the tutorial. Thanks for the help guys (will be sure to come back when I'm stuck :))
<bjorkintosh> methinks it's the ROR layer.
<bjorkintosh> alright, that was mean.
<orbitz> sure but i'm just trying to do a git push
<bjorkintosh> give it half an hour.
<loxs> orbitz, that would be the erlang layer failing ;)
<bjorkintosh> No!
<bjorkintosh> the erlang layer Never Fails (tm).
<orbitz> i think it's my vm
<loxs> believe me (last 3 years Erlang professionally), Erlang does fail :)
<bjorkintosh> it's supposed to. sure.
Anarchos has quit [Ping timeout: 272 seconds]
<loxs> especially when you don't have OCaml's types :)
<orbitz> but you've got dialyzer!
tobiasBora has quit [Ping timeout: 252 seconds]
<bjorkintosh> yet you think ocamerlang is ridiculous.
<bjorkintosh> hmmph!
<bjorkintosh> ocamerlang, ye faithful!
<loxs> orbitz, yes, and I use it heavily... since I started, bug rate dropped quite a lot :)
<orbitz> loxs: do you use PropEr too?
<orbitz> I've started usign companion_cube's quick check impl in Ocaml, not as advanced a the Erlang ones but quite nice
<loxs> no, don't even know what it is
<orbitz> property based testing
<loxs> will be sure to check
<orbitz> PropEr is a free version of QuickCheck
<loxs> ah yes, now I remember
<loxs> seems like quite of a project now
yminsky has quit [Quit: yminsky]
<orbitz> Allegedly Volvo uses teh C version of QuickCheck to property based test their cars. So they really are the safesty cars in the world
<bjorkintosh> nonsense.
<adrien> big companies are like octopusses: many tentacles which don't necessarily behave in the same way
<bjorkintosh> if they wanted to be sure, they'd use ada.
<bjorkintosh> plus, have you seen the videos of their automatic braking vehicles?
<bjorkintosh> they never do!
dr_df0 has joined #ocaml
shapr has left #ocaml []
<loxs> hmm... still trying to figure out all of problem 1 of 99.... what is the difference between [] and [_] ?
<loxs> from what I read, the unerscore is "any of this type" am I right?
<Drup> loxs: [] is the empty list
<Drup> [ _ ] is the list with any element
<Drup> (but only one)
<bjorkintosh> like '?' in regex?
zpe has quit [Remote host closed the connection]
<loxs> so why do they need this case at all? won't it be catched by the next case?
Leonidas has quit [Ping timeout: 260 seconds]
<loxs> Oh, my erlang brain....
<dr_df0> i've got problems with setting up merlin form vim
<Drup> loxs: maybe they want to treat it in a special way
<loxs> in erlang every list of 1 element has a tail of []
zpe has joined #ocaml
<dr_df0> i did everything from the merlin wiki
<loxs> that's what confused me
<Drup> loxs : in ocaml too
<dr_df0> but after starting vim in mldonkey directory i can not use any commands listed in docs
yminsky has joined #ocaml
<dr_df0> can you help?
<loxs> right, I was looking in two separate pieces of code :)
<loxs> sorry :)
tobiasBora has joined #ocaml
<loxs> so far, from what I see, the worst pita with OCaml is that when you make a mistake, that syntax actually means something else... isn't just syntax error :)
loxs_ has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
AltGr has left #ocaml []
loxs has quit [Ping timeout: 264 seconds]
loxs__ has joined #ocaml
<dr_df0> does ocamlmerlin has to run in background when vim is started? how to start it?
tulloch has joined #ocaml
loxs_ has quit [Ping timeout: 264 seconds]
tulloch_ has joined #ocaml
<rks`> .
tulloch has quit [Ping timeout: 272 seconds]
<rks`> dr_df0: it should start automatically when you edit an ml file
Yoric has joined #ocaml
<dr_df0> rks`: how do you know that it started? :scriptnames should show it?
zpe has joined #ocaml
<dr_df0> rks`: scriptnames is showing - among others - the only file from .opam dir: ~/.opam/4.01.0/share/ocamlmerlin/vim/plugin/merlin.vim
yminsky has quit [Quit: yminsky]
Arsenik has joined #ocaml
yminsky has joined #ocaml
<loxs__> so if my function happens to return None, all of the other returns must be Some _?
<def-lkb> dr_df0: and you are editing an ml file?
nikki93 has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 272 seconds]
<dr_df0> def-lkb: yes, I've opened $PWD/src/utils/net/base64.ml from mldonkey-3.1.3 directory. Maybe the problem is, that my .merlin file is in $PWD directory?
<dr_df0> def-lkb: is your :scriptnames showing ocamlmerlin?
<def-lkb> dr_df0: no it should be ok. just to be sure, your vim is compiled with python support ?
<def-lkb> dr_df0: no ocamlmerlin is spawn as a subprocess, however you should have
<dr_df0> def-lkb: good question ... i'll check. i'm using standard vim form macosx
<dr_df0> def-lkb: correction - for macosx
<def-lkb> merlin/ftplugin/ocaml.vim, merlin/autoload/merlin.vim, vimbufsync/autoload/vimbufsync.vim, and if you enabled syntastic support merlin/syntax_checkers/ocaml/merlin.vim
<def-lkb> loaded
<def-lkb> I only checked with MacVim[http://code.google.com/p/macvim/], I can't tell if it works with default vim
ulfdoz has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
<Drup> loxs__: yes
tane has joined #ocaml
<loxs__> that's starting to look really pretty
<loxs__> is it at all possible to have a bug in your program? :)
<Drup> sure, off by one errors :D
Anarchos has joined #ocaml
<dr_df0> def-lkb: hmmm ... i've installed latest macvim and :scriptnames shows the same
<dr_df0> def-lkb: do you have some other stuff in .vimrc than setting :set rtp+ ...
<def-lkb> hmm, are you sure you ocamlmerlin in your PATH ?
<def-lkb> the only other thing in my vimrc is let g:syntastic_ocaml_checkers=['merlin']
<def-lkb> (test with :!which ocamlmerlin )
yacks has joined #ocaml
<dr_df0> def-lkb: !which show the path to ocamlmerlin inside .opam directory in my homedir
<dr_df0> i've added also syntastic, but it does not show on :scriptnames output
<def-lkb> can you paste the content of your .vimrc on some pastebin ?
zpe has joined #ocaml
<def-lkb> you should add at least
<def-lkb> filetype plugin on
<def-lkb> (usually followed by "filetype indent on")
nikki93 has joined #ocaml
Leonidas has joined #ocaml
<dr_df0> def-lkb: can you pasebin relevant part of your .vimrc?
yminsky has quit [Quit: yminsky]
zpe has quit [Ping timeout: 272 seconds]
tobiasBora has quit [Quit: Konversation terminated!]
tobiasBora has joined #ocaml
<def-lkb> minimal working .vimrc
loxs_ has joined #ocaml
<dr_df0> def-lkb: adding filetype plugin on solved the problem ... thanks :)
loxs__ has quit [Ping timeout: 245 seconds]
<def-lkb> np :)
loxs__ has joined #ocaml
loxs__ has quit [Client Quit]
loxs_ has quit [Ping timeout: 246 seconds]
yminsky has joined #ocaml
zpe has joined #ocaml
yminsky has quit [Quit: yminsky]
zpe has quit [Ping timeout: 240 seconds]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
loxs has joined #ocaml
yminsky has quit [Ping timeout: 264 seconds]
baz_ has joined #ocaml
<loxs> which is the established zeromq library for ocaml?
<loxs> I find 2 that are on zeromq's website
<loxs> one of which is not maintained any more as it seems
baz_ has quit [Remote host closed the connection]
<Drup> loxs: you want an async concurent library ?
<loxs> Drup, preferrably, yes :)
<Drup> loxs: lwt
thomasga has quit [Quit: Leaving.]
<loxs> cool, thanks
<bjorkintosh> loxs, what is zeromq needed for when you have erlang?
<loxs> bjorkintosh, to fetch third party data
zpe has joined #ocaml
<loxs> (which exposes a 0mq interface)
<bjorkintosh> hmm. i see.
<bjorkintosh> ipython's for instance?
<loxs> I don't know what this is
<loxs> in my case it's a proprietary service provided to the company I work for
<bjorkintosh> you're writing this in ocaml?
<loxs> at the moment, only evaluating the possibility
thomasga has joined #ocaml
<loxs> but most of the things are in erlang at the moment...
<loxs> and it's starting to not be able to crunch all the data
<loxs> as sequential speed is required
<bjorkintosh> interesting.
<bjorkintosh> can the data not be crunched in parallel?
zpe has quit [Ping timeout: 252 seconds]
<loxs> some of it can, but not all of it... and I'm too lazy to write a good filter :)
<loxs> and also, I'm not sure that an erlang dispatcher will be fast enough
<loxs> it has to unzip the data, load json, analyze its contents
<loxs> and although the unzip and json libs are in C...
<loxs> erlang scheduler is a nasty beast :)
<loxs> it will preempt you to hell :)
<tristan__> I think you mean to heaven
<loxs> depends on how heavyweight your process is :)
<loxs> erlang hates heavyweight processes
<tristan__> what do you mean
<loxs> the short version:
<loxs> if your erlang process does lots of calculations it will get interrupted A LOT
<tristan__> I know how it scheudles
<loxs> so yes, my zeromq dispatcher starts to fall behind
<tristan__> was wondering what you mean tby heavyweight
<tristan__> and if you call out to C you get screwed because it doesn't interrupt
<tristan__> I loath nifs, hehe
<loxs> yeah
<loxs> wow, time for bed
ulfdoz has joined #ocaml
<loxs> good night all
loxs has quit [Quit: Leaving]
tulloch_ has quit [Ping timeout: 272 seconds]
<mrvn> lopex: The author claims that erlang does true preemption. But what he describes is cooperation with a garantied small slice.
<mrvn> args, ENICK and loxs left.
<tristan__> what do you mean
<tristan__> because it has to inrement its reduction count?
darkf has joined #ocaml
Kakadu has quit [Quit: Page closed]
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
<mrvn> tristan__: yes. the reduction count sounds like it has checkpoints all through the code that count down the reduction count and if that reaches 0 then it schedules.
<tristan__> what would you consider "true preemption"..
<mrvn> Sounds like it can't preempt a thread at any time but has to wait till it reaches a safe point where it modifies the reduction count.
<mrvn> tristan__: true preemption would allow seeting a timer and when that goes of it preempts.
<mrvn> "To be precise, preemption[2] means that the scheduler can force a task off execution."
<mrvn> force off vs. waiting for it to reach a safe point
<tristan__> its not waiting for it to reach a safe point
<mrvn> At the end he says: "This section is also why one must beware of long-running NIFs. They do not per default preempt, nor do they bump the reduction counter. So they can introduce latency in your system." That contradicts his claim that erlang does true preemption.
<tristan__> no it doesn't, Erlang does, NIFs do not
<tristan__> but again, it doesn't wait for a safe point. it simply allows X reductions
<mrvn> tristan__: So what are NIFs? C code?
<tristan__> yea
<mrvn> tristan__: It does wait for a safe point. Every change of the reduction count is a safe point.
<mrvn> But if I understand it right a reduction can be hundreds or thousands of assembly instructions. Millions with a NIFs.
<whitequark> mrvn: I think the point here is that you cannot write pure Erlang code which e.g. hogs a scheduler/core
<tristan__> hehe
<mrvn> whitequark: That might be.
<tristan__> that is still true preemption
<mrvn> tristan__: no.
<mrvn> That is cooperation just with verry small time slices.
<whitequark> mrvn: think of it this way: erlang runtime *guarantees* that a process will relinquish control
<whitequark> just as an OS runtime guarantees that a thread will relinquish control
zpe has joined #ocaml
<mrvn> whitequark: unless it is running a NIF.
<tristan__> mrvn: no it isn't
<whitequark> mrvn: NIFs can be instrumented to respect that as well
<whitequark> e.g. regexp library is
<tristan__> it is not cooperative
<mrvn> they must be. That is my point. That is cooperative. Preemption wouldn't need instrumentation.
<tristan__> is the linux kernel cooperative?
<whitequark> mrvn: it's like saying "I can write a linux device driver which clears interrupt flag, therefore linux is not preemptive"
<mrvn> tristan__: some kernel code is. The parts that turn of interrupts. But the rest is preemptive (given the config option).
<tristan__> mrvn: but isn't preemption based on number of jiffies or whatever it can go through befor ebeing preempted
<mrvn> tristan__: no. preemption means the scheduler can force a switch. At any time.
<whitequark> tristan__: fundamentally preemption is based on the fact that it's caused by an interrupt and a program cannot forbid that interrupt to happen
<whitequark> which is true for erlang code and not true for native code
<whitequark> in general
<mrvn> whitequark: where does erlang have an interupt?
<whitequark> mrvn: it doesn't, from inside of the erlang VM it doesn't matter, because you cannot write code which won't relinquish control
<whitequark> this is semantically equivalent to having a privileged interrupt
mort___ has quit [Quit: Leaving.]
<mrvn> Which is nice. I would describe it as compiler enforced cooperative multitasking.
<tristan__> mrvn: erlang can do..
<whitequark> then linux would have OS enforced cooperative multitasking :)
<tristan__> haha
<tristan__> exactly
<mrvn> whitequark: no.
<mrvn> In erlang the compiler builds in the safe points that count down the reduction count and that lets the scheduler schedule. In Linux an interrupt goes of and no matter what the thread is doing it gets switched.
<mrvn> At least that is what I get from the blog.
<whitequark> yes, and semantically it's the same thing
<mrvn> 2 differences: 1) NIFs, 2) you can't use interrupts to switch.
<whitequark> "if you play by rules (don't write [erlang: native code, linux: drivers]), preemption is guaranteed"
<whitequark> what do you mean by 2) ?
<mrvn> cooperation is guarantied
zpe has quit [Ping timeout: 272 seconds]
<whitequark> ok, cooperation, in either case
<tristan__> preemptive because the code is preempted without asking :P
<whitequark> I specifically emphasize how NIFs in erlang is equivalent to drivers in linux
<whitequark> are*
<tristan__> you have to have a preemption plan, which is what reductions are... don't know why this is an argument, haha
<mrvn> whitequark: say you run erlang on bare metal. Then an interrupt fires for the network card and you need switch to the network thread to handle it. But you can't. You have to set some flag in the scheduler that scheduling is required and return. Then the current thread continues runnning till the end of its reduction before the scheduler can switch tasks.
<whitequark> mrvn: I suggest you to look up how this is done in OSes
<whitequark> deferred interrupt handling, etc
<mrvn> whitequark: In an OS the interrupt fires, you store the current register on the old processes stack, switch address space and stack, load the new threads registers from the stack and return from interrupt running the new process.
<whitequark> it's more or less what you are describing. an interrupt fires, does an absolute minimum of work and schedules a tasklet to do the grunt work
<whitequark> for a network card. at least this is how it works in linux and afaik windows
<mrvn> You can do defered interrupt handing, true. But in erlang you must.
<whitequark> I have never heard of an OS which performs a context switch from inside an interrupt handler for something except a timer tick.
<mrvn> whitequark: linux does
<dr_df0> whitequark: yes, you're right - in Windows they call it deffered procedure AFAIR
<mrvn> on return from interrupt it checks if a task switch is sensible and then switched before actually returning.
<whitequark> mrvn: so it's an optimization
<mrvn> its preemption
<tristan__> it is preemption, yes
<tristan__> but not required for preemption
<whitequark> ok
ollehar has joined #ocaml
<whitequark> now I don't know for sure if erlang does this, but it sounds entirely possible to zero the reduction count for the current thread on some external event
<mrvn> whitequark: but that isn't the same.
<whitequark> so, excluding NIFs, the switch will occur before any operation the thread will execute.
<whitequark> how is that different from interrupts in the context of an erlang abstract machine?
<mrvn> whitequark: the switch would occur after the currently running operation.
<mrvn> i.e. the next time the erlang thread decides to modify the reduction count.
<whitequark> [some] real CPUs don't respond to interrupts immediately, too
<whitequark> or maybe even all
<mrvn> whitequark: I don't know any cpu that doesn't have a disable interrupts.
<whitequark> I was thinking about instructions which can't be interrupted.
<whitequark> e.g. on AVR you can't interrupt a jmp, which takes 2 cycles.
<mrvn> most cpus have read-modify-write instructions that run multiple cycles without being interruptibel.
<whitequark> (this actually broke my code once :/)
<whitequark> yeah.
<mrvn> But I think we can let a delay of a few cycles pass.
<whitequark> sure, erlang's operation granularity is higher, but the point is that they're bounded by a very small constant
<whitequark> so there is no significant difference
<tristan__> ok I'm out, but it is explicitly NOT cooperative scheduling :)
<mrvn> But it is.
<whitequark> compared to any kind of cooperative environment: go, node.js, lwt (I think), ... where an uninterruptible operation can take unbounded time
<mrvn> uninterruptible operation == NIF
<whitequark> == a driver
tobiasBora has quit [Ping timeout: 272 seconds]
<mrvn> I grant you that it is way better than haskell or ocaml where task switching only happens on alloc(). But it is still the current running thread checking verry verry often if it should stop running (reducing its reduction count).
<mrvn> hence compiler enforced cooperative multitasking.
<whitequark> it is still a CPU checking very very often if it should execute an interrupt handler
<mrvn> that's a hardware constraint.
strobegen1 has quit [Quit: Leaving.]
yminsky has joined #ocaml
<whitequark> hm?
<mrvn> The hardware can't interrupt in the middle of an opcode.
<mrvn> so yeah, it breaks down at that level.
<whitequark> ok, so that's a VM constraint :)
<whitequark> imagine I built an erlang processor, it would check for the interrupt flag after every VM operation
<mrvn> is every atomic VM operation a reduction?
<whitequark> that's a good question
<mrvn> and xyour erlang processor wouldn't have NIFs
<whitequark> mrvn: why not? NIFs are bound to ports, it could wait for a bus operation to complete
<mrvn> from the way it is described in the blog a built-in-function (BIF) does reduce the reduction count but not atomically. It would run for a while and then say "Ok, I've used up 10 reductions now".
adr has quit [Quit: Quitte]
<whitequark> similarly to how contemporary CPUs can wait for a veeeery long time for a memory transaction to complete
<mrvn> whitequark: the wait for a bus operation would be an atomic instruction. 1 reduction.
<whitequark> mrvn: but it would still lock for an unbounded time
<mrvn> if it's unbound then that would violate real-time properties for sure. Would be verry bad for preemption.
<mrvn> Does waiting for a port block all threads in erlang?
<whitequark> no, only the one which is waiting
<mrvn> so it isn't atomic. your erlang processes must no block on it then.
<whitequark> you're right: a badly written NIF would force a chunk of erlang threads (whatever's scheduled for that core) to wait
<mrvn> anyway. The reason I wondered was because I would love to have a preemptible ocaml. But every language I looked at so far all use some form of safe points for scheduling.
<whitequark> wouldn't this be a non-issue in ocaml? it currently uses 1:1 pthreads, no?
<whitequark> well, can use
Xenasis has quit [Remote host closed the connection]
<mrvn> python, ocaml, haskell do it on memory allocation. erlang inserts the reduction count stuff. and so on.
Xenasis has joined #ocaml
<mrvn> ocaml even has a global lock. One thread has the lock and runs and all others wait for it.
zpe has joined #ocaml
<mrvn> Only C code runs in parallel.
<whitequark> ruby does it on a timer. it sets up SIGVTALRM to fire at every 10ms and forces the currently running thread to relinquish the global lock somehow
<pippijn> perl can have multiple perl interpreters per process
<whitequark> mrvn: parallel and preemptive aren't even related properties
<mrvn> whitequark: In ocaml it has a timer too and that sets the allocation limit of the thread to 0 so the GC runs on the next allocation and the scheduler is hooked into the GC.
<mrvn> whitequark: Like you suggested setting the reduction count to 0 earlier.
<whitequark> I take it let f () = f (); f() doesn't allocate?
<whitequark> *let rec
<mrvn> whitequark: Nope. And that is where you can write NIFs in ocaml.
<whitequark> that sucks
<mrvn> Rarely happens.
<whitequark> but I don't know how else can you do that if you want native code and have a global lock
<mrvn> Any sensible code will do some allocation.
<whitequark> an ideal path would be to get rid of the global lock, that'd also give you parallelism
<whitequark> has anyone considered this?
<mrvn> whitequark: A way around it is to insert extra safe points in code that doesn't do allocs.
<whitequark> mrvn: sure.
<mrvn> whitequark: removing the lock requires a multi core capable GC. There are projects that play with that.
<whitequark> it's not really interesting unless you write realtime sw in ocaml
<whitequark> since as you correctly said, that rarely happens in practice
<mrvn> if you write realtime sw in whitequark> it's not really interesting unless you write realtime sw in ocaml
<mrvn> if you write realtime sw in ocaml then you just have to be carefull not to produce (near) infinite loops without alloc.
<whitequark> and you'd have worse problems than that. I think ocaml's gc is far from being realtime
<mrvn> ocamls GC does its work in small slice. Doing minor and major heaps and compaction passes. The compation pass could be a stop-the-world kind of thing. Not sure.
<whitequark> yeah, talking about the compaction pass
<mrvn> Never had it stop for seconds like e.g. java though.
<mrvn> I think compation is split into slices too.
<whitequark> I think java has true multithreaded collection for a very long time
zpe has quit [Ping timeout: 272 seconds]
<whitequark> Java had concurrent collection since at least 2006
<whitequark> (look for CMS, concurrent mark&sweep)
<mrvn> "the parallel collector will experience pause times longer than one second on many data size and hardware combinations; conversely, the concurrent collector may not be able to keep pauses shorter than one second on some combinations." >1s pause is horrible for something interactive.
<mrvn> GC with multiple cores is really hard.
<whitequark> sure, if you need low latency, you'd need to tweak the GC and your code
<mrvn> I'm off to watch doctor_who_2005.50th_anniversary_special.the_day_of_the_doctor.
<mrvn> didn't get a seat at the cinema. :(
ulfdoz has quit [Ping timeout: 245 seconds]
wormphlegm has quit [Quit: leaving]
wormphlegm has joined #ocaml
<Drup> mrvn: still downloading, my connection is too slow T___T
cesar has joined #ocaml
cesar is now known as Guest39893
w0rm_x has joined #ocaml
WraithM has quit [Ping timeout: 246 seconds]
w0rm_x has left #ocaml []
WraithM has joined #ocaml
Guest39893 has quit [Read error: Connection reset by peer]
willy_ has joined #ocaml
Yoric1 has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
willy_ has quit [Ping timeout: 245 seconds]
Arsenik has quit [Remote host closed the connection]
boogie has quit [Remote host closed the connection]
zpe has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
WraithM has joined #ocaml
gasche has quit [Ping timeout: 272 seconds]
rand000 has joined #ocaml
thomasga has quit [Quit: Leaving.]
gasche has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
breakds has quit [Quit: Konversation terminated!]
tane has quit [Quit: Verlassend]
rand000 has quit [Quit: leaving]
zpe has joined #ocaml
yminsky has quit [Quit: yminsky]
zpe has quit [Ping timeout: 265 seconds]
cesar has joined #ocaml
gnuvince has quit [Remote host closed the connection]
cesar is now known as Guest18384
nikki93 has quit [Remote host closed the connection]
Guest18384 has quit [Remote host closed the connection]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
BitPuffin has quit [Read error: Operation timed out]
madroach has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
Yoric1 has quit [Ping timeout: 272 seconds]
zpe has quit [Ping timeout: 246 seconds]