gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz_ is now known as ulfdoz
dcolish has quit [Quit: Coyote finally caught me]
geef has quit [Quit: Lost terminal]
waterfowl has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 255 seconds]
crassus has joined #ocaml
oriba has quit [Quit: oriba]
sepp2k has quit [Remote host closed the connection]
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
yezariaely has quit [Ping timeout: 240 seconds]
yezariae1y has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
mbac has joined #ocaml
haelix has joined #ocaml
mbac_ has quit [Ping timeout: 240 seconds]
haelix_ has quit [Ping timeout: 240 seconds]
bobzhang has quit [Remote host closed the connection]
pilki has joined #ocaml
fantasticsid has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
dcolish has joined #ocaml
fantasticsid has quit [Remote host closed the connection]
fantasticsid has joined #ocaml
fantasticsid has quit [Remote host closed the connection]
fantasticsid has joined #ocaml
fantasticsid has quit [Remote host closed the connection]
fantasticsid has joined #ocaml
crassus has left #ocaml []
emmanuelux has quit [Remote host closed the connection]
sebz has joined #ocaml
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
emmanuelux has joined #ocaml
<adrien> gildor: there is a "$project-commits Archives" in the forge in the Lists; mine says "Description: CVS commits"; is it something that only works with cvs or should it also work with git?
edwin has joined #ocaml
fantasti` has quit [Ping timeout: 248 seconds]
sebz has joined #ocaml
sebz has quit [Client Quit]
yezariae1y is now known as yezariaely
fantasticsid has joined #ocaml
Kakadu has joined #ocaml
milosn_ has quit [Read error: Operation timed out]
sebz has joined #ocaml
milosn has joined #ocaml
Submarine has joined #ocaml
<adrien> let get_oid (obj : 'a obj) : int = (snd (Obj.magic obj) lor 0)
<adrien> arf, wrong channel
<adrien> but the point is still valid: doesn't mean anything ='(
<adrien> (it's from lablgtk2)
<Submarine> it does mean something but it's quite ugly
<adrien> yes, but it has no documentation and no description
<Submarine> Obj.magic is basically a universal cast operator
<Submarine> this code seems to mean
<adrien> I'm under the impression it's for giving a unique ID to objects
<Submarine> "assume obj is essentially a couple of items, with second component an integer, give that integer"
ygrek has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 240 seconds]
<adrien> it's sometimes depressing to see how many things are missing in lablgtk2's api
<zorun> I don't quite see the point of the "lor 0" part?
ikaros has joined #ocaml
Submarine has quit [Ping timeout: 248 seconds]
itewsh has joined #ocaml
zorun has quit [Quit: leaving]
<adrien> with objects, it's not possible to override a method with a method of a different tyep?
<adrien> type*
<adrien> I'm getting the following:
<adrien> # class foo = object
<adrien> method x a b = a + b
<adrien> method x c = c
<adrien> end;;
<adrien> Error: This expression has type int but an expression was expected of type
<adrien> int -> int
<adrien> with the last 'c' (of "method x c = c") being underlined
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<adrien> or I'll simply break the API in the next lablgtk release and tell everyone to fix their code
zorun has joined #ocaml
Submarine has quit [Ping timeout: 240 seconds]
<adrien> probably that yes; changing (fun i -> ...) into (fun _ i -> ...) is not terrily hard
<flux> adrien, ocaml still doesn't have overloading :)
<flux> this may be why it can be a good idea to use () parameters even in methods
<adrien> I don't want to overload actually: I want to hide an inherited method
<flux> so you can add optional arguments later
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
raichoo has joined #ocaml
itewsh has quit [Quit: o/]
ygrek has quit [Remote host closed the connection]
fantasticsid has quit [Ping timeout: 252 seconds]
ttamttam has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ygrek has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
ttamttam has left #ocaml []
pango_ has joined #ocaml
fantasticsid has joined #ocaml
pango has quit [Ping timeout: 255 seconds]
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 240 seconds]
everyonemines has joined #ocaml
fantasticsid has joined #ocaml
sebz has joined #ocaml
fantasti` has quit [Ping timeout: 244 seconds]
lamawithonel has quit [Remote host closed the connection]
pilki has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
letrec has quit [Remote host closed the connection]
<adrien> will (Obj.obj (Obj.dup (Obj.repr "foo"))) be the same as "String.copy "foo"" ?
ttamttam has joined #ocaml
sebz has joined #ocaml
<zorun> err, such ugliness hurts my eyes :o
letrec has joined #ocaml
<adrien> also, it didn't solve my issue =)
<adrien> but you have to love it when [ String.copy "moo" ] seems to return "http"
<everyonemines> huh?
<everyonemines> I don't follow
<pilki> wtf?
<adrien> ah, I think I've found the issue: I'm using Obj and I knew it was probably the issue but I couldn't figure out how the modules which are using Obj were called
<pilki> just *don't* use Obj...
<pilki> there is a reason why it's not documented
<adrien> actually, no, it doesn't seem to be in the path
<adrien> call path
<adrien> I use Obj in a very restricted place and I have nothing to provide me with a similar functionality
<everyonemines> what functionality
<pilki> you *acutally* have in your code [String.copy "moo"], and it returns ["http"]
<pilki> ?
<pilki> Should I fear some backfire? <--- yop :)
sebz has quit [Quit: Computer has gone to sleep.]
fantasti` has joined #ocaml
<adrien> I have options for my program: I write a description of them and generate the data structure I'll use to access the values
<adrien> like: options = { categories = [| ... |]; options = [| option1; option2 |] }
<adrien> forgot the "name" field
<adrien> and after that, with the generated code, I can access options.cat1.cat2.option3 directly, with proper names
fantasticsid has quit [Ping timeout: 240 seconds]
<zorun> mmh, there's a library for that
<everyonemines> wouldn't a hashtable be more appropriate?
<adrien> I'm using Obj to update the values
<adrien> everyonemines: I want to access the values directly instead of having to lookup the value and then pattern-match the various possibilities (since I'd have to make a type | Int of int | Float of float | ...)
sebz has joined #ocaml
<adrien> but actually, thinking again about it, maybe that I can keep this code organization but stop using Obj
<adrien> hmmm, no, I wouldn't be able to
<zorun> adrien: you might want to have a look at https://forge.ocamlcore.org/projects/config-file/
<adrien> but so far, I haven't been able to see that Obj is the culprit here
<zorun> it's for config files, but there is the same problematic of having data of arbitrary types
<thelema> adrien: don't use obj for this
<everyonemines> What?? When you're pulling a config value
<everyonemines> you should know what type it is
<thelema> adrien: when you access the value directly, how do you know what type it is?
<everyonemines> then you can make a function to pull it
<adrien> thelema: the generated sources have full type information:
<adrien> thelema: well, in the general case that is
<everyonemines> So you have different functions and which one you use
<thelema> adrien: and don't overuse code generation.
<everyonemines> depends on type information in the config file ??
<everyonemines> Weird.
<adrien> I also have the description which I read at the same time and gives me the types
<adrien> zorun: iirc it was too complicated/heavy for what I wanted
<everyonemines> But in that case, variant types are the Offical Ocaml Solution.
<zorun> adrien: it's using objects in a clever way
<adrien> everyonemines: if I store settings in hashtable, I'd have to wrap the different types under a single type
<everyonemines> yes...
<zorun> and it looks far less complicated than what you're trying to do now :)
<adrien> which will require more code than I want
<everyonemines> so you're implementing ad-hoc polymorphism
<everyonemines> in code generation?
<everyonemines> Sounds like you want a dynamic language if you're sure this is what you want to di.
<everyonemines> *do
<everyonemines> python or lua maybe
<everyonemines> if you don't want to use variant types, but want to deal with different types
<adrien> well, it would work but I only want that for the option dialog box (this is a lablgtk2 program btw)
<everyonemines> ocaml just won't work very well
<everyonemines> I suggest writing this part in a diff lang
<everyonemines> and calling it as a command line argument
<everyonemines> if it's a small part
<thelema> everyonemines: ocaml works just fine, you just have to implement the dynamic dispatch yourself. It can be hidden behind the function calls
<everyonemines> thelema: ...yes, that's what variant types do
fantasti` has quit [Remote host closed the connection]
<everyonemines> and apparently adrian doesn't like that
<pilki> lexifi pushed the insertion of GADT's in ocaml to have dynamic typing... for GUI :)
<adrien> I need to check it's actually Obj which is the issue so I'll first make a .mli for the only module which uses Obj and then I'll replace the public functions with effect-less ones
<thelema> everyonemines: adrian doesn't like having them exposed - he can hide it all in a library just as well as other languages can hide it in their implementation
<adrien> pilki: well, yeah, I started my stuff then saw the GADT stuff; but right now I don't have it
<everyonemines> GADTs?
<adrien> I wish I could explain because that would mean I understand them well enough
<adrien> the functions using Obj are not called when my issue happens
eikke has joined #ocaml
<thelema> adrien: still could be their fault
<adrien> thelema: how? no toplevel expressions in modules
eikke has quit [Remote host closed the connection]
<thelema> smart compilation making wrong assumptions
<adrien> I've replaced the functions' bodies with "assert false"
pilki has quit [Quit: This computer has gone to sleep]
ttamttam has left #ocaml []
sebz has quit [Quit: Computer has gone to sleep.]
<adrien> . . .
<adrien> guess
<adrien> it has something to do with settings and nothing to do with Obj but it has to do something with losing type information
<adrien> the stupid issue was the use of the Marshal
<adrien> module
<adrien> wouldn't it be possible to have at least a checksum of the type? ='(
<thelema> adrien: nope.
<thelema> because the type isn't available at runtime - where would Marshal find out the type?
<adrien> bah; I didn't want to stay with Marshal anyway
<adrien> hahah, that's a pretty good reason to not have it ;-)
<adrien> I'll be moving to JSON or biniou soon but I have to figure out how I'll make it possible to load files from previous versions
<everyonemines> biniou
<everyonemines> what is that
<everyonemines> nm https://github.com/mjambon/biniou i assume
<adrien> yup
<adrien> I was planning to use JSON through yojson (iirc) but it depends on biniou and biniou is said to be faster while still being human-readable
<everyonemines> biniou appears to be designed for ocaml
<everyonemines> as a storage for ocaml internal structures
<thelema> what about odn? ocaml data notation
<thelema> oasis uses it seemingly successfully
<adrien> I need to check the "human" formats because I'd like to have something like JSON
sebz has joined #ocaml
<everyonemines> What improvements over JSON did you want? Just speed?
<adrien> I don't "want" anything particular but if I can get more speed for free...
<everyonemines> The cost you pay is really
<everyonemines> compatibility with other stuff using JSON
<adrien> yeah; I haven't checked what the format was yet
<adrien> going to do so in a few minutes
sebz has quit [Quit: Computer has gone to sleep.]
everyonemines has quit [Quit: Leaving.]
<hcarty> thelema: Do you mind if I steal some of the tone/wording from odb's README for ocamlbrew?
<thelema> steal away
<hcarty> Thank you
<thelema> I hope you can improve on it, so I can steal your improvements back
<thelema> also, I'm working on a very simple ~/.odb/packages file that will override oasis-db
<hcarty> thelema: That's cool. Something to allow for (perhaps manually managed) local packages?
<thelema> once I get it working for remote packages, that's the next thing on my list.
<thelema> once I get that, giti/svn should be trivial
<thelema> *git
<thelema> the existing assumptions for tarballs were pretty terrible.
pilki has joined #ocaml
sebz has joined #ocaml
<hcarty> ocamlbrew now has a simple README if anyone is able to give it a quick read and comment: https://github.com/hcarty/ocamlbrew/blob/master/README.md
<thelema> I'm not such a fan of text-mode wizards, any chance of command-line args?
<thelema> The readme looks good
<thelema> maybe a final comment on exactly *how* the installed programs will be available
<thelema> also, your instructions aren't quite right for "download and run", as the downloaded file won't be executable
sebz has quit [Quit: Computer has gone to sleep.]
Kakadu has quit [Read error: Operation timed out]
<thelema> and I just ran it with all "y" answers, and it seems to have done nothing.
Anarchos has joined #ocaml
<thelema> mkdir: cannot create directory `/home/thelema/ocamlbrew': Not a directory
<thelema> oh, because the ocamlbrew file in in my home directory. :P
Kakadu has joined #ocaml
<hcarty> thelema: Ha! All good points...
<hcarty> That's what I get for doing all my testing from the source tree
<hcarty> thelema: Thanks, I'll get those fixed
<thelema> :)
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx_ has joined #ocaml
<Anarchos> i dound why i can't compile ocaml
<adrien> still the float_of_string stuff?
<hcarty> thelema: It will be a few hours before I can make and push the fixes, but I will definitely make them.
<hcarty> thelema: Command line arguments (and possibly environment variables) are on the list to add
<hcarty> *list of features to add
<thelema> hcarty: great
<thelema> I want an --all argument to install everything
<Anarchos> am i the only one unable to build the dev8 version of the compiler ?
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
EmmanuelOga has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
adrien has quit [Ping timeout: 252 seconds]
itewsh has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
<thelema> new odb pushed, fixes bug in upgrading deps, first support for local packages file to override oasis-db
<thelema> read commit message for brief details
<thelema> will document better later
<thelema> report bugs, plz
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
pilki has joined #ocaml
itewsh has quit [Ping timeout: 252 seconds]
pilki has quit [Ping timeout: 252 seconds]
fridim_ has joined #ocaml
waterfowl has quit [Quit: waterfowl]
fridim_ has quit [Ping timeout: 252 seconds]
s44nder has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
pilki has joined #ocaml
bobzhang has joined #ocaml
<bobzhang> hi, I was writing a book about practical bits of ocaml, anyone interested in help?
Kakadu has quit [Quit: Konversation terminated!]
ygrek_ has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
bitbckt has quit [Quit: out]
_habnabit has quit [Quit: ZNC - http://znc.sourceforge.net]
mbac has quit [Ping timeout: 252 seconds]
_habnabit has joined #ocaml
fraggle_ has joined #ocaml
mbac has joined #ocaml
bitbckt has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
milosn_ has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
BiDOrD has joined #ocaml
edwin has quit [Remote host closed the connection]
BiDOrD_ has quit [Ping timeout: 268 seconds]
<hcarty> bobzhang: My guess is that you will get a lot of interest. I won't be able to take a look for a few days, but creating a project on the forge (forge.ocamlcore.org) or github is probably a good place to start.
sebz has joined #ocaml
sebz has quit [Client Quit]
adrien has joined #ocaml
raichoo has quit [Quit: leaving]
fridim_ has joined #ocaml
<Qrntzz> bobzhang: there is already a book named "practical ocaml", just so you consider the naming
<Qrntzz> bobzhang: as hcarty said, creating a project page would probably be the best turn to gather people interested in it
ikaros has joined #ocaml
sebz has joined #ocaml
<bobzhang> Qrntzz: thanks. I put it here http://www.seas.upenn.edu/~hongboz/master.pdf
<bobzhang> sure, I can put the latex file in github
sebz has quit [Quit: Computer has gone to sleep.]
Morphous_ has quit [Ping timeout: 244 seconds]
Morphous_ has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
sebz has joined #ocaml
s44nder has quit [Quit: Ik ga weg]
ygrek_ has quit [Quit: Leaving]
fridim_ has quit [Ping timeout: 268 seconds]
ikaros has quit [Quit: Ex-Chat]
<thelema> bobzhang: "idea??? how about divide enum to two; one is just for iterator the other is for
<thelema> lazy evaluation. (iterator is lazy???)
<thelema> You wrote this about batenum - would you like to explain more to a Batteries dev?
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx_ has joined #ocaml
<bobzhang> thelema: I just noticed that, I mean Enum is designed *too complex*, especially combined with side effects and memory profiling. I mainly use Enum as a iterator :-)
<bobzhang> thelema: but I think as a iterator, Enum does not need to be so complex, aybe I am wrong
sebz has quit [Quit: Computer has gone to sleep.]
<thelema> bobzhang: it could be less complex, I guess. It could only have next() and drop count() and clone()
<bobzhang> thelema: hmm, I don't see obvious advantage compared with Stream module
<thelema> I don't know what you mean by "memory profiling", and side effects enable conversion from one large data structure to another large data structure without needing 2x the memory
<thelema> have you looked under the covers of Stream? It's more complex than Enum.
<bobzhang> thelema: I mean the *sharing* between different copies are hard to reason. I wrote this part several months ago.
<bobzhang> thelema: I skimmed the stream.ml, and read enum.ml carefully
<bobzhang> thelema: you can correct it if I am wrong, I may publish it to github
<thelema> cloning is really useful for being able to print out an enum without consuming it
<thelema> I agree that reasoning about what happens when you clone an enum is difficult
<thelema> Especially enums constructed from IO channels
<bobzhang> another bit quite annoying is not 100% compatible
<bobzhang> tiny bits incompatible always drives you crazy
<bobzhang> like io channel part
<thelema> stream is not compatible with enum
<bobzhang> there are other parts incompatible
<thelema> ah, batteries is not 100% compatible with stdlib because of IO?
<bobzhang> yes
<thelema> I don't think there's anything we can do to gain compatibility with libraries that assume stdlib io
<thelema> but the only thing lost by batteries IO is seeking.
<thelema> and if you *really* need that, you can still fall back to stdlib IO
<bobzhang> I know Legacy, thanks
<thelema> was there some other incompatibility in IO that you were thinking of?
sebz has joined #ocaml
<bobzhang> like I used ocamlgraph library, they used channel, I can walk it around, but you know, still takes some time :-)
<bobzhang> I have written a hoogle-like tiny library, does batteries need that?
<thelema> there is a standard interface for IO that's used by batteries, ocamlnet, cryptlib and others
<thelema> hoogle?
<bobzhang> hoogle for haskell is quite useful
<thelema> better doc generation?
<bobzhang> no. just search the function by type, does ocaml already has such functionality?
<thelema> that sounds good, but maybe that goes into oasis-db.
<thelema> ocamlbrowser has this functionality
<bobzhang> yes. ocamlbrowser is quie unstable in my mac. It crashes every 2 hours..
<bobzhang> and i did not find search works
<thelema> Sorry about that. I don't use ocamlbrowser much, I just pull up the HTML docs in a web browser and jump around in that.
<bobzhang> hoogle is quite useful. for example in my toplevel
<bobzhang> se_type "'a -> 'a -> bool" "Pervasives";;
<bobzhang> external ( = ) : 'a -> 'a -> bool = "%equal"
<bobzhang> external ( <> ) : 'a -> 'a -> bool = "%notequal"
<bobzhang> external ( < ) : 'a -> 'a -> bool = "%lessthan"
<bobzhang> external ( > ) : 'a -> 'a -> bool = "%greaterthan"
<bobzhang> external ( <= ) : 'a -> 'a -> bool = "%lessequal"
<bobzhang> external ( >= ) : 'a -> 'a -> bool = "%greaterequal"
<bobzhang> external ( == ) : 'a -> 'a -> bool = "%eq"
<bobzhang> external ( != ) : 'a -> 'a -> bool = "%noteq"
<bobzhang> -
<thelema> oh, toplevel integration? Hmm, maybe it could go into batteries.
<bobzhang> yes
<thelema> You've seen batteries' help system (totally unmaintained since before 1.0)
<thelema> ?
<bobzhang> what?
<thelema> batteries/src/batteriesHelp.ml
<thelema> if you load batteries in your toplevel, do #help;; to get started
<bobzhang> it does not work in my toplevel. Is it useful?
<thelema> it would be more useful with hoogle built in
<thelema> have you setup batteries' ocamlinit?
<bobzhang> yes. I customized it
<thelema> is your customization still using battop.ml?
<bobzhang> yes. but i turned off syntax extension part
<bobzhang> and erased the Welcome message. a quick load :)
<thelema> sure, the welcome message is nothing. The syntax extension part is fine to disable.
<thelema> But I guess you dropped BatteriesHelp.init ();
<thelema> when you got rid of the startup message
<bobzhang> I just checked it out, no "BatteriesHelp.init ()"
<bobzhang> Oh, sorry, I commented it..
<thelema> yup, it's hiding before the startup message.
<bobzhang> now it works
<thelema> I'd love it if you can fix this part of batteries. even if that means removing everything it does now and replacing it with hoogle.
ulfdoz_ has joined #ocaml
<bobzhang> I see. I can do that part, but my tool is just as an aid to programming, I did not do serious parsing, I generated some complex regexes according to the user input, it works quite well in toplevel. is that ok?
<bobzhang> I tried to use camlp4 built in parser
<bobzhang> But I found it was buggy, so I gave it up
companion_cube has quit [Ping timeout: 255 seconds]
ulfdoz has quit [Ping timeout: 248 seconds]
ulfdoz_ is now known as ulfdoz
<bobzhang> as a user of batteries, I think 100% compatible is really a nice feature