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
<wmeyer``> if you want this to by dynamic i.e. provide list of files from the directory itself then you can write a plugin which uses Unix module to list the files, then add them to the dependencies in the "rule" function
jamii has quit [Ping timeout: 244 seconds]
munga has quit [Ping timeout: 265 seconds]
fubada has quit [Remote host closed the connection]
lamawithonel has quit []
lamawithonel has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
smerz has quit [Remote host closed the connection]
Fnar has joined #ocaml
Fnar has quit [Changing host]
Fnar has joined #ocaml
everyonemines has left #ocaml []
emmanuelux has quit [Ping timeout: 264 seconds]
emmanuelux has joined #ocaml
ivan\ has quit [Ping timeout: 248 seconds]
ivan\ has joined #ocaml
ivan\ has quit [Ping timeout: 244 seconds]
isson has joined #ocaml
isson has left #ocaml []
foocraft has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ninegrid has joined #ocaml
Se7en has left #ocaml []
err404 has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Cyanure has joined #ocaml
ggherdov has joined #ocaml
ocp has joined #ocaml
cdidd has joined #ocaml
ivan\ has joined #ocaml
Se7en has joined #ocaml
Sablier has joined #ocaml
Sablier has quit [Read error: Connection reset by peer]
Sablier has joined #ocaml
munga has joined #ocaml
djcoin has joined #ocaml
ggherdov has quit [Quit: bye folks]
Sablier_ has joined #ocaml
Sablier has quit [Read error: Connection reset by peer]
Reventlov has quit [Quit: leaving]
Snark has joined #ocaml
Reventlov has joined #ocaml
Se7en has quit [Quit: Leaving.]
eni has joined #ocaml
Drakken has quit [Ping timeout: 252 seconds]
Yoric6 has joined #ocaml
Submarine has quit [Quit: Leaving]
Drakken has joined #ocaml
<Qrntz> wmeyer``, this sounds a bit tedious, noting that ocamlbuild has rules to build .cmxs files already, but thanks on your input — I'll try that
<adrien> Qrntz: "ocamlbuild foo1.cmxs foo2.cmxs foo3.cmxs" doesn't work?
alxbl has quit [Ping timeout: 252 seconds]
<Qrntz> oops, forgive my ignorance — it actually seems to build .cmxs libs
<Qrntz> adrien, but there are still some problems
<Qrntz> 1) how do I exactly tell ocamlbuild that all .ml files in a certain directory need to be compiled to .cmxs
<Qrntz> 2) is there any way to tell ocamlbuild to symlink them to the proper place? .cmxs plugins end up being compiled to _build/plugins/, but I need them to be in plugins/
alxbl has joined #ocaml
Sablier_ has quit [Read error: Connection reset by peer]
ccomendant has joined #ocaml
<adrien> Qrntz: find $DIR -maxdepth 1 -type f -name '*.ml' | sed -e 's/\.ml$/.cmxs/g' | xargs ocamlbuild
<adrien> for the output dir, I don't know; I think there's a way but I don't know it; but do you actually need that that way? it's a bit dirty
<adrien> I mean, _build keeps things clean and you're probably going to end up with many .cmxs files
<adrien> if you want them to be at runtime for something else, having an intermediate "installation" step might not be bad
<Qrntz> adrien, I need the main executable to dynlink them from an accessible location and that's pretty much it
<Qrntz> not sure if _build/plugins is a good choice
ccomendant has left #ocaml []
<adrien> you want to build some parts, run something, continue the build process; I'm not aware of an approach that is both simple and clean, no matter the build system ;-)
<Qrntz> thanks for the command — I think I'll write a simple wrapper makefile to just dispatch ocamlbuild commands
<adrien> yup :-)
<Qrntz> well
<Qrntz> thanks on your input anyway
<Qrntz> I'm getting closer to what I have in mind
<adrien> (if you need to strip the path from the files given by "find", there's %P or %p or %f for -printf in find (it would be the _ending_ argument to find)
<Qrntz> I know, I used find for quite a while
cyphase has quit [Ping timeout: 245 seconds]
Yoric6 has quit [*.net *.split]
milosn has quit [*.net *.split]
kaustuv has quit [*.net *.split]
zzz_` has quit [*.net *.split]
tlockney has quit [*.net *.split]
bacam has quit [*.net *.split]
Kakadu has joined #ocaml
Yoric6 has joined #ocaml
milosn has joined #ocaml
kaustuv has joined #ocaml
zzz_` has joined #ocaml
tlockney has joined #ocaml
bacam has joined #ocaml
munga has quit [Ping timeout: 244 seconds]
jamii has joined #ocaml
eni has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 260 seconds]
<wmeyer``> Qrntz: You can prepare a file with the list called all.itarget and then call ocamlbuild all.otarget
<wmeyer``> Qrntz: That will symlink it
struktured has joined #ocaml
Yoric6 has quit [Ping timeout: 240 seconds]
jamii has quit [Ping timeout: 260 seconds]
struktured has quit [Ping timeout: 244 seconds]
Se7en has joined #ocaml
ssbr has quit [Ping timeout: 246 seconds]
ssbr has joined #ocaml
everyonemines has joined #ocaml
jamii has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
hongboz has joined #ocaml
<hongboz> hi, does anyone have any experience to manage serveral versions of ocaml to work together? I have several versions(3.11,3.12.1,svn), I need to test compatibility for different versions. What's the right way to do this?
kolera has joined #ocaml
struktured has joined #ocaml
<mfp> hongboz: this might help https://github.com/hcarty/ocamlbrew (haven't used it though)
<chambart> hongboz: you can install multiple versions by installing multiple godi instances
<hongboz> chambart: I did. and configure the path everywhere. it works anyway :-)
snearch has joined #ocaml
err404 has quit [Remote host closed the connection]
ggherdov has joined #ocaml
<hongboz> btw: topdirs.cmi was no longer placed in stdlib. so you need to add -I +compiler-libs when you build ocamlfind for dev
Kakadu has quit [Quit: Konversation terminated!]
hongboz has quit [Remote host closed the connection]
djcoin has quit [Quit: WeeChat 0.3.2]
osa1 has joined #ocaml
cyphase has joined #ocaml
bjorkintosh has joined #ocaml
eni has joined #ocaml
Sablier has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 252 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
<kolera> stupid question: how to I access a particular element of a tuple without using pattern matching?
<thelema> kolera: batteries has Tuple2-Tuple5 with first/second/etc. functions
<thelema> but they're just `let third (a,b,c,d,e) = c`, etc.
<kolera> how about retrieving a value?
<kolera> something like an `nth` function?
<thelema> kolera: ?
<thelema> oh. what would the type be?
<kolera> int * string
<thelema> what would the return type of nth be?
<thelema> the point is that there's no reasonable type for a tuple.nth function
<thelema> at least not one that worked on heterogenous tuples
<thelema> and homogenous tuples are called arrays.
<kolera> fair point
<kolera> dynamic type thinking :\
<adrien> there are built "fst" and "snd" however: ('a * 'b) -> 'a (or 'b)
<kolera> adrien: thanks, that is what i was looking for
<kolera> however, thelema has rightly pointed out my poor reasoning
SuperNoeMan has joined #ocaml
<SuperNoeMan> hey, I'm on mac os x
<SuperNoeMan> and I'm trying to learn ocaml
<SuperNoeMan> I"m getting this
<SuperNoeMan> error Reference to undefined global Graphics
<thelema> you have to link with graphics.cm[x]a
<SuperNoeMan> after: open Graphics;; open_graph..
<SuperNoeMan> why can't the interpreter do it?
<thelema> SuperNoeMan: ah, in the toplevel. same thing
<thelema> SuperNoeMan: do you have findlib
<SuperNoeMan> I'm using the interactive... how do I make the inter
<SuperNoeMan> dude, I'm totally new: I don't know what you mean by findlib, and I don't understand the part about graphics.cm[x]a where you have the [x] part
<SuperNoeMan> is findlib a utility?
<SuperNoeMan> ah. did port search findlib and some stuff came up, I'm guessing you were going to use findlib to help me
<thelema> try running the "interactive" as "ocaml graphics.cma"
<thelema> I was going to recommend a way to use findlib to load the graphics code into the toplevel
<thelema> but if all you want is graphics...
<Sablier> .cma is bytecode lib and .cmxa native lib
<SuperNoeMan> yeah, I'm just learning, but whatever you have that's extra is good for me,
<SuperNoeMan> so, I'm thinking that findlib will dynamically load the graphics, instead of having to restart the top level
<Sablier> that why [x], in case of using ocamlc or ocamlopt, for ex
<thelema> Instead of that, if you have findlib installed, you can do `#use "topfind";;`
<thelema> and then `#require "graphics";;` to load the graphics package
<SuperNoeMan> ah ok
<SuperNoeMan> cool man
<thelema> ocaml has no real auto-loading
<SuperNoeMan> so this is my first functional language
Anarchos has joined #ocaml
<thelema> SuperNoeMan: no worries, you're just bumping up against some of ocaml's rough parts
<adrien> SML has support for it iirc, so your reasoning wasn't that poor ;-)
<Anarchos> thelema what is the subject ?
<adrien> kolera: ^
<adrien> (sorry, packet loss skyrocketed)
<thelema> Anarchos: subject for what?
<Anarchos> thelema what is the ocaml's rough parts ?
<thelema> Anarchos: oh, irc. SuperNoeMan is having trouble using graphics in the toplevel
<thelema> "open Foo" doesn't load any libraries or indicate that anything needs to be linked in, it only adds the symbols from module Foo to the current namespace
<thelema> It would be very nice if ocaml had something similar that also indicated linking.
<SuperNoeMan> i don't understand why it's authors wouldn't have put that in there by default
<Anarchos> thelema oh ok. I once was able to launch my OS windows from the toplevel :)
<thelema> SuperNoeMan: it's obvious now in the 21st century, but ocaml goes back to the early 90's, when C's linking model was the right way to do things
<SuperNoeMan> ah yeah.
<SuperNoeMan> link everything statically
<SuperNoeMan> I think it's cool how ocaml can be run interactively, or completely compiled
<SuperNoeMan> and is also in a vm
<SuperNoeMan> that's cool. if only some of the more popular lanaguages had that. like maybe if java was also functional, didn't require every damn thing to be a freaking object, and was also able to be compiled...
<Anarchos> thelema i already read that Knuth advocates for static library since dynamic involves only subtle and tricky algorithm, unneeded nowadays since memory has become cheap
<thelema> java's lack of compilation isn't a real weakness for it, except in very few cases
<thelema> Anarchos: sure, but ocaml still needs extra information outside your program for static linking.
<Anarchos> thelema can you give some details ? I don't get the point
<adrien> Anarchos: NO
<thelema> Anarchos: for instance, if you want to use the graphics library, nothing you write in your source code will prevent you from having to list graphics.cma (or .cmxa) on the command line to link it in.
<adrien> and next, someone is going to mention the sta.li nonsense
<adrien> "static linux is based on a hand selected collection of the best tools for each task and each tool being statically linked (including some X clients such as st, surf, dwm, dmenu),"
<adrien> they have a wonderful presentation
<everyonemines> links to a paper
<adrien> which is complete crap: last time, I didn't have enough fingers to count how many of their major advantages were in fact completely wrong
<everyonemines> "Address-space randomization is a technique used to fortify systems against bu
<everyonemines> or, you could not have buffer overflow vulnerabilities
<Anarchos> adrien why your big NO ?
<adrien> first use of dynamic libraries? replacement libraries! I've rebuild my mesa yesterday to match the kernel I'm using, and I haven't had to rebuild all the opengl games I'm using
<Qrntz> static linking is the way to go for moderately small executables
<Qrntz> see busybox
<adrien> and for security: imagine having to relink 1000 programs whenever there is a zlib security update
<adrien> and then you have libc functions which have an even bigger impact in the case of a security issue
<Anarchos> adrien i see, but knuth really wrote that !
<adrien> everyonemines: also, ASLR has been proven to not be that effective
<adrien> Knuth also proves code but doesn't guarantee it runs properly
<Anarchos> adrien yes he likes funny joke :)
<adrien> Knuth is a computer scientist, or whatever you want, I've never heard of him administrate any system
<adrien> also, he hasn't seen Qt, KDE libs, webkit-whatever and others
<adrien> (webkit is roughly 20MB as a lib, plus its deps)
<thelema> my issue isn't with static vs. dynamic linking, but with ocaml requiring metadata (linking commands outside source code) for compilation
<Anarchos> adrien don't panic i see your point : dynamic involves maintaining easier :)
<adrien> -rwxr-xr-x 1 root root 47M Nov 27 15:27 /usr/lib64/libwireshark.so.1.1.0*
<adrien> -rwxr-xr-x 1 root root 47M Mar 24 02:54 /usr/lib64/libgcj.so.13.0.0*
<adrien> -rwxr-xr-x 1 root root 110M Jul 5 2011 /usr/lib64/libgtk-x11-2.0.so.0.2400.4*
<adrien> I think that last file is the result of a debug rebuild :-)
<everyonemines> thelema: What system would you want? What's a language that does things right?
<everyonemines> I just copy/paste compilation command from a comment in source.
<thelema> everyonemines: only works for really small projects.
<everyonemines> ocaml doesn't really have a lot of large projects
<thelema> afaik, all the dynamic languages get this right, although I guess they technically don't have linking...
<everyonemines> that doesn't really count does it
<thelema> ocaml has plenty of projects big enough to use multiple source files, in which the "copy/paste compilation command" method doesn't work
<everyonemines> does too
<everyonemines> you can use it with multiple source files
<everyonemines> i have
<thelema> I wouldn't want to do so for batteries
<everyonemines> it's a multi line command with a cd
<thelema> and I wouldn't want to maintain it.
<everyonemines> well, i haven't done anything as big as batteries
<thelema> Ada has a pretty good system for building large projects
<thelema> gnatmake
<everyonemines> module namespacing is really awkward for something like batteries
<everyonemines> you end up with extra files just to hold module names
<thelema> do you mean the batteries.ml file?
<everyonemines> partly
<thelema> what else?
<everyonemines> ...i forget
<everyonemines> i thought there were also submodule files like batteries.ml
snearch has quit [Quit: Verlassend]
<everyonemines> but also, if you want to organize stuff into folders
<thelema> there's something like batteries.ml for extlib compatibility... but it's for people that don't use batteries.ml
<everyonemines> ...you can't
<adrien> hahaha, I was checking sta.li's "faq" page:
SuperNoeMan has left #ocaml []
<adrien> "Good libraries implement each library function in separate object (.o) files, this enables the linker (ld) to only extract and link those object files from an archive (.a) that export the symbols that are actually used by a program."
<adrien> sure :P
<thelema> yes, the flat namespace of .cmx modules is a bit poor.
<thelema> adrien: feh. too much separation
<everyonemines> adrien: Good thing there's zero overhead for opening and reading small files.
everyonemines has quit [Quit: Leaving.]
eni has quit [Ping timeout: 252 seconds]
<adrien> I hate most of "suckless" (which sta.li is "part" of) =)
<Anarchos> adrien you make very firm statements :)
<adrien> the basis of suckless is "code sucks, so if we make less of it, the end result will suck less"
<adrien> there's less to suck, so it'll suck less
<adrien> what if the code was made better instead?
<adrien> and they're using C
<Anarchos> adrien and what is wrong with C (just to know, don't fight please :) )
<adrien> nothing is wrong with C, I actually like it
<flux> so, what is the best way of doing GUIs in OCaml at the moment?
Submarine has quit [Quit: Leaving]
<flux> if I need to have a custom widget there in as well? is it still lablgtk, or perhaps some of the reactive libs build on top of it?
<adrien> but don't start something stating that code sucks and is unstable, unreadable, hard to understand, has security issues and other problems when you're doing C (as I've said earlier: my connection is losing packets like hell)
err404 has joined #ocaml
<adrien> flux: detail what you want to do more (much more =) )
<flux> I want to have some buttons and a widget I draw myself, nothing overly complicated. the keyphrase here would be 'fast and easy to get to work' :)
<adrien> graphics? :P
<flux> sure, that would be the widget part
<flux> 2d graphics basically
<flux> vector-graphics
<adrien> but currently, lablgtk or labltk, yes
<adrien> (ltk can have some nice themes now)
<adrien> and I meant Graphics ;-)
<adrien> RAH
<flux> I suppose I'll go with lablgtk then
<adrien> soon, I hope to see nice stuff around the EFLs, but then, that won't be vector :-)
<flux> EFL?
<adrien> hmmm, sfml, maybe; I can't remember if it has stuff for GUIs
<flux> I suppose I could always use opengl for the vector graphics
<adrien> flux: libs for enlightenment.org
zzz_` has quit [Quit: Bye]
avsm has joined #ocaml
zzz_ has joined #ocaml
Cyanure has quit [Ping timeout: 244 seconds]
Cyanure has joined #ocaml
smerz has joined #ocaml
tmaedaZ has quit [Ping timeout: 252 seconds]
tmaedaZ has joined #ocaml
kolera has quit [Remote host closed the connection]
Yoric6 has joined #ocaml
<thelema> File "src/batStack.mli", line 34, characters 16-17:
<thelema> Error: Syntax error
<thelema> L34: exception Empty = Stack.Empty
<thelema> The form exception constr-name = constr gives an alternate name to an existing exception.
<thelema> blah, in module types: " exception constr-decl " is all that's allowed
<thelema> meaning I can't have in my signature an exception from another module
<thelema> meaning I can't have in my signature an exception from another module
<thelema> blah.
<adrien> raise Duplicate
<adrien> :-)
<thelema> in order for BatStack to implement Stack's interface, it must have an exception called Empty, but this exception will not be raised; Stack.Empty will be raised instead
osa1 has quit [Quit: Konversation terminated!]
<Anarchos> thelema is there a BatCave module inside the BatStack ?
Yoric6 has quit [Ping timeout: 244 seconds]
Snark has quit [Ping timeout: 264 seconds]
<thelema> Anarchos: no
<Anarchos> thelema no matter, it was a joke, Robin :)
antegallya has joined #ocaml
antegallya has quit [Client Quit]
jamii has quit [Ping timeout: 244 seconds]
err404 has quit [Remote host closed the connection]
Yoric6 has joined #ocaml
Yoric6 has quit [Ping timeout: 264 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
* ninegrid slaps his knee
Cyanure has quit [Ping timeout: 245 seconds]
ggherdov has quit [Quit: bye folks]