flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<gildor> but you know, you can perfectly create the website and not take care at all about the storage of the tarball
<gildor> letting ocaml-archives do it for you
<mfp> how's ocaml-autobuild going? it precedes the website (with the package DB and uploads) logically
<mfp> (since no std build sys means no way to extract info = nothing to show on the site)
<gildor> humm, maybe we don't understand each other
<gildor> ocaml-autobuild is a mix between automake/autoconf and ocamlbuild
<mfp> but what is the devel expected to write for that? a custom myocamlbuild.ml?
<mfp> plus a META?
<gildor> basically it replaces ./configure (autoconf/automake) and build.sh/myocamlbuild.ml
<gildor> wait a second
<gildor> this is very simple
<gildor> Action.configure "ocaml-uname" "0.0.1"
<gildor> we create package ocaml-uname with version 0.0.1
<mfp> could some of that info be place in textual format in a separate file?
<gildor> yes, this is possible
<mfp> the advantage would be that it could then be extracted "statically", without running the code
<mfp> since running anything = risky
<mfp> even parsing is somewhat risky in fact :-P
<gildor> well we are building a software
<mfp> I mean for the central DB to extract that info without relying on the tarball name
<gildor> so i am not sure that we can really "not running the code"
<gildor> this is another question
<gildor> ;-)
<mfp> the user does build, but the centralized DB only extracts data to be showed in the site
<gildor> I have my idea about that
<gildor> as usual, this is a big plan for world domination, and maybe it will never exist
<gildor> so don't take this as granted
<mfp> is it simpler (your idea) than having name: ocaml-uname version: 0.0.1 in a file?
<gildor> in fact i would like to use DOAP
<bluestorm> mfp:
<gildor> in fact, it would replace Action.configure
<bluestorm> ensuring an ocaml code is safe is interesting and imho worth it
<gildor> by Action.configure_from_doap "ocaml-uname.doap"
<bluestorm> there has been some work already with the irc bot
<mfp> bluestorm: it demands more work than putting the data in some text file
<mfp> and it exposes you to ppl finding ways to break it :-|
<bluestorm> probably
<bluestorm> i'm only saying it's fun :-'
<mfp> there has to be something in exchange to justify the risk
<mfp> gildor: the DOAP page is down, but judging from what I see in Wikipedia it sounds like complex, complex and uh complex? :-P I see "RDF schema", "XML vobabulary", "semantic web" and...
<mfp> just an uninformed impression, but likely to be the 1st reaction from most ppl when exposed to this
<gildor> well, DOAP file can be useful for generating a lot of other thing
<mfp> as I said, one of the main lessons from my prev attempt was that doing the Right thing can prevent you from doing anything at all in the end
<gildor> mfp: if you want to provide a Action.configure_from_mfp_format, patches are welcome ;-)
<mfp> gildor: where's the tree?
<gildor> the darcs is not already up
<gildor> give me 5min
<mfp> ah OK, darcs :-))
<mfp> pulling is funny too :-P
<lispy> is darcs popular here?
<mfp> took me a while to get ~1500 patches for cabal-install earlier this morning :-P
<lispy> mfp: whoa, can you use a global cache with that? Or is it darcs version 1 repo?
<mfp> lispy: I've been using darcs for ~3 years or so, but I'm using git for new things now
<mfp> lispy: don't know if they have converted the cabal-install repos yet
<mfp> I prefer git's history rewriting (amend-record is very limited compared to rebase -i), it's faster and has no problems with large repositories/files
<lispy> Global caches help a lot when you can use them. Basically each patch gets a globally unique name, so if you work with any repo and that name comes up it can be fetched from the cache instead of redownloaded
<mfp> I now prefer in-place branching to 1-branch-per-working-dir, too
<mfp> thanks
<lispy> mfp: it doesn't help that the future of darcs seems very uncertain :(
<gildor> mfp: but this is a really young project
<gildor> mfp: i am still working on it
<gildor> mfp: and it will take time before having something good
<mfp> k
<gildor> good night
<mfp> night gildor
<mfp> it's also 02:27 for me, so zzzz
Proteus has joined #ocaml
Proteus_ has quit [Read error: 113 (No route to host)]
<bluestorm> btw
<bluestorm> in my new pet project (#light syntax), i make a heavy use of the pa_matches syntax extension
<bluestorm> and i found it to be very useful and neat in some situations
<bluestorm> (in short, it builds predicate from patterns)
seafood has joined #ocaml
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
jeddhaberstro has joined #ocaml
mikezackles has quit [Connection timed out]
<landonf> Do most of you use tuareg?
<vixey> I would like to but I don't know what to program in ocaml yet
<jeddhaberstro> Can some one help me out here? I don't understand why the compiler says x is of type 'a list (see comments): http://pasteall.org/1779/ocaml
<bluestorm> landonf: yes i do
<bluestorm> jeddhaberstro: Cons(l,Nil)
<bluestorm> is wrong
<vixey> jeddhaberstro: what is 'a * 'a cons ?
<bluestorm> vixey: defined above
<vixey> and it makes no sense to lack the [] case
<bluestorm> jeddhaberstro: you cons a list (l), so you have a ('a list) cons
<bluestorm> yes, you should match | [] -> Nil
<jeddhaberstro> ah, ok
<bluestorm> moreover, it is a bad idea to name a variable "l"
<bluestorm> use "li"
<bluestorm> l is not readable as it tends to be confused with 1 and | and I
<jeddhaberstro> ok, thanks for the type
<jeddhaberstro> that fixed it to :)
netx303 has quit ["Leaving"]
landonf has quit []
jeddhaberstro has quit []
pants1 has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Associat0r has quit []
Philonous1 has joined #ocaml
landonf has joined #ocaml
mwc has joined #ocaml
<mwc> Anybody know about Ocaml threads? I don't see a detach operation on threads, like say, pthread_detach. Do I have to join all threads eventually, in order to reap them?
Philonous has quit [Read error: 110 (Connection timed out)]
<landonf> pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
<landonf> ( otherlibs/systhreads/posix.c, caml_thread_new() )
<mwc> landonf: hmmmmmmm
<mwc> well, that'll do. I guess the join function doesn't return any information, so not much needs to be kept as far as state anyways
seafood has quit []
Proteus has quit [Read error: 104 (Connection reset by peer)]
Proteus_ has joined #ocaml
team-c134 has joined #ocaml
team-c134 has left #ocaml []
landonf has quit []
ygrek has joined #ocaml
mwc has quit ["leaving"]
bluestorm has quit [Remote closed the connection]
Kopophex has quit ["Leaving"]
seafood has joined #ocaml
Proteus has joined #ocaml
seafood has left #ocaml []
Proteus_ has quit [Read error: 113 (No route to host)]
gdmfsob has joined #ocaml
Proteus_ has joined #ocaml
Proteus has quit [Read error: 113 (No route to host)]
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
Snark has joined #ocaml
pants1 has quit [Remote closed the connection]
filp has joined #ocaml
Amorphous has joined #ocaml
GustNG has joined #ocaml
jonas_e has joined #ocaml
Proteus_ has quit [Read error: 113 (No route to host)]
guillem has joined #ocaml
Proteus has joined #ocaml
asmanur has joined #ocaml
Associat0r has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
tab has joined #ocaml
asmanur has quit [Remote closed the connection]
seafood has quit []
ygrek has quit [Remote closed the connection]
det has quit [Read error: 104 (Connection reset by peer)]
jonas_e` has joined #ocaml
det has joined #ocaml
bluestorm has joined #ocaml
jonas_e has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
asmanur has joined #ocaml
seafood has quit [Client Quit]
Mr_Awesome has quit ["aunt jemima is the devil!"]
seafood has joined #ocaml
<ertai> someone talk to me, but I not enough lines in my history, to see the message...
mikezackles has joined #ocaml
<bluestorm> ertai: don't you have logs ? :p
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<petchema> damn, and ircbrowse.com seems down
<ertai> bluestorm: I don't know (I'm using irssi btw)
<ertai> bluestorm: great, thanks
<bluestorm> btw ertai , there was a little discussion on the mailing-list about the use of Camlp4Tracer.ml , and we still don't know : http://groups.google.com/group/fa.caml/browse_thread/thread/25c9706b89196140/ab5c6321ab292123?lnk=gst&q=Camlp4Tracer#ab5c6321ab292123
<bluestorm> in short the question was "What is the intended use of Camlp4Tracer ? What does "exc" mean in that context ?"
<bluestorm> if you had clarifications, that would be interesting
<bluestorm> (or maybe those unknown camlp4 parsers/filters are described somewhere ?)
<ertai> bluestorm: hum this code is buggy
<ertai> exc is unbound
<ertai> but it was about exceptions
<ertai> this module seems really unfinished.
ppsmimou has quit [Read error: 104 (Connection reset by peer)]
seafood has quit []
ppsmimou has joined #ocaml
Watza has joined #ocaml
<Watza> j'en peux plus
<Watza> j'ai envie de me suicider
<Watza> mon portable va pas être porté
<Watza> et ça me saouulle
<Watza> dans 2 jours ils résilient ce putain de contrat de merde
<Watza> et bon norm ça en prend 10
<Watza> pas un sms, rien
<Watza> ;__;
<Watza> ok
<Watza> what's ocaml?
<Watza> I though it was a sextoys mark
haveo has joined #ocaml
<Watza> octal fils de chien
<Watza> c'est quoi ton pseudo
<Smerdyakov> This is an English channel.
<Watza> Oh sorry
Watza has left #ocaml []
RobertFischer has joined #ocaml
xavier__ has joined #ocaml
asmanur has quit [Remote closed the connection]
bluestorm has quit [Remote closed the connection]
ygrek has joined #ocaml
marmotine has joined #ocaml
tomh- has joined #ocaml
Jedai has joined #ocaml
gdmfsob has quit [Read error: 104 (Connection reset by peer)]
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
pec1 has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
RobertFischer has joined #ocaml
tomh- has quit ["http://www.mibbit.com ajax IRC Client"]
haveo_ has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
haveo has quit [Read error: 113 (No route to host)]
Linktim has joined #ocaml
asmanur has joined #ocaml
Philonous1 is now known as Philonous
Axioplase_ is now known as Axioplase
pango_ has quit [Remote closed the connection]
guillem has quit [Remote closed the connection]
landonf has joined #ocaml
munga_ has joined #ocaml
Watza has joined #ocaml
<Watza> ouai bon
<Watza> dédicace à tout le monde
<Watza> à mon cheval
<Watza> ma soeur
<Watza> ++
Watza has left #ocaml []
pango_ has joined #ocaml
munga_ has quit ["Ex-Chat"]
mbishop_ has joined #ocaml
mbishop has quit [Nick collision from services.]
mbishop_ is now known as mbishop
tvn1981a has joined #ocaml
<tvn1981a> I am looking at some ocaml code and see something like let listL = ref [] ;;
<tvn1981a> why would one want to reference a list ? isn't a list variable mutable in the first place ?
<flux> no
<flux> so, that's why :)
<flux> what's the use case for Gc.create_alarm. why would anyone really need that, given that Gc can produce debug output itself?
<flux> I'm actually reading about one case using of it is an option from the caml-list, but it looks hackish
<flux> another tidbit: JDH> For example, I cannot even jump to the definition of an identifier> reliably. DD> OCaml 3.11 has extended .annot files that will allow external toolsto do that. Also, it tells you which function calls are tail callsand which are normal calls.
<flux> ooh, nice :)
pango_ has quit [Remote closed the connection]
filp has quit ["Bye"]
jlouis_ has quit ["Leaving"]
pango_ has joined #ocaml
mattc58 has joined #ocaml
pec1 has left #ocaml []
jlouis has joined #ocaml
mattc58 has quit [Read error: 104 (Connection reset by peer)]
<tvn1981a> is there a function that will print the value of the variable for me ? regardless of what type of variable I am passing it in (e.g., int, float .. )
<fremo> printf ?
<tvn1981a> but printf requires you to know the type passing in
<tvn1981a> like c++ has something like cout , you can pass in a string, int, float, double etc
<tvn1981a> and it auto prints it out without you specifying the type
<RobertFischer> tvn1981a: No.
<tvn1981a> it would be nice if there's something as such
<RobertFischer> tvn1981a: There's no way to do it given OCaml's type system. And, truth be told, you'll miss it less than you think you will.
<RobertFischer> tvn1981a: A function which prints to stdout/stderr given a XXX_to_string function and an argument of type XXX is pretty simple to write. But that the run-time type querying capabilities just don't exist in OCaml. And you don't want them to -- you just don't realize that yet.
<tvn1981a> ic, thanks
<fremo> can't it be done with camlp4 ?
<tvn1981a> I thought it might have something like that given its type inference capability
<RobertFischer> fremo: Sure. I think it has been done -- doesn't Jane St's Core have something like that?
<fremo> probably, I remember some code that automaticaly creates functions for some types...
<RobertFischer> tvn1981a: The type inference capability is the problem with the ambiguous types.
<fremo> but if you use that to much, you'll have to explicitly specify types...
<RobertFischer> fremo: Yeah, that's true. I think the Core thing just creates print_XXX functions. I don't think it frees you from having to know the type passed into a print function.
dafra has joined #ocaml
<fremo> yep
jeddhaberstro has joined #ocaml
r0bby has quit [Connection reset by peer]
Linktim_ has joined #ocaml
<rwmjones> tvn1981a, when camlp4 runs, you don't know the types
<rwmjones> tvn1981a, the reason that janest can do it is because they create the functions when the type is being defined, eg:
<rwmjones> type foo = ... with sexpr
<rwmjones> for example
<rwmjones> camlp4 knows the details of type foo (because it is being defined there and then) and writes a sexpr_of_foo function
<rwmjones> however you cannot write a generic 'show' function using camlp4 that could work like 'show 4', 'show "hello"'
<rwmjones> (hmmmm, well you _could_ if you only wanted to print literals like that)
<rwmjones> but it wouldn't work for 'let v = 1 in show v'
Linktim has quit [Read error: 113 (No route to host)]
tomh- has joined #ocaml
asmanur has quit [Remote closed the connection]
Linktim_ has quit [Read error: 113 (No route to host)]
jonas_e` has quit [Remote closed the connection]
dafra has quit [Connection timed out]
<Philonous> Can someone please explain why ocaml has two different sets of arithmetical operations for ints and floats respectively? What's the gain? I guess this question is asked frequently - so maybe there is a site discussing this issue? (which I haven't found yet)
bluestorm has joined #ocaml
munga_ has joined #ocaml
<RobertFischer> Philonous: They are two distinct operations, which take two different argument types.
<RobertFischer> Ergo, they are two distinct functions.
<RobertFischer> (Man, it's "why doesn't OCaml have argument overloading" central here today.)
GustNG has quit [Read error: 104 (Connection reset by peer)]
<hcarty> Philonous: There is no function or operator overloading in OCaml
<hcarty> One benefit is that (+) always does what you say, as does (+.), without any implicit casts
<Philonous> So basicaly you are saying, that the type system doesn't consider int ant float to be some sort of subtype of an "arithmetic" type, which would then allow + to be polymorphic? (Maybe because Ocamls types are more hardware bound then e.g. Haskell?)
<bluestorm> Philonous: yes
<bluestorm> object-oriented OCaml could express that, and Functors are a way to achieve that too
<bluestorm> but the basic numeric types have no subtyping relations
<Chile`> Philonous: integers & floating point types are really, _really_ different
<Chile`> Philonous: implicit conversions between them produce a lot of bugs in C/C++ code, so its actually kind of nice to have to explicitly say what you're doing.
<bluestorm> Chile`: the same cannot be said for int and int32 or int64
<Philonous> Well, but it would still be meaningfull to write polymorphic functions that work on floats and ints respectively. That's what I was trying to achieve in the first place
Snark has quit ["Ex-Chat"]
<bluestorm> Philonous: use a functor
<bluestorm> you write your function inside a module parametrized over a numeric type
<Philonous> bluestorm: gratefully noted
<bluestorm> in wich case would such a function be useful ?
<bluestorm> i actually fail to see any, apart from let abs x = if x < 0 then x else - x maybe
<bluestorm> (i agree that using + instead of +. for float operations would be a syntaxic advantage, but this entails no polymorphism of any kind)
<Philonous> I was tring to write a function that would work on color codes given in rgb where the components are either ints in a range between 0 and 255 or floats between 0 and 1
<bluestorm> polymorphism in that case seems delicate at least
<bluestorm> you would use, say let rgb_function max_value ... =
<bluestorm> wich rgb_function 1. or rgb_function 255 ?
<bluestorm> if you don't consider any ad-hoc polymorphism (doing different things based on the input type), then you have to give the function a way to know wether it works in [0..1] or [0..255]
<bluestorm> so that's equivalent to using an alebraic datatype : rgb_function (Discrete (255, 0, 150)) rgb_function (Real (1., 0., 0.4))
<Philonous> Actually the function itself wouldn't need to know on which range it is working, since it wouldn't have to do any clipping
<bluestorm> hm
<bluestorm> do you have an example of such function ?
<bluestorm> i thought of adding the components of two colors, but that won't work
<Philonous> Now you mention it I see that prolly any non-trivial function really would have to distinguish between types anyway
<Philonous> Some (basic) vector/matrix operations still might be worth implementing polymorphic
<hcarty> Philonous: Those are relatively easily handled with either a syntax extension or defining new operators
<Philonous> Ok, thanks a bunch. That really helped me a lot.
<bluestorm> the vector/matrix operations should take the operator as parameter
<bluestorm> so that you can use with vectors of bools, lists, and what not
<Philonous> Ok, that even takes care of the different possible operations you could use even on the same type
tvn1981a has quit [Remote closed the connection]
<flux> except unless you want any kind of performance, you won't be giving addition operation as a parameter to vector operations?
<flux> or can ocamlopt do some optimizations in those cases; I think not
kelaouchi has joined #ocaml
tab_ has joined #ocaml
haveo_ is now known as haveo
haelix_ has joined #ocaml
Yoric[DT] has joined #ocaml
haelix has quit [Read error: 104 (Connection reset by peer)]
tab has quit [Read error: 104 (Connection reset by peer)]
kelaouch1 has quit [Read error: 104 (Connection reset by peer)]
<hcarty> flux: It probably depends on how the vector or matrix is represented. If a and b have type 'a array then it may be reasonably performant to use Array.mapi (...) a b
<hcarty> For certain definitions of "reasonably performant"
<flux> hcarty, more efficient than for c = 0 to 42 do ar.(c) <- ar.(c) + 1 done? well, could be, but only because Array.mapi can get rid of bounds checking? (well, they also do different things..)
<flux> but, perhaps one should benchmark before making such claims :)
<hcarty> flux: Hence the "may be" :-)
<flux> but it's so late so I don't bother. instead, I'll go sleep a bit. night.
ygrek has quit [Remote closed the connection]
munga_ has quit ["Ex-Chat"]
ofaurax has joined #ocaml
Jedai has quit ["KVIrc 3.2.4 Anomalies http://www.kvirc.net/"]
palomer has joined #ocaml
<palomer> hello!
<palomer> I'd like to implement a "compile and run" feature for this IDE I'm writing
<palomer> which means running a program in a window
<palomer> how would I accomplish this?
<palomer> if Sys.command would return the standard output it would be fine
fremo has quit [Remote closed the connection]
xavier__ has quit [Remote closed the connection]
<palomer> one option is to have Sys.command open a new window
<palomer> any others?
<pango_> Unix.{create,open}_process* will give you more flexibility
tomh- has quit ["http://www.mibbit.com ajax IRC Client"]
fremo has joined #ocaml
redocdam has joined #ocaml
<pango_> for even more flexibility you could go to an even lower level with Unix.pipe, Unix.fork and Unix.exec, etc.
ofaurax has quit ["Leaving"]
<bluestorm> ertai: do you intend to develop your OcamlReloaded syntax ?
Yoric[DT] has quit ["Ex-Chat"]
Komar_ has joined #ocaml
guillem has joined #ocaml
Komar_ has quit [Remote closed the connection]
fremo has quit [Remote closed the connection]
fremo has joined #ocaml
<bluestorm> haha
<bluestorm> nasty camlp4 fact : { foo = foo; ; bar = bar } parses correctly
fremo has quit [Remote closed the connection]
<palomer> but Unix.* is only for Unix
RobertFischer has quit [clarke.freenode.net irc.freenode.net]
Amorphous has quit [clarke.freenode.net irc.freenode.net]
hcarty has quit [clarke.freenode.net irc.freenode.net]
shortc|desk has quit [clarke.freenode.net irc.freenode.net]
RobertFischer has joined #ocaml
Amorphous has joined #ocaml
shortc|desk has joined #ocaml
hcarty has joined #ocaml
rstites has joined #ocaml
<bluestorm> palomer: no it isn't
<bluestorm> most Unix functions are ported on Windows
<bluestorm> (and the cygwin port has full compatibility)
Kopophex has joined #ocaml
fremo has joined #ocaml
<palomer> ahhh!
guillem has quit [Remote closed the connection]
Mr_Awesome has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
<palomer> ahhh!
<palomer> wicked cool!
<palomer> what about the mingw port?
<bluestorm> the table at the end of the documentation page concerns the MinGW port
<bluestorm> (and the VisualThing port too)
<bluestorm> iirc. Cygwin support all of the Unix functions
rstites has quit [Remote closed the connection]
redocdam has quit [Remote closed the connection]
toxygen has joined #ocaml
<toxygen> hello
<toxygen> i'm looking for a hint. i have project which has embeded some ocaml code. it's in c++ and when linking i'm getting _caml_startup as undefined symbol
<toxygen> against which library should i link?
mikezackles has quit [Read error: 110 (Connection timed out)]
<mfp> toxygen: /usr/lib/ocaml/3.10.2$ nm libasmrun.a | grep caml_startup
<mfp> 00000000000002e5 T caml_startup
<toxygen> ok, thanks
<Smerdyakov> toxygen, you might want to read OCaml documentation. I wouldn't assume that just linking a library is enough to call OCaml from C++.
<toxygen> Smerdyakov: well, it's all already done in this particular project. only thing i have to do is make the polishing
<toxygen> :)
<Smerdyakov> toxygen, how do you know it's done, if you haven't been able to link before now?
<toxygen> it's 2 years old code which was compiled before
<Smerdyakov> OK.
<toxygen> the project contains c, c++, python, ocaml, perl code
<toxygen> quite large project
<palomer> so, if I want to run ls I would do {create_process "ls" [] stdin stdout stderr;}, how do I read the output?