companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
azimut has quit [Ping timeout: 252 seconds]
chrisz has quit [Ping timeout: 244 seconds]
chrisz has joined #ocaml
bibi_ has quit [Quit: Konversation terminated!]
hsw has quit [Read error: Connection reset by peer]
hsw has joined #ocaml
bartholin has joined #ocaml
oisota3 has joined #ocaml
oisota has quit [Read error: Connection reset by peer]
oisota3 is now known as oisota
dme2 has quit [Ping timeout: 244 seconds]
dme2 has joined #ocaml
<discocaml> <ironside2396> is Unix library missing from 5.1 ?
<discocaml> <ironside2396> when I switch to 4.14 its there
<discocaml> <anmonteiro> It's not missing, what's your config and the error you're getting?
<discocaml> <lyhokia> How do I refer to a module in my `src/abc_lib/Mod_a.ml` from `test/inline-tests/Test_a.ml`? using `Abc_lib.Mod_a` doesn't help. I'm using drom
<discocaml> <ironside2396> forgot to add it to dune ... beginner mistakes I guess
Serpent7776 has joined #ocaml
chrisz has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
dnh has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
bibi_ has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml> <chimrod> Hello,
<discocaml> <chimrod>
<discocaml> <chimrod> I would like to report a bug in menhir but I’m not allowed to create any ticket in https://gitlab.inria.fr/fpottier/menhir/ (cannot create an account).
<discocaml> <chimrod>
<discocaml> <chimrod> The issue : menhir does not allow parametrized types with the `%parameter` mecanism:
<discocaml> <chimrod>
<discocaml> <chimrod> Example, this code :
<discocaml> <chimrod> ```
<discocaml> <chimrod> (* These are the functions that we need in order to write our semantic
<discocaml> <chimrod> actions. *)
<discocaml> <chimrod>
<discocaml> <chimrod> %parameter<Semantics : sig
<discocaml> <chimrod> type 'a number
<discocaml> <chimrod> …
<discocaml> <chimrod> end>
<discocaml> <chimrod>
<discocaml> <chimrod> %start <'a Semantics.number> main
<discocaml> <chimrod> …
<discocaml> <chimrod> ```
<discocaml> <chimrod>
<discocaml> <chimrod> Will generate this compilation error:
<discocaml> <chimrod> ```
<discocaml> <chimrod> -> required by alias default
<discocaml> <chimrod> File "parser.mli", line 24, characters 58-61:
<discocaml> <chimrod> 24 | val main: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> ('_a Semantics.number)
<discocaml> <chimrod> ^^^
<discocaml> <chimrod> Error: The type variable name '_a is not allowed in programs
<discocaml> <chimrod> ```
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml> <chimrod> And using an existencial type does not help :
<discocaml> <chimrod>
<discocaml> <chimrod> ```
<discocaml> <chimrod> %parameter<Semantics : sig
<discocaml> <chimrod> type 'a number
<discocaml> <chimrod> type e = E : 'a number -> e
<discocaml> <chimrod> …
<discocaml> <chimrod> end>
<discocaml> <chimrod>
<discocaml> <chimrod> %start <Semantics.e> main
<discocaml> <chimrod> ```
<discocaml> <chimrod> gives
<discocaml> <chimrod> ```
<discocaml> <chimrod> File "parser.ml", line 79, characters 57-64:
<discocaml> <chimrod> 79 | | MenhirCell1_expr of 's * ('s, 'r) _menhir_state * ('_weak1 Semantics.number)
<discocaml> <chimrod> ^^^^^^^
<discocaml> <chimrod> Error: The type variable name '_weak1 is not allowed in programs
<discocaml> <chimrod>
<discocaml> <chimrod> ```
Hammdist has quit [Quit: Client closed]
Hammdist has joined #ocaml
<discocaml> <chimrod> How can I report this ?
<discocaml> <._null._> When this happened to me, I sent a mail to François Pottier directly
<discocaml> <._null._> (this: not being able to report a bug on Gitlab)
<discocaml> <chimrod> Wow ! So personal, I’m not used to 😄
dhil has joined #ocaml
bibi_ has quit [Ping timeout: 264 seconds]
<discocaml> <octachron> You can use the menhir mailing list too.
bibi_ has joined #ocaml
<discocaml> <chimrod> Thanks, he already answered me !
Hammdist has quit [Quit: Client closed]
dnh has joined #ocaml
bibi_ has quit [Ping timeout: 260 seconds]
micro has quit [Ping timeout: 240 seconds]
micro has joined #ocaml
micro has quit [Ping timeout: 245 seconds]
micro has joined #ocaml
bibi_ has joined #ocaml
azimut has joined #ocaml
bibi_ has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
ns12 has quit [Quit: bye]
Hammdist has joined #ocaml
mro has joined #ocaml
yziquel has joined #ocaml
<yziquel> hi. i just install opam from ubuntu distribution. And I tried "opam init --comp=4.14.1". I got OpamSystem.File_not_found("/home/mini-me/.opam/repo/repos-config"). How do I initialise opam properly ?
mro has quit [Ping timeout: 240 seconds]
<yziquel> "opam init" gives me "/usr/bin/opam: "chmod" failed on /home/mini-me/.opam/opam-init/hooks/sandbox.sh: No such file or directory". this is so weird...
<octachron> I would try to `rm -f` the "~/.opam" directory and rerun "opam init --comp=4.14.1"
<yziquel> octachron there is no ~/.opam folder at all...
<yziquel> octachron which is precisely the whole point: it fails with that problem and ~/.opam doesn't even exist...
<yziquel> aaaaah.... octachron No space left on device...
John_Ivan has quit [Remote host closed the connection]
Serpent7776 has quit [Ping timeout: 258 seconds]
Tuplanolla has joined #ocaml
bibi_ has joined #ocaml
Hammdist has quit [Quit: Client closed]
yziquel has quit [Ping timeout: 245 seconds]
waleee has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 258 seconds]
bibi_ has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
bibi_ has joined #ocaml
bartholin has joined #ocaml
mro has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
yziquel has joined #ocaml
<yziquel> opam install dune says dune is installed. it's not on my PATH. anyone knows a quick fix ?
<discocaml> <._null._> Is there anything related to "opam" in the PATH ?
<yziquel> no
<discocaml> <._null._> Does opam not complain about doing `eval $(opam env)` ?
<yziquel> discocaml it did at one point. anything i don't understand, i don't do. i guess i missed something on the way. ofc.
<yziquel> ok. i'll put that in my config.fish.
<discocaml> <._null._> (discocaml is the bridge to Discord) `opam init` should do it for you
<yziquel> with bass plugin or so
<yziquel> why do people hate irc and love discord ???
<discocaml> <._null._> I guess you refused to have it touch your files, you should accept and review it
<yziquel> i refused because of fish...
<discocaml> <._null._> Discord keeps the message history, it has channels
<yziquel> it usually messes things up unless i don't do things manually.
<discocaml> <._null._> opam supports fish out of the box
<yziquel> ah. yes. i see it's fish friendly. cool.
<yziquel> cool. that fixed it.
<yziquel> and i still hate discord. i guess i belong to another millenia. litterally.
<discocaml> <._null._> Good thing there are bridges
<yziquel> bridges to nowhere.
waleee has quit [Ping timeout: 264 seconds]
<yziquel> is Daniel Bünzli still active in the ocaml community ?
<companion_cube> he sure is…
<yziquel> oh. ok
<discocaml> <._null._> (Were those … ?)
<companion_cube> yes
<discocaml> <._null._> The bridge still has issues with them
<companion_cube> grrr
<yziquel> companion_cube are the ... relative to the "swiss problem" i heard on youtube about some dune hostility ?
<companion_cube> yeah he doesn't like dune at all
<yziquel> why ?
discocaml has quit [Remote host closed the connection]
discocaml has joined #ocaml
<companion_cube> he finds it too complicated I think?
<companion_cube> … test
<yziquel> just tried compiling bap (binary analysis platform) with dune. underwhelming. complains about missing curl, missing dune-site, missing bitstring and a lot of other things.
<companion_cube> @._null_. better?
<discocaml> <._null._> … Looking good
<companion_cube> 💃
<discocaml> <._null._> 💃
<yziquel> companion_cube he seems to like minimalist approaches from what i remember. alas build systems need to handle stuff...
<yziquel> dune has a pip feel to it...
<discocaml> <._null._> dune doesn't install dependencies, that would be opam
<companion_cube> not yet anyway
<discocaml> <._null._> pip is the package manager, so that's opam as well
<yziquel> yeah. opam install . --deps-only fails with package conflict about conf-radare2...
<yziquel> i don't quite recognise the ocaml landscape.
<companion_cube> how long have you been away?
<yziquel> companion_cube a decade.
<discocaml> <._null._> `conf-*` stand for external dependencies
<companion_cube> ah yeah, it's evolved a bit 😂
<discocaml> <._null._> What's "a decade ago" in terms of OCaml versions ?
<yziquel> companion_cube yeah. it did. i think opam was just starting at the time.
<yziquel> companion_cube is the GC now able to handle OS threads ?
bibi_ has quit [Ping timeout: 264 seconds]
mro has quit [Ping timeout: 248 seconds]
waleee has joined #ocaml
<companion_cube> yes, since relatively recently
<companion_cube> @._null_. around 3.12, 4.0 ish
mro has joined #ocaml
<Ankhers> I use `dune new project foo` to create a project. I then created `lib/bar.ml`. Now it seems in my main.ml file I need to reference it as Foo__Bar.my_func. Can I explicitly name my modules or is this just how things work?
<octachron> Ankhers, you should *not* use Foo__Bar, the canonical name for the module `Bar` of library `Foo` is `Foo.Bar`.
<yziquel> companion_cube good to know. concurrent GC was a sticking point back then.
<Ankhers> octachron: Oh. Interesting. I did not realize those existed automatically. I was just following utop which when I started typing Foo, had Foo__Bar. Is there a reason both seem to be defined?
<octachron> `Foo__Bar` is the unique-behind-the-scene name for `Foo.Bar`.
<octachron> But there are no strict guarantee that this name will still be here in 10 years.
<discocaml> <._null._> And why is that name required ?
<octachron> Because namespacing is currently implemented through the 'no-alias-deps' module aliases.
<octachron> hack
<Ankhers> Thank for for the insight.
<discocaml> <._null._> (I don't know what you mean with "'no-alias-deps' module aliases")
<octachron> Basically dune defines a module `(* Lib.ml *) module X = Lib__Foo module Y = Lib__Bar`
<octachron> and open this module `Lib` in every modules `Foo` and `Bar` of `Lib`.
<octachron> which should create a circular dependency because `Lib` depends on `Foo` which depends on `Lib`
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<octachron> But the option `no-alias-deps` make it so that static aliases on module don't create dependencies and break the dependencies `Lib` depends on `Foo`.
<octachron> Allowing `dune` to create the pseudo-namespace `Lib`.
bibi_ has joined #ocaml
rgrinberg has joined #ocaml
<discocaml> <._null._> So dune compiles `lib/foo.ml` as `[lib/]lib__Foo.ml` to allow for this hack, because the alternative is to expose `Foo` directly to all other modules in the project ?
mro has quit [Ping timeout: 258 seconds]
myrkraverk has quit [Read error: Connection reset by peer]
myrkraverk has joined #ocaml
yziquel has quit [Quit: Client closed]
yziquel has joined #ocaml
yziquel has quit [Client Quit]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
ec has quit [Remote host closed the connection]
ec has joined #ocaml
troydm1 has joined #ocaml
troydm has quit [Ping timeout: 240 seconds]
yziquel has joined #ocaml
yziquel has quit [Quit: Client closed]
waleee has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
bartholin has quit [Quit: Leaving]
dhil has quit [Ping timeout: 248 seconds]
waleee has quit [Ping timeout: 258 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<src> `let rec sum_aux (acc : int) (l : int list) : int = ...`
<src> `let rec sum_tr : int list -> int = ...`
<src> no question about tail recursion, but why is `:` used in the first function to denote the return type of the function to be int, but `->` used in the second example to do the same?
<src> what makes both examples different to demand a different syntax to denote the return type... don't quite get it
<discocaml> <._null._> In the first case, the arguments are before the `=`; in the second case, the argument would be after the `=`
<discocaml> <._null._> You could write `sum_aux` equivalently as `let rec sum_aux : int -> int list -> int = fun acc l -> ...`
<src> "the ragument would be after the `=`" ?
<src> s/ragument/argument
<discocaml> <._null._> `let sum_tr : int list -> int = fun lst -> <something with lst>`
<octachron> ^ this is annotating the type of the full function
<octachron> "let sum x : int = ..." this is equivalent to "let sum = fun x -> (... : int)"
<octachron> because "let f x = ..." is a syntactic sugar for "let f = fun x -> ..."
<discocaml> <._null._> After `let sum_aux (acc : int) (l : int list) : int` is defined, the value `sum_aux` will have type `int -> int list -> int`, hence why we call it its full type
<src> all that sounds logical but I'm having trouble making the connection to my question but I might just be completely stupid atm
<src> why can I write `let rec sum_tr = ...` but not `let rec sum_tr : int = ...` but can write `let rec sum_tr : int -> int = ...` for example?
<src> seems like I just understand less about it all than I thought or I'm just completely hung up on something ludicrous
<discocaml> <Kali> `let rec sum_tr : int =` would mean the type of the value sum_tr is `int`
<discocaml> <._null._> `sum_tr` is a function, so its type is not `int` which is what the second one would indicate
<discocaml> <Kali> -> is the function type constructor
<discocaml> <._null._> (It could be an int)
<octachron> Functions are first class value so, "let x : int = 0" or "let succ: int -> int = fun x -> 1 + x" are the same thing.
<discocaml> <Kali> (not *literally* the same thing, just the same idea)
<discocaml> <Kali> to be very clear
<discocaml> <._null._> Same thing might be a bit much, but they are treated the same in most places, they are as different as ints and strings)
<src> alrighty... time to revisit my notes on functions... thanks though, appreciated all the quick input
<discocaml> <Kali> this might be something to chew on: functions are parameterized values
<discocaml> <Kali> at least, pure functions are
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
yziquel has joined #ocaml
Tuplanolla has quit [Ping timeout: 244 seconds]