arquebus has quit [Quit: Konversation terminated!]
ttamttam has joined #ocaml
thomasga has joined #ocaml
zRecursive has left #ocaml []
cago has joined #ocaml
ygrek has joined #ocaml
mika1 has joined #ocaml
AltGr has joined #ocaml
AltGr has quit [Remote host closed the connection]
AltGr has joined #ocaml
ulfdoz has joined #ocaml
<kerneis>
wmeyer adrien: oh, so cross-compilation is near ready for OCaml?
<kerneis>
I got some patches for ocaml-autoconf from the MXE guys (who use Richard Jones' hack from 2009)
<kerneis>
and I was reluctant to integrate them as long as upstream did not support it
<kerneis>
we should probably coordinate on that front
sgnb has quit [Remote host closed the connection]
ontologiae has joined #ocaml
sgnb has joined #ocaml
weie has quit [Quit: Leaving...]
Simn has joined #ocaml
yacks has joined #ocaml
Anarchos has joined #ocaml
q66 has joined #ocaml
mcclurmc has joined #ocaml
Kakadu has joined #ocaml
mfp has joined #ocaml
ulfdoz has quit [Ping timeout: 268 seconds]
wwilly has joined #ocaml
<wwilly>
bonjour
<Anarchos>
salut wwilly
weie has joined #ocaml
beginner42 has joined #ocaml
<beginner42>
i am trying to call this function with ctypes http://api.zeromq.org/3-3:zmq-ctx-set , but how can i pass for exampe ZMQ_IO_THREADS and this value is a int?
mcclurmc has quit [Quit: Leaving.]
Drup has joined #ocaml
skchrko has joined #ocaml
cyocum has joined #ocaml
<cyocum>
hi, I have a question about web frameworks and ocaml...has anyone used any and could recommend one? I have quickly looked at Ocsigen but I wanted to see alternatives...
<AltGr>
Well there used to be OPA (http://opalang.org/) but I am not sure about the state of the project
<Drup>
the problem with templating stuff is that you loose the fact that eliom/tyxml html is always correct
<cyocum>
yeah
<Anarchos>
Drup: you think ocsigen/js_of_ocml/eliom is best than j2ee servers ?
<Kakadu>
yeah
<Kakadu>
almost everything is better than java </troll>
<cyocum>
lol
<cyocum>
perl is not better than java
<cyocum>
please believe me
<cyocum>
I have had to work on perl stuff and I used to like it until I saw ocaml
<cyocum>
one thing that java has over ocaml at the moment is that xpath is well supported
<Drup>
Anarchos: we were talking about ocaml web framework :)
<Anarchos>
cyocum: don't confuse java *library* with java *the language*
<cyocum>
yes, I know
<Anarchos>
Drup: ok. I did a lot of struts/j2ee/tomcat for a bank for two years....
<cyocum>
Anarchos, I am kind of doing j2ee/tomcat at work now
<cyocum>
we have lots of legacy perl which I work on
<Kakadu>
Well, I have studied a big one enterprise project and succeeded to make useful changes in it. Just after that I have met OCaml and steted to hate Java kanguage since
<Drup>
Anarchos: my experience with java told me that I don't want to work with this ever again.
<Anarchos>
Drup: i don't too ! even C++ is a pain to use on an industrial basis
<cyocum>
anyway
<Kakadu>
a little bit C++ os OK. For adding Qt Gui to OCaml for example
<cyocum>
yeah, I indulged in some language hate which is pointless in general
<cyocum>
it looks like tyxml does some templating according to the docs
<cyocum>
such as they are
<Kakadu>
I think it is not templating but , it's something more with templates composition and types
<cyocum>
ok
<Kakadu>
I prefer it against javascripts typeless templete for html
<Kakadu>
it seems that Ratio module documentation sucks
<Kakadu>
> This module is used to support the implementation of Num and should not be called directly.
<Kakadu>
Nothing about ratio_of_string
<ggole>
Hmph.
<def-lkb>
Num.(num_of_int 1 // num_of_int 34)
<ggole>
Num.num_of_string then
<lewis1711>
ah, thanks
* ggole
wonders why num has a compare function that is named something other than compare, making it incompatible with Set/Map
<def-lkb>
ggole: and Num.num_of_int, Num.num_of_string, whereas Int32.of_int/of_string, etc.
<ggole>
Yep.
<def-lkb>
the interface is kept for compatibility I think, but it is cheap to write your own interface above, it's not a big issue
<def-lkb>
(otherwise, we would dump the whole stdlib)
talzeus has joined #ocaml
wwilly has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
_andre has joined #ocaml
ollehar has joined #ocaml
introom has joined #ocaml
<beginner42>
i have a function create : kind -> kind t and another function that should only accept one specific output of the first function. Do i need for that polymorphic variants?
<Kakadu>
yes, I think
metasyntax has quit [Quit: Leaving]
<beginner42>
Kakadu: thanks
<ggole>
Or phantom types
<Kakadu>
ggole: how exactly?
<ggole>
Attach a phantom parameter to kind and use that to label the "specific output"
<ggole>
There are a few ways to handle cases that can't happen: you can just assert false on all the ones that you don't want, you can use GADTs, phantom types, etc.
<beginner42>
thank you, i will try that
ontologiae has quit [Ping timeout: 256 seconds]
introom has quit [Read error: Connection reset by peer]
introom has joined #ocaml
ontologiae has joined #ocaml
introom has quit [Read error: Connection reset by peer]
<beginner42>
in the example they have type readonly, but that would also work for, lets say type readonly = A | B, and then the set function could be val set : B t -> int... ?
<ggole>
Not quite: B is a construct at the value level, not at the type level
<ggole>
You could introduce types that mirror the structure of the A | B
<beginner42>
its maybe easier if i show you my concrete problem
<beginner42>
my problem is the return type of Socket.create
<beginner42>
because when i want to implement this set of functions http://api.zeromq.org/3-3:zmq-setsockopt, like ZMQ_ROUTER_RAW only one specific type of socket is allowed as input
<beginner42>
for a function like ZMQ_ROUTER_RAW
<ggole>
Seems that you need several creation functions to distinguish between different types of sockets.
<beginner42>
here they solved it polymorphic variants
introom has quit [Remote host closed the connection]
bondar has joined #ocaml
bondar has quit [Read error: Connection reset by peer]
bondar has joined #ocaml
bondar has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
walter has quit [Quit: This computer has gone to sleep]
ttamttam has quit [Quit: ttamttam]
djcoin has quit [Quit: WeeChat 0.4.0]
justdit has quit [Read error: Connection reset by peer]
justdit has joined #ocaml
shinnya has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
lifeng has quit [Ping timeout: 245 seconds]
lifeng has joined #ocaml
justdit has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 260 seconds]
n06rin has quit [Quit: Leaving.]
yacks has quit [Quit: Leaving]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
ontologiae has quit [Ping timeout: 245 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-130604]: i've been blurred!]
zpe has joined #ocaml
jayprich has joined #ocaml
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 264 seconds]
othiym23` is now known as othiym23
justdit has joined #ocaml
<technomancy>
if I try to load code into utop that depends on another module in the same dir, it fails with "Unbound module Mymodule"
tane has joined #ocaml
zpe has joined #ocaml
<ggole>
You have to load the other one first (if it is a package, you can use #require to get all the bits iirc)
talzeus has quit [Read error: Connection reset by peer]
<ggole>
That rapidly becomes annoying: once I have more than one file, I tend to make an .mltop and build a toplevel with ocamlbuild so I don't have to do it.
darkf has quit [Quit: Leaving]
Drup has quit [Read error: Operation timed out]
<technomancy>
gotcha; I see "creating a custom utop-enabled toplevel" in the readme; sounds like that's what I want.
<technomancy>
but if I do want to do it manually, how should I load it if it's not a package?
<ggole>
#load "foo.cma" then #load "depends_on_foo.cma" :(
<technomancy>
thanks
<ggole>
(I've no idea why there isn't something to hook into ocamldep to make that go away by now.)
<technomancy>
I have a .cmi, a .cmo, and a .cmx, but no .cma
<ggole>
Substitute cmx, I guess
zpe has quit [Ping timeout: 268 seconds]
<ggole>
(There was a limitation a while ago which didn't allow linking native code, but I think that is gone by now.)
<technomancy>
hm; no dice; "not a bytecode object file"
<technomancy>
.cmo works
<technomancy>
well, it loads without complaining
<technomancy>
but it doesn't result in the module being available
<ggole>
Er, hmm
tobiasBora has quit [Read error: Connection reset by peer]
<ggole>
Hang on a sec: it's been a while since I've fiddled with native code in the toplevel (I just use bytecode for that).
<technomancy>
I'm specifying .byte in my ocamlbuild invocations
<technomancy>
I wonder why I'm not getting bytecode in _build then
ulfdoz has joined #ocaml
<ggole>
Oh, I've messed up a bit. I've confused the library files (.cma) with the object files (.cmo)
<ggole>
#load "foo.cmo" should work though
<ggole>
It won't *open* the module
<ggole>
But it should load it
whitequa1k has joined #ocaml
<ggole>
IE, you should be able to #load "foo.cmo" and then Foo.some_value_in_foo and see it.
<technomancy>
no, I still get Unbound module =\
<ggole>
Hmm :/
<ggole>
How are you compiling your files?
whitequark has quit [Remote host closed the connection]
ipoulet has quit [Ping timeout: 240 seconds]
ipoulet_ has joined #ocaml
<adrien>
hmmm
<technomancy>
just this `ocamlbuild -use-ocamlfind grench.byte`
<ggole>
Oh
<ggole>
#cd "_build" and try again
<technomancy>
my _tags file has "true:package(core),package(async),thread,annot,debugging"
<adrien>
or "-I _build"
<ggole>
(Sorry: I've long ago automated all this stuff away and forgot the details)
Simn has quit [Read error: No buffer space available]
Simn has joined #ocaml
<technomancy>
ggole: #load "_build/bencode.cmo" works without the #cd
<technomancy>
it just doesn't result in a module being defined
<technomancy>
(from what I can tell #cd works the same way)
<ggole>
You can't Bencode.whatever after that?
<technomancy>
correct
<ggole>
Hmm.
<ggole>
What about with #cd "_build" #load "bencode.cmo"?
<technomancy>
the readme fails to mention you need core and async pulled in via opam, but it includes the `ocamlbuild` invocation
<ggole>
Seems to work fine
<technomancy>
so from a fresh checkout, you ran the `ocamlbuild` line, then utop, then #load "_build/bencode.cmo", and then the Bencode module was available?
<technomancy>
but it looks like what it's really complaining about is -threads
<technomancy>
which utop needs
<ggole>
Hmm, I can't build that myself: don't have Async
<ggole>
How big is Async?
<technomancy>
not sure
<technomancy>
my .native ends up being ~10M though =\
Drup has joined #ocaml
<ggole>
Hmm
<technomancy>
so I guess if #load "_build/bencode.cmo" doesn't work, what does that mean? is it possible the .cmo file doesn't contain the right module definition?
<ggole>
You are doing #cd "_build" after that, right?
<ggole>
(Or using -I "_build" at the command line)
<technomancy>
#cd before or after #load?
<ggole>
Either is fine
<technomancy>
yeah, it's the same either way
<technomancy>
oh this is weird
<technomancy>
utop's tab completion knows about Bencode
<ggole>
So you are doing #cd "_build" / #load "bencode.cmo" / module B = Bencode and it says "module unbound"?
<def-lkb>
technomancy: #load "unix.cma" ??
watermind has joined #ocaml
<technomancy>
ggole: correct
<ggole>
Hmph.
<ggole>
'opam install async' failed.
<technomancy>
def-lkb: putting that in toplevel.mltop gives me the same error
<ggole>
Oh, don't put that in toplevel.mltop
<ggole>
P
<ggole>
.mltop should be a list of module names, capitalised, that you want included in the toplevel
<technomancy>
ggole: ok, but that refuses to compile with the "undefined global `Unix'" error above
<def-lkb>
technomancy: if you want unix to be accessible from the toplevel, either use #load "unix.cma";; or #require "unix" if you use topfind
<ggole>
Add Unix to the .mltop?
<ggole>
(Before the other module names, I think)
<def-lkb>
technomancy: what are you compiling with ?
<ggole>
I think this is happening because of -threads: ocamlbuild should know that it implies that Unix is needed, but doesn't.
<technomancy>
def-lkb: bingo; thanks!
<ggole>
Oh, great.
ben_zen has joined #ocaml
<technomancy>
ah, but that's not a utop-enabled one; hm
tobiasBora has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
jayprich has quit [Ping timeout: 264 seconds]
<technomancy>
and the toplevel I got working doesn't run with tuareg
<technomancy>
ugh
<kerneis>
I hate ocamlfind
<kerneis>
or, more precisely, I love ocamlfind but I hate the gazillion different conventions about where and how to install packages
<technomancy>
utop works fine, a custom toplevel works fine, and tuareg works fine
<technomancy>
they just don't work together
<adrien>
kerneis: what do you mean? :o
malo has joined #ocaml
yacks has joined #ocaml
justdit_ has joined #ocaml
justdit has quit [Ping timeout: 246 seconds]
<technomancy>
hm; I can just paste in my module inside "module Bencode = struct ... end" for now
<technomancy>
kinda feels like rubbing sticks together to get fire, but it lets me get back to focusing on my code
jayprich has joined #ocaml
<ggole>
O_o
<ggole>
Is utop really that broken?
<technomancy>
ggole: it's more that the instructions for generating a custom top make poor assumptions about how I use ocamlfind
<ggole>
Blargh.
<technomancy>
I'm sure if I knew how ocamlfind worked I could do it, but it's not usable for folks at the "copy/paste shell instructions I found from various readmes" stage
<ggole>
I am so glad that I don't depend on any third party code.
<technomancy>
opam seems to do a great job for the actual installation and stuff
<technomancy>
it's just the last mile of getting it into the repl that sucks
<adrien>
ocamlfind works really well; it has a well-defined scope and does well what it's supposed to do
<ggole>
It's easy to just #use "topfind" and then #require, but that doesn't really help you with your own code...
Anarchos has joined #ocaml
<kerneis>
adrien: ocamlfind has a very idiosyncratic way of dealing with install directories, and is therefore a pain to integrate with autoconf
<kerneis>
(it *works*, but it's a pity every project has to reinvent the *same* wheel)
<technomancy>
just when I thought things couldn't get hairier, someone mentions autoconf =)
<adrien>
kerneis: can you be more precise? I've been satisfied with that logic (except for the little trick when installing to a DESTDIR)
<technomancy>
it's kinda weird that Async redefines exit to return a Deferred
<technomancy>
is there a way to reference the original exit which returns unit?
<avsm>
Caml.Unix.exit will work, but user beware
malo has quit [Quit: Leaving]
<adrien>
hmmm
<adrien>
it's in Pervasives
<technomancy>
avsm: beware what?
<adrien>
and it doesn't return unit but 'a (in the sense that it doesn't return anything)
<technomancy>
adrien: even better, I think?
<technomancy>
thanks; that works nicely
ulfdoz has joined #ocaml
jayprich has quit [Ping timeout: 260 seconds]
<kerneis>
adrien: so, there is the DESTDIR issue
<kerneis>
there is the fact that ocamlfind calls -destdir what everybody else calls libdir (more or less)
<kerneis>
there is no way to "install, overriding if the package exists already" (which is what every sane "make install" target does by default)
<kerneis>
ocaml really lacks a unified convention about installation of packages
<adrien>
I agree these issues are annoying but I've found them manageable
<adrien>
if the user wants to "make install" without first making a packet, you're allowed to break his fingers anyway :P
jayprich has joined #ocaml
<technomancy>
I'm glad at least there's agreement to focus on user-scoped stuff instead of bending over backwards to support system-wide libs during development
<adrien>
and -I +FOO is not a good thing
<adrien>
just use ocamlfind everywhere
tane has quit [Quit: Verlassend]
_andre has quit [Quit: leaving]
ulfdoz has quit [Ping timeout: 245 seconds]
ggole has quit []
transfinite has quit [Quit: transfinite]
justdit has joined #ocaml
justdit_ has quit [Ping timeout: 245 seconds]
<adrien>
heh, it had almost been a month
<adrien>
good luck wmeyer :P
justdit_ has joined #ocaml
justdit has quit [Ping timeout: 268 seconds]
Neros has quit [Remote host closed the connection]
Snark has quit [Quit: leaving]
justdit_ has quit [Ping timeout: 268 seconds]
Patchou has joined #ocaml
Tamae has quit [Ping timeout: 264 seconds]
Simn has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[0.9.7-H-130604]: i've been blurred!]
ollehar has joined #ocaml
void64 has quit [Ping timeout: 245 seconds]
void64 has joined #ocaml
thomasga has quit [Quit: Leaving.]
<wmeyer>
adrien: :D
nlucaroni has quit [Quit: leaving]
tobiasBora has quit [Quit: Konversation terminated!]