adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
manizzle has quit [Ping timeout: 240 seconds]
manizzle has joined #ocaml
wtetzner has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 268 seconds]
nomicflux has joined #ocaml
wtetzner has joined #ocaml
tobast1 has quit [Ping timeout: 240 seconds]
bungoman has joined #ocaml
nomicflux has quit [Quit: nomicflux]
wtetzner has quit [Remote host closed the connection]
nomicflux has joined #ocaml
manizzle has quit [Ping timeout: 268 seconds]
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
johnelse has joined #ocaml
manizzle has quit [Ping timeout: 260 seconds]
nomicflux has quit [Quit: nomicflux]
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
spew has quit [Read error: Connection reset by peer]
sepp2k has quit [Ping timeout: 240 seconds]
manizzle has joined #ocaml
silver has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
fraggle_ has quit [Ping timeout: 240 seconds]
fraggle_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
mfp has quit [Ping timeout: 246 seconds]
Jaxan has quit [Ping timeout: 255 seconds]
FreeBirdLjj has joined #ocaml
Jaxan has joined #ocaml
pilne has quit [Quit: Quitting!]
bbc has quit [Ping timeout: 264 seconds]
bbc has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
ryanartecona has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
ryanartecona has quit [Quit: ryanartecona]
al-damiri has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
louisriesener has quit [Ping timeout: 240 seconds]
mal`` has quit [Quit: Leaving]
louisriesener has joined #ocaml
mal`` has joined #ocaml
psacrifice has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
spew has quit [Ping timeout: 258 seconds]
rpg has quit [Ping timeout: 258 seconds]
ansiwen has quit [Ping timeout: 240 seconds]
ansiwen has joined #ocaml
llmz has joined #ocaml
spew has joined #ocaml
rseymour has quit [Ping timeout: 246 seconds]
tokenrove has quit [Ping timeout: 246 seconds]
rseymour has joined #ocaml
tokenrove has joined #ocaml
MercurialAlchemi has joined #ocaml
larhat has joined #ocaml
freusque has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Client Quit]
lamcee has joined #ocaml
spew has quit [Quit: foobar]
arquebus has joined #ocaml
Simn has joined #ocaml
alfredo has joined #ocaml
lamcee has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lamcee has joined #ocaml
lamcee has quit [Client Quit]
lamcee has joined #ocaml
arquebus has quit [Quit: Leaving]
lamcee has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has joined #ocaml
lamcee has joined #ocaml
laserpants has joined #ocaml
maattdd has joined #ocaml
maattdd_ has joined #ocaml
lamcee has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maattdd has quit [Ping timeout: 268 seconds]
orbifx has joined #ocaml
mcspud has quit [Ping timeout: 246 seconds]
<Fistine> x/byu
<Fistine> Oups sry sry
octachron has joined #ocaml
mcspud has joined #ocaml
gtristan has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
lamcee has joined #ocaml
lamcee has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has joined #ocaml
zpe has quit [Remote host closed the connection]
demonimin has quit [Ping timeout: 260 seconds]
demonimin has joined #ocaml
demonimin has joined #ocaml
ia0 has quit [Quit: reboot]
gtristan has joined #ocaml
ia0 has joined #ocaml
ygrek has joined #ocaml
argent_smith has joined #ocaml
orbifx has quit [Ping timeout: 246 seconds]
demonimin has quit [Ping timeout: 240 seconds]
psacrifice has quit [Remote host closed the connection]
demonimin has joined #ocaml
demonimin has joined #ocaml
demonimin has quit [Ping timeout: 240 seconds]
troydm has quit [Ping timeout: 246 seconds]
<gtristan> Oh, fwiw I overcame my build issues from yesterday
<gtristan> By following instructions in these links
<gtristan> That did the trick for me :)
<gtristan> pretty non standard build scripts though
silver has joined #ocaml
maattdd has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
lamcee has joined #ocaml
psacrifice has joined #ocaml
M-Illandan has quit [Remote host closed the connection]
Bluddy[m] has quit [Read error: Connection reset by peer]
timclassic has quit [Remote host closed the connection]
ktosiek[m] has quit [Remote host closed the connection]
M-martinklepsch has quit [Remote host closed the connection]
yetanotherion[m] has quit [Read error: Connection reset by peer]
aspiwack[m] has quit [Remote host closed the connection]
srenatus[m] has quit [Remote host closed the connection]
smondet[m] has quit [Remote host closed the connection]
M-jimt has quit [Remote host closed the connection]
regnat[m] has quit [Write error: Connection reset by peer]
ktosiek[m] has joined #ocaml
lamcee has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
llmz has quit [Ping timeout: 260 seconds]
aspiwack[m] has joined #ocaml
regnat[m] has joined #ocaml
M-jimt has joined #ocaml
srenatus[m] has joined #ocaml
timclassic has joined #ocaml
M-martinklepsch has joined #ocaml
Bluddy[m] has joined #ocaml
M-Illandan has joined #ocaml
yetanotherion[m] has joined #ocaml
smondet[m] has joined #ocaml
demonimin has joined #ocaml
mfp has joined #ocaml
ygrek has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
psacrifice has quit [Ping timeout: 264 seconds]
psacrifice has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
murmour has joined #ocaml
ygrek has joined #ocaml
snowcrshd has quit [Ping timeout: 260 seconds]
snowcrshd has joined #ocaml
hovind has joined #ocaml
_andre has joined #ocaml
tane has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
mengu has joined #ocaml
FreeBirdLjj has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
lucybun has quit [Remote host closed the connection]
lucybun has joined #ocaml
lamcee has joined #ocaml
lamcee has quit [Client Quit]
mcspud has quit [Ping timeout: 246 seconds]
mrvn has joined #ocaml
<mrvn> # type t = { };;
<mrvn> Error: Syntax error
<mrvn> are empty records not allowed?
<octachron> mrvn, empty records like 0-tuples are not allowed
<octachron> thinking about it, sum type with 0 constructors are also not valid
mcspud has joined #ocaml
<mrvn> but that's because you can't type that. "type t = ". How would ocaml know that the type is done there?
mengu_ has joined #ocaml
<octachron> mrvn, creating a specific syntax for this use case is not that hard "type t = . "
<mrvn> I'm redirecting into a variable. Is the output getting to long for the variable?
<mrvn> ups
<mrvn> octachron: type t = .. :)
mengu has quit [Ping timeout: 258 seconds]
sepp2k has joined #ocaml
rpg has joined #ocaml
ygrek has joined #ocaml
mengu has joined #ocaml
mengu_ has quit [Ping timeout: 260 seconds]
psacrifice has quit []
larhat has joined #ocaml
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
alienbot has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nomicflux has joined #ocaml
nomicflux has quit [Quit: nomicflux]
<lapinot> hi, i'm scratching my head around some higher kinded polymorphism.. Just to be sure: having a function an identity function `id` so that `id (id)` has the exact same type is impossible in ocaml right? Or maybe equivalently, poly-typexpr are not useable everywhere (including on function arguments)
<octachron> lapinot, you two questions are not completely equivalent. For the second one, higher-rank polymorphism is possible using either records or objects
<octachron> record: type id = { f:'a. 'a -> 'a }, object: "object method id:'a. 'a -> 'a = fun x -> x end"
<octachron> For the first question, the problem seems to be more the value restriction: "let f x = let id x = x in let id = id id in id x" works
<octachron> but "let not_id = let id x = x in id id" is monomorphic due to the value restriction
<lapinot> nice answer, so that value restriction is inevitable?
FreeBirdLjj has joined #ocaml
<lapinot> (to be understood: even if i add some dangerous option or hint stating that i'm only doing pure computations and that this would be safe)
BitPuffin|osx has joined #ocaml
<octachron> lapinot, in this precise case, since relaxed value restriction also applies, yes (((except if you break Ocaml type system))).
<lapinot> ok, oh indeed.. breaking the rules does actually break the rules! Obj.magic (Obj.magic (Obj.magic)) :D
mengu has quit [Remote host closed the connection]
<lapinot> typing this in a toplevel gives type 'a = <poly>, i never encountered that <poly>, what is it?
laserpants has quit [Ping timeout: 260 seconds]
zpe has quit [Remote host closed the connection]
kamog has joined #ocaml
<flux> I understand it just to be a polymorphic value that cannot be represented, because its exact type is unknown to the toplevel
<mami> when i have "and 'a t = unit -> 'a node
<mami> i mean "and 'a t = unit -> 'a node" after a typesig, does that mean: if "'a t" is unit, regard it as "'a node"?
<flux> mami, no. x -> y is the syntax for the type of a function that takes argument x and returns y
<flux> also x -> y -> z is the same as x -> (y -> z)
<flux> in general it's not possible to make any kind of conditional in OCaml depending on the type of a value
<mami> what does it want to tell me then?
<mami> the typesig is this
<mami> type +'a node =
<mami> | Cons of 'a * 'a t
<mami> | Nil
<mami> and 'a t = unit -> 'a node
<flux> it defines 'a t to be a polymorphic type (with type argument 'a) that is the type of a function that accepts a unit argument () and returns a value of type 'a node
<mami> aha! thanks.
<octachron> lapinot, note that in many situations there are (more or less acrobatic) workarounds to avoid the value restriction
<lapinot> i think that this is used to create a lazy list (having 'a t instead of 'a node may be used to defer the computation of the result)
<lapinot> mami ^
<mrvn> mami: That looks like a lazy list, a generator.
<mrvn> an enumeration
<mami> lapinot: mrvn: makes sense now, the same lib also has: "let return x () = Cons (x, empty)
<mami> "
<flux> well it's sort of a "semi lazy" list, because I connect laziness to mean that the value is memoized, which this list doesn't do
<mami> flux: could i just do it with the lazy keyword?
<flux> yes
FreeBirdLjj has quit [Remote host closed the connection]
<mami> which reasons could the original author have, to not use the lazy keyword? does it have different performance properties/ memory footprint?
<flux> type +'a node = Nil | Cons of 'a * 'a node Lazy.t
<flux> well, I expect lazy to be slower and because it memoizes the result, it can result in larger memory usage
<mrvn> mami: lazy is more complex because it remembers that it was evaluated.
<mami> i see, it makes sense then to not do it lazy in this place.
<lapinot> octachron: i'm interested in that.. i'm writing some interpreter for a caml subset in a class and I followed a paper about "typeful normalization by evaluation". So I have some (user) functions encoded in ocaml, these can be polymorphic but my normalization function does apply value restriction to them, it would be kick-ass to remove that barrier
<mami> mrvn: that would make it more efficient if similar computations would repeatedly happen?
<mrvn> mami: remembering involves a lot of complext stuff in the Gc that changes the value.
<mrvn> mami: I don't think you are supposed to iterate your list more than once.
<mami> mrvn: good, so it really does not make any sense to use Lazy here.
<mrvn> mami: try it and profile it
<mrvn> mami: try streams and enums/sequence from other core libs too
FreeBirdLjj has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
<lapinot> got to go, bye folks
<mami> mrvn: will do
FreeBirdLjj has quit [Remote host closed the connection]
malc_ has joined #ocaml
Ayey_ has joined #ocaml
sepp2k has quit [Ping timeout: 260 seconds]
sepp2k has joined #ocaml
alienbot has quit [Read error: Connection reset by peer]
ryanartecona has joined #ocaml
SpiceGuid has joined #ocaml
sh0t has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
rpg has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
rpg has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
<tobiasBora> Hello,
Ayey_ has quit [Ping timeout: 260 seconds]
<tobiasBora> I'd like to know, is there a function that takes a Lwt stream of type () -> (), a number of threads, and that runs all the functions in the stream, shared in the x threads?
yomimono has quit [Ping timeout: 246 seconds]
snowcrshd has quit [Remote host closed the connection]
<tobiasBora> (I've a big file that I'd like to proceed with a multithreading thing, that's why I'd like to do that)
jabroney has joined #ocaml
<reynir> unit -> unit?
<tobiasBora> reynir: yes, for example let's imagine that I get from a file a stream of string, then I build from it a stream that works like "take the last element of the file stream, and Printf this string"
yomimono has joined #ocaml
snowcrshd has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
<tobiasBora> For example,
<tobiasBora> let lines = Lwt_io.lines_of_file "myfile.txt"
mcspud has quit [Ping timeout: 246 seconds]
<tobiasBora> let display_lines = Lwt_stream.map (fun s -> Printf.printf "%s\n" s) lines
<tobiasBora> let nb_threads = 100
<tobiasBora> great_function_that_share_stream_between_threads nb_threads display_lines
<tobiasBora>
<tobiasBora> And the thing is that I don't know how to "great_function_that_share_stream_between_threads"
<tobiasBora> Because if I manually do it, I would need to create a pool of threads that always pick up an element from the stream...
gtristan has quit [Ping timeout: 240 seconds]
<companion_cube> tobiasBora: you can try with Lwt_stream.iter_p and Lwt_pool
<companion_cube> (pool is to limit to n parallel computations)
<tobiasBora> companion_cube: oh nice, I missed the iter_p function. The iter_p function create really all the threads in the same time?
rpg has joined #ocaml
mcspud has joined #ocaml
<companion_cube> I think so
<companion_cube> as soon as values arrive, of course
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<tobiasBora> companion_cube: ok thank you. However in the pool doc, I can read:
<tobiasBora> "Note that pools are not for keeping Lwt threads. Lwt threads are very cheap to create and are pure. It is neither desirable nor possible to reuse them. If you want to have a pool of system threads, consider module Lwt_preemptive. "
<tobiasBora> so I'm not sure to see how you would put pool inside
<companion_cube> if a computation is costly (but the thread is cheap):
<companion_cube> Lwt_stream.iter_p (fun f -> Lwt_pool.acquire foo (fun () -> f ())) some_stream
<companion_cube> this way, you only apply functions from the stream when you can acquire a dummy token (here of type `unit`)
<companion_cube> so it limits the number of parallel function applications
jao has joined #ocaml
<tobiasBora> companion_cube: Hum quite cleaver... And I also saw the Lwt_stream.create_bounded function, is it possible to use it in the same idea?
<mami> i am trying to replace the lazy Gen we have with a Seq
<mami> Gen has a function that gives me back a Gen of the object i suplly
<mami> type 'a t = Gen of (('a * 'a t) option) Lazy.t
<mami> my Seq is this:
<mami> type +'a node =
<mami> | Cons of 'a * 'a t
<mami> | Nil
<mami> and 'a t = unit -> 'a node
marsam has joined #ocaml
<mami> how would i define the Seq generation function in a similar way to Gen?
snowcrshd has quit [Remote host closed the connection]
<mami> with of does not work since i need to keep the typesig unit -> 'a node there
vicfred has joined #ocaml
<companion_cube> https://paste.isomorphis.me/Zpc something like that?
MercurialAlchemi has joined #ocaml
<mami> companion_cube: let me think and try a bit
<companion_cube> good luck ;)
moei has joined #ocaml
<mami> companion_cube: hmm, the typesig is: "(unit -> 'a node) -> unit -> ('a * 'a seq) option node"
moei has quit [Client Quit]
johnelse has quit [Read error: No route to host]
moei has joined #ocaml
<mami> should it not be something like "'a -> (foo ->) 'a seq" ?
johnelse has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
<tobiasBora> companion_cube: The pool tricks works great, thank you!
<tobiasBora> Just a question: in my file, I've "A\nB\nC\n", and with the pool version, it first treats C, then B, then A, do you know why?
<tobiasBora> (while if I display only the first element of the string, it's indeed A
<tobiasBora> )
<tobiasBora> Grrr
<tobiasBora> I thought that Stream were lazy
<tobiasBora> but If I run:
<tobiasBora> then I have an error: "Stack overflow during evaluation (looping recursion?)."
<tobiasBora> (I'm building an infinite stream containing "YES")
<tobiasBora> and I expected that it would run infinitely by printing YES...
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tane> tobiasBora, problem is iter_p
sz0 has joined #ocaml
<tobiasBora> tane: hum yes it makes sense...
rpg has joined #ocaml
<tobiasBora> But then I don't see what I could do...
<tane> tobiasBora, do you want multi threading or actual parallelism?
<def`> tobiasBora: does it still happen with(fun () -> Lwt_unix.yield () >>= fun () -> Lwt.return (Some "YES"))
<tobiasBora> tane: Well, I'd love to have actual parallelism, but I thought that Ocaml was not able to do multicore, so I tought I would run several instances else
<def`> (I suspect the problem is that you have no concurrency in your code, in which case Lwt is faster but consume stack)
<def`> (Async doesn't have this eager binding behavior -- which breaks monad laws afair -- so it should be fine with Async)
rpg_ has joined #ocaml
rpg has quit [Ping timeout: 256 seconds]
<tane> tobiasBora, so, multi-processing?
<tane> short reboot, brb
tane has quit [Quit: Leaving]
tane has joined #ocaml
<tobiasBora> def`: With yield indeed it works... What did you do exactly?
Ayey_ has joined #ocaml
<tobiasBora> tane: Well, If you know how to get parallelism and multi core, yes I take it!
<tobiasBora> it's funny to use yield ^^
<tobiasBora> If I use "Lwt_unix.fork ()", you agree that I won't be able to use the same string between the two process right?
Ayey_ has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.46/20161213183751]]
<tane> tobiasBora, if you go for multi-processing, split it completely and communicate the data in a serialized form
<tane> this may be some overhead but will be worth it, if processing the data takes more time than then communication of instance and results :)
freusque has quit [Quit: WeeChat 1.7]
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
<mrvn> tobiasBora: ocaml doesn't support parallel threads
<mrvn> tobiasBora: if you fork then you have 2 processes and two strings even if they are the same.
al-damiri has joined #ocaml
copy` has joined #ocaml
mfp has joined #ocaml
rpg_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rpg has joined #ocaml
mcspud has quit [Ping timeout: 246 seconds]
murmour has quit [Quit: Leaving.]
vicfred has quit [Quit: Leaving]
mcspud has joined #ocaml
FreeBirdLjj has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
mcspud has quit [Ping timeout: 246 seconds]
ryanartecona has quit [Quit: ryanartecona]
alfredo_ has joined #ocaml
Ayey_ has joined #ocaml
alfredo has quit [Ping timeout: 260 seconds]
Ayey_ has quit [Ping timeout: 258 seconds]
Anarchos has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
mcspud has joined #ocaml
Ayey_ has joined #ocaml
Ayey_ has quit [Ping timeout: 264 seconds]
ryanartecona has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
Ayey_ has joined #ocaml
jabroney has quit [Quit: Leaving.]
Ayey_ has quit [Ping timeout: 240 seconds]
troydm has joined #ocaml
Ayey_ has joined #ocaml
snowcrshd has joined #ocaml
mcspud has quit [Ping timeout: 246 seconds]
troydm has quit [Client Quit]
Ayey_ has quit [Ping timeout: 264 seconds]
cojy_ has joined #ocaml
adi______ has joined #ocaml
technoma` has joined #ocaml
l1x_ has joined #ocaml
troydm has joined #ocaml
Pepe__ has joined #ocaml
j0sh_ has joined #ocaml
theblatt1 has joined #ocaml
dlat_ has joined #ocaml
Nazral_ has joined #ocaml
strmpnk_ has joined #ocaml
Bluddy[m] has quit [Ping timeout: 276 seconds]
M-martinklepsch has quit [Ping timeout: 276 seconds]
j0sh has quit [Ping timeout: 276 seconds]
adi_____ has quit [Ping timeout: 276 seconds]
strmpnk has quit [Ping timeout: 276 seconds]
SIGILL has quit [Ping timeout: 276 seconds]
Pepe_ has quit [Ping timeout: 276 seconds]
theblatte has quit [Ping timeout: 276 seconds]
SkeThuVe has quit [Ping timeout: 276 seconds]
noplamodo_ has quit [Ping timeout: 276 seconds]
dlat has quit [Ping timeout: 276 seconds]
l1x has quit [Ping timeout: 276 seconds]
cojy has quit [Ping timeout: 276 seconds]
maufred has quit [Ping timeout: 276 seconds]
technomancy has quit [Ping timeout: 276 seconds]
Nazral has quit [Ping timeout: 276 seconds]
maker has quit [Ping timeout: 276 seconds]
rpg has quit [Ping timeout: 269 seconds]
adi______ is now known as adi_____
noplamodo has joined #ocaml
M-martinklepsch has joined #ocaml
maufred has joined #ocaml
Bluddy[m] has joined #ocaml
SkeThuVe has joined #ocaml
maker has joined #ocaml
cojy_ is now known as cojy
SIGILL has joined #ocaml
strmpnk_ is now known as strmpnk
l1x_ is now known as l1x
mcspud has joined #ocaml
marsam has quit [Remote host closed the connection]
technoma` is now known as technomancy
rpg has joined #ocaml
<tobiasBora> tane: Ok thank you, is there any library that automatate that? And what is lwt-parallel?
<tane> tobiasBora, lwt parallel is just that (assuming the description holds)
<tane> otherwise have a look at https://github.com/rizo/nproc
marsam has joined #ocaml
dhil has joined #ocaml
dhil has quit [Client Quit]
TheLemonMan has joined #ocaml
tobast1 has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
ygrek_ has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
mcspud has quit [Ping timeout: 246 seconds]
octachron has quit [Quit: Leaving]
mcspud has joined #ocaml
alfredo_ has quit [Quit: Textual IRC Client: www.textualapp.com]
vtomole has joined #ocaml
Nazral_ is now known as Nazral
<lapinot> i'm back.. now i'm working on a small parser (using menhir) and i face a lot of end-of-stream conflicts which i don't really understand. Is there any good tutorial on how to write clean grammars? I'm a bit puzzled by the fact that menhir handles precedence and associativity himself (without the need of writing left-only or right-only recursive rules) but still enforces that the user write his rules with
<lapinot> low-level details in mind (state transitions and look-ahead)
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
vtomole has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
orbifx has joined #ocaml
Ayey_ has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
gtristan has joined #ocaml
Ayey_ has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
Ayey_ has joined #ocaml
Ayey_ has quit [Ping timeout: 260 seconds]
marsam has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
<lapinot> some other thought about polymorphism that struck me: is it possible to have a container (a mapping for example) that could contain values of different types? I'm thinking about GADTs and mapping some 'a x keys to 'a y values
<lapinot> (but the container would allow any 'a)
<companion_cube> look at `hmap` on opam (or CCHetMap in containers)
bbc has quit [Ping timeout: 264 seconds]
<lapinot> companion_cube: thanks
Ayey_ has joined #ocaml
Ayey_ has quit [Ping timeout: 240 seconds]
malc_ has quit [Remote host closed the connection]
bbc has joined #ocaml
<orbifx> sup all?
<lapinot> and would be what i discussed earlier (an id function that types exactely same as `id (id)`) possible in coq?
<companion_cube> no idea, it does work in haskell though
kakadu has joined #ocaml
<_y> lapinot, my gallina is a bit rusty, but i think it would work out as is indeed
<companion_cube> does it mean you write Coq code with lifetimes? :p
argent_smith1 has joined #ocaml
<_y> modulo the arguments which are used to instanciate the type variables, which are left implicit and hidden by the syntax
<lapinot> companion_cube: oh indeed, now i have a real incentive to really learn haskell! gonna rewrite my few functions asap!
<_y> companion_cube, i bet you found that joke months ago and were in desperate hope for someone to say the expression :-°
<lapinot> _y: ok, i'm gonna look further to check
argent_smith has quit [Ping timeout: 240 seconds]
Ayey_ has joined #ocaml
<lapinot> companion_cube: ha, i just understood that one.. would be fun that rust evolves into having such hardcore functional features (GADTs, higher-kinded poly...)
<companion_cube> ^^
Ayey_ has quit [Ping timeout: 240 seconds]
<_y> lapinot, okay so i just tried out
<_y> it works, but the implicit type instanciation fails so you have to specify it yourself (and for some reason just giving «ID», which is apparently defined as a shortcut for the type of «id», would lead to universe inconsistency)
<_y> (seems to me that Coq retains a fixed universe level for the value «ID» and is not able to generalize it over any level)
<orbifx> anyone know if MirageOS supports PAM?
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
_andre has quit [Quit: leaving]
jabroney has joined #ocaml
<lapinot> _y: okay, i'm not very fluent in Coq so i don't really get why the others don't work (that universe thing) but i get the solution
<lapinot> actually i never programmed in Coq, only did a little theorem proving class (arguably i was writing programs but you get it)
<lapinot> anyway, the haskell code is straightforward :) https://ptpb.pw/T2Zz
<lapinot> ocaml, i'm leaving you!
gtristan has quit [Ping timeout: 240 seconds]
<companion_cube> you seem to have identity problems ;)
<lapinot> (note that the code does funny things using that feature, it's not defining an identity function that ... (actually a simple identity function will do the job))
<lapinot> companion_cube: wow, on fire ;)
<orbifx> smondet[m]: here?
gregoire has quit [Ping timeout: 240 seconds]
snowcrshd has quit [Remote host closed the connection]
<lapinot> if anyone wonders, my code is representing typed lambda calculus and nbe should return a term in eta-long beta-normal form
<lapinot> (at least that's what the papers says!)
gregoire has joined #ocaml
fraggle_ has joined #ocaml
moei has quit [Quit: Leaving...]
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
silver has quit [Read error: Connection reset by peer]
silver has joined #ocaml
maattdd has joined #ocaml
spew has joined #ocaml
rightfold has joined #ocaml
<rightfold> Anyone done OCaml-Rust interop?
ryanartecona has joined #ocaml
lpaste_ has quit [Ping timeout: 240 seconds]
* Drup points at Enjolras
Ayey_ has joined #ocaml
Ayey_ has quit [Ping timeout: 258 seconds]
<rgrinberg> Drup: i see you're finally warming up to jbuilder
lpaste has joined #ocaml
<Drup> By "warming up" you mean "yell because I can't even write my tests" ? :D
<Drup> you'll see quite soon what it was for.
hovind has quit [Ping timeout: 240 seconds]
<rgrinberg> Drup: in your ticket, is my_ppx just a binary that you produce?
<Drup> rgrinberg: it's a by product of a ppx library
ode has joined #ocaml
<Drup> (as in, a library with "(kind ppx_rewriter)"
<Drup> All in all, I'm not sure how I feel about the limited flexibility
<rgrinberg> I'm not sure about the subtleties of ppx here, but I ported atdgen along with its tests fairly easily. You can talk about the binary that you produced in rules with ${bin:binary_name}
<Drup> that doesn't work in that case, afaics
<rgrinberg> You can also take a look at some jst ppx packages for how to do it.
<rgrinberg> although that seems to depend on driver
<Drup> yeah and they just build something with the ppx
<Drup> I want something a bit more elaborate
<Drup> (basically: running a toplevel with the ppx on a file)
<Drup> I'll just wait for diml's answer, it's no problem
<ode> Can someone tell me what the syntax error in https://pastebin.com/Uu60ngwu is please?
<Drup> there is nothing after the first "in"
<Drup> there is supposed to be an expression there
<ode> I want the printf in both cases.
Ayey_ has joined #ocaml
<Drup> then either do it in both cases, or reform your code in a different way
<Drup> but you can't have a "let .. in .." sitting each half on a different part of a "if then else"
<ode> I don't know how to reform it so I don't have to repeat the printf. Could you show me?
<Drup> you can do something like this : "let a, b = if .. then ... else ... in printf ..."
Ayey_ has quit [Ping timeout: 260 seconds]
<Drup> each branch of the if returns a tuple
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
tane has quit [Quit: Leaving]
argent_smith1 has quit [Quit: Leaving.]
<ode> Thanks, I got it.
mcspud has quit [Ping timeout: 246 seconds]
Simn has quit [Quit: Leaving]
mcspud has joined #ocaml
yomimono has quit [Ping timeout: 258 seconds]
unbalancedparen has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
ode has left #ocaml ["Leaving"]
maattdd has quit [Ping timeout: 260 seconds]
<Enjolras> rightfold: hi, for ocaml / rust bindings, the easier is to use ctypes for generating the bindings with rusty-cheddar to generate a C header file from rust
<Enjolras> future is rusty-binder but i've not tried it
<Enjolras> In theory we could make ctypes generate rust-binding directly but this is quite some work to write ocaml-rusttypes :)
marsam has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 264 seconds]