<artart78>
well it looks like djb2 is different from sdbm
mengu has quit [Quit: Leaving...]
<orbitz>
Drup: Hello! In this little snippet, Furl routes to the default case for the 'goodbye' path, am I doing something wrong? https://bitbucket.org/snippets/orbitz/qAdLr
<orbitz>
Drup: they both fail to route if I put "goodbye" before "hello" in the routing list
<orbitz>
Drup: actually I take the last claim back. my assert was wrong in goodbye. If I flip the ordering goodbye succeeds and hello fails.
ziyourenxiang has joined #ocaml
_andre has joined #ocaml
<Drup>
orbitz: so... what's the issue ?
BitPuffin|osx has joined #ocaml
<Drup>
oh, I see
<orbitz>
Drup: at least for this example, whatever the second route is gets ignored
Muzer has quit [Ping timeout: 256 seconds]
dhil has quit [Ping timeout: 245 seconds]
AlexDenisov has joined #ocaml
shinnya has joined #ocaml
<freyr>
Could somebody explain what does Lwt_engine.event means?
<companion_cube>
it's probably dark magic
<companion_cube>
writing a backend for lwt is no simple task
<freyr>
companion_cube: No, I'm not writing a backend, I want to use some reactive I/O
<companion_cube>
how do you mean "reactive IO"?
<freyr>
I thought Lwt_engine provides something like event callbacks (like in libev or libuv)
<companion_cube>
lwt is already based on nonblocking IO
<Drup>
freyr: what is not sufficient in Lwt_io ?
<freyr>
I know, I need a lwt compatible event mechanism
richi235 has quit [Ping timeout: 260 seconds]
<Drup>
What do you actually want to do ?
mpenet has joined #ocaml
<freyr>
Drup: afaik Lwt_io returns promise until say somebody write something into pipe. I want to poll a descriptor in libev style.
<freyr>
companion_cube: by reactive I mean reactive polling, with a callbacks and events, like in libev.
<companion_cube>
but why would you want to do that? lwt already does it for you
<adrien>
to do what afterwards?
<freyr>
companion_cube: Maybe, I'm still not well aware of lwt concepts. I have a descriptor, some other process writes something into it from time to time, so I want to do some stuff on each such message
mpenet has quit [Remote host closed the connection]
<freyr>
and then write something into db. I used to libev/epoll style I/O so I'm not really understant how to do so in OCaml with lwt
<adrien>
basically you'd write it in the same fashion as if you were using blocking calls
<adrien>
but you use Lwt I/O functions and >>=
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<freyr>
adrien: You mean read? So I could just bind read_line function with the handler with the bind compinator and the handler would be called each time read_line gets a value?
<freyr>
or should I wrap it with the loop?
<Drup>
If you want to read all the lines, it's Lwt_read_lines
<Drup>
Lwt_io.read_lines*
<Drup>
(plural :p)
<orbitz>
Drup: any ideas on the Furl thing? If not I'm going to put my heavy-typing-ahead hardhat on and dive in.
Muzer has joined #ocaml
alienbot has joined #ocaml
<Drup>
orbitz: I'm looking at it now
dhil has joined #ocaml
<orbitz>
drawesome thanks
<Drup>
at least, it's not a regular expression problem
<freyr>
Drup: Well, it does not seem to work as I've wanted. It seems it reads fd's content only once, after that the promise seems to be always ulfilled. I need to call handler on each update of the FD's context, so is seems I need either a loop or an libev wrapper.
<freyr>
adrien:
<freyr>
could I do that with a pure Lwt_io?
slash^ has quit [Read error: Connection reset by peer]
<Drup>
mfp: ^
<Drup>
(freyr: side note, your question on reddit is a very bad case of X/Y problem, you should really explain your original problem)
<freyr>
Drup: Ok, I would edit it
<Drup>
(I mean, your question is really "how to minitor an fd with lwt to retrieve all the content as soon as it's being written", which probably has a good answer, even if I personally don't know)
myst|fon has joined #ocaml
<freyr>
Drup: Thanks, is it better now?
<Drup>
Probably :p
<orbitz>
Drup: this furl code is a wild ride.
<orbitz>
I'm not saying it's over-engineered or something. It's just usage of the type system beyond my day-to-day experience ;)
<Drup>
orbitz: pretty sure I now why this is happening
<orbitz>
So it's actually quite fun.
<orbitz>
Drup: what's the hypothesis?
<Drup>
It's due to a change in the indexing of groups in Tyre
<orbitz>
ok
* orbitz
shakes fist at Tyre
<Drup>
(at least I think so)
<orbitz>
Drup: is there a version of tyre I can pin to for testing?
<Drup>
let me try to fix this in furl first :p
<Drup>
orbitz: by the way, I have a wip branch in furl called "onetype" with a simplified API
<Drup>
(it has the same bug, though)
<orbitz>
Drup: Ok, I can take a look at it if you'd like. So far I don't mind the current api. But I've only written it long enough to find a bug :)
dhil has quit [Ping timeout: 268 seconds]
<orbitz>
Drup: the implementation looks a bit simpler at first glance. And the .mli file is much simpler which is pleasant.
<flux>
what? furl is nowadays dynamically typed?-)
<orbitz>
haha
<orbitz>
Drup: btw, I notice you tend to do like `let by_name () = Furl.(...)` Any reason in particular you don't just do `let by_name = Furl.(...)`?
<Drup>
orbitz: have you tried ?
<Drup>
You can try, you will see that it produces lot's of non-generalized type variables and it's annoying
<orbitz>
ahh ok. I have not tried
dhil has joined #ocaml
<orbitz>
Drup: Is the fix a big diff?
<Drup>
No
<Drup>
but as you said, the code is a big tricky :p
<orbitz>
heeh
clog has quit [Ping timeout: 260 seconds]
TheLemonMan has joined #ocaml
richi235 has joined #ocaml
zpe has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Leonidas>
yep, i can see how having clothes makes you a better programmer
<average>
Leonidas: can you elaborate?
<companion_cube>
certainly not, the best programmers don't wear pants and keep their alcohol level precisely at the Ballmer's peak
<Leonidas>
average: for example, if you code at coffee shops, it is useful to wear clothes to keep the background noise lower, thus making it easier to concentrate
slash^ has quit [Read error: Connection reset by peer]
<average>
Leonidas: was that a trial-and-error revelation?
<average>
Leonidas: or was it obvious from the get?
<Leonidas>
companion_cube: what about underwear? or kilts?