<flux>
btw, though I haven't used core's command line parsing (or anything really :)) I can recommend the great Cmdliner module
<flux>
(though it has a bit steep learning curve)
<flux>
not the least because it gives a very fancy git-liek experience with --help ;-)
glennsl has joined #ocaml
<mpenet`>
I'll look it up, thx for the tip
FreeBirdLjj has quit [Remote host closed the connection]
al-damiri has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
jwatzman|work has joined #ocaml
octachron has joined #ocaml
FreeBirdLjj has joined #ocaml
freehck has quit [Remote host closed the connection]
<reynir>
cmdliner is awesome
mfp has joined #ocaml
soupault has joined #ocaml
<mpenet`>
Command is kind of nice too I must say
<mpenet`>
close to what I am used to in other languages
FreeBirdLjj has quit [Remote host closed the connection]
soupault is now known as messiah
messiah is now known as soupault
wu_ng has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
orbifx-m has joined #ocaml
evhan has quit [Ping timeout: 240 seconds]
<orbifx-m>
Hello all
evhan has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
govg has joined #ocaml
FreeBirdLjj has joined #ocaml
adelbertc has quit [Quit: Connection closed for inactivity]
rossberg has quit [Ping timeout: 264 seconds]
ygrek_ has quit [Ping timeout: 276 seconds]
govg has quit [Ping timeout: 265 seconds]
martinkl_ has joined #ocaml
martinkl_ has quit [Client Quit]
martinkl_ has joined #ocaml
martinkl_ has quit [Client Quit]
martinkl_ has joined #ocaml
martinkl_ has quit [Client Quit]
martinkl_ has joined #ocaml
govg has joined #ocaml
pierpa has joined #ocaml
martinkl_ has quit [Read error: Connection reset by peer]
<orbifx-m>
There are two MessagePack libraries for ocaml. Anyone using either of them?
<flux>
maybe their authors.. :) but thanks, I hadn't heard of MessagePack.
<flux>
is it better than protobuf?
rossberg has joined #ocaml
<flux>
can ocaml polymorphic variants and sum types be intelligently be mapped onto it?
<flux>
difficult choice between msgpack and msgpck. the former has had more releases, while the latter seems to be more built on the work of others (sexplib, ocplib-endian). the former is licensed under ISC, I don't know what msgpack is licensed under.
<flux>
it seems msgpack depends on camlp4 while mgspck uses ppx. that would be a deciding factor for me to try out msgpck out first.
AlexDenisov has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
AlexDenisov has quit [Client Quit]
<companion_cube>
the next lib will be called msgpk
AlexDenisov has joined #ocaml
_andre has joined #ocaml
<orbifx-m>
flux: same rational here. I like that it doesn't enforce an idl and generators unlike protobuf
<orbifx-m>
companion_cube: lol
FreeBirdLjj has joined #ocaml
<flux>
I guess it can be a bit annoying with protobuf, if you're not working with multiple projects
govg has quit [Ping timeout: 250 seconds]
<orbifx-m>
Found the same issue with DDS implementations. I don't like the idea a lot
<orbifx-m>
vbmithr: here?
silver has joined #ocaml
Submarine has quit [Remote host closed the connection]
<orbifx-m>
flux: it seems vbmithr (msgpck(
<orbifx-m>
Has submitted a PR to remove camlp4 which he says is not needed for the core library.
<flux>
..how about for using it?
<flux>
or how does the syntax extension work
govg has joined #ocaml
<flux>
msgpck didn't depend on camlp4 to begin with according to opam?
<companion_cube>
why does it depend on sexplib -_-
<orbifx-m>
flux: no msgpack does depend. And the developer of the other implementation has submitted a patch to remove it, but hasn't been accepted
circuitbreak98 has joined #ocaml
<orbifx-m>
companion_cube: what's wrong with sexplib? It even sounds sexy
<companion_cube>
it seems a bit pointless to have a dependency on this in a serialization library that is not related to S-expressions
<orbifx-m>
Maybe it's for parsing purposes? Dunno
kakadu has quit []
<dmbaturin>
What I find disappointing about every single serialization protocol (schema enforcement issues aside) is that none of them comes with a standardized line protocol, so the "unimportant" detail, how to actually get the data to the application is left up to the user. :)
<companion_cube>
isn't it the point? e.g. with json, you can put json wherever you want, in a file or in a http body, it doesn't matter
<dmbaturin>
Well, it limits it to a single message per file, or per request. Not so important for files or HTTP, but for stream-oriented protocols, I really wish there was something that could just read messages from a stream, without me having to think how exactly it's done.
<dmbaturin>
There are things like ZMQ of course, which come with their own limitations in communication department.
<dmbaturin>
And can be an overkill if there's no queue per se.
sh0t has joined #ocaml
<companion_cube>
dmbaturin: you could just concatenate them
<companion_cube>
with a good parser it should be doable
<dmbaturin>
companion_cube: With JSON, yes. I'm mostly talking about those space-efficient binary stuff, like protobuf. You can't just concatenate them, they need actual framing.
<companion_cube>
oh
<companion_cube>
they're not encoding their own length or something?
<dmbaturin>
Speaking of which, can yojson read JSON this way?
<dmbaturin>
I'm still to see one that comes with its own framing, be it length encoding or anything. Not claiming none exist, just that I haven't seen one. :)
<companion_cube>
I have no idea, but I know Bunzli explicitely refused to parse several successive json values in jsonm because it's not in the standard
<dmbaturin>
Well, it's indeed not in the standard, so it's understandable.
sh0t has quit [Remote host closed the connection]
Unknown123 has joined #ocaml
<Unknown123>
Hello guys. Can anyone tell me which one is the command to print something on the screen? Thank you
<lyxia>
like print_string?
<Unknown123>
Mmmm
<Unknown123>
Yes, but it is not working
<Unknown123>
I gotta be doing something wrong
<mrvn>
well, what are you doing?
<Unknown123>
I have in a .ml file # print_string "Hello World";; and then I'm compiling it with ocamlc file.ml but it returns an error
<lyxia>
oh print_string is a function, not a toplevel directive
<mrvn>
because it is. you can't just go and issue commands.
<dmbaturin>
Unknown123: To be specific, if you bother to write "let () = ...", you can avoid ;;'s in top level function calls. If its type is not unit, you can do "let _ = ", though I would use the ignore function instead (let () = ignore 4).
<Unknown123>
Oh makes sense, thank you :)
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dmbaturin>
Also, ocamlc is the bytecode compiler. Most of the time you'll want ocamlopt, the native one. You should also get familiar with ocamlfind as you will start linking libs sooner or later.
FreeBirdLjj has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
govg has quit [Ping timeout: 240 seconds]
<Simn>
Anyone good with menhir? I'm trying to figure out how to actually recover from a HandlingError state. The manual states that I can "resume normal parsing", but simply calling resume is going to put it in Rejected state.
soupault has quit [Remote host closed the connection]
copy` has joined #ocaml
dakk_ has quit [Ping timeout: 265 seconds]
zv has joined #ocaml
<orbifx-m>
dmbaturin: what you are after would be bad design
<orbifx-m>
The layers for these things are important
yomimono has joined #ocaml
<orbifx-m>
And a silver bullet for this thing doesn't exist as it stands. Different uses need different stacks. I am putting this on zeromq for example, but I'm also considering for sending it to a really simple processor over rs232
<dmbaturin>
orbifx-m: Well... Is there a _generic_ layer for exchanging messages over byte streams?
<dmbaturin>
Not a rhetorical question, I'll be happy if you point me at one.
<orbifx-m>
Generic layer?
ggole has joined #ocaml
<dmbaturin>
Yes. Something I could point to a byte stream and read messages from it (underlying details of how bytes are sent are up to me).
<orbifx-m>
Like a socket?
minn has joined #ocaml
<dmbaturin>
Anything really. We are talking layering, right? :)
<orbifx-m>
You would have to get down to kernel level stuff. And where would you stop? Ethernet 8b/10b encoding?
sh0t has joined #ocaml
<orbifx-m>
You have to relinquish control of low level formats at some point for a good reason: there are some aspects which are more of an issue for others than your application
lolisa has quit [Ping timeout: 260 seconds]
<dmbaturin>
This talk is not going anywhere and I'm not in the mood to continue it, unless you get back to the topic of a generic line protocol for parsing byte streams into messages. ;)
<orbifx-m>
If you explain what you mean and want by generic line control. Still haven't understood
<dmbaturin>
I did already.
<mpenet`>
is it idiomatic to pass a tuple of args to anonymous functions instead of abusing currying?
<mpenet`>
(it's less verbose)
zpe has quit [Remote host closed the connection]
<dmbaturin>
mpenet`: Well, it can be. I don't think there would be abuse of currying; to me it depends on whether pieces of the tuple make sense without one another.
<mpenet`>
kinda, writing (fun x -> (fun y -> ...)) feels a bit odd
<dmbaturin>
E.g. passing user/password pair as a tuple is perfectly idiomatic to me in every case because a closure with just user is useless; but I might want a function that takes coordinates to be curried because I may want to fix just X and do things with various Y's.
<mpenet`>
too many parens (excuse my lisp habbits)
<mpenet`>
true
<dmbaturin>
But if it's not exposed to the user of the function, I think it's just aesthetic consideration. I might want to go for a tuple for brevity if I can change it any time without breaking anything outside the function.
<mpenet`>
that's what I did. thanks for the advices
<Drup>
mpenet`: (fun x y -> ....)
<Drup>
;)
zpe has joined #ocaml
<mpenet`>
damnit it does work, I could swear merlin was yelling at me when I tried ealier
<mpenet`>
oh well
yomimono has quit [Ping timeout: 276 seconds]
sdothum has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
<dmbaturin>
Yeah, this too. ;)
rgrinberg has joined #ocaml
<orbifx-m>
What's the syntax for aliasing a module? Like open Bytes as B?
<dmbaturin>
module B = Bytes ?
<rgrinberg>
or locally with let module B = Bytes in
<orbifx-m>
Does that create an inclusion of the module?
<Drup>
orbifx-m: "an inclusion" ?
<orbifx-m>
There is a janestreet article which says that the above syntax creates a full copy of the module
<Drup>
probably an old article
<Drup>
that's not the case anymore
dakk_ has joined #ocaml
<orbifx-m>
Ow that's what it says, 4.02 changed it right?
<Drup>
module aliases, don't remember which version
<orbifx-m>
If I open Msgpck, it works fine. If I alias with module M = Msgpck, it complains that no implementations were provided for it
<dmbaturin>
That's quite strange.
edwin has joined #ocaml
shinnya has joined #ocaml
<orbifx-m>
It was a makefile issue. But it's strange that it changed the compiler error
yomimono has joined #ocaml
Flerex has joined #ocaml
minn has quit [Ping timeout: 250 seconds]
Flerexweweqe has joined #ocaml
Flerex has quit [Client Quit]
Flerexweweqe is now known as Flerex
agarwal1975 has joined #ocaml
Flerex has quit [Client Quit]
govg has joined #ocaml
jwatzman|work has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<Bluddy[m]>
anybody know the performance impact of -no-naked-pointers mode? Is it activated by default?
orbifx-m2 has quit [Read error: Connection reset by peer]
mattrepl has joined #ocaml
rpip has joined #ocaml
<sh0t>
is there a somewhere a good tutorial on how to use quickcheck with ocaml?
AlexDenisov has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
Xizor has joined #ocaml
orbifx-m has joined #ocaml
octachron has joined #ocaml
dave24 has quit [Quit: leaving]
rpip has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
octachron has quit [Ping timeout: 240 seconds]
rpip has joined #ocaml
ygrek_ has joined #ocaml
octachron has joined #ocaml
govg has quit [Ping timeout: 265 seconds]
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 240 seconds]
<def`>
Bluddy[m]: I might be completely wrong, but I remember a 10% to 20% faster GC
<rgrinberg>
When you pin to override a pacage with opam, does the .install file also get overriden?
<rgrinberg>
seems like that's not the case
orbifx-m2 has quit [Ping timeout: 244 seconds]
orbifx-m has joined #ocaml
octachron has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
gasche` has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
yomimono has joined #ocaml
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 264 seconds]
<Bluddy[m]>
def`: thanks
govg has joined #ocaml
octachron has quit [Read error: Connection reset by peer]
octachron_ has joined #ocaml
<notdan>
Is there a way to list all the available functions/values in the module in the REPL?
shinnya has joined #ocaml
<Drup>
#help;;
<Drup>
oh, that's not what you asked, sorry
<Drup>
#show_module M
octachron_ has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
octachron has quit [Client Quit]
orbifx-m has joined #ocaml
orbifx-m2 has quit [Ping timeout: 252 seconds]
<notdan>
ah, thanks
octachron has joined #ocaml
ggole has quit []
yomimono has quit [Ping timeout: 244 seconds]
orbifx-m2 has joined #ocaml
orbifx has joined #ocaml
orbifx-m has quit [Ping timeout: 244 seconds]
octachron has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
orbifx-m2 has quit [Ping timeout: 264 seconds]
orbifx-m has joined #ocaml
slash^ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
Distortion has joined #ocaml
<sh0t>
HI guys, I am trying to use quickcheck for some tests... i don't know how to start to generate random ADTs though... (sorry i am pretty new of ocaml...) do u guys have any ideas ?