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
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
tobiasBora has joined #ocaml
eh_eff has quit [Ping timeout: 268 seconds]
infinity0 has quit [Remote host closed the connection]
pmetzger has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
hashpuppy has joined #ocaml
infinity0 has joined #ocaml
bigs has joined #ocaml
<hashpuppy> is there something this simple for ocaml? if not, why? `case class Model(hello: String, age: Int); parse(rawJson).extract[Model]`
<hashpuppy> even with deeply nested case classes, it's simple
<hashpuppy> in ocaml i found a library, but you have to run some code generator
<hashpuppy> don't understand why
troydm has quit [Ping timeout: 260 seconds]
mfp has quit [Ping timeout: 260 seconds]
jabroney has quit [Quit: Leaving.]
spew has joined #ocaml
pmetzger has quit []
al-damiri has quit [Quit: Connection closed for inactivity]
spew has quit [Ping timeout: 240 seconds]
eh_eff has joined #ocaml
spew has joined #ocaml
eh_eff has quit [Ping timeout: 282 seconds]
apache2 has joined #ocaml
apache2_ has quit [Remote host closed the connection]
spew has quit [Ping timeout: 240 seconds]
jack5638 has joined #ocaml
rpg has joined #ocaml
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
struk|desk has quit [Ping timeout: 240 seconds]
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 240 seconds]
nomicflux has joined #ocaml
mengu has quit [Quit: Leaving...]
jao has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
nomicflux has quit [Quit: nomicflux]
MercurialAlchemi has joined #ocaml
spew has joined #ocaml
lucybun has quit [Read error: Connection reset by peer]
lucybun has joined #ocaml
spew has quit [Ping timeout: 258 seconds]
AlexDenisov has joined #ocaml
cbot has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
jack5638 has joined #ocaml
govg has quit [Quit: Internet disconnected]
Mercuria1Alchemi has joined #ocaml
cbot` has joined #ocaml
cbot` has quit [Client Quit]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<flux> hashpuppy, because ocaml doesn't have runtime introspection, therefore it must be performed compile time with ie. ppx-based syntax extensions.
<flux> ocaml doesn't preserve type information after the compilation phase
Simn has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
Geekingfrog has joined #ocaml
<companion_cube> indeed, ppx is the simplest way of doing this
<companion_cube> type model = { hello: stirng; age: int} [@@deriving yojson]
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
<reynir> Hint: Did you mean string? ;)
<companion_cube> :p
AltGr has joined #ocaml
<ngWalrus> type stirng = string
<ngWalrus> problem solved :^)
<companion_cube> ^
* companion_cube adds the alias to containers
freusque has joined #ocaml
AlexDenisov has joined #ocaml
maattdd has joined #ocaml
argent_smith has joined #ocaml
<reynir> haha
<reynir> CCStirn
<reynir> oh oops, now you have to add that too
<companion_cube> :p
govg has quit [Quit: leaving]
srcerer_ has joined #ocaml
srcerer has quit [Ping timeout: 268 seconds]
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
jimt_ has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jimt has quit [Ping timeout: 240 seconds]
jimt_ is now known as jimt
alfredo has joined #ocaml
AlexDenisov has joined #ocaml
mfp has joined #ocaml
<ngWalrus> has anyone of you guys used OCaml when making a REST API/web app
<ngWalrus> I've been reading around and I'm getting really mixed results on whether it's a good match
<ngWalrus> it seems to be a kind of love it or hate it kind of deal
kakadu has joined #ocaml
mrgrieve1 has quit [Quit: Lost terminal]
<ngWalrus> I should just prototype this and see if it works
<flux> ngwalrus, I've had good experiences writing a REST client. https://github.com/eras/telkkarista-dl
jao has joined #ocaml
<flux> there was a related link in reddit.com/r/ocaml recently as well I think..
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<reynir> what's telkkarista
AlexDenisov has joined #ocaml
<ngWalrus> from television
<ngWalrus> or from tv rather
<ngWalrus> I assume it was a site/api to check for tv guides
<flux> it was a now-defunct site that provided the finnish tv-channels over internet
<ngWalrus> I'll have to give this a shot
<ngWalrus> looking at the telkkarista code it looks like a pretty good match
<ngWalrus> maybe with some luck I can replace the nodejs monstrosity I'm having to work with right now
cbot has quit [Quit: Leaving]
<flux> I like the end of endpoints.ml the most :)
<ngWalrus> I also like how most of the existing functions in the codebase are at least 2-3 times longer than endpoints.ml
richi235 has joined #ocaml
ee has joined #ocaml
ee has quit [Client Quit]
freyr has joined #ocaml
<freyr> Quick Lwt question: documentation says that `If one of the threads fails, then join l will fails with the same exception as the first one to terminate`. Does that mean that join will terminate only after all threads terminate or should it terminate also if one of the threads fails
cschneid has quit [Ping timeout: 260 seconds]
<mrvn> freyr: join will raise the exception the thread failed with
<mrvn> freyr: From the wording I would say it still waits for all of them but raises the exception of the first one to fail.
<freyr> @mrvn: Ok, I see, thanks. I was confused why it continues other threads after thread failure
<mrvn> join sounds dangerous to me. What about the second thread that failed? Is that exception lost?
Jaxan_ is now known as Jaxan
<mrvn> choose or nchoose seems saner
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has joined #ocaml
<freyr> Yeah, join feels unreliable in most cases while threads could fail (or at least lwt should not have included Fail as lwt state, async feels saner to me)
<freyr> async's approach*
AlexDenisov has joined #ocaml
freyr has quit [Quit: Lost terminal]
tg has quit [Quit: Leaving]
tg has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<infinity0> does talex5 visit this channel? someone mentioned 0install on the reproducible-builds mailing list and wondered if he wanted to comment on it https://lists.reproducible-builds.org/pipermail/rb-general/2017-April/thread.html#461
nahra has joined #ocaml
lucybun has quit [Read error: Connection reset by peer]
alfredo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfredo has joined #ocaml
alfredo has quit [Client Quit]
andreas__ has joined #ocaml
<reynir> I think he visits #mirage
<infinity0> ah, i sent him an email anyways
AlexDenisov has joined #ocaml
myst|fon has joined #ocaml
myst|fon has quit [Client Quit]
nomicflux has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
alfredo has joined #ocaml
mengu has joined #ocaml
sepp2k has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
nomicflux has quit [Quit: nomicflux]
alfredo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
AlexRussia has joined #ocaml
alfredo has joined #ocaml
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
pirbo has quit [Quit: bye]
sepp2k has quit [Client Quit]
sepp2k has joined #ocaml
<mrvn> Anyone know of a module to handle inter-process shared memory passing of ocaml types.
zeldangit has quit [Ping timeout: 260 seconds]
andreypopp has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
_andre has joined #ocaml
lucybun has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
<mrvn> smondet[m]: That's not realy what I mean. That just uses shared memory as transport layer with a serialize and deserialize function on both ends that I have to write myself. I was thinking about something that uses ppx or so to get the structure of the type and manages them directly in shared memory.
<mrvn> somethign with zerocopy
<Drup> you could probably do something like that with cstruct
<Drup> or with one of the zero copy serialization formats (binprot/protobuf)
rpg has joined #ocaml
<mrvn> Drup: I was thinking to start with sexp but cstruct makes more sense I guess. thx.
<Drup> Given that the GC will not run on the shared memory part, I would use the most flat data representation possible, which cstruct is decent at
<mrvn> yeah. every value should be a single blob with no pointers outside the blob.
<mrvn> I think I will just custom build something with cstruct. I don't need arbitrary caml values, just a handfull of messages that I can define as c structs. (even better as c structs since most of the workers are C code).
<smondet[m]> mrvn: to play outside of the GC this could be useful, at least as inspiration: https://admin.fedoraproject.org/pkgdb/package/rpms/ocaml-ancient/
<mrvn> smondet[m]: was that upodated for recent ocaml?
<mrvn> last changeThu, 9 Dec 2010 21:33:20 +0000 (21:33 +0000)
<mrvn> I'm pretty sure that won't work with 4.01 and the new caml_modify / initialize anymore.
<mrvn> netmcore might do what I want
mengu has quit [Quit: Leaving...]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
<orbitz> Anyone here making heavy use of ppx_deriving.* here? I'm wondering if your experience has been positive? Seems like it might be safe ppx to use until we get implicits (assuming we do)
spew has joined #ocaml
<smondet[m]> orbitz: yes overall positive experience; minus the fact that when a new version of OCaml is out you may have to wait for the ppx'es to realease a new version (that's being worked on by def` )
<orbitz> I'm thinking of making use of show, eq, and ord
<orbitz> those seem lik the highest leverage ones
<companion_cube> and yojson
<orbitz> I dont' really use yojson
<companion_cube> ah, well
<companion_cube> if you do serialization it's very useful
<orbitz> I can imaine
<orbitz> I'm not super into automatically generated serializes from types but I can see they speed osme things up
shinnya has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 268 seconds]
MercurialAlchemi has joined #ocaml
averell has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
andreypopp has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 258 seconds]
<mrvn> I think over time the ppx interface will become more stable and not need fixes every time.
zeldangit has joined #ocaml
al-damiri has joined #ocaml
<zeldangit> what switch should I use? right now I am on 4.04 but I am getting the following error: https://gist.github.com/zeldangit/74a3c7532daa2e7be12741068efd8e33
tane has joined #ocaml
<orbitz> I'm hoping implicit modules if they happen solve most of the things I'd be interested in ppx for
<companion_cube> well, implicits are not going to generate code for you
<companion_cube> even Haskell has both typeclasses (~ implicits) and `derive` (~ ppx_deriving)
<mrvn> anyone used ppx to generate code for methods of a class?
<companion_cube> I think "visitors" might
<companion_cube> (well, it generates classes, if that's your question)
<mrvn> not quite. I have the class. I want to create/modify annotated methods
pmetzger has joined #ocaml
<companion_cube> humpf.
<companion_cube> no idea then.
<mrvn> I need the name of the class, the self type and self name. Somehow then you have to handle somewhere around 30 different types and tons of indirections and so and I got lost in all that jungle.
<Drup> what are you trying to do with the self type ?
<mrvn> Drup: annotate the method I'm creating
<mrvn> or coercion.
<mrvn> coersion?
<mrvn> however you spell it.
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mrvn> Drup: The end goal is for the Qt5 bindings to have basically class Foo = object external bla : unit = "foo__bla_stub" end
<Drup> wouldn't you be better off with some ctypes-style mini-DSL to represent the C++ classes ?
<mrvn> How would I tell ocaml about the inheritance between the classes?
<mrvn> i.e. I can pass a QButton to a function that expects a QWidget.
<Drup> abstract types, just like in ctypes
<mrvn> Drup: won't type check. QButton.t and QWidget.t would be different types.
<Drup> ah, you want subtyping
<mrvn> Drup: Currently I have ocaml objects and a widgets is passed as object that has an as_widget method.
<Drup> then phantom types maybe ?
<mrvn> QButton has that so "show_widget button" just works.
<Drup> you seem to want the object typing
<Drup> you have no reason to use the objects semantics
zeldangit_ has joined #ocaml
<mrvn> Drup: yeah, phantom types would work for the typing.
<mrvn> don't remember where I run into problems with that though.
zeldangit has quit [Ping timeout: 260 seconds]
ryanartecona has joined #ocaml
<mrvn> Drup: Personally I think GUIs are the best use case of OO. It just makes sense that I can say button#setEnabled true
<mrvn> "Widget.setEnabled button true" just isn't the same. Then I have to know where setEnabled is actually declared and if it gets overridden in any of the subtypes.
<pmetzger> Are you manually writing these bindings or are you parsing C++ to help generating them?
<mrvn> pmetzger: currently manually. Parsing doesn't work since the c++ code doesn't show how ownership of pointers changes. Some methods take ownership, some release it, some share it.
<pmetzger> could you figure that out from walking the C++ itself? libclang has ocaml bindings...
<mrvn> https://github.com/mrvn/ocaml-qt5 The tetris example code works.
<pmetzger> or is it just llvm that does? I can't remember.
<mrvn> pmetzger: that would mean transforming c++ code into linear types. don't think I can do that.
<mrvn> Probably easier to write some rules to guess. Like methods starting with "take" return ownership. And if there is a "takeFoo" then "insertFoo" steals ownership.
<pmetzger> and one could override them for things where it isn't correct.
<mrvn> pmetzger: at which point I would like to use ppx to just take some annotations and generate the stub code for me.
<pmetzger> generating code is nicer than having to write it of course. :)
fraggle_ has joined #ocaml
zv has quit [Ping timeout: 268 seconds]
fraggle_ has quit [Ping timeout: 255 seconds]
fraggle_ has joined #ocaml
MercurialAlchemi has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
sz0 has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
sepp2k has quit [Quit: Leaving.]
copy` has joined #ocaml
srcerer_ has quit [Quit: ChatZilla 0.9.93 [Firefox 49.0/20160916101415]]
eh_eff has joined #ocaml
zv has joined #ocaml
sh0t has joined #ocaml
soupault has joined #ocaml
govg has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
srcerer has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
maarhart has joined #ocaml
maarhart has quit [Client Quit]
Exagone313 has quit [Quit: see ya!]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
Xadnem has joined #ocaml
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
soupault has quit [Remote host closed the connection]
Exagone313 has joined #ocaml
pmetzger has quit [Ping timeout: 255 seconds]
Xadnem has quit [Quit: leaving]
spew has quit [Ping timeout: 268 seconds]
Xadnem has joined #ocaml
elfring has joined #ocaml
elfring has quit [Client Quit]
TheLemonMan has joined #ocaml
TarVanimelde has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
spew has joined #ocaml
zv has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 260 seconds]
zv has joined #ocaml
ryanartecona has joined #ocaml
troydm has joined #ocaml
Anarchos has joined #ocaml
Xadnem has quit [Ping timeout: 252 seconds]
MercurialAlchemi has joined #ocaml
kakadu has joined #ocaml
Xadnem has joined #ocaml
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 240 seconds]
spew has quit [Quit: foobar]
pmetzger has joined #ocaml
strykerkkd has joined #ocaml
zv has quit [Ping timeout: 255 seconds]
<orbitz> companion_cube: how does one use ppx_deriving.show with CCMap?
pmetzger has quit []
eh_eff has quit [Ping timeout: 240 seconds]
strykerkkd has quit [Quit: Leaving]
<companion_cube> heh, humm, there's a print function in it
<companion_cube> I' not sure there's a way of automating it 100% though
<orbitz> Can I tell .show to use the print function for that part of my type?
zv has joined #ocaml
zv has quit [Ping timeout: 260 seconds]
<companion_cube> yes!
<companion_cube> [@printer some_fun] or something
AltGr has left #ocaml [#ocaml]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ryanartecona has quit [Quit: ryanartecona]
<orbitz> companion_cube: thanks!
govg has joined #ocaml
jlouis has quit [Remote host closed the connection]
apache2 has quit [Remote host closed the connection]
ahf has quit [Read error: Connection reset by peer]
eh_eff has joined #ocaml
<hashpuppy> yesterday i asked why code generation was needed for yojson and the answer was because ocaml doesn't support runtime types. how does code generation and ppx solve this problem? does it create its own version of runtime types and then gives us an interface to make operating with it more friendly?
<orbitz> hashpuppy: ppx and freinds are compile-time
<orbitz> hashpuppy: ppx is a metaprogramming tool
<mrvn> code generation allows serialization functions to be generated automatically.
<companion_cube> (so it's more efficient than runtime types, actually)
_andre has quit [Quit: leaving]
<orbitz> But you can't do some things
<hashpuppy> all i want to be able to do is say here's a record of this type. i want to fetch some data from a url at runtime and parse that data into that record. then use the record with its types
<mrvn> you can always tag types with runtime infos.
<companion_cube> mrvn: ‽
<hashpuppy> in scala const model = parse(rawJson).extract[Model]; println(model.hello)
<companion_cube> hashpuppy: well, write your record with [@@deriving yojson]
<companion_cube> then you get record_of_json, end of story
<hashpuppy> cool. thanks. i guess i should read about deriving and ppx, right?
<companion_cube> yeah
<orbitz> The documentation on ppx_deriving is kind of weak. But the yojson example is in the README
<companion_cube> orbitz: really? I like this readme!
<orbitz> Actually, you're right.
<orbitz> The Plugin: make documentation is outdatedthough. There is create and make and create takes the unit and make doens't. Not sure the point
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ahf has joined #ocaml
jlouis has joined #ocaml
pmetzger has joined #ocaml
spew has joined #ocaml
sh0t has quit [Remote host closed the connection]
<orbitz> companion_cube: do you know how to use [@printer but with a recursive datatype?
<companion_cube> same?
cbot has joined #ocaml
<companion_cube> ah, wait
<orbitz> the pp is not defined
<orbitz> i think.
<companion_cube> it should be, actually
<companion_cube> it's in the scope of the recursive function
<companion_cube> so you can call it
<orbitz> Hrmmm
<orbitz> companion_cube: so if I have "module SMap = CCMap.Make(String);;" what am I doing wrong here: type t = int SMap.t [@printer SMap.pp CCString.print pp] [@@deriving show];;
<orbitz> Actually that is clearly wrong
<orbitz> minimal testcase fail
<companion_cube> let pp = SMap.pp CCFormat.string CCFormat.int
<companion_cube> will be simpler
<orbitz> type t = | A | B of int SMap.t [@printer SMap.pp CCString.print pp] [@@deriving show];;
<companion_cube> (it's hard to use deriving on types defined elsewhere, especially if they are opaque)
<orbitz> Is the actual situation I have
<companion_cube> why is that an int, not a t?
<orbitz> Ack! fail again, one sec
<orbitz> when i change int to t it works, hrmm
<companion_cube> :D
<orbitz> Ohhh
<orbitz> I'm a dummy
<orbitz> All my fault!
<orbitz> Thanks
jack5638 has quit [Ping timeout: 260 seconds]
tane has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
Xadnem has quit [Quit: leaving]
eh_eff has quit [Ping timeout: 252 seconds]
strykerkkd has joined #ocaml
argent_smith has quit [Quit: Leaving.]
<rgrinberg> anyone have an example of a travis setup with multiple opam packages out of 1 repo?
eh_eff has joined #ocaml
spew has quit [Quit: foobar]
eh_eff has quit [Ping timeout: 260 seconds]
Simn has quit [Quit: Leaving]
shinnya has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
andreas__ has quit [Quit: Connection closed for inactivity]
richi235 has quit [Ping timeout: 260 seconds]
nomicflux has joined #ocaml
kakadu has quit [Remote host closed the connection]
zv has joined #ocaml
zv has quit [Ping timeout: 240 seconds]
pmetzger has quit [Remote host closed the connection]
eh_eff has joined #ocaml
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]