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
<NaCl> ocaml is strict. haskell lets you be creative.
<thelema> orbitz: probably 1) lack of generic printing, 2) weak ecosystem
<orbitz> thelema: 2 seems to be where all languages start though
<orbitz> thelema: So the question is why did haskell get a strong eco system and ocaml not?
<thizanne> haskell is masturbating-oriented programming
<thizanne> and actually, it does it very well
<Goat25> lol
<thelema> orbitz: my guess is mostly because of cabal, just as CPAN made perl awesomer in its day
<thizanne> esthetically, haskell is far more pleasant than ocaml
<orbitz> cabal is relatively new compared to Haskells popularity I think
<NaCl> thizanne: yes
<thelema> orbitz: I don't really know
<orbitz> thelema: same
<NaCl> ocaml is not pleasant.
<NaCl> each keyword has approximately one use
<orbitz> Hrm is it? I find Ocaml quite pelasant
<NaCl> and there are many of them
<thelema> NaCl: why is ocaml not pleasant?
<thelema> too many keywords? huh?
<thizanne> OCaml is pleasant, but much less than haskell
<NaCl> for the beginner
<orbitz> I can read Ocaml and know wtf is happening
<thizanne> but, example : type constructors taking several arguments are painful regarding syntax
<orbitz> Haskell always has $ <$> [,>,.$.] and each module likes to redefien them
<thelema> thizanne: ('a, 'b) Hashtbl.t is painful?
<thizanne> no
<thizanne> constructors, not types
<thizanne> Node of 'a * 'a tree * 'a tree eg
<thelema> ah, variants
<orbitz> Why is it painful? It's just a tupel isn't it?
<thelema> Node (a,b,c)
<thizanne> yes, variants is the english name, sry
<thizanne> orbitz: in haskell, it"s like currified
<thizanne> there are two advantages
<thelema> Node a b c
<thelema> In haskell, it's probably a function. This was dropped between caml-light and ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<thizanne> first, you do not need to write things like `let node (x, g, d) = Node (x, g, d)`
<thizanne> second, you do not have to put al theses parenthesis
<thizanne> but let's be clear : i personnally think ocaml is a better language than haskell
<orbitz> Is that really a problem? I have found lack of generic printing to be more cumbersome than lack of ctors being functions
<thizanne> but i also think its syntax is less pleasant sometimes
<thizanne> I personnally would prefer a more pleasant syntax on variants rather than a generic print function
<thizanne> but it's mainly because i do not often write code who could use this function
<thelema> thizanne: what do you do with ocaml?
<thizanne> probably much less things than you
<thizanne> in fact I never code a project of more than 500 lines of code
* NaCl wrote a GUI and a simple ray racer
<NaCl> tracer
<NaCl> adrien wrote a web browser
<thelema> thizanne: that's not unreasonable. what kind of programming? DB? GUI? Numerical?
<thizanne> I wrote a sort of geometric language
<thizanne> and an orthographic corrector
<thelema> ok, that sounds like something ocaml would be good at.
sebz has joined #ocaml
<thizanne> yes
<thizanne> it was :)
<thizanne> I also wrote a little regex engine
<thizanne> which was quite funny
sebz has quit [Client Quit]
<thizanne> and I started a compiler but I paused it because I had not enough time because of a school project
<thizanne> and other various projects I don't exactly remember
sebz has joined #ocaml
ftrvxmtrx has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
iago has quit [Quit: Leaving]
ftrvxmtrx has quit [Remote host closed the connection]
manme has joined #ocaml
manme has quit [Quit: Page closed]
philtor has joined #ocaml
flapjackery has joined #ocaml
ankit9 has joined #ocaml
ulfdoz has joined #ocaml
flapjackery has quit [Quit: Leaving]
philtor has quit [Ping timeout: 240 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
ankit9 has quit [Quit: Leaving]
everyonemines has joined #ocaml
destrius has quit [Quit: Leaving.]
fantasticsid has joined #ocaml
ocp has joined #ocaml
Kakadu has joined #ocaml
edwin has joined #ocaml
raichoo has joined #ocaml
cago has joined #ocaml
ankit9 has joined #ocaml
shachaf has quit [Read error: Operation timed out]
shachaf has joined #ocaml
everyonemines has quit [Quit: Leaving.]
letrec has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
Cyanure has joined #ocaml
raichoo has quit [Ping timeout: 248 seconds]
raichoo has joined #ocaml
probst has joined #ocaml
probst_ has joined #ocaml
probst has quit [Read error: Connection reset by peer]
probst_ is now known as probst
ftrvxmtrx has joined #ocaml
emmanuelux has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
ftrvxmtrx has joined #ocaml
Snark has joined #ocaml
<adrien> for a module Foo in native code, is camlFoo__entry the function that will be called to initialize the module (toplevel initializations)?
ftrvxmtrx has quit [Quit: Leaving]
jamii has joined #ocaml
<f[x]> adrien, yes
<adrien> thanks
<adrien> I'm not doing that right now but I think I'll try to do some magic in order to find out how long each initialization takes
avsm has joined #ocaml
Cyanure has quit [Remote host closed the connection]
raichoo has quit [Read error: Connection reset by peer]
raichoo has joined #ocaml
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
iago has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
jamii has joined #ocaml
sebz has joined #ocaml
ftrvxmtrx has joined #ocaml
ankit9 has quit [Quit: Leaving]
<NaCl> thelema: would it perhaps be possible to link against batteries so that ocamlopt doesn't spit out 3 MB executables? :P
<thelema> NaCl: the best way to do this is to make your own Batteries.ml file to open that only includes modules you use
<thelema> ocamlopt can't do this optimization automatically, because modules have initialization code that may be important (such as the initialization code in BatteriesThreads
<NaCl> kk, thanks
<thelema> sadly, including just batPervasives will pull in a lot of other batteries machinery because of module dependencies. This is something I've wanted to work on, but haven't gotten too far in.
<NaCl> I didn't need batteries towards the end anyways, I was trying to avoid using Str.
<thelema> NaCl: fair enough. I hope you find batteries useful someday.
<thelema> hmm, I'm surprised that batTuple.o is 77KB; it's just a bunch of tiny functions
<NaCl> thelema: static linking ftl
<thelema> NaCl: batteries does build a .cmxa on every platform but mac (some problem with it there)
<thelema> err, *cmxs
<thelema> an ocaml dynamic-link library
ocp has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<NaCl> thelema: in my experience, ocaml doesn't seem to want to use them. But I may just not know how to look
<adrien> NaCl: .cmxs files?
<NaCl> shouldn't that just be "in" ocaml?
<thelema> the equivalent isn't in gcc
iago has quit [Quit: Leaving]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<adrien> cmxs is quite new and ld.ocaml even more
* NaCl derps
ankit9 has joined #ocaml
metasyntax|work has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
Cyanure has joined #ocaml
sebz has joined #ocaml
thelema has quit [Remote host closed the connection]
sebz has quit [Quit: Computer has gone to sleep.]
raichoo has quit [Quit: leaving]
thelema has joined #ocaml
cago has quit [Quit: Leaving.]
Kakadu has quit [Read error: No route to host]
Kakadu has joined #ocaml
lopex has quit [Remote host closed the connection]
bobry has quit [Read error: Connection reset by peer]
joewilliams has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
raichoo has joined #ocaml
joewilliams has joined #ocaml
bobry has joined #ocaml
raichoo has quit [Quit: leaving]
ulfdoz has joined #ocaml
avsm has quit [Quit: Leaving.]
sebz has joined #ocaml
ocp has quit [Ping timeout: 252 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
ocp has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
milosn has joined #ocaml
<thelema> vivanov: if I commit a fix to RMutex, can you test it?
Xizor has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
Cyanure has quit [Ping timeout: 268 seconds]
jamii has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ocp has quit [Ping timeout: 244 seconds]
letrec has quit [Ping timeout: 255 seconds]
bobry has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
lopex has quit [Read error: Connection reset by peer]
joewilliams has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 248 seconds]
bobry has joined #ocaml
jamii has quit [Remote host closed the connection]
roconnor has joined #ocaml
<roconnor> Is this the right way to add a dependency on camomile using ocamlbuild:
<roconnor> <foo.ml> or "foo.native" or "foo.byte": package(camomile)
<roconnor> ^^ adding that line to _tags
<thelema> roconnor: yes, also make sure to run ocamlbuild with -use-ocamlfind
<roconnor> right
<thelema> for my tags file, I usually just do `true: package(camomile)` as it doesn't hurt to try using camomile to build everything
<thelema> or `<*>` instead of `true`
iago has joined #ocaml
lopex has joined #ocaml
lamawithonel__ has quit [Remote host closed the connection]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<roconnor> ocamlbuild works ridiciously well
<_habnabit> basically
<Drakken> Say thelema, that archimedes plot for batbench magically started working. Is it still worth working on, or did someone else already do it for me?
<thelema> Drakken: yes, it's still worth working on
<thelema> I've had my own problems with archimedes, so I didn't work on it myself, and I resolved the archimedes problems without getting back to batbench
<Drakken> thelema okay, great. Do you have any idea what kind of features you want? Right now I just have the test params you gave me hard-coded in. One question would be how many bars you expect to have and how wide the graph can be.
<Drakken> Which are related to the minimum bar width.
<thelema> default samples is 1K - that's what the number of bars would be. Maybe I should tone that down to 300
<thelema> how wide the graph can be - think fitting into a blog, so maybe 600-700 pixels wide
<thelema> If you can, make an impulse graph
<thelema> along the lines of this.
<thelema> (unless the bar chart looks better)
<Drakken> funky :)
<thelema> maybe smaller dots than that particular one...
<Drakken> thelema can I use Str?
<thelema> sure, but why do you want to?
<Drakken> to make sure the name of the output file ends in .png
<adrien> Filename!
<adrien> val chop_extension : string -> string
<thelema> :)
<thelema> yup
<adrien> and check_suffix too if you want
<adrien> good night =)
<thelema> adrien: good night
<Drakken> Is that preferred?
<thelema> here's my version of case on filename suffix: https://github.com/thelema/odb/blob/master/odb.ml#L285
_andre has quit [Quit: leaving]
ocp has joined #ocaml
probst has quit [Quit: probst]
ocp has quit [Ping timeout: 244 seconds]
ocp has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
ocp has joined #ocaml
sebz has joined #ocaml
<_habnabit> there! my junction function is useful again.
<_habnabit> let junction pred f g a = if pred a then f a else g a
<_habnabit> then, `Enum.filter_map (junction (fst |- (=) ti) (snd |- some) (const None))`
<thelema> _habnabit: I use `let iff p f x = if p x then f x else f`
ocp has quit [Read error: Connection reset by peer]
ocp has joined #ocaml
<_habnabit> hmm, how do you use that?
ocp has quit [Client Quit]
<_habnabit> or did you mean `else x` ?
ocp has joined #ocaml
<thelema> yes, oops
<thelema> else x
<thelema> if p x then f x else x
<_habnabit> sure, in this case yours wouldn't require the const
* _habnabit greps for other uses of junction..
<_habnabit> hmm, must be in a different branch
<thelema> `iff Fn.is_relative (fun e -> Sys.getcwd () </> e)`
<_habnabit> woah, what's (</>) ?
<thelema> let (</>) = Fn.concat
<thelema> ` |> iff (fun e -> Unix.((lstat e).st_kind = S_LNK)) Unix.readlink
<_habnabit> what's Fn?
<thelema> Filename
<_habnabit> ah
ikaros has joined #ocaml
Snark has quit [Quit: Quitte]
ecc has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 268 seconds]
randori has joined #ocaml
randori has quit [Quit: leaving]
randori has joined #ocaml
randori has quit [Client Quit]
randori has joined #ocaml
randori has left #ocaml []
oriba has joined #ocaml
<roconnor> which is better to build if I don't know what I'm doing: foo.bye or foo.native?
<roconnor> *foo.byte
<thelema> roconnor: should be no difference - .byte will build faster, .native will run faster
<thelema> about 2x difference each way
<roconnor> ok
<testcocoon> Hi, I tried to interface some C functions to Ocaml and I get the linker error "undefined reference to `caml_copy_string(char const*)'". Does anybody know how to fix ths issue?
<thelema> testcocoon: how are you linking?
<testcocoon> I'm using ocamlopt (http://pastebin.com/TjiLYH6S)
<thelema> do you have a file /opt/godi/lib/ocaml/std-lib/libasmrun.a
Kakadu has quit [Quit: Konversation terminated!]
<testcocoon> The file is present
<testcocoon> thelema: I just found the problem
<thelema> what's that?
<testcocoon> My C file is compiler with g++ (as C++ file). I need to put extern "C" around the #include of ocaml binding headers.
<thelema> ah, that would help
<thelema> I should have noticed the g++ sooner
<testcocoon> I my opinion this is not a good programming practice. #ifdef __cplusplus extern "C" #endif should be added into the include file of ocaml
ocp has quit [Ping timeout: 240 seconds]
<testcocoon> writing :
<testcocoon> extern "C"
<testcocoon> {
<testcocoon> #include "caml/alloc.h"
<testcocoon> #include "caml/custom.h"
<testcocoon> #include "caml/memory.h"
<testcocoon> #include "caml/fail.h"
<testcocoon> #include "caml/callback.h" }
<thelema> testcocoon: please explain to ocaml devs here: http://caml.inria.fr/mantis/my_view_page.php
<testcocoon> I will do it.
pango_ has quit [Ping timeout: 240 seconds]
pango has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
edwin has quit [Remote host closed the connection]
Xizor has quit []
Morphous_ has quit [Ping timeout: 240 seconds]
NihilistDandy has joined #ocaml
Morphous_ has joined #ocaml
emmanuelux has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
ikaros has quit [Quit: Ex-Chat]
sebz has joined #ocaml