adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<whoman> hm
nomicflux has joined #ocaml
nomicflux has quit [Quit: nomicflux]
orbifx1 has quit [Ping timeout: 264 seconds]
spew has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
shinnya has joined #ocaml
infinity0 has quit [Ping timeout: 248 seconds]
infinity0 has joined #ocaml
<rntz> is there any way of getting either ocamlyacc or menhir to emit useful error messages on shift/reduce or reduce/reduce conflicts?
<rntz> something that gives useful info on how to fix the problem?
<rntz> also, are there are any other parser-generator or parser-combinator tools for ocaml? I've found aurochs (PEG-based) and dypgen (GLR-based), both of which seem quite out of date.
pierpa has joined #ocaml
atchoum has quit [Ping timeout: 268 seconds]
Haudegen has quit [Remote host closed the connection]
cbot has quit [Ping timeout: 248 seconds]
silver has quit [Read error: Connection reset by peer]
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
cbot has joined #ocaml
<companion_cube> with menhir, there are options to print the automaton and/or conflicts
<companion_cube> --explain
govg has quit [Ping timeout: 276 seconds]
spew has quit [Read error: Connection reset by peer]
ohama has quit [Ping timeout: 256 seconds]
demonimin has quit [Ping timeout: 252 seconds]
demonimin has joined #ocaml
demonimin has joined #ocaml
mfp has quit [Ping timeout: 265 seconds]
opios has quit [Ping timeout: 264 seconds]
opios has joined #ocaml
ohama has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
shinnya has quit [Ping timeout: 248 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
govg has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 248 seconds]
jao has quit [Ping timeout: 248 seconds]
demonimin has quit [Ping timeout: 240 seconds]
pierpa_ has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
spew has joined #ocaml
demonimin has joined #ocaml
demonimin has joined #ocaml
mbuf has joined #ocaml
spew has quit [Read error: Connection reset by peer]
demonimin has quit [Ping timeout: 240 seconds]
pierpa_ has quit [Quit: Page closed]
demonimin has joined #ocaml
demonimin has joined #ocaml
MercurialAlchemi has joined #ocaml
cbot has quit [Quit: Leaving]
philtor has quit [Ping timeout: 240 seconds]
sapristi has joined #ocaml
mk9 has joined #ocaml
sapristi has quit [Ping timeout: 252 seconds]
<Fardale> octachron, Drup: thanks
sapristi has joined #ocaml
banjiewen has quit [Ping timeout: 256 seconds]
jyc has quit [Read error: Connection reset by peer]
grandy_____ has quit [Read error: Connection reset by peer]
banjiewen has joined #ocaml
jyc has joined #ocaml
grandy_____ has joined #ocaml
dxtr has quit [Quit: leaving]
zpe has joined #ocaml
AltGr has joined #ocaml
cuicui has joined #ocaml
dxtr has joined #ocaml
lopex has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
dr_toboggan has joined #ocaml
argent_smith has joined #ocaml
orbifx1 has joined #ocaml
mk9_ has joined #ocaml
mk9 has quit [Ping timeout: 240 seconds]
mk9_ is now known as mk9
nicoo has quit [Ping timeout: 255 seconds]
BitPuffin has joined #ocaml
antismap has quit [Ping timeout: 248 seconds]
zpe_ has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
mk9 has quit [Quit: mk9]
antismap has joined #ocaml
mk9 has joined #ocaml
dhil has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
mfp has joined #ocaml
mk9 has quit [Ping timeout: 252 seconds]
nicoo has joined #ocaml
zpe_ has quit [Remote host closed the connection]
zpe has joined #ocaml
<_xvilka_> hi
<_xvilka_> I have functions like this https://pastebin.com/9t8tzLnE
<_xvilka_> to do different sql queries and receive results
<_xvilka_> I wonder, is it possible to abstract them away somehow? I see too much code duplication for every single request
<_xvilka_> basically only code of the forming SQL query and code of storing the results inside "if res#ntuples <> 0 then ( ... )"
<_xvilka_> and also return is also changed
zpe has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
mengu has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
mk9 has joined #ocaml
nullifidian has quit [Remote host closed the connection]
mk9 has quit [Remote host closed the connection]
tetsuo-cpp has joined #ocaml
mpenet has joined #ocaml
mpenet has quit [Client Quit]
mk9 has joined #ocaml
nullifidian has joined #ocaml
mpenet has joined #ocaml
mpenet has left #ocaml [#ocaml]
Haudegen has joined #ocaml
kakadu has joined #ocaml
tetsuo-cpp has quit [Quit: Leaving]
ziyourenxiang has joined #ocaml
mk9_ has joined #ocaml
rgrinberg has quit [Ping timeout: 263 seconds]
mankyKitty has quit [Ping timeout: 263 seconds]
mk9 has quit [Ping timeout: 260 seconds]
mk9_ is now known as mk9
<_xvilka_> seems that cppo is my best option
_andre has joined #ocaml
<_xvilka_> no, it seems cppo can't get blocks of the code as an arguments, unline C-style preprocessor
<octachron> _xvilka_, would you mind giving two datapoints from your set of functions? Extrapolating similarities and differences from one datapoint requires quite a bit of creativity
<_xvilka_> octachron: sure, 1s
<_xvilka_> octachron: here it is https://pastebin.com/vzaQSmj0
shinnya has joined #ocaml
<reynir> aren't there libraries for manipulating sql statements instead of concatenating strings?
<theblatte> there's sqlexpr
<_xvilka_> reynir: there are ORMs, but I have also some long JOINS and some postgresql-specific internal machinery, so will not work for 50% of those functions
<octachron> _xvilka_, possibility: pass as arguments the sql statement and the action on tuple (i.e. "fun tpl -> rid := Int64.of_string tpl.(0)" in the first example and "fun tpl -> rversions := List.append !rversions [tpl.(0)];" in the second)
<_xvilka_> octachron: yes, but how to connect then action on tuple and return point of the function?
mbuf has quit [Quit: Leaving]
<_xvilka_> (speaking about ORMs - I really liked this one: https://github.com/andrenth/sequoia )
<andrewalker> I expect this to be a recurring question, but I can't find an answer online... Do people write web services in ocaml? If so, what is recommended? ocsigen, cohttp?
<andrewalker> I'm just playing with it, and I'm curious :)
<_xvilka_> andrewalker: check also opium as a lightweight solution, maybe with BuckleScript for the frontend
<andrewalker> _xvilka_: nice!
orbifx1 has quit [Quit: WeeChat 2.0.1]
jimmyrcom has quit [Ping timeout: 248 seconds]
<_xvilka_> something like monad probably, but there is code in between, so no "channels" like in Go, and also not sure how to make one when one of the function runs multiple times in a loop
<octachron> _xvilka_, depending on your need, you could expose the tuple action as "'a ref -> string array -> unit" and passes the initial value as an argument
<_xvilka_> octachron: aha, ok, thanks, will try to cook something from what you said
spew has joined #ocaml
<Leonidas> andrewalker: I used webmachine.
<andrewalker> Leonidas: cool, I've seen webmachine in other languages, it's a cool concept. Although I haven't used it yet in real world :)
dhil has quit [Ping timeout: 276 seconds]
spew has quit [Read error: Connection reset by peer]
mk9 has quit [Quit: mk9]
mk9 has joined #ocaml
silver has joined #ocaml
<_xvilka_> oh, noticed that Erlang is too similar to Prolog, after checking the sources of that Webmachine thing
jao has joined #ocaml
<dxtr> I like the Prolog syntax
<dxtr> Disclaimer: I am actually writing Erlang right now
jbrown has quit [Ping timeout: 256 seconds]
<reynir> "too similar" ?
<_xvilka_> reynir: it is the first time I see Erlang program
zpe has joined #ocaml
<_xvilka_> and Prolog... you know, it is a thing of its own. Never expected to see something like that outside of the *log world
DM2 has joined #ocaml
<andrewalker> I found an interesting bug somewhere in the stack of webmachine. Not sure exactly where.
<andrewalker> curl -H'Accept: asdf' -v localhost:8080
<andrewalker> this breaks the server with an unhandled exception :)
<andrewalker> I was playing with the hello_async.ml example
<andrewalker> It says: "Raised at file \"parsing.ml\", line 138, characters 8-25", but I don't know where that file is... It's not on webmachine distribution apparently.
mankyKitty has joined #ocaml
rgrinberg has joined #ocaml
letoh has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
govg has quit [Ping timeout: 256 seconds]
Denommus has joined #ocaml
govg has joined #ocaml
infinity0 has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
antismap has quit [Ping timeout: 252 seconds]
<reynir> andrewalker: what version of cohttp? I think it's in cohttp tbh
<andrewalker> reynir: makes sense. Probably latest, I installed it today. Let me check.
<andrewalker> 1.0.2
<reynir> ok thanks
<reynir> Yes, this triggers it »Cohttp.Accept.media_ranges (Some "asdf")«
<andrewalker> right!
dhil has joined #ocaml
antismap has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
aciniglio has joined #ocaml
orbifx has joined #ocaml
mk9 has quit [Quit: mk9]
mk9 has joined #ocaml
aciniglio has quit [Remote host closed the connection]
jfntn has joined #ocaml
FreeBirdLjj has joined #ocaml
aciniglio has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
baboum has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jao has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
mengu has quit [Quit: Leaving...]
sapristi has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
dhil has quit [Ping timeout: 268 seconds]
zolk3ri has quit [Quit: leaving]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
Jesin has joined #ocaml
zolk3ri has joined #ocaml
zpe has joined #ocaml
barcabuona has quit [Quit: WeeChat 2.0.1]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dhil has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
orbifx has left #ocaml [#ocaml]
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
Haudegen has quit [Read error: Connection reset by peer]
barcabuona has joined #ocaml
Haudegen has joined #ocaml
zpe has joined #ocaml
zpe_ has quit [Ping timeout: 240 seconds]
zpe has quit [Remote host closed the connection]
baboum has quit [Quit: WeeChat 2.0.1]
ziyourenxiang has quit [Ping timeout: 240 seconds]
cuicui has quit [Quit: leaving]
philtor has joined #ocaml
cbot has joined #ocaml
al-damiri has joined #ocaml
tonyle has joined #ocaml
AltGr has left #ocaml [#ocaml]
tonyle has quit [Client Quit]
dhil has quit [Ping timeout: 248 seconds]
mk9 has quit [Ping timeout: 248 seconds]
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
shinnya has joined #ocaml
jnavila has joined #ocaml
Jesin has quit [Quit: Leaving]
iitalics has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 255 seconds]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<whoman> by a doctor! =P
<octachron> You mean a medical one?
<whoman> not sure.. arent scientists doctors? i guess anyone with a PhD
troydm has joined #ocaml
chaosite has quit [Ping timeout: 260 seconds]
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #ocaml
shinnya has quit [Ping timeout: 268 seconds]
cbot has quit [Quit: Leaving]
jnavila has joined #ocaml
cbot has joined #ocaml
jnavila has quit [Remote host closed the connection]
jnavila has joined #ocaml
<octachron> whoman, yes doctor is the academic title granted by the completion of a Ph.D, I was merely surprised by your surprise
<reynir> here you're not allowed to call yourself doctor with only a ph.d. unless the ph.d. was done abroad
<reynir> (here <- Denmark)
ianconnolly has quit [Ping timeout: 265 seconds]
al-damiri has quit [Ping timeout: 252 seconds]
ianconnolly has joined #ocaml
terrorjack has quit [Ping timeout: 276 seconds]
kakadu has joined #ocaml
jack5638 has quit [Ping timeout: 256 seconds]
al-damiri has joined #ocaml
<whoman> octachron, sarcasm =)
terrorjack has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
nicoo has joined #ocaml
jack5638 has joined #ocaml
jimmyrcom has joined #ocaml
_andre has quit [Quit: leaving]
jnavila has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
argent_smith has quit [Quit: Leaving.]
nullifidian has quit [Ping timeout: 240 seconds]
nullifidian has joined #ocaml
shinnya has joined #ocaml
cschneid_ has joined #ocaml
cbot has quit [Ping timeout: 256 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
jimmyrcom has quit [Read error: Connection reset by peer]
zpe has quit [Ping timeout: 248 seconds]
orbifx has joined #ocaml
<kakadu> let's say that we are implementing ppx library a la ppx_deriving and we simplify OCaml parsetree to our own mini parsetree where only `interesting` information is present
<kakadu> It will automatically create a stage where we filter out pieces of OCaml parsetree that are not supported by rewriter
<kakadu> And simlify creating rewriter because the tree is more simple and short
<kakadu> Why this approach is wrong?
<kakadu> (obvious idea is that in future out own type will be very similar ot the original parsetree but ... will it?)
<Drup> You can't simplify the tree all that much in practice
<Drup> you might as well use omp
<kakadu> basically you say that OCaml parsetree is not complex enough to make it annoying to traverse?
<Drup> oh, it is
<kakadu> Using omp is an orthogonal question, isn't it?
<Drup> it's just that you might need quite a bit of information for a deriving plugin
atchoum has joined #ocaml
jimmyrcom has joined #ocaml
jnavila has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
iitalics has quit [Ping timeout: 256 seconds]
iitalics has joined #ocaml
jnavila has quit [Remote host closed the connection]
cbot has joined #ocaml
reynir has quit [Read error: Connection reset by peer]
reynir has joined #ocaml
dtornabene has joined #ocaml
rks` has quit [Ping timeout: 240 seconds]
rks` has joined #ocaml
<rntz> companion_cube: thanks, --explain was helpful!
<rntz> unfortunately it looks like I need to either change my grammar so it's LALR, or find a more general parsing tool :(
<thizanne> rntz: I guess you're speaking of menhir, in which case you don't need to be LALR, only LR(1)
<rntz> LALR is more expressive than LR(1), I thought?
<rntz> in any case, menhir does not accept my grammar
<rntz> it gives me reduce/reduce conflicts, and I don't see any way to fix it without being very clever.
<rntz> oh, apparently LR(0) < LALR < LR(1)
<thizanne> be clever then, doesnt seem like a drawnack
shinnya has quit [Ping timeout: 256 seconds]
<rntz> I hate being clever.
<rntz> (and it'll make the error messages worse, probably)
leah2 has quit [Ping timeout: 256 seconds]
sonologico has quit [Ping timeout: 240 seconds]
sonologico has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
engil1 has quit [Ping timeout: 240 seconds]
leah2 has joined #ocaml
engil1 has joined #ocaml
kektrain__ has joined #ocaml
kektrain__ has left #ocaml ["iяс.sцреяиетs.ояg сни sцреявоwl"]
aciniglio has quit [Ping timeout: 252 seconds]
sillyotter has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
orbifx has left #ocaml [#ocaml]
nicoo has joined #ocaml
jimmyrcom_ has joined #ocaml
kakadu has quit [Remote host closed the connection]
sh0t has joined #ocaml
sillyotter has quit [Quit: WeeChat 1.9.1]