adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
waneck has quit [Read error: Connection reset by peer]
AltGr has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
shinnya has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
thomasga1 has quit [Quit: Leaving.]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
mcclurmc has joined #ocaml
nojb has quit [Quit: nojb]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
parcs has quit [Remote host closed the connection]
badon has quit [Disconnected by services]
zpe has joined #ocaml
parcs has joined #ocaml
darkf has joined #ocaml
badon has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
MrScout_ has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
t4nk000 has joined #ocaml
<t4nk000> hey, how's it going? anyone here?
nojb has joined #ocaml
BitPuffin has quit [Ping timeout: 244 seconds]
MrScout has quit [Ping timeout: 272 seconds]
MrScout_ has quit [Ping timeout: 265 seconds]
<t4nk000> hi there, does anyone know how i can reduce the formula: (\xy.y)(\x.xx)(\x.xx)
<t4nk000> i'm new to lambda-calculus
<Drup> 1) It's not really a channel about lambda-calculus 2) Don't ask people to do your homework :p
<t4nk000> haha, drup. i know that. but i couldn't find a channel about it. and yes, it's my homework :) already finished 5 out of 6 exercises and wanna go to bed. it's 2 am here...
ontologiae has joined #ocaml
dav_ has joined #ocaml
dav has quit [Ping timeout: 264 seconds]
MrScout has joined #ocaml
oriba has joined #ocaml
t4nk000 has quit [Quit: Page closed]
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
ygrek has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
araujo has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 240 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
nojb has quit [Quit: nojb]
boogie has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
kalzz has quit [Quit: exit]
MrScout_ has joined #ocaml
MrScout has quit [Ping timeout: 245 seconds]
MrScout_ has quit [Ping timeout: 265 seconds]
kalzz has joined #ocaml
rgrinberg has joined #ocaml
hausdorff has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 250 seconds]
oriba has quit [Quit: oriba]
serge has quit [Remote host closed the connection]
q66[lap] has quit [Read error: Connection reset by peer]
serge has joined #ocaml
zpe has joined #ocaml
q66[lap] has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
hausdorff has joined #ocaml
ebzzry has quit [Ping timeout: 255 seconds]
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
hugomg has quit [Ping timeout: 264 seconds]
govg has joined #ocaml
manizzle has quit [Ping timeout: 265 seconds]
q66 has quit [Quit: Leaving]
ebzzry has joined #ocaml
badkins has quit []
huza has joined #ocaml
boogie has joined #ocaml
Submarine has quit [Remote host closed the connection]
boogie has quit [Client Quit]
huza has quit [Quit: WeeChat 0.3.8]
struktured has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
manud_ has joined #ocaml
samrat has joined #ocaml
manud has quit [Ping timeout: 250 seconds]
<struktured> hi guys, can you evaluate a functor inside a signature ? eg.. module type Key = sig type t end;; module Make(Key:Key) = struct type t = Key.t end;; module type S = functor(Key:Key) -> sig (* the following is not valid syntax, is there a correct way to do this? *) module Instance : Make(Key) end
manud_ has quit [Ping timeout: 245 seconds]
<whitequark> module Instance : module type of Make(Key)
<struktured> excellent, I forgot about that syntax. thanks
hausdorff has quit [Remote host closed the connection]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
phao has joined #ocaml
phao has left #ocaml ["Leaving"]
mcc has joined #ocaml
struktured has quit [Ping timeout: 244 seconds]
struktured has joined #ocaml
hausdorff has joined #ocaml
<mcc> Hello, I was talking in here about a project I am going to do in Ocaml, and I was mentioning in here "I'll use objects and classes!", and everyone was like "Oh no no use modules and functors"
<mcc> The impression was given whatever it was I wanted to do with classes could also be done with modules/functors
<mcc> So I was wondering if I could outline what it is I want to try to do and then verify yes, there is module trickery that approximates it
samrat has quit [Quit: Computer has gone to sleep.]
<mcc> basically, i am implementing an object-oriented language interpreter. to start i want to be able to have, like, a list of items, where each one has a common interface but possibly the data represented therein varies
<mcc> this is the case i normally would think of object polymorphism as tailor made for
claudiuc has quit [Remote host closed the connection]
<whitequark> not really, no
<whitequark> so you could try to represent objects in the guest language using objects in the host language
<whitequark> there are two problems with this approach.
<mcc> "not really" means what
<whitequark> "not really" means that you don't want to use objects for this
<mcc> Like what I basically am thinking is: I might have an object representing a number, and an object representing a string. I want to be able to have both be able to exist in an ordered list together.
<mcc> Okay.
<mcc> I can definitely think of reasons of a host object -> guest object mapping is unwise, but I'm listening.
<whitequark> yes. sure. so the issue with this is that guest objects can fall into two categories
<whitequark> first, primitives. stuff like numbers, strings, or other builtin entities. second, normal, user-defined objects
<mcc> sure
<whitequark> say, you're implementing a method + for a number, right?
<mcc> but the problem sounds basically one and the same to me, because "a user defined object" is just going to be some kind of data structure like a dictionary.
<whitequark> it goes like: method plus other = ..
<whitequark> so inside this method, you need to somehow extract the OCaml number from the object "other"
<mcc> Yes.
<whitequark> in a language that permits downcasting, like, say, Java, you'd just try to cast it.
<whitequark> but OCaml does not have downcasting.
<whitequark> (it doesn't because objects are first-class, in the sense that objects can exist as themselves, without being attached to any class, and they look just like instances of classes)
<whitequark> so what you would do is to define a method, say, repr
<whitequark> that would return a value of type repr = Int of int | String of string | Object of (key*value) list...
<mcc> I could do that or I could do virtual dispatch, but yes
<whitequark> not really, no
<whitequark> how would you implement plus using virtual dispatch?
<whitequark> oh, something like method to_int that either returns an int or raises?
<mcc> call __plus__(), like python does? there's an efficiency question, but.
<whitequark> no, that won't work
<mcc> i could package the plus behavior inside the number object.
<whitequark> at *some point* you need to pull out the OCaml int from the object
manizzle has joined #ocaml
<whitequark> it can't be turtles all the way down
<mcc> okay, i'd probably need a to_int on the right side at least.
<mcc> so it seems like the type repr thing assumes I know all the types at compile time.
<whitequark> yes. that's a) ugly b) essentially equivalent to repr, except it's spread all over and has a less defined behavior
<whitequark> (re to_int)
<mcc> *nod*
<mcc> but i can't load, like, a dynanamic ocaml library or something that adds a new possibility to this repr object that gets called all over
<whitequark> and if you go with repr route, why bother with objects at all?
<whitequark> just operate that type directly
<whitequark> you actually can, since OCaml 4.02
<mcc> i mean, that's not a stopper, i'm just being aware of that
<mcc> ok, that's interesting
<mcc> how would that work?
<whitequark> 4.02 added the so-called extensible variant types
<mcc> cool
<whitequark> you say type x = .., then type x += Foo | Bar
<whitequark> the annoying part of this is that no match statement is ever exhaustive
<whitequark> (because you can never have all constructors in scope, naturally)
<whitequark> and you need to do something with that default case.
<whitequark> in practice, you'd want to call the chain of all the loaded libraries, which would hopefully know what to do with the contructors they add
<whitequark> it's certainly possible, though I'm not sure if this is actually relevant for language implementations. but, I can imagine some cases where you want to define new primitives
<struktured> whitequark: how is that significant different than traditional polymorphic variants?
<struktured> *than
<mcc> whitequark: i'm less interested in defining new primitives and more interested in avoiding painting myself into a corner.
<mcc> or, more appropriately, being aware of which corners i have accepted painting myself into :)
<whitequark> struktured: polymorphic variant can't do that
<mcc> at some point there will be new data types added which have their own data representations, but, they will probably be implemented in c++
manizzle has quit [Ping timeout: 255 seconds]
<mcc> And maybe i'll never even get there who knows
<struktured> whitequark: by no means am I good at polymorphic variants, but I understood you can use the [< ..] or [> ... ] syntax to indicate whether the set is open or closed. When it's open, it indicates that other variant values may exist beyond the ones know in your scope
<whitequark> struktured: yeah, the scoping is different
<whitequark> with polymorphic variants, once you've exhausted the constructors you know, you can't do anything with the rest
<whitequark> it's just a 'a.
<whitequark> with open types, you can pass it to something that has more constructors *in its scope*
<whitequark> mcc: so, yeah, for a typical interpreter, you would have this huge sum type encompassing all possible values
larhat has quit [Quit: Leaving.]
<struktured> whitequark: hmm will need to read up on the feature although I hope I don't have to use it. sounds like you could end up with the same useless guarantees of a java enum pattern
<whitequark> mcc: in plus, you would simply match on lhs and rhs, and then wrap it back
<whitequark> struktured: open types are semantically the same as exceptions, i.e. type exn is now merely an open type
<whitequark> if that helps you understand it
<struktured> whitequark: it does, thanks.
<struktured> whitequark: I suppose that almost justifies its existence right there, as exn was sort of a one-off before
<mcc> right
zpe has joined #ocaml
manizzle has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
<Drup> mcc: reflecting values in the new language as similar values in the host language in usually a bad idea
<Drup> it works if and only if the new language is less expressive than the host language
<Drup> and that the expressiveness "matches" (the translation is not too hard)
<Drup> because you are basically encoding the new language into the host language
<Drup> it can be fun to do it like that too (you can do elegant typed lambda calculus and make ocaml's typechecker check the validity of your terms, it's very pretty and quite useless)
<Drup> but in your case, meh.
<Drup> take the classic route, use and adt for your language, and adt for the values and go on with that
<Drup> s/and/an/
<Drup> (tl;dr : Don't try too hard to use fancy features, ADTs are cool enough :D)
<whitequark> it's tempting to think of objects as this 'basic building block', but in reality they are rather complex beasts (semantics-wise, I ignore efficiency here)
<mcc> drup: my main concern with object<->object is that it means i will have a MAXIMUM efficiency ceiling equal to that of the host language object system
<mcc> also the first-pass interpreter in objective-c used a LOT of objc object machinery to implement the emily object machinery and uh
<mcc> it went bad
<Drup> did you tried already ?
<mcc> it went real bad
<mcc> try what?
<Drup> mapping object on object ?
<mcc> in objective caml? no, because i came in here and said "i am considering using objects to implement objects" and absolutely everyone was like THAT IS A BAD IDEA
<Drup> mcc: in another language then ?
<mcc> unless you mean "did i try it in objective-c", in which case the answer is yeah, pretty much sorta
<Drup> and why did it went bad ?
<mcc> it wasn't like a 1-to-1 exactly but it was pretty close
<mcc> drup: well, primarily it went bad because the objective-c memory management system did not map well to the kinds of object relationships that existed in my hosted language.
<Drup> if you have a 1-to-1 mapping from the new language to the host language, why are you making the new language ? :D
<Drup> ah ok
<Drup> so that's precisely my point.
<Drup> it didn't map.
<Drup> (and it went sideways because of that)
<mcc> it did not. it did when i was doing simple stuff but the more complex things got the less true this was.
<Drup> exactly what I wanted to say :)
<Drup> mcc: so, your question was "should I use objects or functors to express the semantic of my new language"
<Drup> and my answer is "neither, you shouldn't try to encode it in ocaml like that"
<Drup> because it will stop maping at some point, and then go sideways.
<Drup> just have something of the form "type value = Int of int | Float of float | Objects of (attributes lists * methods lists) | .... "
<Drup> and work on that
<Drup> Object*
<Drup> (it's super basic you probably don't want that ...)
<mcc> i wasn't really considering "mapping objects to objects", however, i was trying to figure out if a certain kind of data representation was advisable using objects or possible using non-objects.
<mcc> and ok, a|b|c makes it possible
<mcc> hey two quick questions, which may be basic (i still need to read all this stuff...)
<mcc> (1) am i correct that ' in ocaml is like ' in haskell, it doesn't do anything, it's just a letter from identifier names? i think i remember reading that
<Drup> (side note : if you are interested to read up on this questions, it's ususally called "shallow" or "deep" embedding)
<whitequark> yes, except for leading ', which means a type variable
<Drup> meh, sorry for all the typoes :(
badon has quit [Ping timeout: 255 seconds]
<mcc> ooo
<mcc> ...i had another question but i think it might be a little bit gibberishy.
govg has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
<Drup> go on, it's ok =')
<mcc> ...well... i think the short version, and i'll read through this "real world ocaml" book and try to understand it myeslf, is i got the impression a functor could be used for something like a "templated class' in c++, that it seemed like one use was you could say something like "queue int" where queue creates a typed queue of ints
<mcc> is that much garbage yet
<whitequark> funny; when I first learned functors, I also did compare them to C++ templates
<Drup> well, templates are to functors as C++ type system is to ML's one
<whitequark> ^
<mcc> anyway, my question is basically, if i'm doing the type x = int | float | whatever thing
<Drup> mcc: but yes, plenty of similarities
<mcc> is it possible to put something "higher level" in there, like "queue 'a" or something, and have it match any queue of any type
<mcc> or am i gonna need to enumerate possible a's
<Drup> it's delicate to answer, because everything is possible but means a completely different thing :D
<mcc> haha
<mcc> that is a useful answer, i think
<mcc> thank you both
<whitequark> in your case, I think it should be just an x queue
<Drup> I think too
<whitequark> because x already enumerates everything
<whitequark> so you'd have something like
<whitequark> type x = Int of int | Float of float | Array of x list ref
<mcc> oh, ok! so type can be recursive?
<mcc> Nice!
<whitequark> sure
<Drup> of course it can be recursive !
<Drup> :D
<whitequark> recursive functions to work with recursive types, that's basically the foundation of ML
<Drup> mcc: the definition of (single linked) list is pretty much "type 'a list = Nil | Cons of 'a * 'a list"
<whitequark> or you could say "type 'a list = [] | :: of 'a * 'a list"
<whitequark> it's almost valid code!
<Drup> I have a patch where it's valid code !
<Drup> (well, "(::)" instead of "::")
<whitequark> right
<mcc> right no that makes sense
ygrek has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
badon has joined #ocaml
<whitequark> Drup: btw, on that 1ML paper
<MercurialAlchemi> mcc: if you make a module a Queue module, you could have your module type (usually named 't') be either parametric (module Queue = struct type t='a list end) or not (module Queue = struct type t=x list end)
serge has quit [Remote host closed the connection]
<Drup> MercurialAlchemi: "type t='a list" doesn't work
<MercurialAlchemi> right, type 'a t
<whitequark> Drup: I was thinking on how there are "big" types and "small" types in the inference algorithm
serge has joined #ocaml
<whitequark> Drup: is it related to the way Russell's paradox is resolved in ZFC?
<MercurialAlchemi> don't type code on IRC before your first cup of tea
<Drup> whitequark: I'm nowhere near an expert on the question, I just saw the talk
<Drup> whitequark: can you link me the paper again, I can take another look at it
<whitequark> you gave me that paper ಠ_ಠ
<Drup> I gave you a short 2 page abstract
<Drup> not the complete paper with everything
<whitequark> oh, yeah, I only read that
<Drup> well, it was not really an abstract, but certainly not a full paper :p
<whitequark> it was pretty abstract imo
<whitequark> ;D
<Drup> :)
<mcc> mercurialalchemist: excuse if question is dumb btu: are parametric modules and functors two different things
struktured has quit [Ping timeout: 265 seconds]
<Drup> whitequark: ok, so no, I don't think it's related to that directly
<whitequark> i see, so just a similar concept
<Drup> not really
<Drup> Russell's paradox appears in dependently typed languages when you start having a thing called Type, which is the type of a type
<Drup> and then you ask the question "what is the type of Type"
<MercurialAlchemi> mcc: well, functors let you parametrize a module over another module
<Drup> whitequark: there are two answer "It's a Type", then you have a knot and your system is impredicative (this is the case of Coq, if I recall, not completely sure)
<Drup> and there is the other answer "there is a hierarchy of Turt^W Types, indexed by integers"
<Drup> (that's Agda, Idris, ...)
<Drup> but impredicativity and decidability of the inference algorithm are not related, afaict
<whitequark> I see
<Drup> and the distinction small/large types is a trick to regain decidability while doing things that are arguably dependent types.
<MercurialAlchemi> mcc: it lets you make a module that uses another module implementing a given interface
zpe has joined #ocaml
<Drup> whitequark: basically, it restores the separation of value and modules in normal ML in typing, but only by saying "if you want better, type yourself" instead of enforcing a syntactic separation. :p
<Drup> (at least that's my understanding of it)
zpe has quit [Ping timeout: 250 seconds]
<mcc> thanks agin
samrat has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
panini has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
bugabinga has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
ygrek has joined #ocaml
badon has quit [Ping timeout: 265 seconds]
badon has joined #ocaml
manud_ has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
samrat has quit [Ping timeout: 244 seconds]
manud_ has quit [Quit: Be back later ...]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 255 seconds]
oscar_toro has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
serge has quit [Remote host closed the connection]
serge has joined #ocaml
ontologiae has quit [Ping timeout: 272 seconds]
samrat has quit [Ping timeout: 244 seconds]
jgjl has joined #ocaml
samrat has joined #ocaml
Quintasan has left #ocaml [#ocaml]
samrat has quit [Ping timeout: 265 seconds]
seliopou has quit [Ping timeout: 258 seconds]
seliopou has joined #ocaml
samrat has joined #ocaml
oscar_toro has joined #ocaml
govg has joined #ocaml
oscar_toro has quit [Client Quit]
govg has quit [Client Quit]
<MercurialAlchemi> has any body looked at the Rust Decoder/Encoder traits?
larhat has joined #ocaml
zpe has joined #ocaml
manud_ has joined #ocaml
hhugo has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
zpe has joined #ocaml
Thooms has joined #ocaml
Submarine has joined #ocaml
dav__ has joined #ocaml
hhugo has quit [Quit: Leaving.]
dav_ has quit [Ping timeout: 258 seconds]
arj has joined #ocaml
dav_ has joined #ocaml
captain_furious has joined #ocaml
dav__ has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
zpe has quit [Remote host closed the connection]
arj has quit [Quit: Leaving.]
q66 has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
<captain_furious> is there a virtualenv/kerl type thing for Ocaml where you can have multiple self contained versions installed
Arsenik has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
arj has joined #ocaml
AltGr has left #ocaml [#ocaml]
adrien_oww has quit [Ping timeout: 244 seconds]
adrien_oww has joined #ocaml
govg has joined #ocaml
manizzle has quit [Ping timeout: 245 seconds]
badon_ has joined #ocaml
badon has quit [Ping timeout: 265 seconds]
badon_ is now known as badon
WraithM has quit [Ping timeout: 250 seconds]
_andre has joined #ocaml
WraithM has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
q66[lap] has joined #ocaml
dsheets has joined #ocaml
WraithM has quit [Ping timeout: 272 seconds]
WraithM has joined #ocaml
<MercurialAlchemi> captain_furious: sort of
zpe has joined #ocaml
<MercurialAlchemi> if you use opam (and you should), the 'switch' command lets you switch to an existing environment
wormphlegm has quit [Ping timeout: 258 seconds]
<MercurialAlchemi> so what you do is create an alias for the compiler you're working with, switch to this alias and install whatever you need
wormphlegm has joined #ocaml
govg has quit [Quit: leaving]
thomasga has joined #ocaml
badon has quit [Ping timeout: 245 seconds]
hausdorff has joined #ocaml
badon has joined #ocaml
hausdorff has quit [Ping timeout: 272 seconds]
jonludlam has joined #ocaml
manud_ has quit [Quit: Be back later ...]
Thooms has quit [Quit: WeeChat 1.0.1]
arj has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
ggole has joined #ocaml
lordkryss has joined #ocaml
<captain_furious> Please run 'opam init' first to initialize the state of OPAM.
<captain_furious> is there an advised place to do this ?
<captain_furious> just in home ?, separate OPAM dir ?
<ggole> I don't think the directory matters.
<captain_furious> and what is camlp4
<ggole> (It won't init opam in that directory, it'll go in ~/.opam or some such place.)
<captain_furious> darcs not found, you won't be able to use darcs repositories unless you install it.
<captain_furious> (this is in response to running opam init
acieroid has quit [Ping timeout: 264 seconds]
Denommus has joined #ocaml
hausdorff has joined #ocaml
BitPuffin has joined #ocaml
hausdorff has quit [Ping timeout: 245 seconds]
manizzle has joined #ocaml
panini has quit [Ping timeout: 240 seconds]
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samrat has quit [Quit: Computer has gone to sleep.]
rgrinberg has quit [Quit: Leaving.]
<captain_furious> I am getting errors when doing "opam install core"
<captain_furious> install core_kernel.112.01.00
<captain_furious> failed
jgjl has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
<MercurialAlchemi> captain_furious: failed with what?
AlexRussia has quit [Ping timeout: 250 seconds]
BFarinier has joined #ocaml
<captain_furious> MercurialAlchemi: http://pastebin.com/VJnNxXhg
<captain_furious> batteries installed fine
BFarinier is now known as osheeta
koderok has joined #ocaml
<MercurialAlchemi> it isn't terribly helpful
larhat has quit [Ping timeout: 265 seconds]
<MercurialAlchemi> I'll try, but that's going to take a while
<MercurialAlchemi> is the compiler from opam, or is this the system compiler?
<captain_furious> MercurialAlchemi: ok, well i am not sure, I originally installed Ocaml from ubuntu packages then realised prob best to use OPAM...
<captain_furious> opam switch 4.02.1
<captain_furious> eval `opam config env`
<captain_furious> opam install batteries core
<captain_furious> batteries is installed ok
<captain_furious> i also installed utop
<captain_furious> using opam
koderok has quit [Quit: koderok]
AlexRussia has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
<captain_furious> MercurialAlchemi: I originally installed ubuntu packages using...
<captain_furious> apt-get install ocaml ocaml-native-compilers camlp4-extra
<captain_furious> i have now removed them all
<captain_furious> but core still fails to install using opam
<MercurialAlchemi> captain_furious: ok, so it's using the compiler it itself compiled
rgrinberg1 has quit [Quit: Leaving.]
arj has joined #ocaml
vogler has joined #ocaml
<MercurialAlchemi> managed to install just fine on my system, with opam's 4.02.1
<MercurialAlchemi> you don't have any odd issue like being out of space?
Nahra has quit [Ping timeout: 265 seconds]
<captain_furious> MercurialAlchemi:plenty of free space
hausdorff has joined #ocaml
<captain_furious> might just try on a vm
q66[lap] has quit [Read error: Connection reset by peer]
SomeDamnBody has joined #ocaml
q66[lap] has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
<_obad_> I think Bigarray is missing a size_of_elt function
q66[lap] has quit [Read error: Connection reset by peer]
<captain_furious> is core a necessity
mcclurmc has quit [Ping timeout: 258 seconds]
q66[lap] has joined #ocaml
BitPuffin has quit [Ping timeout: 250 seconds]
pyon has quit [Quit: And the battle will rage until only the Raichu prevail!]
pyon has joined #ocaml
samrat has joined #ocaml
SethTisue has joined #ocaml
mcclurmc has joined #ocaml
panini has joined #ocaml
struktured has joined #ocaml
shinnya has joined #ocaml
acieroid has joined #ocaml
govg has joined #ocaml
SomeDamnBody has quit [Ping timeout: 244 seconds]
larhat has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
badkins has joined #ocaml
larhat has quit [Quit: Leaving.]
samrat has joined #ocaml
hausdorff has joined #ocaml
serge has quit [Remote host closed the connection]
hausdorff has quit [Ping timeout: 272 seconds]
serge has joined #ocaml
tane has joined #ocaml
larhat has joined #ocaml
araujo has joined #ocaml
larhat has quit [Quit: Leaving.]
bytbox has joined #ocaml
bytbox has quit [Read error: Connection reset by peer]
bytbox has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
avsm has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bytbox has quit [Remote host closed the connection]
govg has quit [Ping timeout: 255 seconds]
NoNNaN has quit [Ping timeout: 250 seconds]
yomimono has joined #ocaml
fraggle-boate has quit [Remote host closed the connection]
ebzzry has quit [Remote host closed the connection]
fraggle-boate has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
avsm has quit [Ping timeout: 250 seconds]
hausdorff has joined #ocaml
arj has quit [Quit: Leaving.]
Thooms has joined #ocaml
hausdorff has quit [Ping timeout: 255 seconds]
BitPuffin has joined #ocaml
darkf has quit [Quit: Leaving]
avsm has joined #ocaml
avsm has quit [Client Quit]
Thooms has quit [Quit: WeeChat 1.0.1]
yomimono has quit [Ping timeout: 255 seconds]
mcclurmc has quit [Ping timeout: 256 seconds]
thomasga has quit [Quit: Leaving.]
ontologiae has joined #ocaml
thomasga has joined #ocaml
Hannibal_Smith has joined #ocaml
jgjl has joined #ocaml
thomasga has quit [Client Quit]
avsm has joined #ocaml
mcclurmc has joined #ocaml
bytbox has joined #ocaml
nojb has joined #ocaml
badon has quit [Ping timeout: 258 seconds]
badon has joined #ocaml
hausdorff has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
avsm has quit [Quit: Leaving.]
badon has quit [Ping timeout: 250 seconds]
tinaj1234_ has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
tristero has joined #ocaml
slash^ has joined #ocaml
jgjl has quit [Ping timeout: 272 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
<captain_furious> still no idea what the problem is installing core using opam
<captain_furious> opam update
<captain_furious> opam switch 4.02.1
<captain_furious> eval `opam config env`
<captain_furious> opam install batteries core
<captain_furious> batteries installs but core causes errors
<captain_furious> ubuntu 12.04 32bit if that rings any bells for anyone
<whitequark> we can't help you if you don't say what error do you get
<captain_furious> whitequark: ^
<captain_furious> as you can see batteries succeeded (installed previous attempt)
<captain_furious> i also installed utop fine
Denommus has quit [Quit: ZNC - http://znc.in]
npnth has joined #ocaml
hcarty has joined #ocaml
<npnth> I've got a file, produced by ocamlc on one machine, which will not run on a second machine, giving the error "Fatal error: the file './foo' is not a bytecode executable file".
<whitequark> the OCaml versions must match
<npnth> Both machines (claim to) have 4.00.1 installed, and while I can freely modify machine 2, I cannot touch machine 1 or the source code/compilation commands of the binary.
<npnth> Is there anything else I should try to match?
<npnth> *output file, as I probably shouldn't call it a binary.
<whitequark> you can use `file` to determine the magic number and thus bytecode version
tinaj1234_ has left #ocaml [#ocaml]
<npnth> file just gives 'a /usr/bin/ocamlrun script executable (binary data)' - I'm reading the manpage now to see the argument for raw magic numbers, unless you have it off the top of your head.
<companion_cube> looks lile Core is really hard to build
<whitequark> npnth: hmmm
<captain_furious> whitequark: any ideas on the error ?
<whitequark> captain_furious: no clue
<captain_furious> wanting to work thrreal world ocaml and core is the first lib used
<captain_furious> :/
rwmjones is now known as rwmjones_hols
<whitequark> npnth: tail -c12 binary
<whitequark> will do it
<whitequark> e.g. for 4.02.1, it's Caml1999X011
<npnth> whitequark: Thanks, I get aml1999X008
<npnth> whitequark: and for a completely unrelated file produced by ocamlc on machine2, Caml1999X008
<whitequark> okay, hm, sounds odd
<npnth> (I'm not kidding)
<whitequark> try invoking ocamlrun explicitly
<whitequark> wait, did you say "aml1999X008"? is that not a typo?
hausdorff has joined #ocaml
<npnth> whitequark: yup
<whitequark> oh
<whitequark> well, duh, that explains it. the file got corrupted somehow
<npnth> Well, that would certainly do it.
<npnth> Thanks, I'll try to restore it somehow.
<npnth> whitequark: Well, that was simple. I just rsync'd it again, and this time it works. Thank you, and sorry for the PEBKAC, as I guess it must have been.
hausdorff has quit [Ping timeout: 258 seconds]
SethTisue has quit [Quit: SethTisue]
hausdorff has joined #ocaml
MrScout has joined #ocaml
<vogler> Can I somehow include Set when I already have a 'type t' in a module?
<vogler> Oh, talking about the polymorphic Set in Batteries. So it's type 'a t.
bytbox has quit [Ping timeout: 256 seconds]
<vogler> Right now it complains that the types have different arities: type 'a t = 'a BatSet.t is not included in type t.
mcclurmc has quit [Ping timeout: 256 seconds]
<ggole> No, but can simply place it in the module
<ggole> *you can
<vogler> Mh ok, then I'll keep the functorized set.
panini_ has joined #ocaml
hausdorff has quit [Remote host closed the connection]
<panini_> hii everyone
<panini_> i'm new to ocaml
<panini_> and i'm having an problem
hausdorff has joined #ocaml
<panini_> i have installed the Core library with opam. it works find in utop.
<panini_> but when i compile my program file with ocamlc or ocamlopt it gives me an error.
<panini_> Error: Unbound module Core
badkins has quit []
<whitequark> use: ocamlfind ocamlc -package core
<panini_> ohh, kk
jwatzman|work has joined #ocaml
<panini_> thanks
zpe has quit [Remote host closed the connection]
hausdorff has quit [Ping timeout: 272 seconds]
nojb has quit [Quit: nojb]
jonludlam has quit [Ping timeout: 250 seconds]
serge has quit [Remote host closed the connection]
serge has joined #ocaml
tane has quit [Quit: Verlassend]
Denommus` has joined #ocaml
Denommus` has quit [Client Quit]
Denommus` has joined #ocaml
Denommus` has quit [Client Quit]
vogler has quit [Ping timeout: 260 seconds]
hausdorff has joined #ocaml
mcclurmc has joined #ocaml
Denommus` has joined #ocaml
nicoo has quit [Ping timeout: 250 seconds]
Denommus` is now known as Denommus
dsheets has quit [Ping timeout: 258 seconds]
nicoo has joined #ocaml
<captain_furious> whitequark: opam switch 4.01.0 works
<captain_furious> core works with this version
<captain_furious> :/
<captain_furious> I have no idea why. for some reason there is a conflict on my system or the core package for 4.02.1 has problems
bytbox has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
<nlucaroni> Same version of core?
slash^1 has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
panini has quit [Ping timeout: 250 seconds]
panini_ has quit [Ping timeout: 260 seconds]
slash^ has quit [Ping timeout: 272 seconds]
<captain_furious> didn't work core_kernel.112.01.00
<captain_furious> works core_kernel.111.28.00
<captain_furious> nlucaroni: i assume these are versions opam download for the respective version of ocaml
<nlucaroni> If it makes you feel better I just tried core on 4.02.1 and it worked ;)
<captain_furious> nlucaroni: That cheers me up loads :/
<captain_furious> :D
<captain_furious> well anyway does 4.01.0 have pipes
<nlucaroni> that's a part of core, you shouldn't have a problem with that.
<captain_furious> just starting out and the first lib the book said i should import/use was core
<captain_furious> lol so hence my annoyance
kakadu has quit [Quit: Page closed]
slash^ has joined #ocaml
<nlucaroni> Sure, I can understand that. In fact, I'm dealing with something similar at the office (not ocaml related). Devs of this java library suggest doing something a certain way, but it has a major memory leak.
<captain_furious> nlucaroni: have you used lwt ?
<nlucaroni> not extensively, but a little.
<captain_furious> "A cooperative threads library for OCaml." so these are like coroutines/greenthreads ?
slash^1 has quit [Ping timeout: 272 seconds]
gridaphobe has joined #ocaml
<captain_furious> the other thing that has piqued my interest is js_of_ocaml
<gridaphobe> hey, does ocamlopt have any support for cross-compiling?
<nlucaroni> lwt is similar to jane-street Async. They are used for asynchronous function calls, so yeah like coroutines.
slash^1 has joined #ocaml
slash^ has quit [Ping timeout: 272 seconds]
hhugo has joined #ocaml
<whitequark> gridaphobe: sorta
<whitequark> you can do it with custom builds, e.g. https://github.com/whitequark/opam-android
slash^1 has quit [Ping timeout: 272 seconds]
slash^ has joined #ocaml
<gridaphobe> whitequark: so the idea is to use opam to keep multiple versions of ocamlopt around, and then switch between them?
ontologiae has joined #ocaml
<whitequark> in essence, yes
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 265 seconds]
slash^ has quit [Ping timeout: 272 seconds]
<captain_furious> why do you have to do eval `opam config env` after switch
<captain_furious> why doesn't switching do this extra step
<whitequark> take a look at the output of ocaml config env
<whitequark> opam switch, by itself, cannot inject environment variables into its parent process (the shell)
badkins has joined #ocaml
ggole has quit []
MercurialAlchemi has quit [Remote host closed the connection]
<captain_furious> ok, anyway.  4.02.1 and 4.02.0 both have problems installing core using opam
<captain_furious> (on my system)
<captain_furious> 4.01.0 works
<rks`> are you on a 32 bit machine?
<captain_furious> yeah
<rks`> that's a known problem then
MercurialAlchemi has joined #ocaml
<rks`> (i.e. the problem is known, the fix isn't)
<captain_furious> ohhh, cool at least I know now
<captain_furious> I shouldn't be using 32bit
<rks`> you should opam pin to a previous (working) version of core
<captain_furious> it was a sequence of events when I was trying ubuntu for the first time (as all tooling for erlang worked best on linux so i switched from windows) I was not sure whether I would stick with it and just installed 32bit as it was advised on ubuntu website at the time
<captain_furious> then after a year or so of configuring my install i just too lazy to update
<captain_furious> :)
<captain_furious> opam pi ?
<captain_furious> pin*
<rks`> yes
<rks`> opam help pin
hhugo1 has joined #ocaml
<captain_furious> ok so there is no hard rule that requires a certain version of core for the version of ocaml running
<captain_furious> (obviously assuming I am not trying to run an ancient version of ocaml with a newer version of core and vice versa)
<captain_furious> rks`: thanks for info, feel better now
hhugo has quit [Ping timeout: 260 seconds]
<captain_furious> is multicore a completely different version of ocaml ?
<captain_furious> or a library or what ?
<rks`> a completly unreleased different version of ocaml
kakadu has joined #ocaml
shinnya has joined #ocaml
<captain_furious> rks`: is having multicore not seen as an issue in the community (using things like multiple processes instead to utilise multi-core) - just curious
<mrvn> Everyone wants it, nobody wants to implement it.
nicoo has quit [Ping timeout: 250 seconds]
sheijk has joined #ocaml
claudiuc has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
nicoo has joined #ocaml
badon has joined #ocaml
<captain_furious> open Core.Std;; results in Error: Unbound module Core
<captain_furious> does this mean i need a .ocamlinit file ?
<nlucaroni> no, you don't have to. it just gets run everytime the toplevel starts
<nlucaroni> you can enter those commands one by one in the toplevel manually
yomimono has joined #ocaml
<captain_furious> nlucaroni: buit assuming core was installed correctly (no errors from opam) i also need to enter those commands to be able to do "open Core.Std;;"
<captain_furious> ?
<captain_furious> but*
hausdorff has quit [Remote host closed the connection]
slash^ has joined #ocaml
<nlucaroni> right
<captain_furious> nothiong about this in the book
<captain_furious> not having a smooth ride up to now
<captain_furious> :/
<captain_furious> :)
<nlucaroni> i cannot really speak for the book.
<nlucaroni> you don't have to do all that to use core, but it's helpful. you can do it other manual ways instead. topfind is very helpful though.
<captain_furious> i already have
<captain_furious> (* Added by OPAM. *)
<captain_furious> let () =
<captain_furious> try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
<captain_furious> with Not_found -> ()
<captain_furious> ;;
<captain_furious> in my .ocamlinit
<captain_furious> i understand that there will be files and thing slike this that I might need to learn abotu at some point (like all environments) just wanting to get to be able to code atm though
<captain_furious> do i add literally what was in that stack overflow link
<captain_furious> including "#" at the beginning of each line ?
<nlucaroni> the stuff added by opam should add core as a dependency.
<captain_furious> ok open Core.Std;; works now after adding those lines to the end of ocamlinit
<captain_furious> few
<captain_furious> :/
bytbox has quit [Remote host closed the connection]
<captain_furious> phew*
<nlucaroni> where in the book talks about the environment setup?
<captain_furious> it doesn't. I just search for "Error: Unbound module Core" in google and got that stack overflow page that talked about ocamlinit
<captain_furious> i added those lines tot he end of my ocamlinit and then started utop and i could open core without any errors
<nlucaroni> but it talks about installing opam and core?
<captain_furious> ok, it seems there is a link in the prologue page "https://realworldocaml.org/v1/en/html/prologue.html"
<captain_furious> "this Real World OCaml page" is a link that actually has the information i have stumbled on
badon has quit [Quit: Leaving]
<nlucaroni> that's linked from the realworldocaml.org front page.
hausdorff has joined #ocaml
<nlucaroni> might want to go through that, it contains the bit about the .ocamlinit file. Maybe there are other things you should setup as well.
<captain_furious> nlucaroni: ok it seems i was too keen. I followed the basic installations on the official ocaml website and then got sidetracked due to the errors with the latest version of ocaml on 32bit
<captain_furious> i was assuming after i got it installed i would be good to go with the actual meat of starting to learn ocaml
<nlucaroni> sure, those errors you were hitting with your 32bit OS were pretty crappy to deal with. Glad you're on the right track now though.
<captain_furious> oversight on my part but I was sidetracked by the errors i was getting installing things that
<captain_furious> yeah, and thanks for your help and I am happy now
<captain_furious> ready to start the journey
<nlucaroni> the setup is because Core is a std library replacement. the book uses it, but it isn't necessary. batteries is an alternative, and the very simple one that comes with OCaml.
<captain_furious> nlucaroni: i am sure everything will become clear once i get deeper into it. it is the same when learning any new environment especially when it isn't a mainstream language like java or c#
Anarchos has joined #ocaml
<captain_furious> nlucaroni: so what is meant by a "toplevel" a repl ?
badon has joined #ocaml
<captain_furious> a script that configures and starts an interactive ocaml environment/session ?
samrat has quit [Quit: Computer has gone to sleep.]
<nlucaroni> yeah toplevel = repl.
milosn has quit [Ping timeout: 258 seconds]
zpe has joined #ocaml
<captain_furious> makes sense :/ :)
<nlucaroni> sounds like they could have used more consistent language.
milosn has joined #ocaml
<nlucaroni> even interactive ocaml environment is referring to the toplevel.
<nlucaroni> well, maybe toplevel + executed script, but still.
nicoo has quit [Ping timeout: 250 seconds]
<captain_furious> i could have played on here to get a feel http://try.ocamlpro.com/
<captain_furious> quite nice
<captain_furious> basically i am looking for a functional performant language to compliment erlang
<captain_furious> i am guessing from the computer language benchmarks that ocaml is pretty fast
<captain_furious> (at executing sequential code)
zpe has quit [Ping timeout: 240 seconds]
nicoo has joined #ocaml
_andre has quit [Quit: leaving]
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
<flux> ocaml is decent performance-wise, and its performance is predictable
ebzzry has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
slash^1 has joined #ocaml
slash^1 has quit [Client Quit]
yomimono has joined #ocaml
slash^ has quit [Ping timeout: 272 seconds]
<MercurialAlchemi> captain_furious: it's pretty fast
nicoo has quit [Ping timeout: 250 seconds]
nicoo has joined #ocaml
badon has quit [Ping timeout: 244 seconds]
govg has joined #ocaml
badon has joined #ocaml
nicoo has quit [Ping timeout: 250 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
ontologiae has joined #ocaml
q66[lap] has joined #ocaml
nicoo has joined #ocaml
ontologiae has quit [Ping timeout: 258 seconds]
gdsfh1 has quit [Quit: Leaving.]
<Drup> captain_furious: A note if you are interested by js_of_ocaml, Core (and Async) don't work with it. You can learn with them for now without any issue, of course. ;)
malc_ has joined #ocaml
<captain_furious> anyone using the eclipse plugin ?
npnth has left #ocaml [#ocaml]
badon_ has joined #ocaml
badon has quit [Ping timeout: 272 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
badon_ is now known as badon
gdsfh has joined #ocaml
emery has joined #ocaml
malc_` has joined #ocaml
malc_ has quit [Ping timeout: 244 seconds]
mawuli has quit [Ping timeout: 265 seconds]
<nlucaroni> I think most people use emacs and and to a lesser extent vim.
mawuli has joined #ocaml
malc_` has quit [Ping timeout: 244 seconds]
badkins has quit []
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Thooms has joined #ocaml
MrScout_ has joined #ocaml
MrScout has quit [Ping timeout: 265 seconds]
MrScout_ has quit [Ping timeout: 265 seconds]
WraithM has quit [Quit: leaving]
jonludlam has joined #ocaml
hausdorff has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
hausdorff has joined #ocaml
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
nicoo has quit [Ping timeout: 250 seconds]
bytbox has joined #ocaml
nicoo has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
captain_furious has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
SethTisue has joined #ocaml
<Drup> whitequark: did you had a look at the code emitted by ocaml when pattern matching on constant string with 4.02 ? :p
<Drup> :magic numbers:
ontologiae has joined #ocaml
<whitequark> yup, that's fairly typical
<whitequark> fun fact: LLVM optimizes Rust's pattern matching into the same thing
sheijk_ has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
<Drup> does it works for strings ? I know it works for chars
<whitequark> hm?
sheijk has quit [Ping timeout: 255 seconds]
<Drup> but yeah, I know it's typical (especially for char and ints) :p
jwatzman|work has quit [Quit: jwatzman|work]
Thooms has quit [Quit: WeeChat 1.0.1]
badon has quit [Ping timeout: 264 seconds]
badon has joined #ocaml
cdidd_ has quit [Remote host closed the connection]
cdidd has joined #ocaml
hhugo has joined #ocaml
badon_ has joined #ocaml
hhugo1 has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
rgrinberg has joined #ocaml
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml