<Drup>
reynir: that's the big problem with binding web stuff
<Drup>
they keep trying to reinvent static typing, but they do it so badly that you have to redo all the work.
<reynir>
Yea
<reynir>
I'm implementing a client for a VPS's api. You can ask for info about a specific VM by giving the id. When you create a new VM you also get info about the newly created VM, but a lot of the fields are missing because "they are obvious / can be derivied from the arguments in the request"
<adrien_oww>
(not rackspace btw?)
<reynir>
It means I have to have 2 VM types, one for when creating a new VM and one for everything else
<reynir>
digitalocean
<adrien_oww>
ok
<reynir>
I think rackspace owns digitalocean maybe?
csakatoku has joined #ocaml
<adrien_oww>
not sure; all I know is that avsm is working on their api too
<adrien_oww>
s/ too//
<reynir>
Ah
<reynir>
Some of their api is also poorly documented
<Drup>
reynir: if you want to use ocsigen, I'm (very slowly) building a binding for a big API so I did a little "dsl" like library
<reynir>
like, in the VM you have a field "backup" which is a list. The problem is in their sample response the list is empty lol
<Drup>
reynir: you can probably do the same sort of thing with cohttp
csakatoku has quit [Remote host closed the connection]
<reynir>
Oh, I have implemented most of the api by now. I was just curious because it seemed like a problem well suited for a DSL :)
<Drup>
ok
<Drup>
you can emulate a pseudo-dsl quite nicely with ocaml constructions
csakatok_ has quit [Ping timeout: 256 seconds]
<reynir>
I have used camlp4 (or camlp5?) once. It's pretty nice
l_a_m has joined #ocaml
<l_a_m>
hi
<l_a_m>
i search a lightweb framework to build a RESTful webservice
<l_a_m>
any idea ?
<Drup>
reynir: I meen, whith *native* constructions
<reynir>
Yea, I understood that :D
f[x] has quit [Ping timeout: 264 seconds]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
<Drup>
l_a_m: there is several http server implemented in ocaml from the lighter to the heavier, I would say : ocaml-http (small and limitated, not sure if maintained anymore), cohttp (is a library), ocsigen (is a full stack server and you can use eliom too), ocamlnet.
<Drup>
(before some one said it, yes, the order at the end is dubious)
gnuvince has joined #ocaml
<companion_cube>
cohttp also does server? neat
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
<Drup>
I think so
<Drup>
if it's not cohttp, then it's something else somewhere in the mirage stack.
<companion_cube>
that's cool.
<reynir>
I think it's hard to decide which library to use - there are several that seem to do more or less the same :)
<pippijn>
Very lightweight HTTP server using Lwt. Contribute to ocaml-cohttp development by creating an account on GitHub.
<companion_cube>
I'd go with cohttp, since it uses Lwt, but well.
<Drup>
cohttp is probably the best solution if you just want a lightweigth stuff and do most of the work by yourself
<Drup>
eliom/ocsigen is more featureful but ... :p
<reynir>
What library would you suggest if I only need to be able to make HTTP GET requests?
<reynir>
ocamlnet seems like a huge library. I'd prefer a smaller library if ocamlnet isn't widespread :)
<companion_cube>
is there a documentation flag in opam, to specify where the documentation should go?
<Drup>
reynir: ocamlnet does not have, afaik, async ability. It's somewhat a huge issue
<Drup>
(and yeah, it's big and complicated too)
<companion_cube>
it doesn't?
<companion_cube>
I thought it had some horribly complicated "engine" system
<adrien_oww>
equeue ?
<pippijn>
I like lwt very much
<pippijn>
the only thing I don't like about lwt is that they don't quite behave like haskell I/O
<pippijn>
I mean IO
<companion_cube>
well, lazy IO are a mess
<companion_cube>
I like Lwt very much too
<pippijn>
I like lazy io
<companion_cube>
pippijn: but maybe you can write iteratee for Lwt, I heard they are fashionable in the haskell community ;)
<pippijn>
for example, I can say: let thr = print something;; let foo bar = ... lwt () = thr in ...
<pippijn>
I'd like lwt threads to be started only when they become part of a running thread
<Drup>
urk, that would be weird
<pippijn>
why?
<Drup>
well, not weird
<companion_cube>
on the contrary, it's nice being able to say Lwt.ignore_result some_thread
<Drup>
but debuging race conditions with lazy evaluation ... X_x
<pippijn>
Lwt.async would start them
<companion_cube>
to run in the background
<pippijn>
companion_cube: that's what async is for
<companion_cube>
but it starts a system thread, doesn't it?
<pippijn>
no
<pippijn>
that's Lwt_preemptive
<companion_cube>
oh.
<pippijn>
"async f starts a thread without waiting for the result. If it fails (now or later), the exception is given to Lwt.async_exception_hook. "
<companion_cube>
hmm, right, actually I should use async
<companion_cube>
rather than ignore_result
<pippijn>
Drup: I don't think there is a difference wrt race conditions
<pippijn>
lazy threads just mean: they start out sleeping, rather than running
<pippijn>
and you explicitly need to start them
<pippijn>
so you can make a collection of threads and then start all of them with Lwt.join or choose
<Drup>
I prefer the current way
<companion_cube>
me too
<companion_cube>
you can have threads waiting before they start, using Lwt.wait()
<pippijn>
companion_cube: are you sure?
<companion_cube>
it requires some code
<pippijn>
yeah
<pippijn>
that's just a lock
<pippijn>
ugly
<pippijn>
Lwt.wait should be used when you depend on that order
<pippijn>
usually I don't depend on it, but reasoning about it is easier
<pippijn>
like in haskell, you can just say: a = putStrLn "hello"
<pippijn>
and it will not be executed before it's put into the main execution chain
<companion_cube>
lazy evaluation and side effects are too complicated for me
<pippijn>
side effects occuring at random points in time are more complicated
<companion_cube>
well, if I start a lwt thread, I know the side effect will occur
<companion_cube>
regardless of evaluation of anything
<pippijn>
for me, that knowledge is not useful at all
<pippijn>
I want to know that a side effect will occur before something else happens
<companion_cube>
pippijn: I think you can write your combinators on top of Lwt, like a "lazy" >>=
<companion_cube>
or lazy return?
<pippijn>
yeah
<companion_cube>
or just wrap the thread in Lazy
<pippijn>
and make it unmaintainable for anyone who expects the normal lwt semantics
<reynir>
\o/
<pippijn>
no, I'm fine with lwt the way it is
<l_a_m>
Drup: i see ocsigne
<l_a_m>
Drup: i search more light than ocsigen ...
<l_a_m>
Drup: i will read about cohttp
<companion_cube>
pippijn: when all those projects of multi-runtimes are released/production ready, I think a multicore lib using Lwt would be great
<companion_cube>
or a multicore extension of Lwt, dually
saml has joined #ocaml
yezariaely has quit [Quit: Leaving.]
<Drup>
companion_cube: that seems quite hard in general, since the "good" way to do multicore in ocaml is message passing with forking processus and that's not really close to lwt way of doing stuff
<companion_cube>
Drup: soon, forking should not be necessary
<companion_cube>
but Lwt would serve to wait for messages from other runtimes
<Drup>
soon™ :D
<companion_cube>
I didn't mean every Lwt thread should map to a process :)
<Drup>
(i know about lucas's work, yes ;))
<Drup>
companion_cube: in that case, yeah, that's clearly a good idea
Neros has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
octet8 has quit []
octet8 has joined #ocaml
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
mort___ has joined #ocaml
Neros has joined #ocaml
l_a_m has left #ocaml []
talzeus has quit [Remote host closed the connection]
f[x] has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
Snark has joined #ocaml
ollehar has joined #ocaml
talzeus has joined #ocaml
octet8 has quit []
cesar_ has joined #ocaml
cesar_ is now known as Guest90689
tobiasBora has joined #ocaml
tyty has joined #ocaml
madroach has quit [Quit: leaving]
<tyty>
I identified an issue with OpsCode's official Chef Jenkins recipe. I'm using a nginx proxying setup that differs from what the recipe proposes, necessitating Jenkins being told what it's $PREFIX in a different manner. I haven't signed the contributers agreement. What does the community prefer, I submit a merge request to the recipe's GH repo, or create an issue in the JIRA "Chef Cookbooks" project, or ???
tyty has left #ocaml []
<reynir>
wrong channel?
mchqwerty has quit [Remote host closed the connection]
<adrien_oww>
:D
Guest90689 has quit [Read error: Connection reset by peer]
talzeus has quit [Remote host closed the connection]
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
tane has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest39065
tobiasBora_ has joined #ocaml
tobiasBora has quit [Read error: No route to host]
paddymahoney has joined #ocaml
Guest39065 has quit [Remote host closed the connection]
Neros_ has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
Neros has quit [Ping timeout: 245 seconds]
yezariaely has joined #ocaml
gnuvince has quit [Ping timeout: 260 seconds]
ontologiae_ has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
nikki93 has joined #ocaml
technomancy has left #ocaml []
yezariaely has quit [Read error: Operation timed out]
ttamttam has quit [Quit: ttamttam]
djcoin has quit [Quit: WeeChat 0.4.1]
yacks has joined #ocaml
nikki93 has quit [Remote host closed the connection]
f[x] has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]
Neros_ is now known as Neros
Neros has quit [Ping timeout: 248 seconds]
demonimin has joined #ocaml
ontologiae_ has joined #ocaml
Drup has quit [Read error: Operation timed out]
ontologiae_ has quit [Ping timeout: 246 seconds]
Drup has joined #ocaml
nikki93 has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
gereedy has quit [Ping timeout: 245 seconds]
gereedy has joined #ocaml
nikki93 has joined #ocaml
Neros has joined #ocaml
troydm has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<companion_cube>
curl: 404 is not a valid return code
<tobiasBora_>
Is it possible to send in an in_channel an EOF signal ?
<companion_cube>
tobiasBora_: you need to close it
<companion_cube>
oh, sorry
<companion_cube>
an in_channel? tough
<tobiasBora_>
Euh sorry in an out channel
<Anarchos>
tobiasBora_ yes it is
<tobiasBora_>
companion_cube: the problem is that when I close the channel, it close the socket connection...
<tobiasBora_>
*closes
<tobiasBora_>
I will explain my problem :
<tobiasBora_>
I want to send a message to a server, and wait for the answer. But the server is in an infinite loop while it is not in the end of the input chan, so I need to send EOF to this chan (which is an output chan for the client) in order to leave the infinite loop and send back the message.
<tobiasBora_>
But If I close the chan, the connection is closed...
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
ontologiae_ has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 240 seconds]
tobiasBora_ has quit [Quit: Konversation terminated!]
tristero has joined #ocaml
thomasga has quit [Quit: Leaving.]
<smondet>
tobiasBora_: EOF is kind-of the way the operating systems tell you a channel is being closed
<smondet>
you should not be able to have one without the other
<smondet>
if your server needs to reply it has to detect the end of the message
ng_ has joined #ocaml
emmanuelux has joined #ocaml
<ng_>
how i use big_int in ocaml??? i compile, but appears an error "Unbound value string_of_big_int"
<smondet>
the cannonical way is to send the length of the message before the message
<ng_>
and i put the "load in my code"
<ng_>
and i compile with nums.cmxa
demonimin has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 248 seconds]
kay_ has quit [Remote host closed the connection]
<smondet>
ng_: what is the "load in my code"? are you using ocamlfind?