<please_help>
I have this code for ocsigen: https://bpaste.net/show/fcc8a1d42fbd I don't see any relevant warnings and there are no errors. Running ocsigen in debugmode shows no extra relevant info (no errors or warning). When the page loads, a Failure at initialize_nat is raised. I get "is the module linked on the client?".
<please_help>
I have a code segment basically taken from the button examples, sometimes it works and sometimes it stops working. I used the same model for this code.
johnf has quit [Ping timeout: 268 seconds]
copy` has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
rom1504 has left #ocaml [#ocaml]
Vintila has joined #ocaml
<please_help>
"Client closure <id> not found"
<please_help>
the relevant code is in [%client ] block in a let%shared-defined widget.
johnf has joined #ocaml
rom15044 is now known as rom1504
Simn has quit [Quit: Leaving]
rom1504 has quit [Quit: WeeChat 1.0.1]
rom1504 has joined #ocaml
johnf has quit [Ping timeout: 240 seconds]
malina has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
ygrek has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
demonimin has quit [Ping timeout: 276 seconds]
johnf has joined #ocaml
johnf has quit [Ping timeout: 268 seconds]
struk|desk is now known as struk|desk|away
<please_help>
is there a way to have the js generated unminimized?
<Algebr`>
--pretty
<Algebr`>
js_of_ocaml --pretty --debug-info
chindy has joined #ocaml
<please_help>
Algebr`: doesn't seem to work (I added the option via -jsopt "--pretty", I still get minimized js)
<Algebr`>
what is -jsopt
<please_help>
option to js_of_eliom to pass whatever is given as argument to js_of_ocaml.
atsampson has joined #ocaml
ygrek has quit [Remote host closed the connection]
chindy has quit [Remote host closed the connection]
ygrek has joined #ocaml
Reshi has joined #ocaml
nicholasf has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 268 seconds]
Vintila has quit [Ping timeout: 276 seconds]
<Drup>
please_help: just change the DEBUG option in the makefile
Vintila has joined #ocaml
Haudegen has joined #ocaml
nicholasf has joined #ocaml
<please_help>
Drup: this does not help with regard to the js, but it does improve the output. Nothing useful so far that I can see, though.
noddy has joined #ocaml
cat5e is now known as sad5e
badon has joined #ocaml
johnf has joined #ocaml
Vintila has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 250 seconds]
<please_help>
I see https://bpaste.net/show/eb6fa02f3e85 on one of the actions (action still commits, but an expected update doesn't happen). It's NOT related to the previous issues I'm having which are not fixed, but is there a way to debug this problem further? A longer stacktrace? Can lwt include line/file info of where a concurrent process that caused the error was started?
<please_help>
Nevermind, this is an application issue related to an item being removed but being further referenced because the page wasn't updated to reflect the removal of the element.
idegen has quit [Quit: Leaving.]
infinity0 has quit [Ping timeout: 260 seconds]
nicholasf has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
yegods has quit [Remote host closed the connection]
nicholasf has joined #ocaml
noddy has quit [Ping timeout: 252 seconds]
johnelse has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
adelbertc has joined #ocaml
Fleurety has quit [Quit: Bah, stupid error messages.]
Fleurety has joined #ocaml
<please_help>
So, there's no way to get non-minimized js output then?
noddy has joined #ocaml
badon has quit [Quit: Leaving]
seungjin has joined #ocaml
seungjin has left #ocaml [#ocaml]
GeorgeHahn has quit [Read error: Connection reset by peer]
copy` has quit [Quit: Connection closed for inactivity]
struk|desk|away is now known as struk|desk
struktured has joined #ocaml
seangrove has quit [Remote host closed the connection]
<douglarek>
but i got error: Error: Syntax error; i am using OCaml 4.02
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 240 seconds]
yegods has quit [Remote host closed the connection]
ggole_ has joined #ocaml
slash^ has joined #ocaml
ggole__ has quit [Ping timeout: 252 seconds]
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 240 seconds]
ibor1 has joined #ocaml
ibor has quit [Ping timeout: 276 seconds]
ggole_ has joined #ocaml
ggole__ has quit [Ping timeout: 248 seconds]
MercurialAlchemi has joined #ocaml
Reshi has quit [Ping timeout: 244 seconds]
douglarek has quit [Ping timeout: 248 seconds]
leyyin has joined #ocaml
struk|desk is now known as struk|desk|away
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 276 seconds]
ggole_ has joined #ocaml
ggole__ has quit [Ping timeout: 240 seconds]
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 260 seconds]
dwillems has joined #ocaml
schive has joined #ocaml
shinnya has joined #ocaml
Reshi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
teknozulu has quit [Ping timeout: 244 seconds]
badon has quit [Quit: Leaving]
mistermetaphor has joined #ocaml
<mistermetaphor>
Hi everyone! Silly question about opam: why is that every time I want to install another package (globally), it will want to uninstall everything else that's not a dependency of said package? Am I doing something wrong?
mistermetaphor has quit [Quit: Leaving]
mistermetaphor has joined #ocaml
mistermetaphor has quit [Client Quit]
mistermetaphor has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
Algebr` has joined #ocaml
MercurialAlchemi has joined #ocaml
dwillems has quit [Ping timeout: 246 seconds]
djellemah_ has quit [Quit: Leaving]
Simn has joined #ocaml
djellemah has joined #ocaml
badon has joined #ocaml
seangrove has joined #ocaml
Algebr` has quit [Remote host closed the connection]
malc_ has joined #ocaml
Reshi has quit [Ping timeout: 268 seconds]
Kakadu has joined #ocaml
<flux>
if only these folks would hang around longer ;)
Algebr` has joined #ocaml
abbiya has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
seangrove has quit [Ping timeout: 250 seconds]
ibor1 has quit [Quit: Leaving.]
Algebr` has quit [Ping timeout: 248 seconds]
mistermetaphor has joined #ocaml
ggole__ is now known as ggole
mistermetaphor has quit [Ping timeout: 268 seconds]
mettekou has joined #ocaml
mettekou has quit [Ping timeout: 260 seconds]
mettekou has joined #ocaml
Vintila has joined #ocaml
larhat has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has quit [Quit: Leaving.]
jgjl has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 248 seconds]
tane has joined #ocaml
yegods has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
adelbertc has quit [Quit: Connection closed for inactivity]
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
Haudegen has joined #ocaml
sad5e is now known as cat5e
Reshi has joined #ocaml
Reshi has quit [Read error: Connection reset by peer]
Reshi has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
mettekou has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Anarchos has joined #ocaml
badon_ has joined #ocaml
darkf has quit [Quit: Leaving]
badon has quit [Disconnected by services]
badon_ is now known as badon
mettekou has joined #ocaml
seangrove has joined #ocaml
schive has quit [Quit: Leaving]
seangrove has quit [Ping timeout: 276 seconds]
<Anarchos>
hi everybody
samae has left #ocaml ["WeeChat 1.3"]
mistermetaphor has joined #ocaml
mistermetaphor has quit [Ping timeout: 264 seconds]
abbiya has quit [Ping timeout: 252 seconds]
julien_t has joined #ocaml
aantron has quit [Remote host closed the connection]
Reshi has quit [Ping timeout: 264 seconds]
aantron has joined #ocaml
Reshi has joined #ocaml
Reshi has quit [Ping timeout: 244 seconds]
hnagamin has joined #ocaml
dsheets has joined #ocaml
abbiya has joined #ocaml
seshachalam_ has joined #ocaml
lokien_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
idegen has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ggole__ has joined #ocaml
ggole__ is now known as ggole
ggole_ has quit [Ping timeout: 244 seconds]
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pierpa has joined #ocaml
mettekou has joined #ocaml
dsheets_ has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
ggole_ has joined #ocaml
yegods has quit [Remote host closed the connection]
ggole has quit [Ping timeout: 252 seconds]
seangrove has joined #ocaml
Vintila has quit [Ping timeout: 252 seconds]
seangrove has quit [Ping timeout: 276 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
struk|desk|away is now known as struk|desk
Haudegen has quit [Ping timeout: 276 seconds]
nicholasf has quit [Client Quit]
yegods has joined #ocaml
copy` has joined #ocaml
dhil has joined #ocaml
seangrove has joined #ocaml
<flux>
hello!
<companion_cube>
world
larhat has joined #ocaml
<please_help>
managed to get the javascript unminimized: adding the --pretty option twice (once implicitly via debug, once explicitly) disabled --pretty altogether. Unfortunately, I don't see anything useful for debugging and the call trace isn't very informative.
mistermetaphor has joined #ocaml
<Maelan>
someone knows why « #load "/abs/path/to/zarith.cma" » in a script file does not work (i get « unbound module Z »)?
yegods has quit [Remote host closed the connection]
<Maelan>
i had to do « Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") ;; #use "topfind" ;; #require "zarith" ;; »
tane has quit [Quit: Verlassend]
hnagamin has quit [Ping timeout: 248 seconds]
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yegods has joined #ocaml
struk|desk is now known as struk|desk|away
Haudegen has joined #ocaml
chindy has joined #ocaml
<flux>
maelan, #load only brings in code, not the symbols
Anarchos has joined #ocaml
<flux>
maelan, for ocaml compiler/toplevel to know about the symbols (ie. Z) it must know where the .cmi files are
<flux>
maelan, that's what the #require ends up doing (in addition to loading the .cma)
<flux>
so #directory "/abs/path/to/zarith" would also have helped
<flux>
however I prefer using topfind, it works in all scenarios
<Maelan>
indeed flux, thanks
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<Maelan>
(except that there is no .cmi for zarith, only .cm{a,xa,xs}, but apparently this is enouf)
<flux>
there is z.cmi
<flux>
(so the z in z.cmi means the module Z)
<Maelan>
ah, of course ^^ (i did « locate zarith.cm »)
<flux>
so basically if you want to access a module Foo, you need to have foo.cmi. unless of course you have already opened some other module that has the Foo module inside it.
<Maelan>
by the way, why is there no #load equivalent for interfaces?
<please_help>
With ocsigen I have an expression of the form: "let%server map_it x = List.map (fun x -> x) x", and I want to inject this function for a call in client code like "let%client ... = ... (~%map_it some_list) ...". However, this gives me ocsigenserver.opt: ocsigen:main: Exn during page generation (sending 500): Failure("cannot wrap functional values")
<flux>
perhaps it was deemed excessive when there is the directory-based search already?
<flux>
please_help, I guess defining map_it as let%client is not suitable for you? not that I know that much about eliom..
<Drup>
please_help: see the section about rpc/server functions
struk|desk|away is now known as struk|desk
julien_t has quit [Ping timeout: 252 seconds]
<mistermetaphor>
What is the proper way to install opam on OS X these days? I did `brew install opam` but now I get `mktemp: illegal option -- -` followed by `[WARNING] '/usr/local/bin/aspcud $in $out $pref' failed with End_of_file` when I try to do anything. The only reference I found is this https://github.com/ocaml/opam/issues/1074 issue from 2014. OPAM itself doesn't seem to properly work as every time I try to install a
<mistermetaphor>
package it will propose to remove a bunch of other packages.
seangrove has quit [Ping timeout: 260 seconds]
<please_help>
flux: no, I'm accessing server functions in the non-reduced case, and I get the same error when injecting these functions inside the mapping function. Drup: http://ocsigen.org/howto/rpc ? This doesn't seem to describe the syntax for ppx, but otherwise from what I can tell it's the same as what I'm doing...
<Drup>
please_help: you can't inject functions, use rpc/server_functions ...
seangrove has joined #ocaml
<please_help>
what's the syntax with the derive.json for functions that take multiple arguments?
yegods has quit [Remote host closed the connection]
<Drup>
please_help: you must curry :)
lokien_ has quit [Quit: Connection closed for inactivity]
dhil has quit [Ping timeout: 248 seconds]
<please_help>
does server_function return an object that can be server_function'd?
yegods has joined #ocaml
<Drup>
I'm not sure what that means
<Drup>
oh, no, just use tuples if you want multiple arguments
<please_help>
ok
<please_help>
and what's the correct type for the parameter of a postgresql db handle?
<please_help>
('a Db.t: what is the correct 'a?)
larhat has quit [Quit: Leaving.]
<Drup>
I don't know much about postgresl, sorry
<please_help>
via pgocaml*
larhat has joined #ocaml
psnively has joined #ocaml
chindy has quit [Remote host closed the connection]
<struk|desk>
please_help: did you look at connect function?
<psnively>
Happy Easter everyone! Are there any oasis internals mavens around, by any chance?
<struk|desk>
please_help: I think it's opaque on purpose. eg.. here's how to open and close the conn w/o caring about the type of 'a : let f () = PGOCaml.bind (PGOCaml.connect ()) (PGOCaml.close);;
<please_help>
It looks like the type when using pa_pg_ocaml is (string, bool) Hashtbl.t but nothing is said of the type when not using pa_pg_ocaml. Anyway, it has no to_json defined, so how do I pass the dbh as an argument to the shared function through to the server as an argument to a server_function?
julien_t has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
d0nn1e has quit [Ping timeout: 248 seconds]
d0nn1e has joined #ocaml
<please_help>
(and why is this so complicated anyway?)
seangrove has quit [Ping timeout: 240 seconds]
mettekou has quit [Read error: Connection reset by peer]
mettekou has joined #ocaml
<flux>
how would the javascript make use of the handle anyway.. it would need to pass it back to the server to do anything with it, and because it was in the ownership of the client, it seems like security might be an issue here
<flux>
the reason why this is complicated is because it's distributed programming :)
<mrvn>
Just get a random int64, add the handle into a hashtbl with the random int64 as key and send the key to the client.
<Drup>
please_help: because you are trying to give things to the client that can't be represented there
<Drup>
you can't magically pass function, you can't give db handles, that just doesn't make much sense
<Drup>
So, you do the reasonable thing. You create a function on the server that does what you want and you expose is to the client via RPC.
<mrvn>
Drup: "you can't magically pass function" isn't that what javascript does? :)
<mrvn>
/is
<please_help>
I'm not trying to give the handle to the js, I'm trying to give it to the server. The dbh cannot be in global scope due to pgocaml's behavior so it has to be passed around. The js is modifying the layout by making a query to the database via a server function.
<Drup>
" The dbh cannot be in global scope" <- are you really sure ?
<flux>
please_help, due to pgocaml's behavior you mean its type?
zarul has quit [Ping timeout: 264 seconds]
<please_help>
yeah, the type variable of the db handle cannot be resolved unless the connect function is called within a scope, even if the scope is completely empty. I don't really understand why or how, but it's considered "expected behavior".
struk|desk is now known as struk|desk|away
anoisz has quit [Read error: Connection reset by peer]
idegen has left #ocaml [#ocaml]
shinnya has quit [Ping timeout: 252 seconds]
<Drup>
can you show that ? Because I fail to understand how that can happen
<please_help>
in practice, the only real-world context where the compiler was able to complete the type was the one where the database was opened inside a scope. No matter the kind of requests and manipulations.
<Drup>
please_help: just add a .mli where the db is not exposed
<Drup>
or expose it, with the type fully annoted
<please_help>
Is the correct type for the annotation the same as in the pa_pgocaml case?
lokien_ has joined #ocaml
mettekou has quit [Ping timeout: 252 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<Drup>
No idea, I don't know about pgocaml's typing, your issue is a classical OCaml problem (see the linked RWO chapter)
yegods has quit [Remote host closed the connection]
<seangrove>
I think there's a problem because dispatch.ml (a single file name) shows up in both my source tree any somewhere in Webmachine
<seangrove>
Is that possible? That seems totally crazy
yegods has joined #ocaml
<seangrove>
seliopou: Any idea for ^
<seangrove>
?
<Drup>
clean/recompile ?
<seangrove>
Same
Sorella has joined #ocaml
struk|desk|away is now known as struk|desk
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<seangrove>
So is it possible that because https://github.com/sgrove/riseos/blob/master/dispatch.ml is named dispatch.ml and I'm trying to use ocaml-webmachine, which has a dependency on https://github.com/inhabitedtype/ocaml-dispatch, which has a file named dispatch.ml (which is obviously different from my dispatch.ml) that I would then get the error: `The files /Users/s/.opam/riseos/lib/webmachine/webmachine.cmi and dispatch.cmi make inconsistent
<seangrove>
assumptions over interface Dispatch` ?
<seangrove>
Does every file name have to be globally unique, even against the possibility that some package I transitively install might have a file somewhere with the same name?
<flux>
seangrove, yes, ocaml has a single namespace. usually packages get around it by packing their all code into some slightly more unique name than Dispatch
<seangrove>
If you're working on a big project, and you install e.g. dispatch and there's a name conflict, how do you get around it?
<flux>
seangrove, rename your module :)
<seangrove>
Ah, fs
<flux>
seangrove, or patch ocaml-dispatch, or file a bug report and wish for the best
<seangrove>
ffs
<malc_>
flux: a.ml include b A.b
<seangrove>
flux: So thre's no way to handle badly-behaving modules?
<malc_>
A.B rather
<malc_>
and it was meant for seangrove not flux
xapantu has quit [Quit: WeeChat 1.0.1]
<flux>
apparently there is, I don't quite get what malc_ is suggesting ;). does it really solve the issue?
<flux>
there have been discussions about how to implement namespacing in OCaml, but it seems they have petered out. it seems there are two schools of thought: use compiler switches for providing them (providing maximal backwards-compatibility), or that they should be added as a language feature
<Drup>
seangrove: pack your modules, but
<Drup>
it doesn't help much here
mettekou has joined #ocaml
<seangrove>
Drup: I guess "rename my module" is the only solution :(
<seangrove>
OCaml has some serious warts when considering using it for real-world stuff...
<flux>
I guess the problem is that those problems pop up so rarely with well-behaving packages that it's not considered really a priority
<flux>
C does just fine with a single shared namespace ;)
yegods has quit [Remote host closed the connection]
<Drup>
seangrove: I would yell at seliopou, honestly
<Drup>
dispatch is young enough that it can be renamed
<flux>
Dispatch is just an awfully generic module name to provide
<flux>
though I get that it does seem like the 'obvious' one given the package is called ocaml-dispatch, OCamlDispatch would seem a bit redundant as well.. ;)
<flux>
Spiros'UriDispatcher ;)
seangrove has quit [Remote host closed the connection]
<Kakadu>
Drup: Do you know any attempts to embed jsoo_mktop into ocamlbuild?
seangrove has joined #ocaml
seangrov` has joined #ocaml
seangrov` has quit [Remote host closed the connection]
seangrove has quit [Remote host closed the connection]
<Drup>
kakadu: yes, one, you :D
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<please_help>
how can I extract a value returned from a terminated lwt thread as in "let fn x = Lwt.return x" "extract (fn 3)" (expecting simply 3 : integer instead of whatever : inter Lwt.t)
yegods has joined #ocaml
Algebr` has joined #ocaml
malc_` has joined #ocaml
<ggole_>
please_help: you can use Lwt.state, but more commonly you would use bind to create a thread that continues with the return value once it is available
malc_ has quit [Ping timeout: 244 seconds]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
seangrove has joined #ocaml
seshachalam_ has quit [Remote host closed the connection]
abbiya has quit [Remote host closed the connection]
malc_` has quit [Remote host closed the connection]
seangrove has quit [Ping timeout: 268 seconds]
struk|desk is now known as struk|desk|away
seangrove has joined #ocaml
noddy has joined #ocaml
jgjl has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
seangrove has quit [Remote host closed the connection]
adelbertc has joined #ocaml
seangrove has joined #ocaml
yegods has quit [Remote host closed the connection]
<please_help>
ggole_: Lwt.state yields a Lwt.state-typed object, not the object itself.
<ggole_>
One of the possibilities is a constructor containing a return value.
seangrove has quit [Remote host closed the connection]
<Algebr`>
what the hell? (pyon [~pyon@unaffiliated/pyon] has quit irc [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D, 13),
<Algebr`>
from the first one
seangrove has joined #ocaml
<pyon>
Algebr`: ?
<pyon>
AlexRussia: It was meant to be “2D < 3D”. Maybe I made a typo.
<pyon>
Algebr`: *
<pyon>
Sorry AlexRussia.
<AlexRussia>
pyon: 2D < 3D?
<pyon>
Errr, “2D > 3D”
<AlexRussia>
pyon: why?
<AlexRussia>
pyon: are you about dimensions?
<pyon>
It's a joke. :-|
<AlexRussia>
...
<AlexRussia>
I suck in math :/
<pyon>
Me too!
<AlexRussia>
pyon: so what is the joke about?
<ggole_>
timewasting_cube: you'd better work harder to catch up to Drup
<ggole_>
He's far ahead of us all.
<pyon>
AlexRussia: About someone preferring the “2D world” (anime) over the “3D world” (real life). Anyway, this is off-topic. :-|
<Algebr`>
timewasting_cube haha.
<AlexRussia>
pyon: oh, nice joke, I'll remember it :)
<AlexRussia>
pyon: know few people who match the equalation :)
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<AlexRussia>
pyon: thank you for annoying :))))
<pyon>
:-p
larhat has quit [Quit: Leaving.]
mistermetaphor has quit [Remote host closed the connection]
larhat has joined #ocaml
djellemah has quit [Quit: Leaving]
mistermetaphor has joined #ocaml
djellemah has joined #ocaml
yegods has joined #ocaml
<Drup>
companion_cube: is this in words or in messages ?
<companion_cube>
in messages
<Drup>
Can you count in words ?
<companion_cube>
hmmmmmm
<companion_cube>
it's mor ework :p
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
<please_help>
if there's no way to extract Lwt-wrapped values, is there a way for server_function not to require a Lwt.t-returning function?
<ggole_>
b
<ggole_>
u
<ggole_>
m
<ggole_>
o
<ggole_>
There we go, I'm winning!
<ggole_>
(Except at spelling.)
<Algebr`>
Lwt.ignore_result?
<Drup>
please_help: simplify your life, use lwt everywhere
wiredsister has joined #ocaml
larhat has quit [Quit: Leaving.]
dsheets_ has quit [Remote host closed the connection]
mistermetaphor has quit [Remote host closed the connection]
larhat has joined #ocaml
<please_help>
I can't do that. I have a function which takes an X as an optional parameter and returns a Y. Unless you're telling me to rewrite every ocaml library, that's not an option.
<Drup>
Use Lwt.bind and Lwt.map for that
<Drup>
(also named >>= and >|=
hunteriam has joined #ocaml
<please_help>
Now I'm starting to wonder why async isn't the preferred concurrency solution
dsheets has joined #ocaml
<Drup>
please_help: it would be exactly the same in async
<please_help>
async has peek which allows waiting on the result to actualize and then extracting the real value
<Drup>
You mean active wait ? That's such a terrible idea ...
<please_help>
better than literally nothing
dsheets has quit [Ping timeout: 240 seconds]
<Drup>
There is Lwt.state, but nobody should use it for that ...
<please_help>
I couldn't get Lwt.state to give me the actual value as opposed to a state object that wraps the value. Did I miss something?
<Drup>
You looked at the definition of state ?
<please_help>
Ah, I see, thanks
<Drup>
No seriously, don't use it for that, what are you actually trying to do ?
<ggole_>
please_help: if you are sure that the thread has finished, you can use pattern matching on a state value to get the result out. If you aren't sure, using Lwt.state is not the right thing to do (bind, etc)
<please_help>
Yeah, thanks ggole_, I should've checked the type definition of state sooner.
malina has joined #ocaml
larhat has quit [Quit: Leaving.]
<please_help>
(thanks drup for making me check).
julien_t has quit [Ping timeout: 248 seconds]
JacobEdelman_ has joined #ocaml
dsheets has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
larhat1 has joined #ocaml
djellemah_ has joined #ocaml
larhat1 has quit [Read error: Connection reset by peer]
struktured has quit [Ping timeout: 260 seconds]
wiredsister has quit [Ping timeout: 248 seconds]
dsheets has quit [Ping timeout: 248 seconds]
dsheets has joined #ocaml
larhat1 has joined #ocaml
dsheets has quit [Remote host closed the connection]
larhat1 has quit [Ping timeout: 246 seconds]
mettekou has joined #ocaml
yegods has quit [Remote host closed the connection]
<flux>
ocaml effects (&multicore) are going to save us from the ire of monads for threading! praise the camel!
<companion_cube>
yeah! praise the camel!
<flux>
I wonder if the effect system would be applicaple for implementing other problems solved by monads. seems to me it would.
Algebr` has quit [Remote host closed the connection]
<flux>
though the problem is that deep down it's just as dynamic as exceptions
<flux>
but dynamic is good? webscale?
<zozozo>
flux: any idea on when effects are coming ?
slash^ has quit [Read error: Connection reset by peer]
<companion_cube>
flux: doesn't look to me like it could replace error/option monads
<companion_cube>
could, or should
<flux>
I think they go hand-in-hand with multicore, and there's certainly some effort in making that happen
<flux>
companion_cube, I think it could, basically it would just look like a thread can gets cancelled on error?
<flux>
s/can/that/
<companion_cube>
hu
<flux>
though I'm not sure what benefit there would be compared to traditional exceptions
<companion_cube>
I meant, to compose options or results
<companion_cube>
not to fail like exceptions
ggole_ has quit []
<flux>
I recall an alpha multicore release is announced to be available some time after 4.03.0 release is made
<flux>
(4.03.0 beta has been released so far, but I haven't tried it though I would have liked, because soooo many opam packages for whatever reason like to say they work only with <4.03.0)
<flux>
it's good that ocaml now gets faster when multicore is undoubtedly going to cost some performance ;)
<companion_cube>
really?
<companion_cube>
more than a few percents?
<flux>
I don't remember the numbers, but there were some preliminary numbers.. certainly less than 10%, but iirc it seemed significant
<flux>
depends what the code does I think
<flux>
but it's perhaps a bit too early to talk about performance when there's no release out
<flux>
I mean, to get it really working it might even cost more performance, and on the other hand when it's working some effort is probably put in to optimize it further
mistermetaphor has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
<companion_cube>
well if it makes the singlecore too slow, it won't be merged
badon_ is now known as badon
<flux>
I guess it might be possible to disable/enable at compile time
<flux>
not unlike ocamlc/ocamlopt maybe
<please_help>
Wasn't one of the major reasons multicore was delayed so much that previous solutions tended to reduce single-threaded performance?
<companion_cube>
I don't think so
<companion_cube>
the runtime changes quite a lot
<flux>
I bet there is NO solution that will not hinder single-core peformance, the question is how small the impact can be made
<companion_cube>
please_help: that's possible
<companion_cube>
yeah yeah
<companion_cube>
I think if it's a few percents, it might fly
<flux>
in any case, let's ask this question: if you have a cpu-bound large problem, how likely do you want to run it on one core only?
<flux>
and the shared memory/sending messages approaches aren't free either
<flux>
only microcontrollers these days come in single-core.
<companion_cube>
let's rephease: if you have a cpu-bound large problem that no one knows how to parallelize... ?
<companion_cube>
which is the case of a LOT of OCaml programs, at least in research
<companion_cube>
good luck parallelizing significantly a theorem prover
<flux>
sounds like a great place to do some parallel tree searching to me*
<companion_cube>
nah
<flux>
*I have never written a theorem prover ;)
<companion_cube>
the real algorithms are really intricate and have lots of global invariants
<companion_cube>
it's very difficult to even parallelize a SAT solver
<flux>
but parallelizing it would certainly be interesting
<flux>
and have potentially great benefits
<companion_cube>
it's open research
<companion_cube>
no one knows how to do it
<flux>
na-ah, "Several parallel SAT solvers have been proposed in the past few years" says google ;)
<companion_cube>
well strangely, afaik, the top sovlers inthe competition aren't parallel
<companion_cube>
so it's still really research
<flux>
are the top solvers written in ocaml?
<companion_cube>
and when you go to more expressive logics it gets much worse
<companion_cube>
no, they are in C++ :D
<companion_cube>
or C
<flux>
tadah..
<companion_cube>
which means that if they could be parallelized, they would
<flux>
ocaml is for nice performance with static safety, not for suberb performance at any cost ;)
<companion_cube>
sure
<companion_cube>
I'd like to have multicore, but not if it slows my sequential programs too much
<fds>
Don't you think there are research grants in those parallelisation projects? :-)
<companion_cube>
I'm not sure
<companion_cube>
I mean, it's hard enough looking for funding in provers
<flux>
I bet there's some grants in making GPUs suitable for SAT solving ;)
<companion_cube>
parallelizing Coq could be interesting
<companion_cube>
flux: meh.
<companion_cube>
GPUs are quite weak for this kind of problem
<companion_cube>
requires too much memory, recursion (or at least complicated control structures....)
Algebr` has joined #ocaml
<flux>
and you know all this for sure without taking a team and a year to study it! I'll take your word for it ;)
<companion_cube>
bah
<companion_cube>
GPUs are only good for matrix-like stuff
<flux>
apparently GPUs can branch nowadays
<flux>
btw, there was also this one team that did routing/firewalling on a GPU, seemed like a novel concept