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/
orbifx has quit [Ping timeout: 248 seconds]
waleee has quit [Ping timeout: 248 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chrisz has quit [Ping timeout: 268 seconds]
chrisz has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
spip has quit [Ping timeout: 248 seconds]
spip has joined #ocaml
John_Ivan has quit [Ping timeout: 256 seconds]
dh` has quit [Ping timeout: 252 seconds]
mbuf has joined #ocaml
williewillus_ has quit [Quit: Leaving]
azimut has quit [Ping timeout: 268 seconds]
gopiandc1 has quit [Read error: Connection reset by peer]
zebrag has quit [Quit: Konversation terminated!]
gopiandc1 has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gopiandc1 has quit [Ping timeout: 248 seconds]
gopiandc1 has joined #ocaml
dh` has joined #ocaml
Serpent7776 has joined #ocaml
dh` has quit [Changing host]
dh` has joined #ocaml
adanwan_ has quit [Read error: Connection reset by peer]
adanwan has joined #ocaml
gopiandc1 has quit [Ping timeout: 252 seconds]
gopiandc1 has joined #ocaml
bartholin has joined #ocaml
olle has joined #ocaml
<Leonidas> I am porting a project to dune and the author has asked me to put the Makefile bits back and holy shit is is a lot of code that also does a way worse job building (e.g. spewing artifacts all over the source tree)
<sim642> Sounds fun
<sim642> I recently also ported some Makefile stuff to dune fully (instead of having dune run make...)
<sim642> It can be a bit rough though because dune doesn't allow declaring targets in different directories
gopiandc1 has quit [Ping timeout: 256 seconds]
gopiandc1 has joined #ocaml
trev has joined #ocaml
orbifx has joined #ocaml
<pgiarrusso> sim642: dune allows at least declaring targets in subfolders
<pgiarrusso> You need (subdir name (rule …))
<sim642> That's declaring a rule in a subdir, not a target of a rule in the current dir to be in a subdir
orbifx has quit [Quit: orbifx]
Serpent7776 has quit [Ping timeout: 248 seconds]
dnh has joined #ocaml
Techcable has quit [Remote host closed the connection]
Techcable has joined #ocaml
Serpent7776 has joined #ocaml
gopiandc1 has quit [Ping timeout: 256 seconds]
gopiandc1 has joined #ocaml
Everything has joined #ocaml
oriba has joined #ocaml
Everything has quit [Quit: leaving]
xgqt has quit [Ping timeout: 248 seconds]
xgqt has joined #ocaml
jtm has quit [Ping timeout: 268 seconds]
jtm has joined #ocaml
trev has quit [Remote host closed the connection]
azimut has joined #ocaml
Haudegen has joined #ocaml
<olle> Error: Unknown field inline_tests
<olle> Did opam install ppx_inline_test
<olle> Anything else I should do?
<olle> Hm, also "Error: ppx_inline_test: extension is disabled because the tests would be ignored (the build system didn't pass -inline-test-lib)"
<olle> No reasonable google result found
<companion_cube> did you add a `(preprocess ` instruction?
<olle> Added all info here ^
<companion_cube> ah then no idea
<companion_cube> should be in the docs of ppx_inline_test no?
<olle> Can check that
<olle> I'm still trying to follow https://dev.realworldocaml.org/testing.html, but maybe that's just idiotic
<olle> Maybe the problem is that I have my test in a separate folder than the library?
<olle> So top line is not (library ..., but (test ...
<olle> Guess I could move the test to the lib folder, won't matter for me
gwizon has joined #ocaml
John_Ivan has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 256 seconds]
szkl has quit [Quit: Connection closed for inactivity]
<olle> Nice, new error message. "Error: No inline tests backend found.
<olle> Getting "closer"
<reynir> I'm getting this annoying Rresult.result vs Result.result error: https://p.reyn.ir/p/Jf-fuqR4foU
<olle> Oh, it works, but don't know why :d
<olle> Error: This expression has type ('a * Cstruct.t, Asn.error) Result.result
<reynir> likely it's not a problem if I upgrade, but there's a package constraining the versions
<olle> Result.result is abstract because no corresponding cmi file was found in path.
<olle> Is that the problem, being abstract?
<reynir> I think so
<reynir> As far as I can tell they're both Stdlib.result
<companion_cube> do you use the dune option to remove implicit dependencies?
rgrinberg has joined #ocaml
<reynir> It's in x509.0.11.2. I don't know
<reynir> Anyway it turns out I don't need x509.. \o/
Serpent7776 has quit [Quit: WeeChat 1.9.1]
Haudegen has quit [Ping timeout: 256 seconds]
Tuplanolla has joined #ocaml
Serpent7776 has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
<olle> 5 [%test_eq:int] 1 1
<olle> Error: Unbound value sexp_of_int
<olle> Sooo yeah
<olle> [%test_eq: int] 1 1, looks trivial enough? What's wrong?
<olle> Also, can I make a dune library contain multiple files?
azimut has joined #ocaml
<companion_cube> a library can contain many modules, sure
<olle> companion_cube: Hmmm, can't seem to find them from my bin/main.ml file :/ Only the "main" module.
<companion_cube> if the main moduel hsa the same name as the library, you need to re-export from it
<companion_cube> it acts like __lib__.py or lib.rs or whatever, if present
<olle> companion_cube: What's "re-export"?
<olle> Oh, include or something?
<companion_cube> typically, `module Foo = Foo`, or include, or `let x = Foo.x`, etc.
<olle> Lemme try that
<olle> Works, thanks \o/
dwt_ has quit [Ping timeout: 252 seconds]
<olle> OK, so Menhir question
<olle> All my program must start with `<?php // @pholyglot`, but I don't want it to be a token, or add it to the AST
<olle> Oh wait
<olle> Perhaps it works
mbuf has quit [Quit: Leaving]
<olle> Nope
<olle> This seems to work
<olle> 68 | s=START_SCRIPT d=list(declaration); EOF {Declaration_list d}
<olle> Just don't use s after ;
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
azimut has quit [Remote host closed the connection]
<olle> It's a token, but not added to the ast
azimut has joined #ocaml
<olle> OK, new error :)
<olle> Error: PTyp expected
<olle> In [%test_eq program]
<olle> The program type is missing some ppx thingy so it can be compared in tests?
<companion_cube> what is "program" here? an expression?
<olle> companion_cube: It's the ast type, actually
<companion_cube> ah wait. maybe it does need equal_program?
<olle> companion_cube: ppx_compare?
<companion_cube> or write it yourself probably
<companion_cube> I don't use this ppx, really, I have no idea
<olle> Ehm, how do I [@@derive two things]?
azimut has quit [Ping timeout: 268 seconds]
<olle> Ah
<companion_cube> [@@derive foo, bar]
<olle> Right
<olle> Oh, list type does not derive compare... :|
azimut has joined #ocaml
<companion_cube> hmm any deriver worth its salt should know `list`
<olle> Apparently, I need ppx_compare_lib for base types
<companion_cube> 😅
Anarchos has joined #ocaml
<olle> Still same PTyp error ><
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
<olle> Meh, syntax error, my bad
<Anarchos> weird, in merlin i always get file_perm instead of int
<companion_cube> they're aliases
<olle> Thoughts on exploding opam? https://paste.centos.org/view/c3219e3e
<olle> * No agreement on the version of ocaml:
<olle> The OCaml toplevel, version 4.14.0
<sim642> Probably another thing for the opam "hard to understand conflict" issue
<companion_cube> you sure you `eval $(opam env)` ? if so, is it an old OCaml
<olle> It says I have ocaml 4.14 installed
<olle> After doing the eval
<olle> sim642: link?
<Anarchos> companion_cube i know they are alias, but i prefer to see types as int-> ... instead of file_perm ->....
<sim642> I think the issue now links to a discussion where more are being collected
<sim642> Anarchos, I think it's just merlin picking the "closest" name for the type
<sim642> Have you used "open Unix" to bring it into scope?
<Anarchos> sim642 yes
<Anarchos> sim642 maybe i should use rather Unix.XXX syntax instead of opening it
<olle> [ERROR] undefined filter variable in dependencies of catala.0.7.0: catalaz3mode
<olle> Known?
<companion_cube> hmm, not to me
<sim642> olle, I think there was an issue about it, I saw someone asking recently
<olle> Hm
<companion_cube> in doubt, check on ocaml/opam-repository
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<olle> sim642: Thanks
<olle> Never had problems with opam before :d
<olle> Nah, probably another error causing my build to break
<olle> - ppx_sexp -> ocaml
Anarchos has joined #ocaml
<olle> Which version is ppx_sexp assuming with "ocaml" here??
<olle> oh my
<olle> - downgrade ocaml 4.14.0 to 4.02.3 [required by ppx_sexp]
<olle> This downgraded is needed for ppx_sexp
<Anarchos> olle you got your eureka moment...
<olle> ppx_sexp is the wrong package, facepalm
<olle> ppx_sexp_conv
<olle> Holy smoke, it works x|
<olle> Painful setup
<olle> And lots of details missing from realworldocaml
<olle> Thanks for all help
<olle> Again
<reynir> good old 4.02.3
<olle> Heh
<companion_cube> :DDDDD
<companion_cube> that's one version too low even for me
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<olle> And my first compiler test ever now runs <3
<olle> For my previous project, I never wrote any tests, and to come back 6 months later, having no idea where I was...
<Anarchos> olle compiler test ?
<olle> Anarchos: My own compiler, not OCaml compiler :)
<olle> or transpiler*
<Anarchos> olle ok :) i am working on the tiger compiler from the Andrew Appel book 'modern compiler implementation' , when i have time
<olle> Anarchos: Good book?
<olle> I only ever read one book on compilers, in Java lul
<olle> Then the OCaml LLVM tutorial
<Anarchos> olle yes good one
<olle> Can I motivate such a read on office hours... :d
<olle> So, should I do opam lock now...?
<companion_cube> probably… if you made it work
<olle> Ye
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
<olle> Hm, what am I locking? I want to "freeze" my dev env in this project
<companion_cube> should lock all the opam libraries that you use
<olle> companion_cube: I can't use my dune-project file for that?
<olle> opam lock <package name from dune-project>
<Anarchos> olle opam pin ?
<companion_cube> no, I think it needs to use the opam files
<companion_cube> but you can generate these from dune-project 😅
<olle> companion_cube: nice, how? or link?
<olle> Found it
nerdypepper has quit [Quit: bye]
nerdypepper has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #ocaml
waleee has joined #ocaml
rgrinberg has joined #ocaml
olle has quit [Ping timeout: 256 seconds]
neiluj has joined #ocaml
<neiluj> Hey! Got a C stub that executes two nested for loops and prints the product of their indices, but it crashes when I run dune test
<neiluj> keeping only one loop with a print works on the other hand
<neiluj> do you have some ideas on what to look at to hopefully fix this nasty issue?
<neiluj> also noticed that the C function is called a lot of time, even though it is called once in the OCaml code
<neiluj> oh, the C function happens to be also called a lot of time even if the Ocaml call to the C function is commented
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
gwizon has quit [Ping timeout: 252 seconds]
dnh has quit [Quit: Textual IRC Client: www.textualapp.com]
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
<sleepydog> neiluj: is your stub large? could you pastebin it?
Serpent7776 has quit [Quit: leaving]
<neiluj> sleepydog, somewhat, and depends on a specific C library
<neiluj> it turns out that removing parameters doesn't make the ocaml program crash
<neiluj> from 5 arguments to 1 for the C stub
<neiluj> since valgrind doesn't work with dune test, I guess I should make an executable and then run it with valgrind, but I'm not familiar with that
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<neiluj> removing arguments (CAMLParams) also reduces the number of prints so the number of calls to the C function
<neiluj> thanks for helping with this stuff, I'll try to debug with valigrind by crafting an executable, that should give the error
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
Tuplanolla has quit [Ping timeout: 252 seconds]