ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
tnguyen has quit [Quit: tnguyen]
rgrinberg has quit [Quit: Leaving.]
fraggle_laptop has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 240 seconds]
WraithM has quit [Ping timeout: 245 seconds]
Muzer has quit [Excess Flood]
racycle_ has quit [Quit: ZZZzzz…]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
Muzer has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
q66 has quit [Quit: Leaving]
tobiasBora has quit [Quit: Konversation terminated!]
rgrinberg has joined #ocaml
ontologiae has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
WraithM has joined #ocaml
_JokerDoom has joined #ocaml
JokerDoom has quit [Ping timeout: 265 seconds]
huza has joined #ocaml
studybot has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tianon has quit [Quit: brb]
tianon has joined #ocaml
tianon has quit [Client Quit]
tianon has joined #ocaml
WraithM has quit [Ping timeout: 240 seconds]
WraithM has joined #ocaml
michael_lee has joined #ocaml
rand000 has quit [Quit: leaving]
tiglionabbit has quit [Quit: tiglionabbit]
tiglionabbit has joined #ocaml
divyanshu has joined #ocaml
philtor_ has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
DaveS has quit [Ping timeout: 252 seconds]
huza has quit [Ping timeout: 240 seconds]
tlockney is now known as tlockney_away
yacks has joined #ocaml
tiglionabbit has quit [Quit: tiglionabbit]
WraithM has quit [Ping timeout: 255 seconds]
tiglionabbit has joined #ocaml
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
philtor_ has quit [Ping timeout: 265 seconds]
axiles has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
alpounet has joined #ocaml
tiglionabbit has quit [Quit: tiglionabbit]
Guest18547 has quit [Remote host closed the connection]
boogie has quit [Remote host closed the connection]
ggole has joined #ocaml
michael_lee has quit [Ping timeout: 264 seconds]
michael_lee has joined #ocaml
bjorkintosh has quit [Ping timeout: 252 seconds]
bjorkintosh has joined #ocaml
boogie has joined #ocaml
huza has joined #ocaml
patojo has joined #ocaml
boogie has quit [Read error: Connection reset by peer]
boogie has joined #ocaml
patojo has quit [Ping timeout: 240 seconds]
patojo has joined #ocaml
<adrien> crap bots
boogie has quit [Ping timeout: 258 seconds]
patojo has quit [Read error: Connection reset by peer]
boogie_ has joined #ocaml
boogie_ has quit [Ping timeout: 240 seconds]
yacks has quit [Ping timeout: 252 seconds]
yacks has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
huza has joined #ocaml
wwilly has quit [Quit: Ex-Chat]
cesar_ has joined #ocaml
cesar_ is now known as Guest67386
Submarine has quit [Ping timeout: 258 seconds]
Guest67386 has quit [Ping timeout: 258 seconds]
huza has quit [Quit: WeeChat 0.3.8]
huza has joined #ocaml
pyon has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
arj has joined #ocaml
michael_lee has quit [Quit: Ex-Chat]
ia0 has quit [Quit: leaving]
tiglionabbit has joined #ocaml
ia0 has joined #ocaml
boogie has joined #ocaml
Simn has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
divyanshu has joined #ocaml
Submarine has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
eikke__ has joined #ocaml
AltGr has joined #ocaml
<kaustuv> I'm guessing http://caml.inria.fr/mantis/view.php?id=5157 is not likely to become part of OCaml any time soon?
<huza> ocaml use mantis,cool
<huza> used mantis before
<huza> ocaml do not accept your patch?
ousado has quit [Ping timeout: 252 seconds]
eikke__ has quit [Ping timeout: 258 seconds]
eikke__ has joined #ocaml
yacks has quit [Ping timeout: 265 seconds]
rand000 has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
huza has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
ousado has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
<adrien_oww> most likely, forgotten
ousado_ has joined #ocaml
ousado has quit [Ping timeout: 265 seconds]
ollehar has joined #ocaml
huza has quit [Remote host closed the connection]
huza has joined #ocaml
huza has quit [Remote host closed the connection]
boogie has joined #ocaml
huza has joined #ocaml
NoNNaN has joined #ocaml
yacks has joined #ocaml
boogie has quit [Ping timeout: 252 seconds]
huza has quit [Quit: WeeChat 0.3.8]
cesar_ has joined #ocaml
cesar_ is now known as Guest37085
tiglionabbit has quit [Quit: tiglionabbit]
Guest37085 has quit [Ping timeout: 240 seconds]
pgomes has quit [Quit: Page closed]
pgomes has joined #ocaml
<reynir> I saw there's an ocamlbuild plugin for atd-gen. Has anyone here used it? Does it work well? https://github.com/hcarty/ocamlbuild-plugins
<gasche> reynir: it looks fine, but I never used it myself
tobiasBora has joined #ocaml
rossberg has quit [Read error: Connection reset by peer]
<tobiasBora> Hello !
<tobiasBora> I would like to know if a kind of "super functor" exists (without using complicated Camlp4 extensions)
<tobiasBora> By "super functor" I mean a functor whose signature isn't fixed
<tobiasBora> For exemple I would to be able to give to a functor named here SuperFonctor a list of strings ["fonc1"; "fonc2"] and get new functions named "fonc1" and "fonc2"
<tobiasBora> For example : let myObject = SuperFonctor(["fonc1"; "fonc2"]) in myObject.fonc1 ();;
octachron has joined #ocaml
<tobiasBora> Does anyone knows if it's possible to define such "SuperFonctor" ?
<tobiasBora> *s
<gasche> no it isn't
<gasche> you must either change your approach, or use metaprogramming
<gasche> would you say more about what you expect the "new functions" to do?
<tobiasBora> Won't it be a great replacement to avoid Camlp4 extensions in simple cases ?
<tobiasBora> What do you call metaprogramming ?
<tobiasBora> Here is what I would like to do (but I know it will be quite hard to do) :
ggole_ has joined #ocaml
<tobiasBora> I would like to define an abstraction of a database (based on Macaque), as it's possible to see it in lot's of web framework (Cf. Symfony2 and Doctrine) based on Objects
<tobiasBora> I would like to be able to define a new table in the data base by creating a new "object", and after totally forget the database behing
ggole has quit [Ping timeout: 255 seconds]
<tobiasBora> For example : let book_module = NewTableSuperFunctor ({Id of Int_64_auto_increment; Title of string; Author of string })
ustunozgur has joined #ocaml
<tobiasBora> And after to use it
<gasche> metaprogramming (here): mechanical program generation
<gasche> what you describe has been done with Camlp4 (and could be done with -ppx), see https://github.com/avsm/ocaml-orm-sqlite
<tobiasBora> let new_book = book_module(); new_book.set_Title("My super title"); new_book.set_Author("Author"); new_book.save_in_db()
<gasche> in Macaque, there is no ORM that automatically turns OCaml-side type declarations into base definitions
<gasche> but this could be implemented/contributed
<gasche> the reason why you need metaprogramming is that OCaml's type system itself is not powerful/expressive enough to describe the link between the OCaml type definition and the database row type; so this cannot be implemented as a library
<gasche> (you could, however, piggy-back on some form of metaprogrammaticaly-produced RTTI such as Sexplib to do that as a library)
<tobiasBora> Thank you for this library, I didn't know it !
<tobiasBora> (very interessting)
boogie has joined #ocaml
ggole_ has quit [Ping timeout: 252 seconds]
<tobiasBora> I don't understand why Ocaml types aren't powerful enough to describe a database row type, can't we just define a type Sql_int of int to make the link between both types ?
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
huza has joined #ocaml
boogie has quit [Ping timeout: 255 seconds]
avsm1 has joined #ocaml
Kakadu has joined #ocaml
divyanshu has joined #ocaml
ontologiae has joined #ocaml
ggole_ has joined #ocaml
kaustuv has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
<tobiasBora> That's pretty interesting... But I'm a bit affraid of using camlp4 (which is going to diseapear) or even ppx. But if it's the only choice I'll make further researches, thank you !
<octachron> tobiasBora: I know very little about database but couldn't you use something like http://cranialburnout.blogspot.ca/2013/09/database-radiation-hazard.html ?
<octachron> tobiaBora: I mean something like module Book = Database.New_Table()
<octachron> Then Title = Book.New_property(struct ... end )
<octachron> We should let you do things like: let book_1= Book.new |> Title.set "A title"
<octachron> And it seems to me that the module Book could have any type informations to send the resulting book to the database
Valdo has quit [Ping timeout: 264 seconds]
studybot has quit [Remote host closed the connection]
<tobiasBora> octachron: Uhm... That's really interesting but I'm not sure to understand everything, it seems a little bit "magic" ^^ Thank you for this link, I will read it until I understand everything !
ustunozgur has quit [Remote host closed the connection]
eikke__ has quit [Ping timeout: 252 seconds]
alpounet has quit [Read error: Connection reset by peer]
eikke__ has joined #ocaml
alpounet has joined #ocaml
ggole_ is now known as ggole
thomasga has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest90805
Guest90805 has quit [Ping timeout: 264 seconds]
pyon has joined #ocaml
<tobiasBora> octachron: That's quite funny ^^ If I understand well a new table is created for each property and has the form | ID_user | type |. I'm not sure it's really nice for time benchmark, but it is interessting. The type of the ID_user is always int so it's easy to make general functions, and I think it can be generated to Macaque, but I'm not 100% sure (I'm quite new with Macaque).
ontologiae has quit [Ping timeout: 252 seconds]
<huza> hi all,metaocaml vs camlp5(will separate from Ocaml) which is better?
ustunozgur has joined #ocaml
octachron has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
dsheets has joined #ocaml
thomasga has quit [Quit: Leaving.]
ontologiae has joined #ocaml
octachron has joined #ocaml
<octachron> tobiasBora: Ah, yes some of the design presented in this site is quite specific to the need of an Entity Component System; so maybe overkill for your application
boogie has joined #ocaml
<gasche> huza: they have different use cases, so a comparison is hard
<gasche> I think if the task can be done with MetaOCaml, it's interesting to use it
<octachron> tobiasBora: But I find interesting the general idea to have a row object which holds only a map/hashtable of universal value and then have independant modules which defines the injection/projection to specific type from the universal type
<octachron> tobiasBora: see for instance http://alaska-kamtchatka.blogspot.com/2012/07/existential-crisis.html for the definition of universal type and a method to use then in a type-safe way.
huza has quit [Ping timeout: 264 seconds]
boogie has quit [Ping timeout: 245 seconds]
avsm1 has quit [Quit: Leaving.]
ollehar has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
huza has joined #ocaml
<Drup> octachron: the performance profile, compared to a real sql database, is going to be very very different
<Drup> (and don't even think about the entity way if you have lot's of data)
<tobiasBora> I will read your answer later, I've to go now, but thank you for your help !
rossberg has joined #ocaml
Derander has quit [Ping timeout: 276 seconds]
tobiasBora has quit [Ping timeout: 265 seconds]
Derander has joined #ocaml
<jpdeplaix> whitequark: For the thing I asked you yesterday, I'll try to do a pseudo comment by doing: « %mycomment = call void @llvm.donothing() » :)
<jpdeplaix> but later, now I'm back to work :D
<Drup> jpdeplaix: why not use metadata for that ?
<jpdeplaix> Because I want to have a real separation and I'm not sure if the metadata will be displayed entirely in the line and not just refereed
cesar_ has joined #ocaml
cesar_ is now known as Guest74656
SethTisue has joined #ocaml
Guest74656 has quit [Ping timeout: 265 seconds]
thomasga has joined #ocaml
huza has quit [Ping timeout: 276 seconds]
Simn has quit [Ping timeout: 265 seconds]
ustunozgur has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 255 seconds]
ustunozgur has joined #ocaml
avsm has joined #ocaml
tnguyen has joined #ocaml
huza has joined #ocaml
<dsheets> mrvn, hacking on a fuse filesystem? in c or ocaml?
<kerneis> I was like, "oh, I know someone doing this" and then… "wait, it's dsheets in fact"
ccasin has quit [Remote host closed the connection]
_JokerDoom has quit [Quit: Leaving]
<dsheets> kerneis, ya, just saw mrvn send some mail to fuse-devel so i'd thought i'd say hello and plug my lib :-P
ygrek has joined #ocaml
racycle_ has joined #ocaml
racycle_ has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
hhugo has joined #ocaml
Simn has joined #ocaml
darkf has quit [Quit: Leaving]
octachron has quit [Ping timeout: 240 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
ustunozgur has quit [Remote host closed the connection]
ustunozgur has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
jerry__ has joined #ocaml
hhugo has quit [Quit: Leaving.]
rand000 has quit [Ping timeout: 240 seconds]
rand000 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
mcclurmc has joined #ocaml
tobiasBora has joined #ocaml
yacks has joined #ocaml
olauzon has joined #ocaml
olauzon has quit [Client Quit]
hhugo has joined #ocaml
SethTisue has quit [Quit: SethTisue]
SethTisue has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest8582
SethTisue has quit [Client Quit]
Guest8582 has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
divyanshu has joined #ocaml
ccasin has joined #ocaml
boogie has joined #ocaml
boogie has quit [Ping timeout: 276 seconds]
strobegen has quit [Read error: Connection reset by peer]
strobegen has joined #ocaml
pyon has quit [Remote host closed the connection]
pyon has joined #ocaml
studybot has joined #ocaml
studybot_ has joined #ocaml
studybot has quit [Ping timeout: 272 seconds]
philtor_ has joined #ocaml
jeregrine has joined #ocaml
<eikke__> in opam, is there any standard way to handle packages whose url is a git repository, and uses submodules?
<eikke__> i.e. for these submodules to be init'ed etc
philtor_ has quit [Ping timeout: 245 seconds]
<flux> iirc git nowadays supports recursive gets, maybe that could be used directly
<flux> I mean recursive cloning
<flux> yep, --recursive
WraithM has joined #ocaml
<eikke__> I know, but when creating opam packages, I don't declare how to perform the git clone ;)
<eikke__> maybe it's because I had the repo in-place, removing from ~/.opam now so it gets re-cloned
<eikke__> preferably using --recursive
<eikke__> looks like it doesnt :(
olauzon has joined #ocaml
olauzon has quit [Ping timeout: 240 seconds]
ustunozgur has quit [Remote host closed the connection]
tnguyen has quit [Quit: tnguyen]
<eikke__> I added 'git submodule update --init' to my opam file, but now it looks like a new clone of the submodules is done everytime, I guess because it's lacking in the ~/.opam/packages.dev folder (which is then copied to build?)
<whitequark> jpdeplaix: not in line, no
gasche has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
SethTisue has joined #ocaml
<jpdeplaix> ok, thanks
boogie has joined #ocaml
pgomes has quit [Quit: Page closed]
rgrinberg has joined #ocaml
thomasga has quit [Quit: Leaving.]
tnguyen has joined #ocaml
boogie has quit [Ping timeout: 252 seconds]
ikaros has joined #ocaml
Arsenik has joined #ocaml
SethTisue has quit [Quit: SethTisue]
tnguyen has quit [Quit: tnguyen]
jerry__ has quit [Quit: Quitte]
SethTisue has joined #ocaml
rand000 has quit [Ping timeout: 255 seconds]
tlockney_away is now known as tlockney
SethTisue has quit [Quit: SethTisue]
rgrinberg has quit [Quit: Leaving.]
SethTisue has joined #ocaml
racycle has joined #ocaml
SethTisue has quit [Client Quit]
cesar_ has joined #ocaml
cesar_ is now known as Guest24373
rgrinberg has joined #ocaml
SethTisue has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
SethTisue has quit [Client Quit]
Guest24373 has quit [Ping timeout: 265 seconds]
ustunozgur has joined #ocaml
tnguyen has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
tobiasBora has quit [Ping timeout: 265 seconds]
SethTisue has joined #ocaml
Hannibal_Smith has joined #ocaml
<jeregrine> \ignore join leave quit
<jeregrine> oops sorry
ontologiae has joined #ocaml
pminten has joined #ocaml
avsm has quit [Quit: Leaving.]
boogie has joined #ocaml
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
jwatzman|work has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
avsm has quit [Client Quit]
thomasga has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
pyon has quit [Read error: Connection reset by peer]
q66 has joined #ocaml
SethTisue has quit [Quit: SethTisue]
arj has quit [Quit: Leaving.]
SethTisue has joined #ocaml
Kakadu has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
pminten has quit [Quit: Leaving]
mcclurmc has quit [Remote host closed the connection]
<Drup> whitequark: is there a pass to give name to all the variables ?
<whitequark> yes
<Drup> hum, I don't find it, what is the name ?
<whitequark> opt -metarenamer
olauzon has joined #ocaml
<whitequark> possibly it is not exported to the C/OCaml API
<Drup> http://llvm.org/docs/Passes.html it's not even there
<whitequark> it's kind of a debug one
<whitequark> odd, given that -deadarghax0r *is* there
<whitequark> oh, -instnamer could be what you look for
<Drup> aaand it's not in the ocaml api :(
<whitequark> unsurprisingly
SethTisue has quit [Quit: SethTisue]
Nahra` has joined #ocaml
pyon has joined #ocaml
SethTisue has joined #ocaml
Valdo has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
olauzon has quit [Quit: olauzon]
tiglionabbit has joined #ocaml
philtor_ has joined #ocaml
testcocoon has joined #ocaml
olauzon has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
Kakadu has joined #ocaml
jeregrine has quit [Ping timeout: 240 seconds]
jeregrine has joined #ocaml
labichn has joined #ocaml
rgrinberg has joined #ocaml
hhugo has quit [Quit: Leaving.]
olauzon has quit [Quit: olauzon]
SethTisue has quit [Quit: SethTisue]
olauzon has joined #ocaml
SethTisue has joined #ocaml
mcclurmc has joined #ocaml
cesar_ has joined #ocaml
SethTisue has quit [Client Quit]
cesar_ is now known as Guest84401
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
olauzon has quit [Ping timeout: 240 seconds]
eikke__ has quit [Ping timeout: 240 seconds]
SethTisue has joined #ocaml
Guest84401 has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
eikke__ has joined #ocaml
mcclurmc has joined #ocaml
SethTisue has quit [Client Quit]
mcclurmc has quit [Remote host closed the connection]
SethTisue has joined #ocaml
<labichn> Does anyone know if it's possible to have mutually recursive module type constraints (using "with" in a functor signature)?
<mrvn> try recursive modules
<mrvn> the syntax is a pain though
mcclurmc has joined #ocaml
<Drup> the syntax ? not that much
<Drup> the fact that you have to give all the signature, on the other hand ...
<mrvn> Drup: exactly
<mrvn> and you can't just ocamlc -i it
<labichn> Oh I don't mind giving the whole signature, I just can't figure out the write way to specify it
<labichn> I've got a pastebin here, if anyone has a moment to look: http://pastebin.com/nF1mnd6J
<Drup> labichn: "module rec ... and ..."
<labichn> It's the module F(...) line that gives me trouble
<labichn> I try to refer to the type expr inside of X while constraining the type of kont, but can't quite figure out how to say it
mcclurmc has quit [Remote host closed the connection]
olauzon has joined #ocaml
rand000 has joined #ocaml
mcclurmc has joined #ocaml
SethTisue has quit [Quit: SethTisue]
eikke__ has quit [Ping timeout: 264 seconds]
<Drup> labichn: the issue here is that you have a module with type variable
<Drup> you can't have that
* mrvn wants module ['a] M = struct type t = 'a end
<labichn> Hmm, I'm not sure that's what I'm trying to express, even if that is what I wrote. I'm simply trying to say that the second type parameter to the kont0 type is the same as the constrained expr type. After F is given a module there shouldn't by any unassigned type parameters
<pyon> Equality of objects is reference equality, right?
eikke__ has joined #ocaml
<mrvn> no
<mrvn> objects have an id
ollehar has quit [Ping timeout: 240 seconds]
<pyon> I tried "let foo x = object method get = x end;; let a = foo 1;; let b = foo 1;; a = b;;"
<pyon> And it returned "false". Clearly equality of objects only cares about when the object was created.
WraithM has quit [Ping timeout: 252 seconds]
<mrvn> because the id differs
olauzon has quit [Quit: olauzon]
<pyon> Ah!
<pyon> Is there anything like polymorphic variants, but for tuples/records (that do not have an id, that is)?
<mrvn> write your own method eq x y = ...
<Drup> mrvn: I'm not sure you can write a deep equality of type (< .. > as 'a) -> 'a -> bool in pure ocaml without Obj.stuff
<Drup> I'm not even sure you can write it with Obj.stuff
<Drup> pyon: short answer is no
<mrvn> Drup: sure you can with Obj.stuff. But you don't need to. You only need equality of equal types.
<Drup> mrvn: how do you iterate equality over the field of the object ?
<mrvn> Drup: you know what all the fields are
<Drup> no, that's the point, look at the type I gave
<mrvn> Drup: in every class you implement method eq. each class knows its type.
<Drup> yes, but that's not what I said.
<mrvn> but what he wants
<Drup> not, that's not really what he asked either.
<Drup> no*
<mrvn> you can also add a type identifier to each class and then first compare the identifier and only on equal compare the specific class type.
<pyon> Mmm... On a second thought, it actually does not make much sense. { a = 1, b = 2 } would be equal to { a = 1, c = 3 }. First, both would be upcasted to { a = 1 }, and then they would be deemed equal.
<mrvn> add in a GADT and you can probably make that work near magicall.
<pyon> s/,/;/
<mrvn> pyon: that's where the type identifier would come in. They would still differ even after the cast.
<pyon> Ah!
<mrvn> But wether { a = 1, b = 2 } would be equal to { a = 1, c = 3 } depends on what you actually want.
<Drup> anyway pyon : you probably don't need it :p
<mrvn> You could also wrapp your class Foo with a weak hashtbl that maps initial values to objects and use that so "make_foo 1" always gives the same class.
<mrvn> object.
<mrvn> depends on what you actualy need
maattdd has joined #ocaml
<Drup> (in your place, I would just put an "eq" method in all my classes)
<pyon> I do not need anything in particular, I was just wondering why polymorphic variants in a sense had "value semantics", while objects had "reference semantics".
<pyon> (Or, more accurately, as you said, why objects keep an id.)
<pyon> But, yeah, a binary eq method should do the trick.
<mrvn> Two cars just aren't the same just because they both are green and have 4 wheels. You have to comparte the plates (id) too.
<Drup> mrvn: that's such a terrible answer xD
<def`> pyon: objects are often mutable and have behaviors (functions), so it makes sense to rely on physical identity
<Drup> pyon: you have to consider how both are implemented too
<Drup> poly variants are basically like variants : an int plus a field
<Drup> it's easy to look inside the value
<mrvn> Drup: just hinting that people expect objects to be somewhat physical
<Drup> pyon: on the contrary, objects are basically hash maps
<Drup> (not exactly, but almost)
<pyon> Method names to implementations?
<Drup> yes
<Drup> so it's a hash map of functions
<Drup> hence why the equality is not structural
<pyon> Ah!
<mrvn> you could iterate over all entries and compare the functions and values.
SethTisue has joined #ocaml
<ggole> Don't use objects, problem solved
* ggole coughs
<Drup> you could, but you bump into the subtyping issues
<Drup> which, as you pointed out involuntary by your id technique, are slightly hairy
<mrvn> = total equality, == physical equality, === subtype equality
<def`> what does subtype equality means :' ?
<mrvn> only the field belonging to the current type are compared.
<def`> an object subtype exposes only methods, how do you compare methods ?
<labichn> Drup: Figured it out! I can just write in the full signature rather than try to add type implementations the existing module type using "with". Looks like the "with" operator just doesn't let you do mutually recursive type restrictions
<mrvn> def`: does it? I thought the values are hashed too
<Drup> labichn: can you pastebin the solution ?
<def`> mrvn: values are never exposed in the type
<Drup> labichn: I must say, I didn't look very closely to figure out why you wanted to do, just pointed out the first issue
<labichn> No worries, thanks for taking a look at all
<Drup> oh ok, so you don't really have type variables
<labichn> Yeah, exactly
<Drup> it's juste placeholder until you have all the time information, which is fine :p
<Drup> you could probably unroll part of that, to make it less convoluted
<Drup> in order to minimize the recursive part, which is the big pain point
<labichn> What do you mean by unroll? Part of what?
SethTisue has quit [Quit: SethTisue]
rgrinberg has quit [Quit: Leaving.]
<Drup> you have a big convoluted recursive definition, with type parametrized poly variant and the functor
<Drup> I'm wondering if you could make it smaller, and have most of the stuff out
<Drup> (btw, this parametrized recursive poly variant is the best way to shoot yourself in the foot and have nightmarish error messages, you are warned.)
<labichn> I wouldn't be able to extend a language without copying the rest of the implementation each time
<labichn> Oh, I'm well aware :)
yacks has quit [Quit: Leaving]
<Drup> :p
<mrvn> labichn: module M' = struct include M let foo x = x end;;
<mrvn> labichn: with open types that even works for types
<Drup> def`: we have to add this pattern on our list of "stuff to do if you want to kill yourself".
<labichn> mrvn: not if the types have recursive components, like most ASTs do
ikaros has quit [Quit: Ex-Chat]
<Drup> labichn: the question is : are you really sure you want to extend the language like that ? :]
<mrvn> labichn: you said extend the language
<labichn> Definitely. I'm interested in figuring out the performance implications versus hand-coding the full language each time
<labichn> And I like playing around with languages features I don't fully understand
<Drup> well, you will see that the performance implications are little
philtor_ has quit [Ping timeout: 252 seconds]
<Drup> but the type error messages implications are ...
<labichn> I think I've just about got recursive modules and variants down
<labichn> oh yeah, the errors are nigh-unintelligable
<mrvn> labichn: raise your hand when you get a 100k error message
<labichn> Luckily haven't hit one of those yet, I'll be sure to let you all know when I do
<Drup> you'll see, it's fun.
<Drup> the first time :D
<mrvn> fun is when you get val foo : 'a -> 'a and val foo : 'a -> 'a are not the same errors or 'a must not escape it scope errors in recursive modules.
<mrvn> But hey, just write perfect code and you will neve have that problem. :)
<labichn> Sound advice
<labichn> And I think that camlp4 bug from last week will exist for a while, no one seems enthused to take it on
<labichn> It ends up being an issue only if you use the constructors `True or `False, so I'm taking the cowards way out and using `Tru and `Fals
thomasga has quit [Ping timeout: 240 seconds]
<flux> how about `true and `false :)
<Drup> flux: no difference,
<flux> cool, a case-insensitive bug?
ustunozgur has quit [Quit: Leaving...]
<Drup> indeed :p
<labichn> Actually, you can't have `true as a variant constructor
<labichn> Or `[any reserved keyword]
<labichn> Or so my repl tells me
<flux> oh
<ggole> Variants are actually parsed as ` name
<ggole> Separate tokens
<labichn> Ah, that'd be why
<flux> so it follows ` foo works as well (and it does)
<flux> and ` (* hello *) world ;)
<ggole> OCaml is pretty strange, lexically speaking
labichn has quit [Quit: Page closed]
<flux> and `a`a is also valid
<flux> but `a`a`a of course isn't
<flux> I bet you could try some obfuscation with that
<Drup> flux: are you testing with or without camlp4 ?
<flux> `a` (* the letter 'a') diudau
<flux> without
<flux> hmm
<flux> maybe ;)
<Drup> the result is actually different ;)
<flux> it's some batteries' old init file, lemme see..
ustunozgur has joined #ocaml
<flux> I think it's without, didn't the output look different than val a : int = 42
philtor has joined #ocaml
rgrinberg has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest30764
Guest30764 has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
hhugo has joined #ocaml
WraithM has joined #ocaml
thomasga has joined #ocaml
SethTisue has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
nlucaroni has joined #ocaml
_andre has quit [Quit: leaving]
SethTisue has quit [Quit: SethTisue]
thomasga has quit [Quit: Leaving.]
SethTisue has joined #ocaml
rand000 has quit [Quit: leaving]
SethTisue has quit [Client Quit]
SethTisue has joined #ocaml
ontologiae has joined #ocaml
sheijk has joined #ocaml
tane has quit [Quit: Verlassend]
Hannibal_Smith has quit [Quit: Sto andando via]
ontologiae has quit [Ping timeout: 276 seconds]
maattdd has quit [Ping timeout: 276 seconds]
SethTisue has quit [Quit: SethTisue]
maattdd has joined #ocaml
tobiasBora has joined #ocaml
thomasga has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
WraithM has quit [Ping timeout: 276 seconds]
ggole has quit [Ping timeout: 252 seconds]
WraithM has joined #ocaml
jeregrine has quit [Ping timeout: 240 seconds]
WraithM has quit [Quit: leaving]
<Drup> rgrinberg: don't you think it would be better to compile .cppo.ml files, just to keep editors happy ?
<rgrinberg> yeah that's how I'd do it
<rgrinberg> the only reason i had it the other way is because that's how shcaml did it
<rgrinberg> i might change it
<Drup> ok
Submarine has quit [Quit: Leaving]
WraithM has joined #ocaml
kakadu_ has joined #ocaml
eikke__ has quit [Ping timeout: 265 seconds]
<Drup> rgrinberg: there is no -D/-U used in shcaml ? cppo is only used for #include ?
Kakadu has quit [Ping timeout: 240 seconds]
axiles has quit [Ping timeout: 245 seconds]
jeregrine has joined #ocaml
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
kakadu_ has quit [Quit: Konversation terminated!]
Arsenik has quit [Remote host closed the connection]
cesar_ has joined #ocaml
<rgrinberg> Drup: yeah
cesar_ is now known as Guest77378
<rgrinberg> but it's easier to use cppo i think if you're packaging for opam
<Drup> what do you mean ?
<rgrinberg> if your package needs cpp to build opam has no way of installing that
alpounet has quit [Ping timeout: 276 seconds]
<Drup> ah, ues
<avsm> cpp is part of the c compiler suite; opam assumes that exists
<Drup> yes*
<Drup> avsm: he means cppo
<rgrinberg> avsm: what does it do on windows?
<rgrinberg> oh wait nvm...
jeregrine_ has joined #ocaml
<rgrinberg> avsm: btw, did the JS guys manage to sell you on jenga?
Guest77378 has quit [Ping timeout: 264 seconds]
jeregrine has quit [Ping timeout: 240 seconds]
<Drup> god, makefiles are complicated =__=
<avsm> it's pretty impressive (I would have loved to have had it when I was doing the xenserver build system)
<rgrinberg> Drup: at least tehy work
<avsm> still some work to be done to make it usable outside of JS, but it's making progress
ustunozgur has quit [Remote host closed the connection]
<avsm> this is the first cut at a set of build rules for out of tree compilation of normal ocaml programs: https://github.com/janestreet/jenga/blob/master/examples/js-build-style/jengaroot.ml
<Drup> 5k lines ?!
<Drup> 4.2* actually
jeregrine_ has quit [Ping timeout: 245 seconds]
<avsm> seems about right wrt ocamlmakefile/ocamlbuild
<Drup> oh, that's not an equivalent of myocamlbuild.ml, nvm then
ustunozg_ has joined #ocaml
ustunozg_ has quit [Read error: Connection reset by peer]
<Drup> yeah, it seems right if it's inside jenga :)
jeregrine has joined #ocaml
<avsm> this is the quickstart! :)
<rgrinberg> cool
<Drup> it's actually quite more than pure ocaml projects
<rgrinberg> anyway, it doesn't look like jenga will save us anytime soon
<avsm> 4.02 helps a lot, with -pack not being needed any more
<Drup> and jenga is probably quite overkill for small to medium projects
Thooms has joined #ocaml
<rgrinberg> Drup: there's no satisfactory solution for small/medium projects anyway :/
WraithM has quit [Ping timeout: 252 seconds]
maattdd has quit [Ping timeout: 265 seconds]
WraithM has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
jeregrine has quit [Ping timeout: 240 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
eikke__ has joined #ocaml
Thooms has joined #ocaml
<Drup> it's getting slightly better, but yeah
<Drup> jpdeplaix, hhugo : can I do a pflag with 2 arguments ?
<Drup> (sub question : how ?)
<jpdeplaix> Drup: yes and no
<Drup> (I hope it's going to be "take a string, split at the comma)
<Drup> it's NOT*
<jpdeplaix> …
<jpdeplaix> it is
<Drup> T__T
<Drup> jpdeplaix: and how does the "error report" part goes, when there is no comma ?
<jpdeplaix> I don't know. It's up to you to decide
eikke__ has quit [Ping timeout: 255 seconds]
philtor has joined #ocaml
<hhugo> drup: what's your use case for pflag with 2 arguments ?
<Drup> hhugo: a flag for the cppo -x option
<Drup> I'm just going to pass the (only) argument right away, and the user will be yelled at by cppo if they don't use the command line syntax used by cppo.
<Drup> but semantically, it should be two arguments
typedlambda has quit [Ping timeout: 252 seconds]
alpounet has joined #ocaml
ustunozgur has joined #ocaml
typedlambda has joined #ocaml
ustunozgur has quit [Ping timeout: 245 seconds]
jeregrine has joined #ocaml
ikaros has joined #ocaml
ontologiae has joined #ocaml
huza has joined #ocaml
SethTisue has joined #ocaml
cdidd has quit [Ping timeout: 252 seconds]
jeregrine has quit [Ping timeout: 255 seconds]
xenocons has quit [Remote host closed the connection]
Thooms has quit [Ping timeout: 240 seconds]
cdidd has joined #ocaml
AltGr has left #ocaml [#ocaml]
<Drup> if I have a module with side effects inside a package foo, is "-package foo" enough to link it and trigger the side effects ?
<Drup> (use case : add rule in ocamlbuild as an ocamlbuild plugin)
Simn has quit [Quit: Leaving]
<whitequark> Drup: I think sometimes you manually need to add -linkall to the ocamlc invocation with -linkpkg
<whitequark> or ocamlopt
xenocons has joined #ocaml
<whitequark> because findlib tries to be clever or something
jeregrine has joined #ocaml
Valdo has quit [Excess Flood]
Valdo has joined #ocaml
<Drup> and there is no tag for linkpkg, obviously
<Drup> oh, actually there is !
<Drup> it's just not documented.
Muzer has quit [Excess Flood]
avsm has quit [Quit: Leaving.]
<Drup> ahah
<Drup> ocamlbuild just exploded at my face with an infinite loop and ate up all my memory
<Drup> rgrinberg: so, "%.cppo.ml -> %.ml" is a bad idea™
huza has quit [Ping timeout: 240 seconds]
<rgrinberg> Drup: ^_^
<Drup> (I have no idea why it loops, it's seems quite silly)
<rgrinberg> you should have known it could never be that simple with ocamlbuild
<Drup> -'s
Muzer has joined #ocaml
<Drup> it doesn't even loop on the .cppo.ml
<Drup> it loops on a normal .ml
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
SethTisue has quit [Quit: SethTisue]
<hhugo> drup: to build an .ml ocamlbuild tries .cppo.ml -> to build an .cppo.ml, it tries .cppo.cppo.ml -> …
<Drup> . . .
<hhugo> drup: try to insert your rule in a different position
<Drup> how do I do that ?
alpounet has quit [Ping timeout: 255 seconds]
<Drup> actually, I know how
<hhugo> use both dispatch_hook (after_rules) and ~insert argument un rule function
<Drup> both ? ~insert is not enough ?
ikaros has quit [Quit: Ex-Chat]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest85566
<hhugo> if you declare your rule too early (before ocamlbuild register common rules), you loose control of the position
<Drup> I see
<Drup> for the insert, `bottom is ok ?
<hhugo> ideally, all sideeffect should take place in the dispatch function
<hhugo> `bottom seems right (or is it `top ?)
<Drup> that was my question :D
<Drup> I can't call the dispath function myself, right ? The user must be the one to call it ?
thomasga has quit [Client Quit]
<Drup> that means the user will still have to write some stuff in the ocamlbuild.ml >_>
<hhugo> yes, you can use dispatch only once (left to the user)
Guest85566 has quit [Ping timeout: 240 seconds]
<Drup> grmbl.
<hhugo> we should be albe to register many dispatch function
<Drup> hhugo: can you add to the wiki "add a auto_dispatch feature" :D
<hhugo> I've added you to the Collaborators
<hhugo> of hhugo/ocamlbuld
<Drup> that's a bit ambitious.
huza has joined #ocaml
<Drup> (let me figure out this and I will edit the wiki)
ontologiae has quit [Ping timeout: 255 seconds]
darkf has joined #ocaml
<hhugo> another solution to your problem would have been to prevent dots in your cppo rules => "%(path:<**/>)%(name: <*> and not <*.*>).cppo.ml"
<Drup> I'm not sure I want to do that
<Drup> it doesn't seem right
<hhugo> But this patterns may be buggy in ocamlbuild (raise unexpected exception)
<Drup> I would prefer ocamlbuild to have the right priority over rules
<hhugo> It has to be fixed
philtor_ has joined #ocaml
<Drup> that's what I'm trying to do
<Drup> ok, so I put the rule declaration inside the dispatcher, inside After_rules
<hhugo> you would not have the issue if reverse the rule (like .pp.ml)
madroach has quit [Ping timeout: 252 seconds]
<Drup> huum
madroach has joined #ocaml
<Drup> it's still not working, with the rule inside After_rule and ~insert:`bottom
<Drup> I tried `top too
WraithM has quit [Ping timeout: 252 seconds]
<Drup> hhugo: do you think it's better to reverse the rule ?
<Drup> it's far more invasive to the user, though
NoNNaN has quit [Remote host closed the connection]
huza has quit [Quit: WeeChat 0.3.8]
NoNNaN has joined #ocaml
huza has joined #ocaml
rgrinberg1 has joined #ocaml
asmanur_ has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 240 seconds]
<hhugo> reversing the rule has a different meaning. why do you say it's more invasive
<Drup> hhugo: don't the user will have to do something special to talk about the module defined by "foo.ml" if it's actually compiled as "foo.cppo.ml" ?
<Drup> hnrgrgr: also, I tried to user the pattern restriction, and yeah, it just launch an exception and fail
<hhugo> also you can write the rule dep:"%.ml.cppo" prod:"%.ml"
<hhugo> no looping here
<Drup> yes
<Drup> that was the first version
<Drup> but it breaks editors and tools
<Drup> I wanted to fix that
<Drup> hhugo: I still don't understand why it's not working when I define the rule after all the other rules
huza has quit [Quit: WeeChat 0.3.8]
huza has joined #ocaml
huza has quit [Client Quit]
<hhugo> you rule fail to build
huza has joined #ocaml
<hhugo> have you try with -verbose 2 -classic-dispay
<hhugo> -display
<hhugo> -classic-display
<Drup> my rule fails to build ?
studybot_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
huza has quit [Client Quit]
<Drup> it's not even looping on a cppo.ml, it's looping on a regular ml file not related. and it doesn't call ocaml, it fails at the first .ml