<jyc>
how do people normally read the documentation for Jane Street's libraries?
<jyc>
some of the stuff is pretty cool, but when I go to the website for generated documentation I see that the version available is actually several versions out of date and feel discouraged...
<jyc>
it makes me wonder if it isn't necessary because people have a better way
<Drup>
apache2: interesting, I don't think I ever saw someone use that
<Drup>
what do you want it for ?
<apache2>
I want a graphical representation of the state machine for my protocol
<apache2>
or well, a tool that can tell me if I have "dead ends" and which states can be reached from each other, it doesn't have to be "graphical" :)
<apache2>
my friend has used ragel a lot for his projects and recommended it, I'm completely unfamiliar with anything like this, so if you know a similar tool, please speak up :)
<Drup>
menhir can do that
<Drup>
but it's really meant to write parsers, not protocoles
nullcatxxx_ has quit [Ping timeout: 240 seconds]
<apache2>
menhir can do the parsing, but this thing can also help analyze the state machine
<Drup>
it was more a comment than a suggestion, yes :p
<apache2>
ok, thanks :)
nullcatxxx_ has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 260 seconds]
lolisa has quit [Quit: meow]
nullcatxxx_ has joined #ocaml
Tekilla has joined #ocaml
nullcatx_ has quit [Ping timeout: 260 seconds]
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
Tekilla has quit [Quit: Quitte]
pacmann has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
<Algebr>
How can I write mutally recurisve class type signatures? class type foo = ....uses bar, ....class type bar uses foo.
<Algebr>
I tried sticking an "and" in between the class types but didn't work
struktured has joined #ocaml
ollehar has quit [Quit: ollehar]
nullcatx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apache2>
for modules you could use a signature, but I'm not sure how it works for classes
<Enjolras>
Algebr: use a type instead of a class maybe ?
<Enjolras>
and name it
<Drup>
Algebr: "module rec M : sig class type t = .. class type t' = ... end = M"
<apache2>
oh neat
nullcatxxx_ has joined #ocaml
<Enjolras>
what is rec ?
<Drup>
recursive module
<Drup>
(self recursion, in this case)
<Enjolras>
i figured it would be named like this :)
<Drup>
as long as the module only contains types, that scheme works
* Enjolras
reads the doc
<Drup>
however, Enjolras is right, class types are rarely useful and type would generally be enough
<Enjolras>
to be honest, i don't even know why class are useful. Inheritance ?
<Algebr>
Enjolras: has to be a class type
<Algebr>
Drup: Thank you
<Algebr>
Enjolras: that seems to be the best use case I guess, lambda-term I remmber uses class a lot.
mengu has quit [Remote host closed the connection]
<Drup>
why do you need a type class specifically ?
<Algebr>
jsoo bindings
<Drup>
I don't see why then
travisbrady has joined #ocaml
<Drup>
an object type would work just fine
<Enjolras>
Is there anyway way to encode "extension" with row polymorphism in ocaml. Like { foo : int, bar : float } x { boo : int } -> { foo : int; bar : float; boo : int }
<Enjolras>
i guess it would be called cartesian product
<Algebr>
I don't want an object type, I want it to be known in the signature that its of a specific type.
<Enjolras>
maybe that would be inherit actually
<Enjolras>
Algebr: you can name the type in the signature. Like every other type
<Algebr>
Drup: at the moment I'm being lax and just leaving it as 'a Js.t
<Enjolras>
type foo = < ... >
<Algebr>
but the type isn't known yet.
<Enjolras>
you don't need class for this
<Algebr>
okay, will try that
<Enjolras>
not saying that you should not use class, i'm mentionning it to say you can do this too :)
antkong has quit [Ping timeout: 260 seconds]
antkong has joined #ocaml
ygrek has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
travisbrady has quit [Quit: travisbrady]
darkf has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 244 seconds]
mengu has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
mengu has quit [Ping timeout: 256 seconds]
mac10688 has quit [Quit: Leaving]
nullcatx_ has quit [Ping timeout: 255 seconds]
mac10688 has joined #ocaml
__uu__ has quit []
antkong_ has joined #ocaml
antkong has quit [Ping timeout: 252 seconds]
antkong_ is now known as antkong
mac10688 has quit [Ping timeout: 272 seconds]
nullcatxxx_ has joined #ocaml
antkong has quit [Quit: antkong]
swgillespie[GT] has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 244 seconds]
darius93 has quit [Quit: Bye bye now :)]
keen______ has quit [Ping timeout: 244 seconds]
keen______ has joined #ocaml
darius93 has joined #ocaml
govg has joined #ocaml
antkong has joined #ocaml
<cojy>
Enjolras: the real problem is subtraction
psy_ has joined #ocaml
nullcatxxx_ has joined #ocaml
nullcatx_ has quit [Ping timeout: 250 seconds]
tmtwd has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
destrius_ has joined #ocaml
destrius has quit [Ping timeout: 250 seconds]
ousado has quit [Ping timeout: 255 seconds]
antkong has quit [Quit: antkong]
eni has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
canhtak has joined #ocaml
tmtwd has joined #ocaml
MercurialAlchemi has joined #ocaml
mengu has joined #ocaml
slash^ has joined #ocaml
mengu has quit [Ping timeout: 268 seconds]
canhtak has quit [Quit: canhtak]
canhtak has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ousado has joined #ocaml
antkong has joined #ocaml
mort___ has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
keen_______ has joined #ocaml
keen______ has quit [Ping timeout: 240 seconds]
Guest10923 has joined #ocaml
orbifx has joined #ocaml
mort___ has quit [Quit: Leaving.]
Lis has joined #ocaml
darius93 has quit [Quit: Bye bye now :)]
Guest10923 has left #ocaml ["Quit"]
sh0t has joined #ocaml
darius93 has joined #ocaml
darius93 has quit [Ping timeout: 256 seconds]
orbifx has quit [Quit: WeeChat 1.3]
eni has quit [Ping timeout: 268 seconds]
ggole has joined #ocaml
orbifx has joined #ocaml
zpe has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
Haudegen has joined #ocaml
canhtak has quit [Quit: canhtak]
canhtak has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
orbifx has quit [Read error: Connection reset by peer]
<orbifx>
If I have a `let function_name = ...` expression, does it mean that it will get executated at the point where it is defined? Or does it have to be called first?
<orbifx>
If I have a `let function_name = ...` expression, does it mean that it will get executated at the point where it is defined? Or does it have to be called first?
<companion_cube>
if the ... is a function, that nothing gets executed until some argument(s) are provided
<companion_cube>
if you write let x = 1+1, otoh, it's executed in the module initialization phase
govg has joined #ocaml
<orbifx>
how can i defer execution until the expression is "called" in my sequence later on?
<orbifx>
since it has some side-effects
mengu has quit []
<companion_cube>
if you have a non functional expression?
<companion_cube>
let x = lazy (print_endline "yolo"; 1 + 1);;
<companion_cube>
later: blabla; assert (Lazy.force x = 2)
<orbifx>
ok
<companion_cube>
first call to Lazy.force will evaluate x
<orbifx>
is there a way to make ocaml lazy by defailt?
<companion_cube>
no
<companion_cube>
why would you want that?
<orbifx>
I guess one way would be to move that expression in a let expression inside where I use it
<companion_cube>
sure
<orbifx>
I liked it in Haskell..haha :P
<companion_cube>
well it's totally different in OCaml, don't try to write haskell-in-diguise :)
<companion_cube>
+s
<orbifx>
yeah I know
<orbifx>
just a joke
<ggole>
Usually you would just make it a function, unless you want it to be "evaluated" many times but only run once.
<companion_cube>
exactly
<orbifx>
It's about an expression that would be a bit bloated to put inside my other expressions, but I want it to run when it is actually referred to
bjorkintosh has quit [Quit: Leaving]
<orbifx>
I think what I was looking for is `let f () = ...`. It doesn't seem to be executed where it is defined.
struktured has joined #ocaml
<orbifx>
can someone confirm this?
<Maelan>
yes
bjorkintosh has joined #ocaml
<dmbaturin>
orbifx: In languages with no lazy and force primitives a function of unit is the most common way to add some laziness.
<dmbaturin>
Or rather "non-strictness".
<orbifx>
dmbaturin, Maelan: thanks guys
<orbifx>
(gals contained in guys :P)
^elyse^ has quit [Quit: Leaving...]
<dmbaturin>
As ocaml does have a lazy primitive, whether you should use it or a unit-taking thunk is debatable. :)
<orbifx>
dmbaturin: what's the jist of the criteria for choosing?
native_killer has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
govg has joined #ocaml
native_killer has quit [Client Quit]
<ggole>
Laziness if you want work to be delayed, but done only once when the answer is required many times
<ggole>
Functions otherwise
<orbifx>
thanks ggole
xet7 has joined #ocaml
dsheets has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
<struktured>
I thought you wrote thanks google when I first read that. lol
^elyse^ has joined #ocaml
<struktured>
ggole: speaking of "only once", do you know of a slick memoizing module for ocaml?
<ggole>
No, but there might be something interesting floating around
<ggole>
Which supports recursive functions, etc
^elyse^ has quit [Client Quit]
<struktured>
ggole: at some point I want to get serious about that..was considering a ppx-esque solution maybe (annotate a function as memoizable)
<apache2>
t/25
* companion_cube
hints `CCCache` to struktured
<companion_cube>
;)
<struktured>
companion_cube: all I see is a long sequence of capital Cs...is that a module name at the end of it? :)
<companion_cube>
:p
<companion_cube>
CCCache.with_cache_rec for memoizing recursive functions, if you want to take a look
govg has joined #ocaml
ivan\ has quit [Ping timeout: 246 seconds]
ivan\ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
<struktured>
companion_cube: I will later today, thanks!
<struktured>
companion_cube: so its a bounded by default? whats the eviction policy?
<companion_cube>
well it depends on what cache you use
<companion_cube>
there are unbounded and lru caches, typically
<struktured>
ok, cool.
travisbrady has joined #ocaml
ollehar has joined #ocaml
djellemah has joined #ocaml
rgrinberg has quit [Ping timeout: 255 seconds]
travisbrady has quit [Quit: travisbrady]
struktured has quit [Ping timeout: 240 seconds]
travisbrady has joined #ocaml
^elyse^ has joined #ocaml
dhil has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
rgrinberg has joined #ocaml
govg has quit [Ping timeout: 255 seconds]
ollehar has quit [Ping timeout: 256 seconds]
orbifx has quit [Quit: WeeChat 1.3]
mac10688 has joined #ocaml
MercurialAlchemi has joined #ocaml
govg has joined #ocaml
Tekilla has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 250 seconds]
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
tmtwd has joined #ocaml
antkong has quit [Quit: antkong]
lobo has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
mac10688 has quit [Ping timeout: 272 seconds]
govg has quit [Ping timeout: 250 seconds]
lopex has joined #ocaml
tmtwd has quit [Ping timeout: 255 seconds]
xet7 has quit [Remote host closed the connection]
xet7 has joined #ocaml
govg has joined #ocaml
^elyse^ has quit [Quit: Leaving]
tmtwd has joined #ocaml
Algebr has joined #ocaml
luz1e has quit [Remote host closed the connection]
luzie has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
^elyse^ has joined #ocaml
nullcatxxx_ has joined #ocaml
toomuchtvrotsurb has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
^elyse^ has quit [Quit: Leaving]
tmtwd has quit [Ping timeout: 240 seconds]
elrzn has joined #ocaml
travisbrady has quit [Quit: travisbrady]
nullcatxxx_ has joined #ocaml
canhtak has quit [Quit: canhtak]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
canhtak has joined #ocaml
swgillespie has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
travisbrady has joined #ocaml
Haudegen has joined #ocaml
SomeDamnBody has joined #ocaml
<SomeDamnBody>
I am getting parse errors on a package that I've pinned locally in the past before and that I've not edited even one bit
johnf__ has quit [Read error: Connection reset by peer]
johnf has joined #ocaml
djellemah_ is now known as djellemah
swgillespie is now known as swgillespie[ATL]
<SomeDamnBody>
Yeah, things just went smoothly through a dependenccy installation now
johnf has quit [Read error: Connection reset by peer]
johnf has joined #ocaml
travisbrady has joined #ocaml
mort___ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
Tekilla has quit [Quit: Quitte]
eni has joined #ocaml
mac10688 has joined #ocaml
elrzn_ has quit [Quit: Leaving]
psy_ has quit [Ping timeout: 268 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
mort___ has quit [Quit: Leaving.]
psy_ has joined #ocaml
Algebr has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
psy_ has quit [Read error: No route to host]
travisbrady has joined #ocaml
<SomeDamnBody>
how do you pin a package to a version with opam
<Drup>
opam pin add foo.x.y.z
psy_ has joined #ocaml
urs_ has joined #ocaml
xet7 has quit [Remote host closed the connection]
Guest39209 has joined #ocaml
Guest39209 is now known as xet7_
xet7_ is now known as xet7
xet7 has quit [Remote host closed the connection]
ggole has quit []
xet7 has joined #ocaml
zpe has quit [Remote host closed the connection]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 260 seconds]
tibor_ has quit [Quit: Page closed]
xet7 has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
canhtak has quit [Quit: canhtak]
Haudegen has joined #ocaml
Lis has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
dsheets has joined #ocaml
travisbrady has quit [Quit: travisbrady]
mengu has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
eni has quit [Quit: Leaving]
Guest38 has joined #ocaml
travisbrady has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
<jyc>
is it possible to make a blocking system call in one ocaml thread of execution and concurrently run other threads of OCaml code
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<mfp>
jyc: yes, using caml_release_runtime_system and caml_acquire_runtime_system
<mfp>
(which used to be named caml_enter_blocking_section and caml_leave_blocking_section, showing they're exactly for the use case you gave)
travisbrady has quit [Quit: travisbrady]
^elyse^ has joined #ocaml
mobius-eng has joined #ocaml
rgrinberg has joined #ocaml
tmtwd has joined #ocaml
urs_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 268 seconds]
swgillespie[ATL] has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jyc>
mfp: cool, thanks a bunch!
urs_ has joined #ocaml
Haudegen has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jyc>
is it possible to use ctypes with bytecode? I managed to make it so I can use my module using CTypes from native code, but when I try to use it from bytecode or UTop I get Exception: Dl.DL_error("/home/jyc/.opam/4.02.3/lib/stublibs/dllctypes-foreign-base_stubs.so: undefined symbol: create_watcher").
antkong has joined #ocaml
nullcatxxx_ has joined #ocaml
<jyc>
I've tried adding -Wl,--no-as-needed but it doesn't seem to help :(