adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
segmond has joined #ocaml
fluter has joined #ocaml
S11001001 has joined #ocaml
rgrinberg2 has quit [Ping timeout: 260 seconds]
mort___ has quit [Quit: Leaving.]
AltGr has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 250 seconds]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
swgillespie has joined #ocaml
psy_ has joined #ocaml
obadz has quit [Ping timeout: 252 seconds]
obadz has joined #ocaml
rgrinberg2 has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg2 has quit [Ping timeout: 260 seconds]
higgs has quit [Ping timeout: 240 seconds]
rgrinberg2 has joined #ocaml
higgs has joined #ocaml
obadz has quit [Ping timeout: 240 seconds]
lolisa has joined #ocaml
obadz has joined #ocaml
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ocaml
Algebr has joined #ocaml
lolisa has quit [Quit: meow]
lolisa has joined #ocaml
lolisa has quit [Quit: meow]
rgrinberg2 has quit [Ping timeout: 264 seconds]
empyrean has quit [Ping timeout: 250 seconds]
rgrinberg2 has joined #ocaml
struk|work has quit [Ping timeout: 246 seconds]
tnguyen has quit [Read error: Connection reset by peer]
tnguyen has joined #ocaml
darkf has joined #ocaml
higgs has quit [Ping timeout: 240 seconds]
johnf has joined #ocaml
gabemc has joined #ocaml
MercurialAlchemi has joined #ocaml
mac10688 has quit [Ping timeout: 252 seconds]
tmtwd has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 260 seconds]
Algebr has quit [Remote host closed the connection]
rgrinberg2 has quit [Ping timeout: 264 seconds]
rgrinberg2 has joined #ocaml
Algebr has joined #ocaml
palomer has joined #ocaml
Algebr has quit [Remote host closed the connection]
palomer has left #ocaml [#ocaml]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
mea-culpa has quit [Remote host closed the connection]
mea-culpa has joined #ocaml
MercurialAlchemi has joined #ocaml
johnf has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
igoroliveira has quit [Quit: Connection closed for inactivity]
Krikey_Sanchez has joined #ocaml
<Krikey_Sanchez> are type variables consistent across a module?
<Krikey_Sanchez> i.e. if I have some functions in a module that all use 'a, is that 'a bound to be the same when I compose those functions?
<flux> krikey_sanchez, the scope of 'a is the one function
<flux> actually, it is only its signature
<flux> krikey_sanchez, though may I not be understanding what you mean..
yurug has joined #ocaml
<flux> krikey_sanchez, you can have: let identity a = a and let identity2 a = a (both 'a -> 'a) in the same module, and you can just use those both function whichever values yuo want
<flux> regardless of their type
MercurialAlchemi has quit [Ping timeout: 255 seconds]
tmtwd has quit [Ping timeout: 252 seconds]
mea-culp` has joined #ocaml
mea-culpa has quit [Ping timeout: 250 seconds]
Kakadu has joined #ocaml
rks` has quit [Ping timeout: 246 seconds]
rks` has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
yurug1 has joined #ocaml
yurug has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
mea-culp` is now known as mea-culpa
yurug1 has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
yurug has quit [Ping timeout: 264 seconds]
darkf_ has joined #ocaml
bitbckt has quit [Ping timeout: 240 seconds]
yurug has joined #ocaml
_habnabit has quit [Ping timeout: 240 seconds]
segmond has quit [Ping timeout: 240 seconds]
rossberg has quit [Ping timeout: 240 seconds]
yurug1 has joined #ocaml
darkf has quit [Ping timeout: 240 seconds]
cball has quit [Ping timeout: 240 seconds]
icicled has quit [Ping timeout: 240 seconds]
yurug has quit [Ping timeout: 272 seconds]
darkf_ is now known as darkf
yurug1 has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
qrvpzvb has joined #ocaml
gabemc has quit [Ping timeout: 255 seconds]
yurug has quit [Read error: Connection reset by peer]
yurug has joined #ocaml
cball has joined #ocaml
segmond has joined #ocaml
ely-se has joined #ocaml
rossberg has joined #ocaml
icicled has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
mea-culpa has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 264 seconds]
<ely-se> btw about that subtyping questino I asked here
<ely-se> I posted it on Stack Overflow and got some answrs:
ibor has joined #ocaml
fluter has joined #ocaml
yurug has joined #ocaml
Algebr has joined #ocaml
<orbitz> is whitespark on vacation?
<orbitz> Or change names?
<flux> I think the key is in that what does one want to communicate with the term 'subtype'. I think usually people mean that you can have a value with interface X but a function on interface Y, and if interface Y is a subtype of interface X, then you may apply the function with the argument a
<flux> but with polymorphic arguments you don't really get to say anything at all about the parameter
<flux> there is no incompatibility with any value, there is no way to extract any kind of information out from the argument - except by given other operators with the exact same bound type variables, and loopholes such as ocaml polymorphic comparisons
keen________ has joined #ocaml
keen_______ has quit [Ping timeout: 260 seconds]
<flux> in fact if you say that 'a is a subtype of all type in ocaml, one might thing you're talking about Java's Object class, which could not be further from the thruth.. :)
Kakadu has quit [Remote host closed the connection]
<ely-se> no, Object is only a subtype of itself
<Algebr> How do I use C++ code in C bindings? for example I want this line to compile std::vector<uint8_t> *output = (std::vector<uint8_t> *)data;
<Algebr>
<ely-se> why are you casting vectors
<Algebr> adding -llibc++ to _oasis's CClib didn't work.
<Algebr> that doesn't matter, I just need to know how to have this compile
<orbitz> Does anyone know how this trick Core.Command does where you can construct a function call like... (Command.(empty +> string) will then be able to call a fun of type (s -> unit -> unit)?
<Algebr> I get this compile error, : error: expected expression std::vector<uint8_t> *output = (std::vector<uint8_t> *)data; I'm not sure what I need to say in _oasis to make this work
<companion_cube> orbitz: imaplet
<companion_cube> you can use 'opam search' for this sort of things
<companion_cube> and whitequark doesn't do much OCaml those days, if you were wondering
<orbitz> Oh no, how come/
<companion_cube> he switched to rust, apparently; but my feeling is that any language will annoy him eventually
<orbitz> I have a similar problem
<orbitz> Has he transitioend his protobuf stuff over to someone else?
Haudegen has quit [Ping timeout: 268 seconds]
<ely-se> if you think a language annoys you, just try JavaScript for a moment and you'll love the other one again
<orbitz> companion_cube: imaplet? An imap server? Is this re: Core.Command?
<companion_cube> it's re: imap
<companion_cube> ohhh sorry, imap /server/
<orbitz> Did I ask about an imap server?
<companion_cube> I have the commit rights to the ppx_protobuff, and he does maintain his libs a bit
Krikey_Sanchez has quit [Ping timeout: 272 seconds]
<orbitz> oh, you were talking to "oriba" :)
<companion_cube> awwww
<orbitz> who was asking about smtp/imap
<orbitz> anyways, perhaps you have an idea of how to solve this, companion_cube
<companion_cube> sorry, my Levenshtein module made me confused :p
<orbitz> Do you have time to listen for a bit?
orbifx has joined #ocaml
<orbifx> hello all
<orbitz> orbifx: get your own first 4 characters of your name.
ely-se is now known as orbilyse
<orbifx> lol
<orbifx> never thought it would get this close :p
<orbitz> I started this orbi thing! Get off my lawn.
<orbilyse> urbi et orbi
orbilyse is now known as ely-se
mort___ has joined #ocaml
<orbifx> mine is short for orbital_fox
<orbifx> which i had 2 years less than you did :P
<ely-se> mine is long for elyse
<companion_cube> and I suppose orbitz is short for orbital_zorro
<orbifx> just making us feel old
<orbifx> companion_cube: lol
<ely-se> orbital_companion_cube
<companion_cube> mine is short for companion_cube
<companion_cube> spaaaaaaace
<orbitz> There is actually a companion_cube in my apartment somwhere. a fluffy one.
Haudegen has joined #ocaml
<companion_cube> I have a small 3d-printed one :D
<ely-se> drop it on the 1500 Megawatt Aperture Science Heavy Duty Super-Colliding Super Button
<ely-se> I want a 1500 MW laser.
ely-se has quit [Quit: leaving]
mort___ has left #ocaml [#ocaml]
<orbitz> Hrm, I think this will stretch my brain a bit, whee
ely-se has joined #ocaml
yurug has quit [Ping timeout: 272 seconds]
orbifx has quit [Ping timeout: 256 seconds]
orbifx has joined #ocaml
ollehar has joined #ocaml
<mrvn> I want a 1TW super-collider in a cola can.
<ely-se> I've always wanted lasers.
<mrvn> mW lasers are easy to get
<ely-se> I'm in too many IRC channels.
<mrvn> impossible
<ely-se> mrvn: something like 10W would already be very nice to have
<ely-se> Stack Overflow average question quality
<ely-se> especially the ad is hilarious
<qrvpzvb> So, I'm trying to learn OCaml, reading the tutorial. What's the difference between ref and mutable?
<ely-se> qrvpzvb: yeah, ref adds one layer of indirection
<ely-se> what other languages do you know?
<mrvn> ely-se: The first thing you need to learn about c++ is how to read error messages.
<mrvn> qrvpzvb: basically nothing.
<ely-se> mrvn: once you know std::vector and you know int, you know C++. the rest is details. 1500 pages of details
<mrvn> qrvpzvb: 'a ref is a { mutable data : 'a; }
<ely-se> ADL is my favourite C++ feature because it surprises so many newbies :)
<qrvpzvb> Why don't they use the same syntax then?
<mrvn> qrvpzvb: because ref is syntactic suggar so you don't have to define a record every time.
ibor has quit [Ping timeout: 256 seconds]
<mrvn> qrvpzvb: you don't want to have to type name.data every time.
<ely-se> I think the language would be simpler without mutable, and ref suffices
<mrvn> ely-se: other way around. { mutable x : int; mutable y : int; mutable z : int; } would be bad with refs
<ely-se> why?
<qrvpzvb> Can you put refs in records?
<mrvn> ely-se: because refs would be 3 pointers to int while the the record is one pointer to 3 ints.
<ely-se> qrvpzvb: sure, they're just normal values
<dmbaturin> Are there thrift bindings that aren't java written in ocaml? :)
<qrvpzvb> OK then... thanks
<dmbaturin> ely-se: That would be SML.
<dmbaturin> ely-se: I just thought if it would be better if records that allow mutable fields were distinct from those that don't.
<ely-se> mutability is for peasants anyway :p
<qrvpzvb> Does ocaml have some build system?
<ely-se> I use ocamlbuild and bash scripts. there may be other solutions
ggole has joined #ocaml
huza has joined #ocaml
<qrvpzvb> Yeah, I just saw ocamlbuild
ollehar has quit [Ping timeout: 246 seconds]
troydm has quit [Ping timeout: 264 seconds]
Kakadu has joined #ocaml
ely-se has quit [Quit: lunch]
ely-se has joined #ocaml
Algebr has quit [Remote host closed the connection]
jonludlam has joined #ocaml
Simn has joined #ocaml
ely-se has quit [Quit: leaving]
ollehar has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
libertas has joined #ocaml
Tchou has joined #ocaml
<companion_cube> yay, new release of irc-client! :)
<Armael> cool
ely-se has joined #ocaml
ibor has joined #ocaml
Tchou has quit [Quit: leaving]
<johnelse> It's backwards incompatible, but I think the new API is nicer (thanks largely to companion_cube!)
<Armael> it definitely is
<Armael> thanks a lot for the release
obadz has quit [Ping timeout: 250 seconds]
<johnelse> no problem, and sorry it took a while - I've been busy at work, and sadly I can't even tangentially call it work any more :)
obadz has joined #ocaml
_habnabit has joined #ocaml
AltGr has left #ocaml [#ocaml]
bitbckt has joined #ocaml
<qrvpzvb> Is anyone using vim for OCaml?
rgrinberg2 has quit [Ping timeout: 246 seconds]
<johnelse> qrvpzvb: yep, it's quite nice with merlin
ibor has quit [Ping timeout: 250 seconds]
<companion_cube> +1
<ely-se> qrvpzvb: of course
<qrvpzvb> I'm installing merlin now
<qrvpzvb> Appart from that, do you use any other "special" plugin?
bitbckt has quit [Ping timeout: 240 seconds]
_habnabit has quit [Ping timeout: 240 seconds]
<ely-se> no
<qrvpzvb> s/appart/apart
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
<johnelse> merlin plugs into syntastic so you'll probably want that installed too
<companion_cube> yep
<dmbaturin> ...and does anyone here use thrift at all?
<orbifx> qrvpzvb: I am, for about 2 days. No plubins yet
freehck has joined #ocaml
ollehar has quit [Remote host closed the connection]
_habnabit has joined #ocaml
bitbckt has joined #ocaml
bitbckt has quit [Ping timeout: 240 seconds]
_habnabit has quit [Ping timeout: 240 seconds]
ibor has joined #ocaml
<orbifx> any game development with OCaml?
<Kakadu> I remember a guy who did some posts about it
<Kakadu> Antony Traveler or something like that, orbifx
Haudegen has quit [Ping timeout: 244 seconds]
<dmbaturin> orbifx: Why write games when you can write compilers? ;)
<dmbaturin> I remember someone coming to here for help with a 3D tennis game.
rgrinberg2 has joined #ocaml
<flux> I wrote this! good luck compiling it! https://modeemi.fi/~flux/goba/
Submarine has joined #ocaml
Submarine has joined #ocaml
<flux> I think ocaml could do with some nice game engine that would work on top of opengl.
<flux> bonus points with running stuff in the background thread and letting to interact with it from the toplevel.
<flux> I really should port that one to OpenGL some day..
Haudegen has joined #ocaml
rgrinberg2 has quit [Ping timeout: 250 seconds]
<bernardofpc> companion> I agree that the lack of numeric types is annoying -> it's strange to feel that "adding xor 0xff" is bad, but doing 2n+1 / (n-1)/2 full time is not
<bernardofpc> palomer> is it possible to find all the files installed by an opam package? -> +1 to that request :d
<flux> hmm, does opam even track that?
<orbifx> Kakadu: I can't find anything on him
_andre has joined #ocaml
<orbifx> Armael: thanks, good read
empyrean has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
BitPuffin has joined #ocaml
rgrinberg2 has joined #ocaml
<orbitz> Anyone know their applicatives :)
rgrinberg2 has quit [Ping timeout: 252 seconds]
<ely-se> yes i do i do i do!
<Drup> what's the question ?
<orbitz> I'm not sure if I'm barking up the wrong tree
<ely-se> whether anyone know their applicatives
<orbitz> But I'm trying to make a mroe genralized "with" construct
<orbitz> so I want to do: with_resources (file foo <*> socket bar) (fun file socket -> ...)
<orbitz> and have construction and destruction logic run around the fun. Is that something I can do with applicatives?
sepp2k has joined #ocaml
<Drup> yes, but that's not how you would write it
<Drup> you would it like "run (pure (fun file socket -> ...) $ file foo $ socket bar)"
<Drup> ($) being the operator of type ('a -> 'b) t -> 'a t -> 'b
<orbitz> Sure
<Drup> 'b t
<ely-se> I like how F# does that. You write "use" instead of "let", and it'll desugar to a try-finally expression :D
<orbitz> The problem I'm running into os (<*>) or ($) depending on your notation. I'm getting confused in the types
rand__ has joined #ocaml
rand__ has quit [Client Quit]
<qrvpzvb> How do I take that first element of a list in a let? Like let a = car mylist;
<Drup> type _ t = Pure : 'a -> 'a t | Finalized : ('a * 'a -> unit) -> 'a t | App : ('a -> 'b) t * 'a t -> 'b t
<Drup> let ($) f x = App (f, x)
<orbitz> qrvpzvb: you don't, use match
<orbitz> Drup: you clever bastard.
<Drup> Thanks you, I guess
<Drup> :D
<orbitz> Does one need GADTs for this or did you just want ot write it as GADTs?
<Drup> you need the gadt
<Drup> (for App)
<qrvpzvb> orbitz: I did, but I want to do it again.
<companion_cube> I prefer the simple with_foo : resouce -> f:(resource' -> 'a) -> 'a
mingus__ has joined #ocaml
<qrvpzvb> orbitz: I mean, I want the first of the first
<orbitz> qrvpzvb: match
<Drup> qrvpzvb: pattern match deeper :p
<orbitz> Or use List.hd
<ely-se> match xs with | (x :: _) :: _ -> ...
<orbitz> companion_cube: that sucks for multiple resoruces though
<companion_cube> just nest them
<ely-se> eww List.hd is a partial function
<orbitz> bleh
<dmbaturin> Partial functions are sinful!
<orbitz> ely-se: we're in Ocaml, lots of partial functions!
<ely-se> Are all functions partial functions?
<ggole> If the compiler is buggy enough.
<ely-se> it seems so
<ely-se> that total functions is a subset of partial functions
<ely-se> "a partial function from X to Y (written as f: X ↛ Y) is a function f: X′ → Y, for some subset X′ of X."
<ely-se> X is a subset of X
<orbitz> Drup: is there any way to strucutre it such that i can do with_resources resources f? I suspect this is why Core.Command has explicit () in teh function call
<Drup> ely-se: in all technicality, every function can raise an exception as soon as it allocates in ocaml, and such it's partial.
<qrvpzvb> If I want to use "as" in a function definition, do I have to use parens?
<Drup> qrvpzvb: yes
<orbitz> qrvpzvb: probablu
<ely-se> what is as?
<dmbaturin> It's a keyword. :)
<Drup> orbitz: probably, try ^^'
<ely-se> it's the ungooglable kind of keyword
<orbitz> ely-se: | (x, y) as your_butt ->
<Drup> ely-se: (<pattern> as <identifier>)
<ely-se> ohh
<Drup> is a pattern
<ely-se> like @ in Haskell
<Drup> yes
<ely-se> absolutely fascinating
<dmbaturin> ely-se: I like it in | _ as foo -> ... especially.
<ely-se> why not just foo ->
LnL has joined #ocaml
yurug has joined #ocaml
<dmbaturin> To clarify the intent. That would work too of course.
<Drup> dmbaturin: I'm not sure what it's supposed to clarify
<ely-se> that you are ignoring the value but not really :P
<dmbaturin> Drup: Well, then it may be my illusion. :)
<orbitz> It's perfectly clear to me the intent was to not be clear.
<orbitz> I consider it a success
<dmbaturin> orbitz: Well, there are more subtle ways not to be clear.
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
rgrinberg2 has joined #ocaml
xet7_ has quit [Ping timeout: 240 seconds]
xet7_ has joined #ocaml
rgrinberg2 has quit [Ping timeout: 240 seconds]
zpe has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
ontologiae has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
<qrvpzvb> Say I have a type constructor Many of int * 'a; Then, would "let p = (1, 123) in Many p" work? Because it's not working for me here...
yurug has joined #ocaml
<Drup> qrvpzvb: you need to write "Many of (int * 'a)"
<Drup> with parens
<Drup> then it will work
<Drup> the memory layout will be less compact, but that matters very little
Haudegen has joined #ocaml
<qrvpzvb> Drup: Oh... So Many of int * 'a needs two distinct "arguments" and Many of (int * 'a) needs one pair of two
<Drup> yes
<dmbaturin> qrvpzvb: I'll be a smartass and say that Many here is a data constructor, not a type constructor. :)
<qrvpzvb> dmbaturin: Correction dully noted :P
<qrvpzvb> Drup: Thanks!
Haudegen has quit [Ping timeout: 246 seconds]
yurug has quit [Read error: Connection reset by peer]
yurug1 has joined #ocaml
yurug has joined #ocaml
yurug1 has quit [Read error: Connection reset by peer]
yurug1 has joined #ocaml
yurug has quit [Read error: Connection reset by peer]
rgrinberg2 has joined #ocaml
yurug has joined #ocaml
yurug1 has quit [Read error: Connection reset by peer]
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
Haudegen has joined #ocaml
* ggole wonders how long that has been tripping people up
<Drup> ggole: since it has been introduced, obviously
yurug has quit [Read error: Connection reset by peer]
yurug1 has joined #ocaml
_habnabit has joined #ocaml
<ggole> Yeah
<ggole> I remember Appel referring to it as "Cardelli's optimisation", so presumably it was his ML compiler
yurug has joined #ocaml
yurug1 has quit [Ping timeout: 244 seconds]
slash^ has joined #ocaml
rossberg has quit [Remote host closed the connection]
<dmbaturin> ggole: Got a reference?
zpe has joined #ocaml
<ggole> "A Critique of Standard ML - Appel"
Tekilla has joined #ocaml
<companion_cube> "how much better OCaml is compared to SML — #ocaml"
<ely-se> "why elyse is awesome - elyse"
zpe has quit [Ping timeout: 250 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
<companion_cube> "letter for elyse — Beethoven"
<ggole> OCaml contains a number of the improvements suggested in the paper, fwiw :)
<dmbaturin> ggole: Oh. I read that paper, but I don't remember that point. I probably should read it again.
nullcatxxx_ has joined #ocaml
ontologiae has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
<Drup> ggole: I just schemed it, it's amusing how much of those problems are solved in OCaml, I wonder if it was by mere accident or a consequence of the paper
<Snark> Drup: "skimmed" ?
<rks`> many*, while we're at it
* Snark nods
<Drup> Snark: huuum *lookup dictionary*. Probably, yes.
ely-se has quit [Quit: leaving]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
higgs has joined #ocaml
higgs has quit [Ping timeout: 256 seconds]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
Submarine has quit [Remote host closed the connection]
Major_Biscuit has joined #ocaml
Major_Biscuit has quit [Client Quit]
chambart has joined #ocaml
nullcatxxx_ has joined #ocaml
yurug has quit [Ping timeout: 244 seconds]
nullcatx_ has joined #ocaml
orbifx has quit [Quit: WeeChat 1.3]
nullcatxxx_ has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
<qrvpzvb> You skim through a book, you scheme against your government
marsam has joined #ocaml
<dmbaturin> qrvpzvb: Guy Steele schemes against static typing.
<dmbaturin> What was the correct procedure for cleaning up traces of compiling with an older version after opam switch? Even after running oasis setup and ./configure again the configuration still refers to 4.02.1 and I can't remember how I fixed it last time.
<Drup> distclean, twice
<enjolras_> it happens to me sometimes, i don't know why. I just run make clean distclean twice
<dmbaturin> Drup, Enjolras_: Oh. Thanks, that was it.
ousado has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
higgs has joined #ocaml
mort___ has joined #ocaml
ely-se has joined #ocaml
libertas has quit [Quit: Lost terminal]
darkf has quit [Quit: Leaving]
malc_ has quit [Ping timeout: 246 seconds]
rgrinberg2 has quit [Ping timeout: 255 seconds]
rgrinberg2 has joined #ocaml
jwatzman|work has joined #ocaml
ontologiae has joined #ocaml
Radvendii has joined #ocaml
demonimin has quit [Remote host closed the connection]
<Radvendii> can someone help me with installing opam libraries on mac?
<Radvendii> I keep getting an error with ocamlfind
<Radvendii> and google is not turning up anything useful
mingus__ has quit [Remote host closed the connection]
ygrek has joined #ocaml
demonimin has joined #ocaml
Major_Biscuit has joined #ocaml
<Drup> Radvendii: have you done "eval `opam config env`" ?
<Radvendii> Drup: yes.
<Drup> huum.
<Drup> you will need to provide details.
<Radvendii> Drup: what details would you like?
shinnya has joined #ocaml
<Radvendii> the error message?
<Drup> the error message would be a good start ...
<Drup> and how you get it, and everything really
<Radvendii> hahaha
<Radvendii> So simplest case: I run brew install opam
<Radvendii> then opam init
xet7_ has quit [Ping timeout: 264 seconds]
<Radvendii> then eval (opam config env)
xet7_ has joined #ocaml
<Radvendii> which is the correct syntax on fish
<Radvendii> then opam install ocamlfind
<Radvendii> Could not build ocamlfind. The most common reason for that is a missing 'm4' system package.
<Radvendii> But m4 is installed
<Radvendii> and I can install ocamlfind manually
<Radvendii> in fact, I have
<Radvendii> can I just tell opam to use that copy?
chambart has quit [Ping timeout: 264 seconds]
<qrvpzvb> Put that custom install directory in your PATH
<Radvendii> it's installed in /usr/local/bin
<Radvendii> it's in my PATH
<Drup> Radvendii: please pastebin what you get with `opam install -v ocamlfind"
<Drup> (and "opam config report" while we are at it)
<Radvendii> does that work?
<Radvendii> first time using pastebin
ollehar has joined #ocaml
ely-se has quit [Quit: Leaving]
<Drup> huh, what's your os ?
<Radvendii> mac os x
<Radvendii> yosemite
<Radvendii> but this was happening on mavericks too
<Drup> this is very strange
<Radvendii> hahaha
<Drup> I'm not competent in mac things, so I'll let someone else try
<Radvendii> that doesn't sound good
<Drup> Radvendii: in the meantime, you can try a workaround by doing "opam switch 4.02.3" (which will install a new compiler locally)
jonludlam has quit [Ping timeout: 244 seconds]
Algebr has joined #ocaml
Algebr has left #ocaml [#ocaml]
<Radvendii> i've tried that. it doesn't work either
nullcatx_ has quit [Ping timeout: 272 seconds]
<smondet> Radvendii: `opam config env` has a --shell=fish option to output the right things (I've never used fish)
mort___ has quit [Ping timeout: 240 seconds]
m__ has joined #ocaml
<m__> hi, what could be the factors to choosre between Lwt, Async or Unix sockets to implement a tcp server?
bitbckt has joined #ocaml
<enjolras_> m__: (Lwt/Async) vs Unix socket : ease of programming
<enjolras_> if you go with Unix you probably will need something like libevent, and use an event loop
<enjolras_> (Lwt/Async) are considerably easier to use
<enjolras_> Lwt vs Async : can't comment, never used async
<adrien> well, it also depends on the usecase
<adrien> if you want a single client at a time, Unix is fine :P
<m__> at the moment yes. But I might need to have it with multiple users later
ely-se has joined #ocaml
<adrien> lwt or async then :P
<enjolras_> Lwt is an abstraction on top of unix socket and poll like syscall
Tekilla has quit [Quit: Quitte]
<m__> aha, I wanted to ask this
<m__> thanks
<m__> but Lwt is cooperative. Does that hold for unix sockets?
<m__> which Lwt uses
<enjolras_> basically, for unix socket, it wrapps socket operation to use non blocking io
<enjolras_> and if the io would block, it will enter the poll loop and be resumed when data are avaible
<enjolras_> while your thread is sleeping in poll loop, an other thread might execute
<enjolras_> hence cooperative
yurug has joined #ocaml
<adrien> lwt exposes all network-related functionality that Unix has (and more) through its own APIs which are made cooperative and the type system ensures you don't mix cooperative and uncooperative ones
Submarine has joined #ocaml
Submarine has joined #ocaml
<enjolras_> (unless you explicitly ask for it)
<m__> thanks
Major_Biscuit has quit [Quit: WeeChat 1.1.1]
<m__> is Lwt_io the best library for such implementation?
<m__> (for Lwt)
mort___ has joined #ocaml
<flux> best and only I suppose?-)
ontologiae has quit [Ping timeout: 256 seconds]
shinnya has quit [Ping timeout: 244 seconds]
<qrvpzvb> Does OCaml have threads? I know it's single threaded, but Python is single threaded too and it has threads, albeit, they are only useful for IO. Does OCaml have that? (Not that I want to do that, just asking)
marsam has quit [Read error: Connection reset by peer]
<enjolras_> yes, it has threads. See Threads package
<enjolras_> i mean Threads module
<qrvpzvb> But are they OS threads or "green" threads?
<def`> Os threads, with a lock
<enjolras_> OS threads for native code
<qrvpzvb> Just like Python then.
<def`> or vm threads, both are supported.
marsam has joined #ocaml
<qrvpzvb> Thanks!
<def`> yes. although concurrency minads are preferred
<def`> monads*
<enjolras_> i wouldn't use that for io though
<qrvpzvb> Me neither
<def`> why?
<enjolras_> but it can be easy to wrap blocking library written in another langages andnot supporting asynchronous api
yurug has quit [Ping timeout: 265 seconds]
<enjolras_> def`: because i do'nt see any reason not to use cooperative threading for io insteade
<def`> What do you mean by cooperative threading? concurrency monads are common for cooperatice threading
<enjolras_> which fits the job more especially for scaliability. If you want to scale blocking I/Os with preemptive thread you need to start wondering about throttling, ressource limitation
<enjolras_> def`: i think there is a misunderstanding here. I mean i wouldn't use preemptive threads for io
<def`> that's my point why one should prefer monads to threads
<enjolras_> and cooperative threads = monad
<enjolras_> in this case
ontologiae has joined #ocaml
<def`> ahhh :)))) sorry, that's what I meant
higgs has quit [Ping timeout: 244 seconds]
BitPuffin has quit [Ping timeout: 256 seconds]
<adrien> for async disk I/O the answer is simple
<adrien> go outside
<adrien> especially if you were planning on making something cross-platform
<adrien> just go outside, do something else and save your soul
MercurialAlchemi has joined #ocaml
<enjolras_> you're the only one bothering about cross platform :p
<qrvpzvb> UNIX select (and others like it) works with file fds. And Windows has that nice API for asyncIO.
<qrvpzvb> It may not be that good for a huge number of files
<qrvpzvb> (select I mean)
<qrvpzvb> Now, I have no idea if OCaml has a nice library for all that, but in Python we have asyncIO and others like it.
<enjolras_> Lwt is good but it's tied to the unix io model
orbifx has joined #ocaml
<enjolras_> cross platform async io is really hard to design anyway
<enjolras_> cros platform ios is already hard enough
<qrvpzvb> IOs or iOS? :P
<enjolras_> IOs
mv has joined #ocaml
mort___ has quit [Quit: Leaving.]
<mv> Whats the difference between "Xml.xml list option" and "Xml.xml option list" ?
<qrvpzvb> The first is Some [xml1; xml2] or None, the second is [Some xml1; None; Some xml2]
<mv> qrvpzvb, thanks! Makes total sense :)
<mv> ...and I can see where I'm going wrong.
yurug has joined #ocaml
rgrinberg2 has quit [Ping timeout: 268 seconds]
sepp2k has quit [Quit: Leaving.]
higgs has joined #ocaml
Kakadu has quit [Quit: Page closed]
yurug1 has joined #ocaml
yurug has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
sepp2k has joined #ocaml
clog has quit [Ping timeout: 250 seconds]
<Radvendii> smondet: the --shell=fish option doesn't seem to be changing anything about the output, but I'll look into that, it seems promising. Thanks!
clog has joined #ocaml
<smondet> Radvendii: yes I checked the output is very different
<Radvendii> smondet: I think on my machine it's automatically detecting that fish is my default shell and putting in the --shell=fish option for me
<Radvendii> opam seems to be very good at already knowing that I'm using fish
<smondet> ah ok
<Radvendii> is the difference that the fish one outputs set -gx at the beginning of every line?
<Radvendii> and bash has a different syntax?
ontologiae has quit [Ping timeout: 246 seconds]
<qrvpzvb> bash has a different syntax, yes
Simn has quit [Quit: Leaving]
yurug1 has quit [Ping timeout: 240 seconds]
obadz has quit [Ping timeout: 268 seconds]
obadz has joined #ocaml
m__ has quit [Ping timeout: 246 seconds]
cthuluh has quit [Ping timeout: 260 seconds]
swgillespie has joined #ocaml
Algebr has joined #ocaml
Algebr has left #ocaml [#ocaml]
Haudegen has quit [Ping timeout: 268 seconds]
nullcatxxx_ has joined #ocaml
cthuluh has joined #ocaml
Haudegen has joined #ocaml
Kakadu has joined #ocaml
mengu has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
mv has quit [Remote host closed the connection]
<smondet> Drup: is `conf-libev` Vs Lwt nicely documented somewhere? like saying “you should `brew install libev` and `opam install conf-libev` and let the magic happen”
mort___ has quit [Quit: Leaving.]
igoroliveira has joined #ocaml
Haudegen has joined #ocaml
rgrinberg2 has joined #ocaml
mort___ has joined #ocaml
<Drup> I don't have better than that
ontologiae has joined #ocaml
mengu has quit [Remote host closed the connection]
<Drup> http://ocsigen.org/lwt/2.5.0/manual/manual section "the lwt scheduler"
nullcatxxx_ has quit [Ping timeout: 240 seconds]
<smondet> Drup: yes, thanks, I had seen those
nullcatxxx_ has joined #ocaml
<smondet> Drup: is that crazy wiki syntax documented somewhere? :)
<Drup> yes, it's wiki creole
<Drup> it's standard, if you can believe it
<adrien> ='(
nullcatx_ has joined #ocaml
<adrien> creole is
<adrien> not really my cup of tea
<Drup> terrible
<smondet> Drup: found it thatnks → http://ocsigen.org/ocsimore/dev/manual/wiki
hamilto-nyan has quit [Quit: Now that it's all over and done, now that you find, now that you're whole.]
<adrien> it matches real-world creole: those who know it tend to like it and everyone else is completely lost
nullcatx_ has quit [Client Quit]
<companion_cube> hmm, new type_conv with ppx... wonder if it will make ppx-deriving disappear
<adrien> sensors
<adrien> argh
<companion_cube> pwnd
marsam has quit [Read error: Connection reset by peer]
<adrien> I had started EFOCUS'ing but noticed, cleared, tried to focus the right term and apparently I failed a second time
<companion_cube> the solution is to get back to a neutral window before leaving the IRC client
nullcatxxx_ has quit [Ping timeout: 265 seconds]
mort___ has quit [Quit: Leaving.]
marsam has joined #ocaml
higgs has quit [Quit: Leaving]
<orbifx> how is symmetric processing coming along?
chambart has joined #ocaml
<j0sh> does Vg have the ability to draw pre-existing images, eg photos?
Submarine has quit [Remote host closed the connection]
<Armael> I don't think so, it's for drawing vector shapes
yurug has joined #ocaml
shinnya has joined #ocaml
<j0sh> Armael: yeah, figured as much
<j0sh> cairo and ocaml-cairo looks like it could do the trick
BitPuffin|osx has joined #ocaml
yurug has quit [Ping timeout: 240 seconds]
freehck has quit [Ping timeout: 246 seconds]
obadz has quit [Ping timeout: 264 seconds]
nullcatxxx_ has joined #ocaml
travisbrady has joined #ocaml
ggole has quit []
rand__ has joined #ocaml
obadz has joined #ocaml
<qrvpzvb> Does OCaml have something like Python's beatifulsoup?
<Armael> the closer I know of (i.e. a HTML parser that is relatively tolerant to relatively broken html) is ocamlnet's html parser
<Armael> (the Nethtml module)
<qrvpzvb> Armael: Thanks, I'll check it out
<Armael> you may have to extend the standard DTD (Nethtml.html40_dtd) a bit
ollehar has quit [Ping timeout: 256 seconds]
rgrinberg2 has quit [Ping timeout: 240 seconds]
rgrinberg2 has joined #ocaml
travisbrady has quit [Ping timeout: 260 seconds]
LnL has quit [Ping timeout: 260 seconds]
Guest38 has joined #ocaml
_andre has quit [Quit: leaving]
ollehar has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
travisbrady has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<orbifx> I haven't searched for it yet, but what is the most popular GUI framework for OCaml? And any support for QT?
<companion_cube> probably lablgtk
<companion_cube> (so, gtk)
<orbifx> :/
<Armael> there is lablqt but it's quite experimental atm, I think
<Armael> otherwise a increasingly popular solution is building a gui using html and js
<Armael> binding to some js library and using js_of_ocaml
<Armael> an*
<orbifx> ok
<orbifx> thanks
Major_Biscuit has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
mac10688 has joined #ocaml
<orbifx> what's the equivalent of Haskell's >> in Ocaml?
<Drup> there is none
<Drup> well
<Drup> >>= fun () ->
<Drup> A regular operator wouldn't work with strictness by defualt
<orbifx> thanks Drup
travisbrady has quit [Quit: travisbrady]
<Denommus> some libraries (such as lwt) introduce syntax extensions that translate >> into >>= fun () ->, though
ollehar has quit [Quit: ollehar]
<Drup> yeah, don't use that
marsam has quit [Read error: Connection reset by peer]
<Denommus> rather, >>= fun _ ->
marsam has joined #ocaml
rgrinberg2 has quit [Ping timeout: 260 seconds]
<orbifx> I'll try to remember that
ely-se has quit [Quit: Leaving]
<orbifx> so I'f I have two execvp functions which I want to run one after the other.. what is the convention for writing that?
<Drup> foo x ; bar y
<mrvn> execvp never returns unless it fails
<mrvn> sis you forget a fork?
<mrvn> did
<orbifx> mrvn: will it not return upon completion?
<mrvn> nope
<mrvn> it unloads your program and runs the new program in its place.
<mrvn> maybe you want system()?
<orbifx> mrvn: I do want system
<orbifx> was going to ask if there is a higher level function
<mrvn> Unix has a bunch of higher level process things
<orbifx> yeah
deavid has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 255 seconds]
psy_ has quit [Ping timeout: 250 seconds]
deavid has joined #ocaml
<orbifx> thanks mrvn
lmaocaml has joined #ocaml
Radvendii has quit [Ping timeout: 240 seconds]
Kakadu has quit [Remote host closed the connection]
ygrek has joined #ocaml
Haudegen has joined #ocaml
rgrinberg2 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<orbifx> what made you guys use ocaml?
<mrvn> what would me make use anything else?
<orbifx> You tell me :P
rgrinberg2 has quit [Ping timeout: 244 seconds]
ollehar has joined #ocaml
<ollehar> I can't do gc without tagging or boxing ints, right?
<mrvn> you can but you don't want to
<mrvn> it's called speculative GC
<ollehar> mrvn: oooh
<ollehar> wait, you mean "conservative" gc?
<mrvn> maybe. it's late
<ollehar> where you just analyse the ints for pointers. as opposed to accurate gc.
<ollehar> :)
<ollehar> yes
<ollehar> nope, I don't want to go there, I think.
marsam has quit [Read error: Connection reset by peer]
<bitbckt> s/accurate/precise/
<bitbckt> the opposite of consevative is precise.
<bitbckt> +r
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Major_Biscuit has quit [Quit: WeeChat 1.1.1]
<lmaocaml> you can do away with conservative gc if you have type information during runtime.
<lmaocaml> no need of boxing/tagging.
<mrvn> i.e. tags or boxes
<lmaocaml> nope
<mrvn> yes, for anything on the heap
<lmaocaml> no, look at hlvm :D
Major_Biscuit has joined #ocaml
Major_Biscuit has quit [Client Quit]
<lmaocaml> what i mean by not tagging is you do not have to lose precision
<lmaocaml> like ocaml currently do
<mrvn> lmaocaml: you need a tag somewhere that tells you what is a pointer. You can do that inside the value, in the header of a box, using the prefix of the address, putting it in some parallel memory block or so.
<mrvn> For the stack you can use static debug infos in the DWARF format but for the heap you have to create that dynamically.
<mrvn> you call that from your scheduler.
<mrvn> ups
rgrinberg2 has joined #ocaml
<ollehar> ah, more info, thanks :)
ollehar has quit [Quit: ollehar]
<orbifx> is there a standard-library way to fold a list of booleans ?
<orbifx> like haskel can do `true list`
<Drup> List.fold_left (&&) true ? :D
<orbifx> Drup: thanks, considered that and wondered if there was something more terse.
<Drup> as opposed to haskell, the stdlib is very thin
<Drup> most people use something on top of it
<orbifx> okie
<lmaocaml> mrvn: you have static info of all data types, which can tell you whether they have pointers or not.
<lmaocaml> why do we need to tag dynamically.
<mrvn> lmaocaml: but you don't know what type is on the heap
<mrvn> lmaocaml: you can box everything and put a pointer to the static type into the header of the box.
NickParker has joined #ocaml
<NickParker> Hi all, I'm bashing my head against a wall here... Can I write a recursive function to wait for input on stdin, print the input it gets, and continue doing that until I enter "exit"?
<NickParker> I've somehow spent over an hour googling trying to answer that and come up short...
<mrvn> yes
<lmaocaml> mrvn: right you can store point to static typeinfo. But what do you mean box everything? The type is already boxed if it's in the heap
<mrvn> lmaocaml: 00:48 < lmaocaml> no need of boxing/tagging.
<NickParker> Could you point me towards an example? I keep ending up on pages about reading from files, which seems like it should be similar but I can't make the jump from there to here
<lmaocaml> that was meant to distinguish integer vs pointers.
<lmaocaml> you still do not need to box integers
<mrvn> NickParker: let rec loop () = let line = getline () in print_string line; if line <> "exit\n" then loop () (* basically *)
<mrvn> lmaocaml: if you have a box then the header can contain a bitmap of what is a pointer and what not. That way you don't loose a bit for ints.
<lmaocaml> exactly :)
<mrvn> (for large structures have the bitmap follow the struct)
<lmaocaml> true
<mrvn> or a pointer to a static type info.
<lmaocaml> that is what i was trying to say.
<mrvn> but that is still boxing/tagging.
<mrvn> runtime type infos in C++ are basically a box too
<lmaocaml> well all pointers to data structures are boxed.
<lmaocaml> so you don't add any more indirection
<lmaocaml> but the sizeof structs are slightly larger.
<NickParker> Ugh... thanks a ton @mrvn. As usual, I've left my work off far too long, gotten stressed, and forgotten something about syntax. Not 5 minutes into this ordeal I wrote let rec loop = let line = read_line in print_string line; if line<>"exit" then loop
<NickParker> Forgot that functions without arguments need the ()
<lmaocaml> mrvn: are you a bot?
<mrvn> 42
<lmaocaml> XD
orbifx has quit [Quit: "laterz"]
<mrvn> and no, I don't make tea.
Denommus has quit [Quit: going home]
Radvendii has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Radvendii has quit [Ping timeout: 240 seconds]
raphaelss has joined #ocaml
rgrinberg2 has quit [Ping timeout: 250 seconds]
johnelse has quit [Read error: Connection reset by peer]
siddharthv_away has quit [Read error: Connection reset by peer]
NickParker has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Haudegen has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
qrvpzvb has quit [Ping timeout: 240 seconds]
rgrinberg2 has joined #ocaml
johnelse has joined #ocaml
siddharthv_away has joined #ocaml
johnelse is now known as Guest19197
obadz has quit [Ping timeout: 260 seconds]
obadz has joined #ocaml