adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
BitPuffin has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 264 seconds]
gtrak has joined #ocaml
kvda has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
jao has quit [Ping timeout: 264 seconds]
Fare has joined #ocaml
pierpal has joined #ocaml
silver has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 260 seconds]
Fare has quit [Ping timeout: 256 seconds]
mali__ has quit [Read error: Connection reset by peer]
<jgkamat> is there a way to use pattern matching on strings? I'm trying to have branching code paths depending on the first character of a string
demonimin has quit [Remote host closed the connection]
Fare has joined #ocaml
tautologico has joined #ocaml
demonimin has joined #ocaml
mlh has joined #ocaml
dtornabene has joined #ocaml
pierpa has quit [Quit: Page closed]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
dtornabene has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
mlh has quit [Ping timeout: 244 seconds]
raduom has joined #ocaml
<jgkamat> never mind, I found a function to help
Fare has quit [Ping timeout: 256 seconds]
<xvilka> Does anyone know why this https://www.chargueraud.org/research/2015/ocaml_errors/ocaml_errors.pdf wasn't implemented?
<xvilka> those errors look so much better...
<Enjolras> xvilka: afaik because it requires maintaining two typechecker implementation and that scared devs a bit
<Enjolras> plus over concerns
<Enjolras> but some of the ideas got implemented already and some work is being done in the error messages front
jbrown has quit [Ping timeout: 256 seconds]
kleimkuhler has joined #ocaml
<xvilka> thx for the explanation
<Enjolras> there was a PR, you might want to read the comments if you want to get a clear picture of this topic :)
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
kleimkuhler has quit [Quit: kleimkuhler]
cbot has quit [Quit: Leaving]
mbuf has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
gtrak has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
zolk3ri has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
ColeW_Picaro has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tarptaeya has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
<Enjolras>
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
shw has left #ocaml [#ocaml]
TarVanimelde has joined #ocaml
<Armael> xvilka: I can give you a bit more details about that
<Armael> Arthur wrote a proof-of-concept patch for what is described here, and proposed a PR at the time with the patch (https://github.com/ocaml/ocaml/pull/102)
<Armael> however, there were basically two issues: the patch was monolithic (although it implements several independent improvements), somewhat hackish
<Armael> but also, there are a couple fundamental issues that remain; at the moment the patch does not interact well with GADTs and record field disambiguation, so this will have to be sorted out
<Armael> so in the end Arthur's original patch didn't get merged
<Armael> fast forward last winter, I also wondered why his patch wasn't merged into ocaml already, so I asked Arthur (he's my PhD co-advisor btw..) and we met with Jacques Garrigue and a couple other people to discuss this
<Armael> the conclusion was that: first there are some "easy" aspects of the patch (missing rec check, explanations for type constraints propagated by constructors..) that can be extracted and submitted as PRs
<Armael> then, the difficult part of the patch (the one which does a second typechecking phase to get better error messages for application) should be isolated, rebased on top of trunk, and then Jacques or other typechecker experts could look at it and try to solve the remaining problems
<Armael> Now: for the easy parts, I indeed submitted them as PR and most of them have already been merged in 4.07/4.08: see PRs #1720, #1510, #1505
<Armael> I'm also currently working on doing some refactoring and hopefully improving the printing of existing error messages
<Armael> and then hopefully I'll finish rebasing the remaining part of Arthur's part and people will be able to look at it
<Armael> xvilka: hope that answers your question :) In the end, the conclusion is that nothing's free, someone has to work for it, and this someone can be you!
<Enjolras> Armael: \o/
rixed has quit [Quit: "change TZ"]
rixed has joined #ocaml
Guest65784 has joined #ocaml
Guest65784 has quit [Read error: Connection reset by peer]
TheRuralJuror has joined #ocaml
jaar has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
<xvilka> Armael: thanks for the answer! And no, I am too dumb to work on this
<Armael> please :) I don't know shit about the compiler codebase either! But it's true that having physical access to Gabriel Scherer and Arthur clearly helps a lot
<reynir> heh
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
kakadu has joined #ocaml
kakadu has quit [Client Quit]
kakadu has joined #ocaml
TheRuralJuror is now known as Haudegen
jao has joined #ocaml
zolk3ri has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
mfp has joined #ocaml
mlh has joined #ocaml
webshinra has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Ping timeout: 265 seconds]
webshinra has joined #ocaml
shw has joined #ocaml
mlh has quit [Ping timeout: 265 seconds]
argent_smith has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
<discord> <rgrinberg> @struktured it does not. Generation of Json schemas would be orthogonal
al-damiri has joined #ocaml
jao has quit [Ping timeout: 248 seconds]
BitPuffin has joined #ocaml
jaar has quit [Ping timeout: 256 seconds]
kvda has joined #ocaml
moolc has joined #ocaml
Fare has joined #ocaml
silver has joined #ocaml
ziyourenxiang has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mk9 has joined #ocaml
freyr69 has joined #ocaml
mk9 has quit [Quit: mk9]
ziyourenxiang has quit [Read error: Connection reset by peer]
ziyourenxiang has joined #ocaml
moolc has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
shinnya has joined #ocaml
mahem1 has joined #ocaml
jao has joined #ocaml
spew has joined #ocaml
Haudegen has quit [Remote host closed the connection]
mlh has joined #ocaml
mlh has quit [Ping timeout: 268 seconds]
CcxWrk has quit [Ping timeout: 264 seconds]
CcxWrk has joined #ocaml
jbrown has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Fare has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
mbuf has quit [Quit: Leaving]
_andre has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
shinnya has quit [Ping timeout: 244 seconds]
Denommus has joined #ocaml
Haudegen has joined #ocaml
tarptaeya_ has joined #ocaml
tarptaeya has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
mk9 has joined #ocaml
jaar has joined #ocaml
<discord> <struktured> @rgrinberg what are you using atdgen for these days, if its not a trade secret to tell me?
<discord> <rgrinberg> @struktured No trade secrets, but also nothing really interesting to say. Atdgen has always been my tool of choice for auto generating json derivers
neatonk[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
<discord> <struktured> @rgrinberg interesting- do you have any opensource projects which demonstrate your style of using it this way?
pierpal has quit [Ping timeout: 260 seconds]
mk9 has quit [Remote host closed the connection]
<discord> <rgrinberg> Not really my project but I have contributed to the ocaml github bindings
<freyr69> Is atdgen better than yojson + ppx?
<freyr69> in the performance sense*
mk9 has joined #ocaml
mk9 has quit [Client Quit]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
Fare has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
lostman has joined #ocaml
FreeBirdLjj has joined #ocaml
freyr69 has quit [Remote host closed the connection]
pierpal has joined #ocaml
nkhodyunya[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
Soni has quit [Ping timeout: 244 seconds]
pierpal has quit [Ping timeout: 264 seconds]
pierpal has joined #ocaml
martinklepsch[m] has left #ocaml ["Kicked by @appservice-irc:matrix.org : removing from IRC because user idle on matrix for 30+ days"]
pierpal has quit [Read error: Connection reset by peer]
Soni has joined #ocaml
pierpal has joined #ocaml
<discord> <rgrinberg> Yes but for the wrong reasons
pierpal has quit [Read error: Connection reset by peer]
letoh_ has joined #ocaml
letoh has quit [Ping timeout: 244 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
pierpal has joined #ocaml
jao has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
pierpal has quit [Ping timeout: 248 seconds]
letoh_ is now known as letoh
jaar has quit [Ping timeout: 248 seconds]
ziyourenxiang has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
tarptaeya_ is now known as tarptaeya
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
<discord> <struktured> From atdgen tutorial: Auto-generating GUI widgets from type definitions is another popular use of annotated type definitions. The implementation of such code generators is facilitated by the atd library. I'd like to see an example of that.
pierpal has quit [Read error: Connection reset by peer]
<discord> <rgrinberg> Yeah, but you'd need to implement your own converters from the atdgen types to the gui widgets.
pierpal has joined #ocaml
<discord> <struktured> yeah I figured that, but I want to understand better how the converters are used and integrated, will study some existing projects more carefully...
pierpal has quit [Ping timeout: 256 seconds]
gtrak has quit [Ping timeout: 244 seconds]
zolk3ri has quit [Quit: leaving]
gtrak has joined #ocaml
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 244 seconds]
jaar has joined #ocaml
letoh has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
letoh has joined #ocaml
gtrak has quit [Ping timeout: 256 seconds]
gtrak has joined #ocaml
TheLemonMan has joined #ocaml
pierpal has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
pierpal has quit [Ping timeout: 248 seconds]
pierpal has joined #ocaml
Haudegen has quit [Remote host closed the connection]
dtornabene has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
tarptaeya has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
kakadu has joined #ocaml
raduom has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
mahem1 has quit [Quit: Page closed]
jao has joined #ocaml
jack5638 has quit [Ping timeout: 276 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jack5638 has joined #ocaml
<cjd> Does anybody know what the status is of multicore-ocaml ?
<cjd> Is it something that's "going to land in mainline" or more something kind of experimental which might end up in mainline at some point in the far future ?
<flux[m]> Work is still being done - seems there are 7 merged pull requests in 7 days. My guestimate of the situation is that in some point not so far in the future a feature complete version will be announced, but it will be a longer time before it will be merged into the mainline.
<flux[m]> Some parts of it hopefully end up earlier, such as effects. I guess typed effects will be years away.
<flux[m]> by "end up" I meant "end up integrated to the main line"
<flux[m]> You are already able to try the multicore ocaml opam switch, I have. But then I needed to switch out of it to do some stuff that required ppx which didn't work great with the language extensions (effects) :/.
<discord> <Bluddy> effects will probably not be integrated earlier
<flux[m]> Perhaps this is the url to monitor? https://github.com/ocamllabs/ocaml-multicore/milestone/2
<discord> <Bluddy> instead, multicore will arrive without effects AFAIK
<cjd> hmm, so I guess there's a company pushing this ?
<cjd> thx
<flux[m]> Bluddy: without effects at all? well that's a big change then!
<flux[m]> Wasn't the whole point that schedulers were written in OCaml using the effect system?
<flux[m]> Well, 60% point at least ;-)
<discord> <Bluddy> effects are really for concurrency moreso than for parallelism
<discord> <Bluddy> the problem with effects arriving before they're typed, is that it'll be hard to integrate the typing afterwards
<flux[m]> True, you can have the multiple domain stuff without that at all. So it's the regular thread interface then?
<flux[m]> That I can certainly agree with. So does that mean there's hope for typed effects?
<discord> <Bluddy> I believe so. perhaps simplified a little. But I could be wrong.
<discord> <Bluddy> yeah
<discord> <Bluddy> typed effects will be awesome
<flux[m]> I wonder how Lwt and Async will then work with all this, without effects..
<flux[m]> I guess they'll be changed to threadsafe and with some additional machinery to allow easier use of multiple threads; before it has been pointless.
<cjd> I'm very new to this ocaml/reasonml stuff, haven't even written one real program in them yet, but keep getting drawn in by the fact that things I like to do (macro-programming), which other people call "horrible" are pretty accepted here
<flux[m]> :)
spew has quit [Quit: going home]
<flux[m]> I guess ppx/macro programming is relatively popular in OCaml, and I believe today its story is much better than it used to be, though it's quite not as able as it used to be
<flux[m]> It's the third or fourth revision of it, depends how and what you count..
<flux[m]> Personally I haven't dug into how the drivers and ppx version converters work, but it seems that finally a future-proof solution. Sadly it didn't work with the effects switch, because I guess nobody is updating that piece of code for effects. I guess it makes sense if the effects effort is slowing down for multicore integration.
<cjd> > it's quite not as able as it used to be
<cjd> Less powerful ?
<flux[m]> yes. previously it was possible to create syntactic structures that were not valid plain ocaml, but nowadays the original code must in itself be valid ocaml code before it can be transformed.
<octachron> yes, strictly speaking camlp4/5 are more powerful than ppx
<cjd> ok, that's a fair tradeoff
<flux[m]> so it certainly limits the kind of structures you can propose. but on the other hand you can have a better understanding of the code, even if it uses extensions you are not familiar with.
<sophiag> i'm new to ocaml (coming from haskell) and trying to define a module to use a generic interface for different sequential data types like arrays. i'm cleary doing something wrong: https://pastebin.com/hnyHeH5k
* cjd keeps imagining the scene in The Matrix when there's a fight w/ an agent or something and they start bending reality and guy on the ship says "the code just got all weird"
jnavila has joined #ocaml
<flux[m]> sophiag: well, there are many things wrong with it :). what's your first problem?
<flux[m]> not sure what you mean by type 'a t = T of float 'a
<sophiag> flux[m]: ha. i'm not surprised. firt of all, i'm clearly not defining the type correctly
<flux[m]> also type arrayT = T array doesn't make sense and even if it did, it wouldn't match the Sequential interface
<flux[m]> what is the float's purpose in the interface?
<sophiag> i want to constrain types like Array or BatVect to all have the same type
<sophiag> my understanding is T is the constructor?
<sophiag> so T array would be like wrapping float array
<flux[m]> so if it's wrapping a float array, what is the 'a for?
<octachron> sophiag, OCaml does not have higher-kinded polymorphism
<sophiag> flux[m]: other modules with the type of that abstract module
<sophiag> e.g. float BatVect.t
<sophiag> octachron: i thought for something like this a module would actually be better than a type class...
<octachron> maybe but type variable cannot have kind "* -> *" in OCaml if it is what you are trying to do
<flux[m]> well, this is not maybe quite not what you were looking for, but https://pastebin.com/TWsRyzYy
<flux[m]> if you want it to work with any type (not just float) you would use a functor
<sophiag> flux[m]: thanks, that's helpful. the only thing i didn't consider is how to make this work with both mutable and immutable data structures given the return type of set
<octachron> flux[m], with the problem that the signature constraint make the module useless
<sophiag> could i use a functor to parametrize the container type rather than the elements? that was what i was going for initially with that type constructor
<flux[m]> actually maybe better: https://pastebin.com/sq8Xxwi6
<flux[m]> octachron: well yes that's one problem :)
jnavila has quit [Remote host closed the connection]
<flux[m]> and actually what I missed from that last paste is the other way to solve it
<flux[m]> module ArraySeqFloat : Sequential with type u = float = struct .. end
<flux[m]> actually2 it doesn't solve it ;) because the type t is still abstract
<flux[m]> so: module ArraySeqFloat : Sequential with type u = float with type t = float array =
<octachron> sophiag, you can with a functor `functor(Seq:Sequential) -> struct ... end`
<octachron> and Sequential = sig type 'a t val get: int -> 'a t -> 'a ... end
<sophiag> flux[m]: except in my case u will actually always be the same concrete type. i want to parametrize over modules like array
<sophiag> octachron: that looks like what i'm going for
<sophiag> octachron: like this?
<octachron> No? More https://pastebin.com/1UsAE1fn
<cjd> I'm getting issues with ocamlmerlin hundreds of processes and causing "no more resources" errors
<cjd> is merlin supposed to make hundreds of processes should I consider this a bug ?
<cjd> I'm using vscode w/ "OCaml and Reason IDE"
Jesin has quit [Quit: Leaving]
<octachron> cjd, this sounds like a bug
<cjd> maybe I should ask in the editor support chan on discord
Jesin has joined #ocaml
<sophiag> octachron: thanks, that's helpful. my initial confusion was largely over parametrizing the type rather than the function signatures that use it. i'm still a little unclear about module functors. in your example the module SeqUtil is unnecessary. i assumed i could define a functor in SEQ to be the type of ArraySeq
pierpa has joined #ocaml
<octachron> sophiag, I am not following you.
kvda has joined #ocaml
<sophiag> octachron: i was imagining something like this: https://pastebin.com/fz57yJDq
<octachron> Well, you are not using the functor argument in its body, thus it is useless
TC01 has quit [Remote host closed the connection]
<sophiag> yeah, i'm realizing i probably want the functor on the actual module i use `get` and `set` in and then i can define a module for ArraySeq using that as you did at the end of your snippet
TC01 has joined #ocaml
<sophiag> what's throwing me about your example is that you use Array.init in the same module as the functor so it breaks the abstraction barrier. but if i substitute another example it makes sense
<sophiag> and would you typically put the module type in an interface file?
<octachron> sophiag, my example does not break the abstraction barrier, I am just outputting an array from the Sequential abstract type
<octachron> you can put the module type in an implementation file, the interface file will control if it is hidden or visible from outside the (parent) module definition
<sophiag> okay, thanks
<sophiag> so to be clear, `array_up_to` is just an example of how with the functor you can use Seq.get rather than Array.get. so if you didn't need to call Array.init then just module ArraySeqUtil = SeqUtil(ArraySeq) would instantiate the type you're actually using?
<octachron> The functor is more or less creating new utility functions from the core functions defined in the interface Seq
<octachron> I am not sure what you mean by instantiating the type?
olle has joined #ocaml
<olle> still no prog language that supports linear types?
<olle> e.g. guarantees that a file handler is closed at exit.
<sophiag> octachron: grasping for terminology really. i realize ocaml has an object system so i didn't want to say "creating an instance of SeqUtil where ArraySeq is of type Sequential"
_andre has quit [Quit: leaving]
kakadu has quit [Remote host closed the connection]
Denommus has quit [Remote host closed the connection]
BitPuffin has quit [Remote host closed the connection]
Jesin has quit [Quit: Leaving]
shinnya has joined #ocaml
Haudegen has quit [Remote host closed the connection]
olle has quit [Remote host closed the connection]
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 268 seconds]
argent_smith has joined #ocaml
cbot has joined #ocaml
argent_smith2 has joined #ocaml
argent_smith1 has quit [Ping timeout: 256 seconds]
argent_smith has quit [Ping timeout: 256 seconds]
argent_smith2 has quit [Quit: Leaving.]
granttrec has joined #ocaml
jaar has quit [Remote host closed the connection]
jaar has joined #ocaml
cjd has quit [Ping timeout: 256 seconds]
Jesin has joined #ocaml
jao has quit [Ping timeout: 265 seconds]