flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
<dsheets> mrvn, yes, it seems you need to compute the screenspace, render the screenspace + margin from the lightsource and then render the screenspace?
<dsheets> should be able to reuse some of the results for the two passes
<beginner42> has someone an idea how i can find the problem with DL_error?
<mrvn> dsheets: I don't need all of the margin, only enough to tell if I'm in shadow. The amount depends on the height of the last pixelsin the direction of the shadow.
<dsheets> right. so you just need to project a terminator ray onto the fractal in the direction of the light
<dsheets> that doesn't seem like a very easy operation
<dsheets> perhaps there is something i've missed or an approximation to help
<mrvn> dsheets: you draw a line from the pixel to the light source and then have to compute all the grid points below that line. But once the line is higher than the maximum height you can stop.
<mrvn> n8
<dsheets> right, this is what i was imagining. g'night
<beginner42> ocamlfind: [WARNING] You have installed DLLs but the directory /.opam/4.00.1/lib/stublibs is not mentioned in ld.conf
<beginner42> dsheets: does this give you some clue?
<dsheets> beginner42, what is the error?
<beginner42> Fatal error: exception Dl.DL_error("/.opam/4.00.1/lib/stublibs/dllctypes-foreign_stubs.so: undefined symbol: zmq_version")
<dsheets> you haven't linked with libzmq it seems...
<dsheets> what is the command being run that generates that exception?
<dsheets> use -verbose and -classic-display i think?
<beginner42> dsheets: i wrote a small ocaml program that should print me the zmq version, this crashes and i get the error
<dsheets> yes, how are you compiling it? whatever command is issued is not resulting in a link against libzmq
<beginner42> in the _oasis file i have the field CCLib: -lzmq
<beginner42> dsheets: i have libzmq.so and libzmq.a in /usr/local/lib is that correct?
<dsheets> beginner42, what command are you using to compile? Are you compiling bytecode? because no, that won't work
<beginner42> 2. Run 'ocaml setup.ml -configure' 3. Run 'ocaml setup.ml -build' 4. Run 'ocaml setup.ml -install'
<beginner42> i do just the steps the INSTALL.txt file tells me
<dsheets> beginner42, ocaml setup.ml -build -class-display
<dsheets> should print the actual commands being executed to compile
<dsheets> which you can put in a pastebin
<dsheets> also, what executable are you running?
<dsheets> oops -classic-display
mfp has quit [Ping timeout: 276 seconds]
<beginner42> dsheets: http://pastebin.com/KL3FhbZg
<dsheets> also paste your oasis file
<dsheets> and what binary are you executing that results in the DL_error?
<dsheets> beginner42, is that in the toplevel?
<dsheets> what happens when you uncomment the dllLib
<beginner42> no thats in an ml file. i tried that doesnt work
Yonex has quit [Read error: Connection reset by peer]
<dsheets> well, the problem is probably that "ocamlfind ocamlc -a -cclib -lzmq src/zmq.cmo -o src/ZMQ_EXT.cma" should contain a -dllib
<dsheets> but i still don't know whether you're running bytecode or native code so it's just a guess
<beginner42> i am using the ocamlmakefile so i guess native code?
<dsheets> i have no idea what ocamlmakefile does or how... does your executable say "ELF" when you 'file' it?
<dsheets> oops nm that won't tell you
<beginner42> i have compiled the test file once with ocamlc and once with ocamlopt both times undefined symbol: zmq_version
<dsheets> put it in a repository and i can take a look
<dsheets> both the test binding and the test
<beginner42> is pastebin ok too?
<dsheets> no. something with a file system preferably git
<dsheets> if you're going to publish this binding as library might as well start version control now ;-)
<beginner42> thats true, i will try to upload it later today
<dsheets> ok i'll look at it tomorrow
<beginner42> thanks a lot
<dsheets> no problem, welcome to ocaml
<beginner42> been there for a few years, but more maintaining stuff than designing my own ;)
<dsheets> ah, well, welcome to writing bindings and designing programs in ocaml
<beginner42> thanks, have a good night
<dsheets> night
beginner42 has quit [Quit: irc2go]
Sim_n has quit [Quit: Leaving]
pkrnj has quit [Quit: Computer has gone to sleep.]
q66 has quit [Quit: Leaving]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
introom has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
goodmanio has quit [Excess Flood]
ygrek has joined #ocaml
k3VB6u4d has joined #ocaml
Neros has quit [Ping timeout: 248 seconds]
Neros has joined #ocaml
darkf has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
Neros has quit [Ping timeout: 276 seconds]
csakatoku has joined #ocaml
csakatoku has quit [Read error: Connection reset by peer]
csakatoku has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
milosn_ has joined #ocaml
Drup has quit [Quit: Leaving.]
milosn has quit [Ping timeout: 260 seconds]
hellome has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
chrisdotcode has joined #ocaml
ollehar has joined #ocaml
introom has quit [Remote host closed the connection]
introom has joined #ocaml
introom has quit [Remote host closed the connection]
introom has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
introom has quit [Remote host closed the connection]
introom has joined #ocaml
pkrnj has joined #ocaml
pkrnjevic has joined #ocaml
ggole has quit []
pkrnj has quit [Ping timeout: 264 seconds]
pkrnjevic is now known as pkrnj
gautamc has quit [Ping timeout: 276 seconds]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
chrisdotcode has quit [Ping timeout: 256 seconds]
hyperboreean has quit [Ping timeout: 248 seconds]
zRecursive has joined #ocaml
yacks has joined #ocaml
zRecursive has left #ocaml []
ggole has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
tane has joined #ocaml
csakatoku has joined #ocaml
avsm has joined #ocaml
avsm has quit [Quit: Leaving.]
Simn has joined #ocaml
avsm has joined #ocaml
csakatoku has quit [Remote host closed the connection]
osa1 has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
introom has quit [Remote host closed the connection]
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
beginnner42 has joined #ocaml
malo has joined #ocaml
<beginnner42> does anyone here successfully linked a c library with oasis to access it with ctypes?
osa1 has quit [Read error: No route to host]
osa1 has joined #ocaml
<avsm> beginnner42: are you on ubuntu?
<beginnner42> avsm: yes
<avsm> you need to add "-cclib -Wl,-no-as-needed" to your ocaml command line
introom has joined #ocaml
<avsm> or else gcc will aggressively drop the "unused" library
<avsm> OASIS sadly doesn't have the autoconf support for that just yet, so it's a little tricky
<beginnner42> avsm: what do mean with the add part? just entering that into the command line?
<avsm> that's for the ocaml command line
<avsm> ultimately, gcc needs to see -Wl,—no-as-needed
<avsm> which is accomplished in ocaml by adding "-cclib -Wl,—no-as-needed"
<avsm> (unfortunately, that isnt accepted by MacOS X's linker, hence the need for compile-time probing)
<avsm> this is being solved in two ways: adding C stub generation support to ctypes, and/or some autoconf support in ctypes itself
<beginnner42> but at which point do i add this? i dont write it into the _oasis file and the rest is done with ocaml set.. -config build and install?
osa1 has quit [Read error: No route to host]
osa1 has joined #ocaml
avsm has quit [Quit: Leaving.]
mfp has joined #ocaml
Snark has joined #ocaml
<mrvn> CCOpt: -Wl,--no-as-needed
<mrvn> or not?
<pippijn> "Unlike the usual way of writing C extensions, there are no C "stub" functions to write, so there's much less opportunity for error."
<beginnner42> thats what my _oasis file looks like
<pippijn> there are different kinds of mistake you can make
<pippijn> with C stubs, you are less likely to mess up the C part
<mrvn> why do you need no-as-needed? Shouldn't the bindings "use" the zmq functions and thus make them needed?
ulfdoz has quit [Ping timeout: 260 seconds]
<pippijn> mrvn: as I understand it, those bindings use libdl
<beginnner42> mrvn: avsm recommended that before
<mrvn> sorry, just woke up
<beginnner42> no problem, can you see some mistakes in my _oasis file?
<mrvn> no
<mrvn> unless it needs to be -Wl,-no-as-needed instead of 2 options
<mrvn> You could also try to put into CCLib since it is only for linking. Whatever works.
<beginnner42> mrvn: i tried this, but same result
<pippijn> ctypes seems really cool
<pippijn> I didn't know about it until now
<pippijn> I'm reading the api docs
<pippijn> seems rather clean, I like it
<pippijn> ah, it uses libffi
<mrvn> beginnner42: the result being what?
<orbitz> sometimes opam makes very odd decisions
<beginnner42> Fatal error: exception Dl.DL_error("/.opam/4.00.1/lib/stublibs/dllctypes-foreign_stubs.so: undefined symbol: zmq_version")
<orbitz> it wants to downgrade a bunch of my packages, i had to pin core to the latest version to get it to stop trying
Drup has joined #ocaml
<mrvn> and the gcc comand uses -Wl,-no-as-needed? You didn't forget to run oasis setup && make clean && make?
<beginnner42> mrvn: thats the output of my test file, in which i want to output the zmq version
tane has quit [Quit: Verlassend]
malo has quit [Quit: Leaving]
mort___ has joined #ocaml
Kakadu has quit [Ping timeout: 264 seconds]
Drup has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
lifeng has quit [Quit: Ex-Chat]
amirmc has joined #ocaml
Neros has joined #ocaml
amirmc has quit [Ping timeout: 240 seconds]
Kakadu has joined #ocaml
q66 has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
mort___ has quit [Ping timeout: 276 seconds]
introom has quit [Remote host closed the connection]
Kakadu has quit []
Simn has quit [Ping timeout: 276 seconds]
csakatoku has joined #ocaml
mort___ has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 260 seconds]
mort___ has quit [Quit: Leaving.]
chambart has joined #ocaml
introom has joined #ocaml
avsm has joined #ocaml
ygrek has joined #ocaml
csakatoku has quit [Remote host closed the connection]
<beginnner42> mrvn: do you have another idea how i could fix that problem with _oasis?
<mrvn> check how gcc is called
<beginnner42> mrvn: this way?
<beginnner42> ocaml setup.ml -build -classic-display
ben_zen has quit [Ping timeout: 256 seconds]
<mrvn> for me that just shows the ocamlfind call, not gcc.
<beginnner42> mrvn: what command should i issue?
amirmc has joined #ocaml
<avsm> beginnner42: i wouldn't really recommend using OASIS for c bindings, to be honest. I just use ocamlopt directly, mostly via OCamlMakefile
<beginnner42> avsm: my thoughts were that it should be an library in the end, that i can put into opam. Thought oasis would facilitate that
<mrvn> beginnner42: last time I used strace.
<mrvn> there is a -verbose <level> option but I couldn't get that to actualy print the gcc command.
<avsm> beginnner42: it does make it easier to get the metadata, but for development, direct control over the ocaml commands is a lot easier
ggole_ is now known as ggole
<whitequark> I'm not sure I understand labelled arguments
<whitequark> utop # let x ?id ~foo = ();;
<whitequark> val x : ?id:'a -> foo:'b -> unit = <fun>
<avsm> C bindings are always a bit special, and OASIS doesnt have good support for them (yet — there's nothing fundamental)
<whitequark> utop # x ~foo:1;;
<whitequark> - : ?id:'a -> unit = <fun>
<mrvn> avsm: oasis works fine for C bindings. The problem is ctypes doing strange things
<whitequark> how do I make it just execute the function?
<avsm> mrvn: not really. It doesn't have enough autoconf support. See Lwt/Core's gymnastics to work around that
<companion_cube> whitequark: ?id:None I believe
<avsm> it can be added; just hasn't been done yet. So for now, CCLib have to be hardcoded in the OASIS file.
<whitequark> companion_cube: then what is the point of even making it optional :/
<companion_cube> the problem with your function is that all its arguments are named or optional
<mrvn> avsm: he has CCLib, doesn't seem to work
amirmc has quit [Ping timeout: 276 seconds]
<companion_cube> so since you can pass them in any order, just giving ~foo makes for a partial application
<avsm> he needs -Wl,—no-as-needed
<avsm> but only on Ubuntu
<mrvn> whitequark: you need a non optional non labeled argument to terminate the application
<companion_cube> imho optional arguments only really make sense if at least one argument is positional
<companion_cube> (can be unit)
<mrvn> avsm: he has -Wl,--no-as-needed, doesn't work
<whitequark> that's dumb :/
<beginnner42> mrvn: i think i have only one - in front of the no-as-needed
<mrvn> whitequark: the point of labels is that they can be used in any order. So how should ocaml know if you mean (x ~foo:1) or (x ~foo:1 ~id:2)?
<mrvn> beginnner42: if that where the problem then gcc/ld would give you an error.
<whitequark> mrvn: IMO if at the end of an application only optional labels left, OCaml should just treat it as full application without optional labels
<whitequark> instead of a partial one.
<ggole> (And the names can make code more readable.)
<whitequark> *are left
<whitequark> and what ggole says
<mrvn> whitequark: let y = x ~foo:1 .... y ~id:2
<mrvn> whitequark: perfectly valid code.
<whitequark> mrvn: right now, sure. arguably this is not very useful.
<whitequark> I won't cry over not being able to write that.
<mrvn> it can be verry usefull
<mrvn> anyway, that is how it is. Use let x ?id ~foo () = ()
<whitequark> in fact I'm not even sure if currying for labelled arguments *ever* makes sense
<whitequark> well, I'd rather demote one labeled argument to unlabeled one
<beginnner42> is there no project on github that uses ctypes and oasis that i could really use as a guideline?
<mrvn> whitequark: there are lots of cases where you call some function multiple times with the second argument always the same. With labels you can bind the second argument first and save typing.
<whitequark> mrvn: so this is basically trading one set of cases when you need to explicitly type out closures, for another
<mrvn> whitequark: no
<mrvn> it tardes needing closures to not needing closures and having more readable code when you have lots of simmilar looking arguments
* whitequark sighs
<ggole> Labels are fine, really. It's optional args that are a bit kooky.
<whitequark> labels + optional labels + currying = weirdness
<whitequark> take any one thing out, it's ok
<mrvn> optional labels + currying = weirdness
<ggole> (Also, it's weird how they always construct an option even if there is always a value.)
<mrvn> ggole: you mean with default values?
<ggole> Yeah
<mrvn> they don't
<ggole> Did that change?
<mrvn> or at least it is hidden from you
<whitequark> ggole: well, I'd expect the option to be consturcted by caller and parsed by callee
<whitequark> so it makes sense
ygrek has quit [Ping timeout: 240 seconds]
<mrvn> default values are syntactic suggar for let arg = match arg with None -> default | Some x -> x in ...
<ggole> I'd expect the actual value to be simply passed
<mrvn> The caler has no idea wether an optional arg has a default or not. That is not part of the signature.
<ggole> Maybe that's difficult to do with independent compilation though...
<mrvn> It's something the cross module inlining could optimize away but it probably doesn't.
<dsheets> mrvn, you can get ocamlbuild to show the gcc command with -verbose + -classic-display, i believe
<dsheets> it's tracked on mantis as a bugf
lifeng has joined #ocaml
Simn has joined #ocaml
<mrvn> even -verbose 999 only shows: ocamlfind ocamlc -ccopt '-std=c99' -ccopt -ffast-math -ccopt -Wno-long-long -ccopt -msse2 -ccopt -mssse3 -ccopt -O3 -c ofract/mandel.c
<mrvn> mv mandel.o ofract/mandel.o
<beginnner42> is there a chance that this will be simpler with newer versions of ctypes and oasis?
<avsm> yes. newer ctypes will support stub generation, for a start.
<avsm> (it's backwards compatible with existing specs, too)
<beginnner42> avsm: can you tell when the new version will be available?
<avsm> "soon"
<beginnner42> so i can continue writing the ml and mli files, check whether or not the compile and wait for this new version to create a library?
<avsm> it works right now too. it's just easier to write the ocamlc/opt commands directly right now
<avsm> although dsheets, i notice that lacks a -Wl,—no-as-needed too
<beginnner42> avsm: i have read that one, but it doesnt use oasis
<dsheets> avsm, i'm not clear on why -Wl,-no-as-needed is needed? It seems to work fine for me without those (but maybe not portably?)
<dsheets> dead library removal?
<dsheets> bah so it's an ubuntu bug
Nahra has joined #ocaml
<avsm> "feature"
<dsheets> "look ma, my desktop environment starts 20ms faster!"
csakatoku has joined #ocaml
amirmc has joined #ocaml
travisbrady has joined #ocaml
amirmc has quit [Ping timeout: 264 seconds]
ollehar has quit [Ping timeout: 240 seconds]
introom has quit [Ping timeout: 240 seconds]
osa1 has quit [Ping timeout: 240 seconds]
travisbrady has quit [Quit: travisbrady]
csakatoku has quit [Remote host closed the connection]
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 264 seconds]
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
csakatoku has joined #ocaml
yacks has quit [Quit: Leaving]
csakatoku has quit [Ping timeout: 260 seconds]
zpe has quit [Remote host closed the connection]
Drup has joined #ocaml
ulfdoz has joined #ocaml
walter has joined #ocaml
Drup has quit [Ping timeout: 248 seconds]
yacks has joined #ocaml
csakatoku has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 264 seconds]
csakatoku has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
malo has joined #ocaml
ben_zen has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
MarcWeber has quit [Quit: leaving]
amirmc has joined #ocaml
csakatoku has joined #ocaml
tane has quit [Quit: Verlassend]
amirmc has quit [Ping timeout: 240 seconds]
csakatoku has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
mcclurmc has joined #ocaml
pango has quit [Quit: Client exiting]
osa1 has joined #ocaml
pango has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
Neros has quit [Read error: Operation timed out]
darkf has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 264 seconds]
travisbrady has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
amirmc has joined #ocaml
mort___ has joined #ocaml
amirmc has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Read error: Operation timed out]
travisbrady has quit [Quit: travisbrady]
klrr has joined #ocaml
<klrr> "some of the #ocaml crowd are haskellers in exile" are banned haskellers usually go here?
<ben_zen> can't say I've heard anything about that
amirmc has joined #ocaml
travisbrady has joined #ocaml
ggole has quit []
csakatoku has joined #ocaml
mort___ has quit [Quit: Leaving.]
amirmc has quit [Ping timeout: 276 seconds]
mort___ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
travisbrady has quit [Quit: travisbrady]
tani has joined #ocaml
tane has quit [Ping timeout: 276 seconds]
chambart has quit [Ping timeout: 246 seconds]
ski has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
beginnner42 has quit [Ping timeout: 276 seconds]
ollehar has joined #ocaml
Arsenik has joined #ocaml
chambart has joined #ocaml
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
tlockney has left #ocaml []
wmeyer has joined #ocaml
ben_zen has quit [Quit: leaving]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 276 seconds]
watermind has joined #ocaml
ta`e has joined #ocaml
ta`e is now known as tane
<watermind> was just coding some simple functions in ocaml to get acquainted with the syntax a bit more
<watermind> can I get some criticism regarding style / ask some questions?
<companion_cube> sure
<watermind> ^ just transposing a matrix
<watermind> so the matrix is an array of array, therefore mutable... and I did it using recursion
<watermind> although I know I could just use simple loops C style
<companion_cube> first, I'd say that the "if i >= 0 then .... else ()" should rather be an assert
<companion_cube> second, "else ()" is most of the time useless
<mrvn> why not Array.iteri?
<watermind> I see, I thought skipping the () could mean it would return undefined
<companion_cube> undefined doesn't exist
<companion_cube> you can only omit the "else" part if it returns ()
<watermind> mrvn: didn't know about it... although I suspected something like that should exist
<watermind> companion_cube: right that's what I was going to ask
<mrvn> val iteri : (int -> 'a -> unit) -> 'a array -> unit
<watermind> mrvn: cool
tani has quit [Ping timeout: 264 seconds]
<watermind> how about assert, where do I find it?
<watermind> it doesn't seem to be available by default
<mrvn> Array.iteri (fun x row -> Array.iteri (fun y z -> res.(y).(x) <- z) row) matrix
<watermind> mrvn: nice
<mrvn> assert is a keyword
<watermind> oh
<watermind> but what happens when the assertion isn't satisfied? because I'm used to assert just breaking the program when it fails
<mrvn> it raises an exception
<watermind> oh ok, then I can't use it there instead of my if
<watermind> because the if actually defines the base case of the recursion
<companion_cube> oh, my bad oO
* companion_cube slaps himself
<watermind> :)
<watermind> one more question... this confused me, why don't I need a rec in trans_line?
<watermind> I forgot about it but it didn't complain
<flux> if you defined trans_line earlier..
<flux> then it's using that version
<wmeyer> hi
<mrvn> you do
<watermind> hmmm
<watermind> I see what may be happening
<flux> if you reload the file to an 'empty' ocaml toplevel, it will fail
<watermind> right
<mrvn> Error: Unbound value trans_line
<watermind> damn, that can lead to some weird bugs
<flux> true. there was this extension for doing #use_module or something
<watermind> is there some toplevel command to clean toplevel and then load a file ?
<mrvn> watermind: performance wise it is usualy a good idea to process arrays in-oder, not reverse order.
<flux> that loaded modules from source files the same way they are loaded in compiled programs
<companion_cube> mrvn: that doesn't help much if Array.iteri is used, does it?
<mrvn> Array.iteri is in-order
<watermind> mrvn: oh I see, I just did it because it would lead to a simpler recursion since I could have 0 as the base case
<watermind> I'll keep that one in mind too then
<companion_cube> mrvn: in C I believe a for loop may be slightly more efficient if decreasing, though
<companion_cube> because checking for 0 is faster
<watermind> also... why do I need that begin end in trans_matrix but not in the let in trans_line?
<companion_cube> I don't think that's very relevant for a beginner ^^
<mrvn> companion_cube: most of the time the check can be stuffed in some empty slot.
<watermind> companion_cube: I'm only a begginer in OCaml... I'm pretty experienced in Haskell, C, and others
<mrvn> watermind: let has an implicit begin/end basically
<flux> watermind, let is scoped like: (let x = y in expr1; expr2) but if is scoped like if expr1 then expr2 else expr3
<watermind> right
<flux> so 'let' starts a new scope. I wonder though how it could be improved..
Snark has quit [Quit: leaving]
<wmeyer> companion_cube: flux mrvn hi
<flux> if 'if' started a new scope, it would mean we would need to write code like (if true then printf "Hello world\n"); printf "hello afterworld\n";
* wmeyer is getting annoyed, when install Agda on his arm netbook
<watermind> flux: I see... I expected that to be the case actually
<flux> wmeyer, hello.
<watermind> I'm used to think of ; as just any other binary operator
<watermind> one that sequences two statements and returns the result of the second
<companion_cube> hi wmeyer
<watermind> thanks for the feeback guys!
<companion_cube> you're welcome :)
<flux> watermind, I think the current 'if' can be more consistent in the presence of nested if/elses, but I didn't think it through..
<wmeyer> flux: right :-)
ben_zen has joined #ocaml
<watermind> flux: yes I can see how it makes for a sensible option... it also keeps notation more consistent with that of imperative languages in general
<wmeyer> it's quite clunky, to use nested if's with imperative code normally it's best to sorround them with scope delimiters
avsm has quit [Quit: Leaving.]
<watermind> I actually like Ada's approach where the delimiter is compulsory
<watermind> that way nested if's with some missing elses aren't ambiguous
<mrvn> python doesn't have that problem
<wmeyer> mrvn: python has different problems
<companion_cube> python doesn't have the same syntax
<companion_cube> its syntax prevents its from having proper lambdas ;)
<mrvn> companion_cube: what's wrong with lambda x: foo x?
<wmeyer> first of all python does not use proper off-side rule like haskell
<companion_cube> mrvn: python has too many statements for lambdas to be able to express everything in an expression
<wmeyer> it does some heuristics to parse the multiline code fragments
<wmeyer> mrvn: I wouldnt say the syntax prevents, but rather how lambdas are limited
<wmeyer> in particular case, introducing `let' inside lambda is not possible
<wmeyer> lambdas with side effects are prohibiten
<wmeyer> lambdas with side effects are prohibited
<mrvn> One thing that always trips me is y = 1 \n f = lambda x: print(y) \n y = 2 \n f 0 prints 2 and not 1 like it would in ocaml.
<wmeyer> :D
<wmeyer> yes, indeed, I've heard that JS got it right actually :-)
<mrvn> mutable ints suck
klrr has left #ocaml []
pkrnj has joined #ocaml
<pippijn> lablgtk2 hello world crashes :\
<watermind> mrvn: ouch that's awful... so (...) y = 2 \n f 0 \n y = 3 \n f 0 would print 2 and then 3?
<mrvn> watermind: yes. python has mutable variables. So y = 3 changes y and does not bind a new one
Neros has joined #ocaml
<watermind> right
wmeyer has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
<watermind> when I define an array directly, as in let a = [| 1 ; 2; 3|] ;; the resulting type is int array
<mrvn> yes
<watermind> if I define it using Array.init then the type is int Core.Std.Array.t
<mrvn> because you opened Core.Std.
<watermind> i thought Core.Std would be opened by default
<watermind> so it is only opened at the point where I use a Core function?
<mrvn> it is only opened when you open it
<watermind> that's the thing I don't open anything explicitely
<watermind> both definitions are one right after the other
<mrvn> Are you using Core.Std.Array.init?
<watermind> let me try swapping the order
manud has joined #ocaml
<mrvn> [| |] is always the built in array type
<watermind> oh I see
<mrvn> at least I think it is. don't think that calls any Array.* functions that you could overload.
<watermind> however I can apply my trans_matrix function to both
<watermind> val trans : 'a Core.Std.Array.t Core.Std.Array.t -> unit
<watermind> so it seems like arrays are automatically coerced to Core.Std.Array's
<mrvn> Core.Std.Array.t = Array.t
<watermind> ok so it is the same type...
<mrvn> If you use it with an Core.Std.Array.t it will infer that type.
<watermind> I see
travisbrady has joined #ocaml
Arsenik has quit [Quit: Quitte]
tane has quit [Quit: Verlassend]
pkrnj has quit [Quit: Computer has gone to sleep.]
cdidd has quit [Ping timeout: 264 seconds]
cdidd has joined #ocaml
dtg has quit [Quit: Leaving...]
ben_zen has quit [Ping timeout: 276 seconds]
travisbrady has quit [Quit: travisbrady]
pkrnj has joined #ocaml
Simn has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 246 seconds]
ulfdoz has quit [Ping timeout: 264 seconds]
watermind has quit [Quit: Konversation terminated!]
gasche has quit [Ping timeout: 260 seconds]
malo has quit [Quit: Leaving]
tobiasBora has joined #ocaml
<tobiasBora> Hello,
<tobiasBora> I'd like to know how I could run my program in several cores.
<tobiasBora> I arrive to generate a pseudo multithread with thread.cma, but I don't think it is run in several cores...
<tobiasBora> So the efficiency is the same ...
watermind has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
gasche has joined #ocaml
<tobiasBora> I saw Jane Street, is it the standard way to do it ?
Drup has joined #ocaml
hcarty has quit [Ping timeout: 248 seconds]
hcarty has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
<troydm> tobiasBora: you can forking library
<troydm> *use*
<tobiasBora> And I've some problems with modules : how could I just load a file in interpreter mode and by compilation ? I tried #load "file.ml" but it says that it must be an object... So I MUST compile or is it possible to load a .ml ?
<troydm> tobiasBora: such as https://github.com/rdicosmo/parmap
<troydm> tobiasBora: for compiling better use some tool like omake or other ocaml oriented compiling tool
<troydm> i use omake so i don't know any other tools sorry
<troydm> but maybe someone could suggest you another alternative
<tobiasBora> troydm: this library doesn't modify ocaml, at the contrary of janestreet ?
<troydm> tobiasBora: you mean parmap?
<tobiasBora> yes
<troydm> what do you mean by "modify ocaml" ?
<xenocons> recompilation of ocaml src
<troydm> sorry i don't have any experience with janestreet library so i'm not sure what you are talking about
Neros has quit [Ping timeout: 240 seconds]
<tobiasBora> In the project they say that Core isn't compatible with the classic Ocaml version, that's why I think the ocaml code has been modify.
<troydm> i think Core is just a library
<tobiasBora> Is it the same think for parmap ?
<troydm> it's not like modifies ocaml by itself
<troydm> it's just another library
<troydm> an alternative to standard ocaml library
<troydm> parmap is just another library too
<troydm> so basicly if u have something written in ocaml that uses standard library
<troydm> and you want to use core you'll eventually will have to modify the source code of your program
<troydm> that what's that means
pkrnj has quit [Quit: Computer has gone to sleep.]
<tobiasBora> ok thanks ! And how do I replace the currents librairies with the new ones ? Just with #load ?
<tobiasBora> Or is it the goal of omake ?
<troydm> i'm sure you better of reading some book on how to use ocaml's top level and compiling source code Makefile or omake for example
<troydm> *using Makefile*
<tobiasBora> Yes I find the system of loading librairies quite strange...
<troydm> tobiasBora: what system are you comparing that to?
csakatoku has joined #ocaml
<tobiasBora> For exemple in python to include a .py just do "import monfichier.p". In Ocaml... I don't find how to do it without creating a .cmo !
<whitequark> is there any unicode-capable lexer which also supports proper capture groups?
<tobiasBora> Oh! It is #use in toplevel !
<whitequark> ulex doesn't, and it is awkward.
<troydm> tobiasBora: you can't do that without recompiling file
<tobiasBora> troydm: Ok... And #use compile it in "secret" ?
<tobiasBora> *s
csakatoku has quit [Ping timeout: 240 seconds]
<troydm> tobiasBora: better read some tutorials on that
<tobiasBora> troydm: I will do it. Do you have good tutorials ? I tried http://caml.inria.fr/pub/docs/manual-ocaml/manual023.html but I don't think it's really a complet tuto.
<troydm> or better this book http://tinyurl.com/mkthypm
<troydm> also you can read beta of Real World Ocaml, but i haven't read it yet so i'm not sure how good it is for a begginer
<whitequark> it is very good for a beginner if you already know some other language well.
<tobiasBora> Thanks a lot !
<pippijn> http://xinutec.org/~pippijn/home/projects/lang/cparser/online <- I integrated it in my website :) much prettier now
<whitequark> pippijn: wasn't re2ml your project?
<pippijn> yes
<whitequark> how is it going?
<pippijn> suspended, but will be resumed, soon
<whitequark> hm
<whitequark> can I use capture groups in it?
<pippijn> not yet, but I'm working on exactly that feature
<whitequark> awesome
<whitequark> because ulex doesn't have them and this leads to very ugly code.
<pippijn> yes
<pippijn> they are necessary
<whitequark> why don't you just extend ulex though?
<pippijn> re2ml is a lot faster than ulex
<pippijn> it's also a lot faster than ocamllex
<whitequark> oh, good
<pippijn> we'll see how fast it still is after capture groups are in
<whitequark> it generates pure ML code ?
<pippijn> yes
<pippijn> it aims to be fully compatible with ocamllex
<pippijn> but not using its lexing engine
<whitequark> I like ulex's interface better :/
<whitequark> also, what about unicode?
<whitequark> unicode is, like, important :p
<pippijn> unicode is the next step
<whitequark> I see
<pippijn> after sub-matching
<pippijn> whitequark: https://paste.xinu.at/qzFAs/
<pippijn> I need it :)
* whitequark nods
<pippijn> my ancient code
<pippijn> from 2011
<pippijn> actually no
<pippijn> I have no idea
<pippijn> in 2011, I put it in a git repo
<pippijn> haha
<pippijn> whitequark: I already had a merr at that time :)
<pippijn> written in perl