andreas_ has quit [Quit: Connection closed for inactivity]
dtornabene has quit [Remote host closed the connection]
dtornabene has joined #ocaml
VermillionAzure has quit [Quit: Leaving]
pierpa has quit [Quit: Page closed]
dtornabene has quit [Quit: Leaving]
jbrown has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
xaimus has quit [Remote host closed the connection]
cbot_ has quit [Quit: Leaving]
mk9 has joined #ocaml
mk9_ has joined #ocaml
mk9 has quit [Ping timeout: 276 seconds]
mk9_ is now known as mk9
mk9 has quit [Quit: mk9]
sonologico has quit [Quit: WeeChat 1.9.1]
orbifx1 has joined #ocaml
baboum has joined #ocaml
freusque has joined #ocaml
reynir has quit [Quit: WeeChat 1.7.1]
j0sh has quit [Remote host closed the connection]
sapristi has joined #ocaml
orbifx1 has quit [Ping timeout: 256 seconds]
simpson has quit [Ping timeout: 255 seconds]
reynir has joined #ocaml
argent_smith has joined #ocaml
zpe has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
madroach has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
madroach has joined #ocaml
jimmyrcom has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
chindy has quit [Ping timeout: 276 seconds]
mfp has joined #ocaml
antoine1fr has joined #ocaml
chindy has joined #ocaml
mk9 has joined #ocaml
Onemorenickname has joined #ocaml
<Onemorenickname>
Hello
baboum has quit [Ping timeout: 248 seconds]
<Onemorenickname>
Which keywords should I use in my search to find the default .mli inferred from a .ml when there is no .mli provided ?
<def`>
inferred in man ocamlc
<def`>
(it is -i flag)
<Onemorenickname>
thanks :)
<Onemorenickname>
(is it easy to use within a jbuilder project ?)
mk9 has quit [Ping timeout: 276 seconds]
<def`>
no idea :/
<Onemorenickname>
np, with your keywords, I could find other results, indicating that the choice was basically to put this feature inside merlin instead of jbuilder
<Onemorenickname>
thanks :)
chindy has quit [Quit: No Ping reply in 180 seconds.]
chindy has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
chindy has quit [Quit: No Ping reply in 180 seconds.]
chindy has joined #ocaml
baboum has joined #ocaml
kerrhau has quit [Ping timeout: 256 seconds]
kerrhau has joined #ocaml
kerrhau has joined #ocaml
kerrhau has quit [Changing host]
mk9 has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
mk9 has quit [Ping timeout: 248 seconds]
zpe has quit [Read error: No route to host]
zpe has joined #ocaml
pitastrudl has quit [Remote host closed the connection]
kensan has quit [Quit: leaving]
pitastrudl has joined #ocaml
zolk3ri has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
Serpent7776 has joined #ocaml
<orbifx[m]>
Would a `match .. with` be more efficient than a `Map` lookup over a small number of strings?
<flux>
benchmark :)
KeyJoo has quit [Ping timeout: 255 seconds]
<Armael>
hasn't someone asked that exact question here already?
maattdd has joined #ocaml
<Armael>
it was a while ago though
<def`>
pattern matching will be faster
<def`>
(the compiler is quite smart for that :P)
<Drup>
The compiler is *very* smart for that :3
zpe has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
zpe has joined #ocaml
andreas_ has joined #ocaml
maattdd_ has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
dhil has joined #ocaml
ZirconiumX has joined #ocaml
<ZirconiumX>
Hi everyone
maattdd_ has quit [Ping timeout: 256 seconds]
<ZirconiumX>
So, this is something I've found in Scheme as well as OCaml: using an accumulator parameter (or multiple). Can someone explain to me how to recognise when they would be useful in an algorithm?
<ZirconiumX>
For example, I was trying to solve the OCaml "reverse a list" problem, and I completely missed the possibility of using an accumulator.
KeyJoo has joined #ocaml
<def`>
they just replace mutable variables.
<def`>
s/just/can/
dakk has joined #ocaml
<ZirconiumX>
Would you mind giving an example?
govg has quit [Ping timeout: 256 seconds]
govg has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
maattdd_ has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
TarVanimelde has joined #ocaml
kerrhau has quit [Ping timeout: 248 seconds]
zpe has quit [Ping timeout: 256 seconds]
maattdd_ has quit [Ping timeout: 248 seconds]
dhil has quit [Ping timeout: 255 seconds]
mk9 has joined #ocaml
<def`>
sum of elements in C: int sum = 0; for (i = 0; i < len; ++i) sum = sum + table[i];
<def`>
in ML: let rec sum total = function [] -> total | x :: xs -> sum (total + x) xs
<ZirconiumX>
That makes things much easier
<ZirconiumX>
Thank you very much, def`
<ZirconiumX>
So essentially if I can formulate a problem as a loop with state, I can express it in ML as a tail loop with an accumulator?
baboum has quit [Quit: WeeChat 2.0.1]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
<def`>
yep
<def`>
this is actually what an efficient C compiler will do
Haudegen has quit [Remote host closed the connection]
_andre has joined #ocaml
spew has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
groovy2shoes has quit [Ping timeout: 276 seconds]
sapristi has quit [Remote host closed the connection]
dhil has joined #ocaml
sapristi has joined #ocaml
<ZirconiumX>
Okay, that makes sense.
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
demonimin has joined #ocaml
spew has quit [Read error: Connection reset by peer]
silver has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
zolk3ri has quit [Ping timeout: 264 seconds]
zolk3ri has joined #ocaml
ShalokShalom has joined #ocaml
<ShalokShalom>
How are the libs for native interop in OCaml?
<ZirconiumX>
ShalokShalom: how do you mean "native interop"?
<ZirconiumX>
I know that OCaml has an API for you to write C modules if you need it.
<ZirconiumX>
Networking is limited by the run time seeming to be single threaded (experts, please correct me on my googling)
<Drup>
not really, no
<Drup>
I mean, unless you can't write webserver in python anymore, but last time I checked, everyone was doing that just fine
<ZirconiumX>
Mmm.
tizoc has joined #ocaml
<ZirconiumX>
It does provide a maximum throughput limitation though
<ZirconiumX>
I guess it depends on your specific circumstances
<Drup>
not really, networking is very compatible with good old multiprocess-based parallelism
<ZirconiumX>
Less so when you have dynamic webpages that have to read from a database
<Drup>
multiple process accessing the same database. As I said, people have been doing that with python for years, I don't even know why this discussion is happening again. This is almost FUD at this point, and completely off-topic. ShalokShalom was asking for libraries to do networking, to which the current answer is : Unix module or the cohttp library.
<_xvilka__>
also multicore support seems to be landed in mainline ocaml not that far away - check reddit thread about multicore progress
maattdd_ has joined #ocaml
<kakadu>
any link?
maattdd_ has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
dhil has quit [Ping timeout: 263 seconds]
shinnya has joined #ocaml
<ShalokShalom>
Drup: Thanks a lot
ShalokShalom has quit [Quit: Konversation terminated!]
nore has quit [Ping timeout: 248 seconds]
jbrown has joined #ocaml
Jesin has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
maattdd_ has joined #ocaml
maattdd_ has quit [Ping timeout: 248 seconds]
<silver>
kakadu, top one in r/ocaml
an-tuan has joined #ocaml
wxyzzyrd has joined #ocaml
<kakadu>
thanks. The GUI is so intuitive that I thought that this top thread is not a thread at all
dhil has joined #ocaml
<companion_cube>
_xvilka__: wait until there's confirmation
<companion_cube>
multicore has been "close" for some many years…
nore has joined #ocaml
superherointj has joined #ocaml
superherointj has left #ocaml [#ocaml]
jlongster has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
<orbifx[m]>
def`, Drup thanks for saving me time :)
<orbifx[m]>
doh formatting messed up
<orbifx[m]>
def```, Drup thanks for saving me time :)
antoine1fr has quit [Ping timeout: 256 seconds]
<reynir>
orbifx[m]: huh?
MercurialAlchemi has quit [Ping timeout: 240 seconds]
wxyzzyrd has quit [Ping timeout: 240 seconds]
<orbifx[m]>
?
xaimus has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
wxyzzyrd has joined #ocaml
FreeBirdLjj has joined #ocaml
cuicui has joined #ocaml
<kakadu>
Folks, which small extensions of untyped lambda calculus with numbers can you imagine...
<kakadu>
to present them as interpreter-writing task for students?
<Drup>
kakadu: which level, which class/language ?
<kakadu>
I have an abvious thought about delim-cc but I can't imagine anything simple enough else
<kakadu>
Drup: they should be able to write interpreters for simple Untypel lambda calculus, evaluating ASTs of binary expressions, transformin propositional formulas
<kakadu>
Drup: haskell if it does matte
<kakadu>
r
<Drup>
you could add references.
<Drup>
otherwise, why not jump to simply typed ? As long as it's explicitely typed without polymorphism, it's very easy to typecheck
<kakadu>
refernces like mutable fields or like name bindings?
<Drup>
like ocaml references
mk9 has quit [Quit: mk9]
<kakadu>
ah, you want to add assignment. OK
<kakadu>
I also have an idea about simple language with pattern matcing...
<Drup>
you can add a simple case, yes
<Drup>
with inL and inR
<Drup>
(arguably, sum types without types is less usefull, but ... :p)
maattdd_ has joined #ocaml
Jesin has joined #ocaml
maattdd_ has quit [Ping timeout: 260 seconds]
moei has joined #ocaml
wxyzzyrd has quit [Ping timeout: 264 seconds]
simpson has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
<reynir>
orbifx[m]: I think your client is broken :)
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<orbifx[m]>
Riot is broken
maattdd_ has joined #ocaml
<orbifx[m]>
But it let's me past a firewall :)
FreeBirdLjj has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
jao has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
cuicui has quit [Quit: leaving]
ziyourenxiang has quit [Ping timeout: 260 seconds]
Serpent7776 has quit [Quit: Leaving]
wxyzzyrd has joined #ocaml
zolk3ri_ has joined #ocaml
zolk3ri_ has left #ocaml [#ocaml]
cthuluh has quit [Ping timeout: 260 seconds]
cthuluh has joined #ocaml
nicoo has quit [Ping timeout: 272 seconds]
sapristi has quit [Remote host closed the connection]
nicoo has joined #ocaml
sapristi has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
nicoo has quit [Ping timeout: 272 seconds]
andreas_ has joined #ocaml
nicoo has joined #ocaml
wxyzzyrd has quit [Ping timeout: 265 seconds]
maattdd_ has joined #ocaml
KeyJoo has quit [Ping timeout: 276 seconds]
maattdd_ has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
maattdd_ has joined #ocaml
Chobbes has quit [Ping timeout: 240 seconds]
bramford has quit [Quit: leaving]
dhil has quit [Ping timeout: 240 seconds]
maattdd_ has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
Chobbes has joined #ocaml
wxyzzyrd has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
maattdd_ has joined #ocaml
wxyzzyrd has quit [Ping timeout: 256 seconds]
maattdd_ has quit [Ping timeout: 255 seconds]
kakadu has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
_y has joined #ocaml
orbifx1 has joined #ocaml
_y has left #ocaml [#ocaml]
bartholin has joined #ocaml
<bartholin>
hello
sapristi has quit [Remote host closed the connection]
<reynir>
When using qcheck with code that uses an RNG (e.g. most things using nocrypto), how do you deal with this ?
<reynir>
I guess you want to seed the RNG from qcheck somehow
<zozozo>
reynir: I guess I'd make the RNG seed configurable, and set it using the same seed as qcheck ?
<zozozo>
though it may be a bad idea, as it would make sense to change the seed independently (to check for errors in the libs RNG usage using the same generated tests for instance)
spew has joined #ocaml
<octachron>
reynir, I would think that one
<octachron>
could use the fact that random random variables can be flattened to random variables
<octachron>
i.e. generate the RNG seed randomly from qcheck
jmiven has quit [Quit: co'o]
<reynir>
Yea
<reynir>
Thanks
jmiven has joined #ocaml
zolk3ri has quit [Ping timeout: 260 seconds]
zolk3ri has joined #ocaml
Haudegen has joined #ocaml
argent_smith has quit [Quit: Leaving.]
orbifx1 has quit [Ping timeout: 256 seconds]
maattdd_ has joined #ocaml
moei has quit [Quit: Leaving...]
maattdd_ has quit [Ping timeout: 255 seconds]
DanielRichman has quit [Quit: leaving]
DanielRichman has joined #ocaml
zolk3ri has quit [Quit: leaving]
<ousado>
just saw that coq now uses opam as package manager, and read that opam2 introduces a few changes for opam switch, now I wonder if haxe could use opam as a package manager without too much hassle
an-tuan has quit [Quit: WeeChat 2.0.1]
feli has joined #ocaml
<ousado>
IIUC one would need a separate repo, and then one can set a flag on compiler packages, a base flag on directly with the compiler associated packages, and that's basically it
maattdd_ has joined #ocaml
<ousado>
I wonder in which ways opam2 is an ocaml-specific tool
Onemorenickname has quit [Read error: Connection reset by peer]
maattdd_ has quit [Ping timeout: 260 seconds]
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
maattdd_ has joined #ocaml
Jesin has quit [Quit: Leaving]
zmt00 has quit [Read error: Connection reset by peer]
zmt00 has joined #ocaml
kakadu has quit [Remote host closed the connection]
maattdd_ has quit [Ping timeout: 256 seconds]
<Armael>
ousado: AFAIU one of the goals of opam2 was precisely to make it not ocaml-specific, so that it could be used for other languages
<Armael>
(e.g. compilers are standard packages in opam2)