companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<Anarchos> is a .ml needed to define a type, or just the .mli suffices ?
mxns has joined #ocaml
vicfred has quit [Ping timeout: 264 seconds]
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
rpcope has quit [Ping timeout: 258 seconds]
rpcope has joined #ocaml
wonko7 has quit [Ping timeout: 260 seconds]
vicfred has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
madroach_ has joined #ocaml
mxns has joined #ocaml
madroach has quit [Ping timeout: 256 seconds]
mxns has quit [Ping timeout: 272 seconds]
rpcope has quit [Ping timeout: 260 seconds]
oriba has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
steenuil has quit [Read error: Connection reset by peer]
mxns has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
rpcope has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mfp has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
schlaftier6 has joined #ocaml
schlaftier has quit [Ping timeout: 258 seconds]
schlaftier6 is now known as schlaftier
mxns has quit [Ping timeout: 256 seconds]
_habnabit has quit [Excess Flood]
_habnabit has joined #ocaml
mxns has joined #ocaml
madroach has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
madroach_ has quit [Ping timeout: 256 seconds]
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
<guanohhh> Anarchos: don't listen to me, but I think an mli is an interface and an ml is the implementation. If you are talking about getting away with just .mli files, I don't know.
narimiran has joined #ocaml
<d_bot> <Bluddy> I believe there are certain cases where you can use just an .mli file. I think this works for types. (i.e. no implementation is needed)
mxns has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <EduardoRFS> Yup, you can use a .mli if you're defining only types
<d_bot> <mnxn> huh, didn't know that
<d_bot> <mnxn> pretty cool
<d_bot> <mnxn> dune wants a `modules_without_implementation` field for it to work though
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
<companion_cube> Or, just use a .ml with types inside
<d_bot> <darrenldl> @Cyclomatic Complexity good news: recur API is kinda in place, and for the example you mentioned "Every 2 months, this. And every week, on Monday and Friday" can be done as follows
<d_bot> <darrenldl>
<d_bot> <darrenldl> ```
<d_bot> <darrenldl> recur ~month:(every_nth_month 2) start & weekdays [`Mon; `Fri]
mxns has quit [Ping timeout: 272 seconds]
<d_bot> <darrenldl> ```
<d_bot> <darrenldl>
<d_bot> <darrenldl> bad news: it's a mess to implement fully : D (recurrence up to day level is done at least), and I have no idea if it'll make it into the final API
<d_bot> <Bluddy> yeah not sure what the advantage is for .mli only
<d_bot> <darrenldl> (oh hm, i misread the sentence, oop)
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
vicfred has quit [Quit: Leaving]
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
daimrod has quit [Ping timeout: 258 seconds]
daimrod has joined #ocaml
shawnw has joined #ocaml
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #ocaml
<oni-on-ion> why does ocaml toplevel not refresh file list ?
<oni-on-ion> i create a file with toplevel loaded (just 'ocaml') and #mod_use or #load or anything, it cannot find the file until i restart the REPL. why is this
<oni-on-ion> ?
<def> which ocaml version?
<oni-on-ion> 4.11.1
<def> hmm, there was a change in 4.09 or 4.08. would you mind checking with an old version if you still have the problem? this look like a regression.
<oni-on-ion> "cannot find xyz.ml" and its in the same dir. it is not a heavy problem, as i can just make the files i know i may need before starting toplevel
<oni-on-ion> extremely reproducable
<def> yep, that's a regression. it's worth reporting :o
<oni-on-ion> http://ix.io/2I7L
<oni-on-ion> would it be better to wait for 4.12 ? sry i dont know what regression quite means
<oni-on-ion> (in this context)
<def> Regression means it is a feature that used to work and is now broken.
<oni-on-ion> ahh
<def> It is unlikely to be fixed in 4.12 if it is not reported.
<def> Do you think you can open an issue on https://github.com/ocaml/ocaml/issues/ ?
<oni-on-ion> i am not sure where to begin. i will try somethign simple
<oni-on-ion> thx we will see
<def> great, thanks
Haudegen has joined #ocaml
mbuf has quit [Ping timeout: 260 seconds]
cross has quit [Quit: Lost terminal]
<d_bot> <Ulugbek> `opam install memtrace_viewer` results in
<d_bot> <Ulugbek>
<d_bot> <Ulugbek> ```sh
<d_bot> <Ulugbek> #=== ERROR while compiling memtrace_viewer.v0.14.1 ============================#
<d_bot> <Ulugbek> # context 2.0.7 | macos/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#09d02dd3
<d_bot> <Ulugbek> # path ~/Code/ocaml/ocaml-git/_opam/.opam-switch/build/memtrace_viewer.v0.14.1
<d_bot> <Ulugbek> # command ~/.opam/opam-init/hooks/sandbox.sh build dune build --profile release --default-target @install . --root . --cache-transport=direct
<d_bot> <Ulugbek> # exit-code 1
<d_bot> <Ulugbek> # env-file ~/.opam/log/memtrace_viewer-87780-1872ec.env
<d_bot> <Ulugbek> # output-file ~/.opam/log/memtrace_viewer-87780-1872ec.out
<d_bot> <Ulugbek> ### output ###
<d_bot> <Ulugbek> # [...]
<d_bot> <Ulugbek> # dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
<d_bot> <Ulugbek> # Referenced from: /Users/ulugbekna/Code/ocaml/ocaml-git/_opam/.opam-switch/build/memtrace_viewer.v0.14.1/_build/default/vendor/async_ssl/src/../stubgen/ffi_stubgen.exe
<d_bot> <Ulugbek> # Reason: image not found
<d_bot> <Ulugbek> # /bin/bash: line 1: 96109 Abort trap: 6 ../stubgen/ffi_stubgen.exe -c > ffi_generated_stubs.c
<d_bot> <Ulugbek> # File "vendor/async_websocket/src/crypto.ml", line 2, characters 25-40:
<d_bot> <Ulugbek> # ^^^^^^^^^^^^^^^
<d_bot> <Ulugbek> # 2 | module CryptokitBignum = CryptokitBignum
<d_bot> <Ulugbek> # Warning 49: no cmi file was found in path for module CryptokitBignum
<d_bot> <Ulugbek> # File "vendor/async_websocket/src/crypto.ml", line 2, characters 25-40:
<d_bot> <Ulugbek> # 2 | module CryptokitBignum = CryptokitBignum
<d_bot> <Ulugbek> # ^^^^^^^^^^^^^^^
<d_bot> <Ulugbek> # Warning 49: no cmi file was found in path for module CryptokitBignum
<d_bot> <Ulugbek> ```
<d_bot> <Ulugbek>
<d_bot> <Ulugbek> Anybody knows how to fix this?
wonko7 has joined #ocaml
<d_bot> <Ulugbek> `opam install memtrace_viewer` results in
<d_bot> <Ulugbek>
<d_bot> <Ulugbek> ```shell
<d_bot> <Ulugbek> #=== ERROR while compiling memtrace_viewer.v0.14.1 ============================#
<d_bot> <Ulugbek> # context 2.0.7 | macos/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#09d02dd3
<d_bot> <Ulugbek> # path ~/Code/ocaml/ocaml-git/_opam/.opam-switch/build/memtrace_viewer.v0.14.1
<d_bot> <Ulugbek> # command ~/.opam/opam-init/hooks/sandbox.sh build dune build --profile release --default-target @install . --root . --cache-transport=direct
<d_bot> <Ulugbek> # exit-code 1
<d_bot> <Ulugbek> # env-file ~/.opam/log/memtrace_viewer-87780-1872ec.env
<d_bot> <Ulugbek> # output-file ~/.opam/log/memtrace_viewer-87780-1872ec.out
<d_bot> <Ulugbek> ### output ###
<d_bot> <Ulugbek> # [...]
<d_bot> <Ulugbek> # dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
<d_bot> <Ulugbek> # Referenced from: /Users/ulugbekna/Code/ocaml/ocaml-git/_opam/.opam-switch/build/memtrace_viewer.v0.14.1/_build/default/vendor/async_ssl/src/../stubgen/ffi_stubgen.exe
<d_bot> <Ulugbek> # Reason: image not found
<d_bot> <Ulugbek> # /bin/bash: line 1: 96109 Abort trap: 6 ../stubgen/ffi_stubgen.exe -c > ffi_generated_stubs.c
<d_bot> <Ulugbek> # File "vendor/async_websocket/src/crypto.ml", line 2, characters 25-40:
<d_bot> <Ulugbek> # 2 | module CryptokitBignum = CryptokitBignum
<d_bot> <Ulugbek> # ^^^^^^^^^^^^^^^
<d_bot> <Ulugbek> # Warning 49: no cmi file was found in path for module CryptokitBignum
<d_bot> <Ulugbek> # File "vendor/async_websocket/src/crypto.ml", line 2, characters 25-40:
<d_bot> <Ulugbek> # ^^^^^^^^^^^^^^^
<d_bot> <Ulugbek> # 2 | module CryptokitBignum = CryptokitBignum
<d_bot> <Ulugbek> # Warning 49: no cmi file was found in path for module CryptokitBignum
<d_bot> <Ulugbek> ```
<d_bot> <Ulugbek>
<d_bot> <Ulugbek> Anybody knows how to fix this?
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
steenuil has joined #ocaml
loxs[m] has quit [Quit: Idle for 30+ days]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<d_bot> <Cyclomatic Complexity> Nice!
bartholin has joined #ocaml
Tuplanolla has joined #ocaml
<oni-on-ion> def, also thanks =) seems to be well known as you suggested, there is awareness of it. i was hoping it was not just me
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mfp has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 240 seconds]
objmagic has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
cross has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
objmagic has joined #ocaml
objmagic has quit [Client Quit]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
waleee-cl has joined #ocaml
objmagic has joined #ocaml
mxns has joined #ocaml
<d_bot> <ulrikstrid> Is there a better way than Unix.gettimeofday when I need to check how long something took? I sometimes get negative numbers
<def> Sys.time ?
<def> (it measures CPU time, not wall clock)
Haudegen has joined #ocaml
<d_bot> <ulrikstrid> Thanks def, that seems to yield much better results 🙂
mfp has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
waleee-cl has quit [Ping timeout: 260 seconds]
waleee-cl has joined #ocaml
stux|RC has quit [Quit: Aloha!]
stux|RC has joined #ocaml
<d_bot> <craigfe> There is also dbuenzli's `mtime`, if you end up wanting greater precision
<theblatte> @ulrikstrid the mtime library? https://github.com/dbuenzli/mtime
<d_bot> <craigfe> I just default to that nowadays
<d_bot> <ulrikstrid> Sys.time seems fine for my usecase
<theblatte> @craigfe beat me to it :)
<d_bot> <ulrikstrid> I guess I just won't get the job if it's not okay 😂
stux|RC has quit [Quit: Aloha!]
mxns has quit [Ping timeout: 260 seconds]
stux|RC has joined #ocaml
mxns has joined #ocaml
shawnw has quit [Ping timeout: 260 seconds]
hnOsmium0001 has joined #ocaml
raver has quit [Remote host closed the connection]
RalfJ has quit [Remote host closed the connection]
RalfJ has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mxns has quit [Ping timeout: 260 seconds]
RalfJ has quit [Remote host closed the connection]
RalfJ has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
vicfred has joined #ocaml
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
bartholin has quit [Quit: Leaving]
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
objmagic has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
raver has joined #ocaml
<cemerick> is this ever actually unsafe, or just in bad taste? `let narrow : ('a * 'b * 'c) -> ('a * 'b) = Obj.magic`
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
<Armael> narrow (1, 2, 3) = (1, 2) is going to return false, so at least it would be a bit surprising
mxns has joined #ocaml
<theblatte> *ksssss*!
<zozozo> cemerick: well, it won't horribly break things, but the gc will keep alive the third value as long as the tuple is alive
<zozozo> additionally, you have Obj.truncate for this kind of things iirc
<companion_cube> why use Obj
<zozozo> companion_cube: because hacking the runtime if fun !
<zozozo> *is
<companion_cube> no it's not :p
<companion_cube> it's dangerous and it requires unsafe levels of knowledge of the compiler
<zozozo> well, it has to be, because else my job is not that fun, :p
<companion_cube> sure, but the compiler doesn't change under your feet
<companion_cube> by definition :)
<zozozo> indeed, XD
<zozozo> i'm more on the side of people that change the compiler under everyone else's feets, so, yeah I'm not a typical regular hack-the-runtime ocamler
<zozozo> and flambda will break your program if you use Obj, so indeed probably not a good idea
<companion_cube> exactly
<zozozo> actually, maybe flambda2 will complain at compile-time if you do this kind of thing (though maybe it allows them because of gadts), let me check
<cemerick> huh, narrow as above seems okay with flambda
<cemerick> not really worried about gc, since everything's long-lived anyway
<companion_cube> zozozo: how would it know?
<companion_cube> change of size?
<zozozo> companion_cube: flambda2 can keep track of a value's size and tag
<companion_cube> ok, so indeed a `magic` that changes the size is invalid
<companion_cube> btw, do you plan to be able to unpack non-escaping tuples/sums?
<companion_cube> like a local option/local tuple
<zozozo> you'd better wrap it in a Sys.opaque_identity at least
<zozozo> companion_cube: yup, it's already (partially) done
<companion_cube> will you have attributes to ensure it does so, and warnings if it fails to do so?
<companion_cube> (like [@tailcall])
<zozozo> companion_cube: so for instance with a view function, assuming it's inlined, the intermediate value wil likely not need to be allocated
<zozozo> for things like that across function borders, it's less easy to do (well less easy to determine when to do and precisely how to do that), so there are still some discussions about it
<companion_cube> yes, well, that's already something :p
<companion_cube> I guess we'll always be limited by the lack of proper value types
<zozozo> well... starting with flambda and in the backedn, it's not really that much of a problem, I think (but just to be sure what do you mean by proper value types ? the kinds proposed in the unboxing RFC ?)
objmagic has joined #ocaml
<companion_cube> yeah, something that is a value and not a block, even though it's not `int`
<companion_cube> (or a restriction thereof)
nullcone has joined #ocaml
vicfred has quit [Quit: Leaving]
gareppa has joined #ocaml
Jesin has quit [Quit: Leaving]
gareppa has quit [Quit: Leaving]
Jesin has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
Jesin has quit [Quit: Leaving]
mxns has quit [Ping timeout: 260 seconds]
Jesin has joined #ocaml
mxns has joined #ocaml
wonko7 has quit [Ping timeout: 258 seconds]
amiloradovsky has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
wonko7 has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> is there a way to insert raw html into tyxml?
objmagic has joined #ocaml
<thizanne> companion_cube:
<companion_cube> yeah...
<companion_cube> data did it
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
vicfred has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
mxns has joined #ocaml
Haudegen has joined #ocaml
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
Serpent7776 has quit [Quit: leaving]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
wonko7 has quit [Ping timeout: 260 seconds]
wonko7 has joined #ocaml
steenuil has quit [Read error: Connection reset by peer]