companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Soni has quit [Ping timeout: 276 seconds]
rgrinberg has joined #ocaml
williewillus has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
waleee has quit [Ping timeout: 255 seconds]
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
Soni has joined #ocaml
Sankalp- has joined #ocaml
Sankalp has quit [Ping timeout: 240 seconds]
Sankalp- is now known as Sankalp
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
trev has joined #ocaml
QDX45_ has quit [Ping timeout: 240 seconds]
zebrag has quit [Quit: Konversation terminated!]
xd1le has joined #ocaml
mbuf has joined #ocaml
kurfen_ has joined #ocaml
kurfen has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
williewillus has quit [Quit: Leaving]
fastru has quit [Ping timeout: 244 seconds]
fastru has joined #ocaml
Haudegen has joined #ocaml
salkin has joined #ocaml
gopiandcode has quit [Read error: Connection reset by peer]
gopiandcode has joined #ocaml
andreypopp has joined #ocaml
Serpent7776 has joined #ocaml
Tuplanolla has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
kakadu has joined #ocaml
Anarchos has joined #ocaml
<d_bot> <p0lunin> Hi, I'm reading Menhir docs about positions:
<d_bot> <p0lunin> *A position consists mainly of an offset (the position’s pos_cnum field), but also holds information about the current file name, the current line number, and the current offset within the current line*
<d_bot> <p0lunin> Did I understand correctly this type?
<d_bot> <p0lunin> ```
<d_bot> <p0lunin> type position = {
<d_bot> <p0lunin> ...
<d_bot> <p0lunin> pos_lnum : int; (* current offset within the line *)
<d_bot> <p0lunin> pos_bol : int; (* current line numer *)
<d_bot> <p0lunin> }
<d_bot> <p0lunin> ```
<Anarchos> p0lunin i thought that pos_bol was beginning of line, so the offset of the beginning of the line within the whole file
bartholin has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
wingsorc has quit [Quit: Leaving]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
<d_bot> <deepspacejohn> The type comes from the stdlib, documented here: https://v2.ocaml.org/releases/4.14/api/Lexing.html
Serpent7776 has quit [Ping timeout: 244 seconds]
amk has quit [Ping timeout: 240 seconds]
amk has joined #ocaml
fastru has quit [Changing host]
fastru has joined #ocaml
dnh has joined #ocaml
fastru has quit []
fastru has joined #ocaml
salkin has quit [Remote host closed the connection]
salkin has joined #ocaml
<companion_cube> hum, seems like a bug in the docs then
adanwan has quit [Remote host closed the connection]
jpds1 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
adanwan has joined #ocaml
jpds1 has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
xd1le has quit [Quit: xd1le]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
motherfsck has joined #ocaml
jpds1 has quit [Remote host closed the connection]
jpds1 has joined #ocaml
rgrinberg has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 272 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
bartholin has quit [Quit: Leaving]
gwizon has joined #ocaml
waleee has joined #ocaml
gwizon has quit [Quit: leaving]
trev has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
azimut has joined #ocaml
zebrag has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
<d_bot> <Bluddy> I really need someone to make sense of the ppx ecosystem for me. Which ppxs are compatible and which aren't is *so* confusing.
<d_bot> <Bluddy> ok the answer seems to be this post https://discuss.ocaml.org/t/the-future-of-ppx/3766 which I didn't pay enough attention to at the time
<companion_cube> hmmm most ppxes that use ppxlib should be compatible, I think
<companion_cube> that's most of them nowadays, excluding magic like ppx_import
mbuf has quit [Quit: Leaving]
orbifx has joined #ocaml
<orbifx> o/
<d_bot> <Bluddy> bleh. tries to switch ppx_deriving.show in my project to ppx_show and it breaks
<d_bot> <Bluddy> *tried
<d_bot> <Bluddy> and I love ppx_import
<d_bot> <Bluddy> it's too valuable to let go
<rgrinberg> companion_cube why is ppx_import incompatible?
<companion_cube> I mean, it has to go into its own stage, no?
<companion_cube> you know mor ethan me
<rgrinberg> it shouldn't make it incompatible - just slower
<d_bot> <Bluddy> in general we want to direct people away from ppx_deriving-based ppxs now, right?
<d_bot> <Bluddy> (assuming the alternatives work)
<rgrinberg> yes, there's no advantage in using the ppx_deriving api
<companion_cube> and there again, if only ppx_deriving.std was moved to ppxlib
<companion_cube> if only
<sim642> companion_cube, there is some attempt under the ocaml-ppx organization to rewrite it or something
<companion_cube> good, I just hope it works
<sim642> Not much progress though, it was some Outreachy thing
<d_bot> <Bluddy> fyi I'm also relating to the discussion/post here https://discuss.ocaml.org/t/creating-a-ppx-that-transforms-record-updates/10189/8?u=bluddy
<rgrinberg> it's not the most interesting project indeed
<d_bot> <Bluddy> it's quite essential though
<companion_cube> it's incredibly important
<companion_cube> so important that it's basically the only ppx who has an equivalent in rust's *stdlib*
<rgrinberg> half of ppx_deriving.std has equivalent janestreet ppxlib derivers
<rgrinberg> and it's basically the important subset of them
<companion_cube> but don't the janestreet ppx pull half the universe with them?
<sim642> ^
<rgrinberg> no, just base usually
<companion_cube> ppx_deriving has the attractive properties that it doesn't have deps and is *stable*
<companion_cube> and it has a tiny runtime dep
<rgrinberg> ppx_deriving pulls findlib and cppo
<companion_cube> findlib is… ok?? cppo is a build dep
<companion_cube> I mean, are you going to argue that base is as small and stable as ppx_deriving.runtime? :/
<rgrinberg> no, but i find both more heavy than they should be
<d_bot> <anmonteiro> this is also annoying https://github.com/ocaml-ppx/ppx_deriving/issues/212
<d_bot> <Bluddy> what do you guys think of https://github.com/thierry-martinez/metapp ?
<d_bot> <Bluddy> as mentioned in that thread?
<d_bot> <anmonteiro> I haven't had time to play with it, but my eternal complaint is: it'd be nice if it were hygienic
<companion_cube> rgrinberg: ah, sure. In my dream world, ppx_deriving's derivers would be in the stdlib… no deps
<d_bot> <Bluddy> yeah they really need to be
<rgrinberg> i wish that metapp didn't rely on findlib
<companion_cube> didn't realize you dislike findlib that much :)
<rgrinberg> well, it's an issue for the monorepo effort
<d_bot> <Bluddy> we desperately need something like metapp/ppx_stage that is typed i.e. a metaprogramming language in ocaml
<d_bot> <anmonteiro> sounds like _you_ desperately need it 😛
<d_bot> <Bluddy> well you can see the demand is there
<rgrinberg> tbh, dbuenzli's suggestion for reflection in the compiler is more conservative and compelling to me.
<d_bot> <Bluddy> ppx is esoteric and is converging on small modifications rather than the global scope it allows for
<rgrinberg> all of these constexpr pretenders are far less attractive without deeper build system integration
<d_bot> <Bluddy> not to mention the repeated pain of maintaining ppx since it doesn't have a user-facing api
<rgrinberg> ppx does have a user facing api
<rgrinberg> what's ppxlib if not that?
<companion_cube> yeah, a third party library
<companion_cube> what's Dbuenzli's suggestion? can't remember that one
<d_bot> <Bluddy> I mean that's finally changing and ppx is becoming a sort-of user-facing api. but the problem was precisely that it wasn't use-facing
<d_bot> <Bluddy> question: is the output of rust's metaprogramming facility type-checked?
<companion_cube> sure
<companion_cube> it's all macros
<d_bot> <Bluddy> right so that's a big advantage
<companion_cube> I mean, ppx is typechecked too?
<d_bot> <Bluddy> but I was thinking of something like metapp
<companion_cube> same, no? you get a parsetree that's later typechecked
<d_bot> <Bluddy> yeah ok
<d_bot> <Bluddy> what does the note at the bottom mean here https://github.com/thierry-martinez/metapp
<companion_cube> well, it's on the caller of the ppx to ensure they produce well-typed ASTs
<companion_cube> whereas with metaocaml/ppx_stage(?) you get a more principled staging system
<companion_cube> I think?
<d_bot> <Bluddy> I guess so... confusing
<d_bot> <Bluddy> it's very cool though. the example Thierry provides for my request is essentially a full-on macro system
<rgrinberg> consider something like let i : int = [%meta .. ] vs. let i : int = Ppx_stage.run [%code .. ]
<rgrinberg> the former will rely on ocamlc to give you the type error after the preprocessing
<rgrinberg> while the latter should error before running anything if the quotation isn't of type int code
<d_bot> <Bluddy> I see. thanks!
<d_bot> <Bluddy> So the latter should be a little easier to debug
<rgrinberg> defo
<rgrinberg> a lot easier in some cases. debugging type errors in large generated code can be quite hard
orbifx has quit [Ping timeout: 272 seconds]
<companion_cube> rgrinberg: what's the dbuenzli reflection proposal?
salkin has quit [Quit: salkin]
<companion_cube> oh, the runtime type representation?
<companion_cube> that's useful, but not exactly a replacement for ppx_deriving in all cases
<companion_cube> (like, the performance profile will be quite different)
<companion_cube> (I'm thinking about deriving eq/ord in particular)
<rgrinberg> at the same time, it gives a fallback to pretty much all possible uses of deriving without ppx
<companion_cube> all those that are not performance critical, yeah
<companion_cube> I guess if it were combined with staging, it'd be as fast potentially… but that's a lot to ask for :(
Anarchos has joined #ocaml
<Anarchos> i needed help to compile dune/..../otherlibs/stdune/wait3_stubs.c with a -lbsd linker flag
ente is now known as ente`
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Anarchos has quit [Ping timeout: 240 seconds]
Tuplanolla has quit [Quit: Leaving.]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
fastru has quit [Ping timeout: 244 seconds]
fastru has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
wingsorc__ has joined #ocaml