BiDOrD_ has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
NaCl has quit [Ping timeout: 265 seconds]
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
dsheets has joined #ocaml
ggherdov has joined #ocaml
ygrek has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
mreca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe_ has quit [Remote host closed the connection]
zpe has joined #ocaml
dsheets has quit [Quit: Leaving]
dsheets has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets_ has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
watermind has quit [Quit: Konversation terminated!]
ontologiae has quit [Ping timeout: 260 seconds]
<bernardofpc>
humpf list.combine is giving me stack overflow
<bernardofpc>
(or so it seems)
shinnya has quit [Ping timeout: 245 seconds]
sagotch has quit [Ping timeout: 246 seconds]
thomasga has quit [Quit: Leaving.]
zpe has joined #ocaml
yellowfish has quit [Ping timeout: 248 seconds]
zpe has quit [Ping timeout: 272 seconds]
wolfnn has quit [Ping timeout: 248 seconds]
ollehar has quit [Ping timeout: 246 seconds]
sheijk has quit [Quit: .]
yacks has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
philtor has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
yacks has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 265 seconds]
struktured has joined #ocaml
Dongyancai has quit [Quit: leaving]
mreca has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
struktured has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
shinnya has joined #ocaml
ggole has quit [Read error: Connection timed out]
ggole has joined #ocaml
yacks has joined #ocaml
ygrek has joined #ocaml
codygman has joined #ocaml
<codygman>
Hi! I plan on learning ocaml in the future and just had a very shallow syntax question. Why so many "let" bindings for variables? Are they required? Is this annoying for you personally? For instance in this code: http://www.ffconsultancy.com/languages/ray_tracer/comparison.html
axiles has joined #ocaml
<ggole>
let is how bindings are established in ocaml
<ggole>
It's a little wordy, but I don't personally mind it.
<pippijn>
"However, note that the C++ implementation has been optimised by using pass by reference for structs. In contrast, the OCaml implementation is unoptimised."
<pippijn>
yes, and ocaml passes everything "by reference"
<pippijn>
because there are no value types besides some small word-sized types
<pippijn>
I don't like this page
<ggole>
It's Harrop, just ignore it.
<pippijn>
ah
yellowfish has joined #ocaml
<ggole>
Neither implementation is much good anyway
<ggole>
(In terms of speed.)
<pippijn>
yeah
Kakadu has joined #ocaml
<r0bgleeson>
that code is freaky
pango_ has quit [Remote host closed the connection]
<bernardofpc>
run with ./array_combine.native 100000 50, then 300000 10 then 3000 1000
<bernardofpc>
(then 300 10000 for fun...)
<ggole>
Something like let map_2arrays_to_list f a1 a2 = let rec loop bound i acc = if i = bound then acc else loop bound (i + 1) (f a1.(i) a2.(i)::acc) in loop (Array.length a1) 0 []
<ggole>
Er, wrong way around.
<companion_cube>
you really should use a benchmarking lib ;)
<ggole>
let map_2arrays_to_list f a1 a2 = let rec loop i acc = if i < 0 then acc else loop (i - 1) (f a1.(i) a2.(i)::acc) in loop (Array.length a1 - 1) []
<bernardofpc>
mhn, I do have a list.rev too much in my code
<bernardofpc>
(that's the problem of having a commutative function eat the result of my lxy)
<bernardofpc>
ggole: that was it
kyrylo has quit [Ping timeout: 272 seconds]
jao has joined #ocaml
<bernardofpc>
companion_cube: what do you mean by "a benchmarking lib" ?
pango has quit [Remote host closed the connection]
kyrylo has joined #ocaml
pango has joined #ocaml
Thooms has quit [Remote host closed the connection]
Thooms has joined #ocaml
kyrylo has quit [Ping timeout: 245 seconds]
kyrylo has joined #ocaml
gargaml has quit [Ping timeout: 245 seconds]
tnguyen1 has joined #ocaml
tnguyen1 has quit [Client Quit]
tnguyen_ has joined #ocaml
philtor has joined #ocaml
r0bgleeson is now known as livewire
livewire is now known as livewire1
livewire1 has quit [Quit: WeeChat 0.4.2]
livewire1 has joined #ocaml
struktured has joined #ocaml
FreeArtMan has joined #ocaml
watermind has joined #ocaml
kamatara has quit [Remote host closed the connection]
zpe has joined #ocaml
kamatara has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
<struktured>
hi, any body know of a way to pass a tuple to a type constructor without having to destructure it? eg. type TUPLE = TUPLE of int * string; let val = (5,"hi") in TUPLE val gets a compiler error. I must do let (a,b) = (5,"hi") in TUPLE (a, b) instead
<struktured>
sorry, the type itself should be called "tuple"
<companion_cube>
I don't think you can, sadly :/
<struktured>
companion_cube: I suppose records are an alternative paproach for this
<companion_cube>
records are nice, indeed
<struktured>
companion_cube: type TUPLE of some_record_type should work
<struktured>
companion_cube: guess I'll just switch to a record for my representation here, not really a problem
<companion_cube>
if you only have one case, why not use the record directly?
<struktured>
companion_cube: I have more than one, this isn't my actual code which is more more complex
<Drup>
struktured: type tuple of Tuple of (int * string)
<companion_cube>
ah, ok
<Drup>
add the paranthesis
<struktured>
what is the distinction from the type system level?
<Drup>
I think it's for efficiency reasons
<struktured>
interesting, thanks
<kamatara>
struktured, you can create a method which take a tuple and apply the constructor to the destroyed value
<Drup>
one used boxed element, the other is not
<Drup>
do not*
<struktured>
kamatara: I don't understand your approach but it also sounds interesting.
<Drup>
struktured: if you write your constructor in GADT style, this weird behavior disappear
<struktured>
ok, will look int that too. thanks for all the tips guys. very helpful
<Drup>
struktured: "type tuple = Tuple int * string" = "type tuple = Tuple : int -> string -> tuple"
<kamatara>
struktured, you have one function which do that, and everywhere you call it, like that if you change your type to have only one argument (a tuple) and not two, you just change that function
<Drup>
hum, actually, you can't really write the first version, my bad
<Drup>
the syntax for constructor is not very good :/
NoNNaN has quit [Ping timeout: 240 seconds]
kamatara has quit [Quit: Leaving]
kamatara has joined #ocaml
kamatara has quit [Remote host closed the connection]
kamatara has joined #ocaml
sgnb has quit [Ping timeout: 256 seconds]
kamatara has quit [Client Quit]
kamatara has joined #ocaml
<ggole>
Is it a syntax problem? I thought that was the usual optimisation hack.
NoNNaN has joined #ocaml
<Drup>
ggole: I find it weird that tuples are currified, that's all
struktured has quit [Ping timeout: 246 seconds]
<ggole>
I'm not sure what you mean.
<Drup>
and yes, it's the usual optimisation hack, but it's not very nice to have an optimisation hack by adding paranthesis, which are usually a neutral element
<ggole>
Oh yeah, that's ugly.
<Drup>
s/tuples/constructors/
<Drup>
it would be less ugly if constructors types looked like a function
<kamatara>
Drup, haskell is your friend :)
kamatara has quit [Quit: Leaving]
<arj>
anyone knows of a ocaml-gnupg binding?
kamatara has joined #ocaml
<Drup>
kamatara: I know, haskell did that part right
<kamatara>
yes, and the function for each field member <3
<companion_cube>
you'd actually need a lense for each record field
<kamatara>
a lense?
<Drup>
arj: not that I know of
<companion_cube>
lens*
<kamatara>
what can we do with a lens?
<kamatara>
except replace glass?
<arj>
kamatara: lens as in "accessor" of a field in a structure
<arj>
sort of.
<kamatara>
i could write a function, it never took time
<arj>
Drup: thx.
<ggole>
The idea is to abstract over them.
<companion_cube>
and compose them
<ggole>
So you can express, say, "add one to a field and subtract another field and put that into this other field" without reference to any particular concrete record.
<companion_cube>
kamatara: since you like haskell, try taking a look at #haskell, they'll explain lenses to you ;)
<kamatara>
is it a code generator?
<ggole>
No, it's just abstraction.
<kamatara>
because I know how to extend law over functions
<kamatara>
there is always an hidden (co?)monad
ontologiae has quit [Ping timeout: 245 seconds]
<ggole>
Right, although I 'm not sure it's particularly hidden in Haskell
<flux>
I just used old bindings I had embedded in a project of mine, because I need to use them in another project
<flux>
a particular feature it has is that it is able to decode the almost-jpeg-files from webcams
zpe has joined #ocaml
Eyyub has quit [Ping timeout: 272 seconds]
<flux>
it doesn't work the way I like when I'm _tags including it below another project though :(
<adrien>
hmm, what do you mean?
ontologiae has joined #ocaml
<flux>
well, it tries to compile the v4l2.cmo directly I see
<flux>
it doesn't use the v4l2.cma which brings in the C code and -ljpeg
<adrien>
doesn't sound like a very good idea with ocamlbuild
<adrien>
maybe you can exclude the other directories?
<flux>
if I do ocamlbuild -use-ocamlfind OCamlV4l2/v4l2.cma it does produce that file properly
<flux>
yes, there is probably a way.. there always is with ocamlbuild ;-)
zpe has quit [Ping timeout: 272 seconds]
<companion_cube>
if you need to use it in other projects, I suggest using ocamlfind
<companion_cube>
packaging/installing with oasis is ridiculously easy
<adrien>
:)
<flux>
I don't want people or me needing to git clone this, then install a few packages to the system, then build the program
<flux>
I just want it to work in one go
<adrien>
you can install locally
<flux>
and it worked fine with another library, without C code though :)
<flux>
I also want to modify the library while I'm develing this piece
<adrien>
ah :)
<adrien>
installing (not by hand, in a Makefile) should work fine for a couple libs
<flux>
it can also be I have another project which uses an older version of the library
<flux>
seems quite inelegant to always install different versions of a library, depending on what I'm going to compile next..
<flux>
maybe I can compile it in as a more traditional submodule
<adrien>
no, I meant, installing locally
<flux>
ok, so under projectname/ocamlfind?
<adrien>
mkdir -p /tmp/ocaml-fileutils-install
<adrien>
OCAMLFIND_DESTDIR=/tmp/ocaml-fileutils-install make install
<adrien>
whereever you want
<adrien>
(whenever, wherever)
<adrien>
(I need some reste)
<adrien>
rest*
<flux>
integrating that into ocamlbuild.. well, I have build.sh already in place..
<flux>
it'll probably end up reinstalling the submodule always, not only when it is changed
ggole has quit []
<adrien>
it's common to have a "Makefile" which simply calls "ocamlbuild longlistofarguments" or similar commands
<adrien>
because "make" is so much shorter to type :P
<flux>
hmm, I think it used to be that if I did ocamlbuild main.native then main.byte symbolic link would disappear and vice versa
<flux>
but now it seems to stay in place
<flux>
that was my reason for not using make, as it doesn't really integrate well with make's targets
<flux>
(or 'didn't')
<adrien>
the symlink doesn't get removed nowadays? \o/
<flux>
:)
<flux>
just tried it out, it doesn't get removed
Eyyub has joined #ocaml
<flux>
probably too much trouble to make ocamlbuild do the sub-installation
sagotch has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 252 seconds]
rks has quit [Killed (hubbard.freenode.net (Nickname regained by services))]
rks_ has joined #ocaml
Don_Pellegrino has joined #ocaml
Arsenik has joined #ocaml
<flux>
well, I think this is hardly optimal. to make it as smooth as with plain ocamlbuild I now oasis setup, configure, build, install
<flux>
which of course produces a ton of diagnostics
<flux>
so more scripting..
<adrien>
=/
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 265 seconds]
mreca has joined #ocaml
kamatara has quit [Quit: Leaving]
Yoric has joined #ocaml
axiles has quit [Remote host closed the connection]
sorethroat has joined #ocaml
kyrylo has joined #ocaml
Arsenik has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
arjunguha has joined #ocaml
arjunguha has quit [Client Quit]
<flux>
hmm, so opam says "ocaml setup.ml -configure --prefix /home/flux/ocaml/.opam/system --enable-lablgtk2" and it works fine, yet if I enter the same command myself after extracting the same archive, I get an error that "sh: 1: cannot open lablgtk2: No such file" and "ERROR: Install the development files for lablgtk2 (e.g. the liblablgtk2-ocaml-dev package for Debian)."
kyrylo has quit [Ping timeout: 250 seconds]
<flux>
some sort of glitch or fixed bug, worked with a more recent extracted archive..
kyrylo has joined #ocaml
<adrien>
what?
<adrien>
setup.ml in lablgtk sources?
sorethroat has quit [Ping timeout: 250 seconds]
<flux>
yeah
<flux>
but I couldn't quite understand how opam was able to run it. maybe it uses /bin/sh whereas my $SHELL is zsh..
<adrien>
there is no setup.ml in lablgtk sources
<livewire1>
is gtk and ocaml popular?
<Drup>
Sure. :D
<flux>
oh sorry, not in lablgtk but cairo
<adrien>
flux: or it's something which depends on lablgtk?
<adrien>
ah, right, ok
<adrien>
(cairo2 actually I guess)
<livewire1>
cool, it seems people use them together in this channel often but that could be a coincidence.
<adrien>
flux: well, do you have the script named "lablgtk2"?
<flux>
adrien, the script named lablgtk2?
<flux>
ah, I do
<adrien>
hmm
<adrien>
then
<Drup>
livewire1: well, it also happens that the gtk binding is the more solid among gui bindings in ocaml
mreca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<flux>
it even implements it, but doesn't export it
<adrien>
open a bug about it; cairo2's upstream is very very reactive
ulfdoz has quit [Ping timeout: 248 seconds]
<flux>
finally got it working though. I should file a bug report yes, otherwise it'll be annoying for people to compile this :) (well, for me as well in the future)
<flux>
maybe "active" is an overstatement, last release is from Oct12 and 3 bugs in the tracker ever?
Yoric has quit [Ping timeout: 265 seconds]
<flux>
apparently requires making an account before a bug can be filed.. it can wait a moment.
Thooms has quit [Ping timeout: 246 seconds]
FreeArtMan has quit [Ping timeout: 272 seconds]
<Drup>
last time I had a bug, I just send a mail to christophe troestler, he answered and released a new version reasonably quickly