companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Tuplanolla has quit [Quit: Leaving.]
<d_bot> <BobbyT> utop loads about 30 things for a new project. and its slow af doing it
<d_bot> <BobbyT> also dune utop -j 4 doesnt even change the jobs from 1 to a higher number. idk if u can?
dhil has quit [Ping timeout: 272 seconds]
zebrag has joined #ocaml
vicfred has quit [Ping timeout: 268 seconds]
<companion_cube> if your project is built, I don't think -j4 will change anything
<companion_cube> dune utop is really 2 things: build the relevant bytecode libraries, then call utop with insturctions to load them
<companion_cube> (30 things for a new project?! a new project should be empty)
dy` has quit [Quit: ZNC 1.9.x-git-124-15e2351d - https://znc.in]
dy has joined #ocaml
waleee-cl has quit [Ping timeout: 252 seconds]
waleee-cl has joined #ocaml
<d_bot> <BobbyT> when i do dune utop it says:
<d_bot> <BobbyT> Done: 32/32 at the end
<d_bot> <BobbyT> so its processing 32 things for sure
<d_bot> <BobbyT> idk why its doing so much work
waleee-cl has quit [Ping timeout: 272 seconds]
<companion_cube> ah, it's just dune rebuilding a few things I guess
<companion_cube> but if you do it twice, the second time should be fast?
waleee-cl has joined #ocaml
<d_bot> <BobbyT> yeah but when u edit a single thing it does it all again
<d_bot> <rgrinberg> It depends on where the file is in your dependency tree. If it’s near the root, a lot of recompilation would be expected
<d_bot> <BobbyT> im just confused why dune itself is slow. cuz this project only uses pervasives and theres a 100 lines total.
<d_bot> <BobbyT> using makefile and ocaml opt would be more convenient imo
<d_bot> <rgrinberg> Perhaps you have a huge directory in your source tree? That would slow things down
<d_bot> <BobbyT> nah this is basically a fresh project
<companion_cube> is `dune build @install` also slow?
<d_bot> <BobbyT> no its a lot faster
<d_bot> <BobbyT> its basically instant
<companion_cube> right, that's more normal
<d_bot> <rgrinberg> There’s another way to use the top level with dune. You can run the top level first, and then load the libraries with a special directive.
<d_bot> <rgrinberg> I don’t remember the invocation off the top of my head though
<companion_cube> for me `dune utop src/` is fast to start utop, then utop takes a second or so to start and load stuff
<companion_cube> roughly
<d_bot> <BobbyT> i dont even have a src directory. i have the bin/ lib/ config thing
<companion_cube> sure sure, `dune utop lib`
<d_bot> <BobbyT> nah same speed
<companion_cube> I'd run `strace dune utop lib` but that's going to be quite verbose
<d_bot> <BobbyT> i guess the real issue is that it doesnt cache things in memory like ghci and just allow :r
<d_bot> <BobbyT> is there a technical reason why utop cant reload like that?
waleee-cl has quit [Ping timeout: 268 seconds]
<companion_cube> I have no idea
<companion_cube> the toolchain is not designed to have several versions of a library, that's for sure
ocabot has joined #ocaml
ocabot has quit [Remote host closed the connection]
ocabot has joined #ocaml
<companion_cube> !manual
<companion_cube> yess
ocabot has quit [Remote host closed the connection]
ocabot has joined #ocaml
mikess has quit [Ping timeout: 244 seconds]
zebrag has quit [Quit: Konversation terminated!]
<drakonis> nice
<drakonis> what is it written with? ocaml :V?
<companion_cube> yep
<companion_cube> it has been a little bit of a mess recently, with SASL and all that
<companion_cube> but it works again
<plvoskik> is ocaml ever going to get official support for multicores?
<drakonis> hmm yes
<drakonis> within the year
<drakonis> at long last
<plvoskik> hurrah!
plvoskik has quit [Ping timeout: 252 seconds]
Ekho- is now known as Ekho
plvoskik has joined #ocaml
<companion_cube> or next year maybe? not sure it can happen in <6 month
<plvoskik> i'd rather them take their time
wingsorc has joined #ocaml
plvoskik has quit [Ping timeout: 244 seconds]
<companion_cube> it's been in the works for years and years, but upstreaming also takes time
<companion_cube> @plvoskik I'd recommend reading the "multicore ocaml" monthly posts
<d_bot> <BobbyT> Out of curiosity, does Jane street want multicore?
<d_bot> <anmonteiro> correction: last one was https://discuss.ocaml.org/t/multicore-ocaml-may-2021/7990/2
<companion_cube> hmpf the 2 was important then
<companion_cube> sometimes discuss' urls annoy me
<companion_cube> @BobbyT I think so?
<companion_cube> who doesn't want multicore
<d_bot> <BobbyT> They’ve been without it so long. So I’m assuming they never needed it. If Jane street wanted multicore it probably woulda been implemented a long time ago, since they have the resources. That’s just an assumption tho.
<companion_cube> I think they funded precedent efforts
plvoskik has joined #ocaml
<companion_cube> I can't find the names
<companion_cube> but there were at least 2 projects before with that aim, that didn't get to a mergeable state
wingsorc has quit [Quit: Leaving]
wingsorc has joined #ocaml
<d_bot> <anmonteiro> no you posted the march 2021 one
<companion_cube> oh my bad.
tizoc has quit [Quit: Coyote finally caught me]
<companion_cube> m-months :p
tizoc has joined #ocaml
mikess has joined #ocaml
shawnw has quit [Ping timeout: 244 seconds]
wonko has joined #ocaml
mro has joined #ocaml
mbuf has joined #ocaml
yoctocell has joined #ocaml
Haudegen has joined #ocaml
olle has joined #ocaml
vsiles_ is now known as vsiles
Wilfred has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 272 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
andreypopp_ has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
andreypopp has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
wonko has quit [Ping timeout: 268 seconds]
mro has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
wonko has joined #ocaml
bartholin has joined #ocaml
unyu has quit [Ping timeout: 252 seconds]
unyu has joined #ocaml
dhil has joined #ocaml
gareppa has joined #ocaml
unyu has quit [Read error: Connection reset by peer]
unyu has joined #ocaml
gareppa has quit [Quit: Leaving]
Guest9824 has quit [Quit: Konversation terminated!]
unyu has quit [Read error: Connection reset by peer]
Guest4189 has joined #ocaml
troydm has joined #ocaml
unyu has joined #ocaml
unyu has quit [Read error: Connection reset by peer]
mal`` has quit [Quit: Leaving]
mal`` has joined #ocaml
unyu has joined #ocaml
<d_bot> <Cyclomatic Complexity> I see on the man ways to copy files in dune actions, and to depend on a whole dir in dune deps, but is there a way to copy a whole dir?
<d_bot> <Cyclomatic Complexity> (without running custom commands)
<d_bot> <EduardoRFS> it accepts a glob
<d_bot> <Cyclomatic Complexity> i expected glob to not be enough, as deps accept globs too, but have an option for entire dirs
unyu has quit [Read error: Connection reset by peer]
<d_bot> <Cyclomatic Complexity> dune error i don't get:
<d_bot> <Cyclomatic Complexity> https://pastebin.com/hrBpYidt
<d_bot> <Cyclomatic Complexity> `Error: This action has targets in a different directory than the current one,`: but both path start with `./`
unyu has joined #ocaml
<d_bot> <Cyclomatic Complexity> (I replaced it with `(system "cp ...")`, dirty, but does the job)
Wilfred has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Quit: Bin weg.]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
unyu has quit [Ping timeout: 268 seconds]
unyu has joined #ocaml
mbuf has quit [Quit: Leaving]
mro has joined #ocaml
olle has joined #ocaml
mro has quit [Ping timeout: 252 seconds]
yoctocell has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
dhil has quit [Ping timeout: 272 seconds]
mro has quit [Ping timeout: 244 seconds]
mro has joined #ocaml
dhil has joined #ocaml
waleee-cl has joined #ocaml
zebrag has joined #ocaml
TheLemonMan has joined #ocaml
dhil has quit [Ping timeout: 272 seconds]
mro has quit [Remote host closed the connection]
dhil has joined #ocaml
vizard has joined #ocaml
mro has joined #ocaml
smondet[m] has quit [Ping timeout: 244 seconds]
krnkktz has quit [Read error: Connection reset by peer]
radiopotin[m] has quit [Read error: Connection reset by peer]
Sumera[m] has quit [Read error: Connection reset by peer]
labor[m] has quit [Read error: Connection reset by peer]
fluxm has quit [Read error: Connection reset by peer]
labor[m] has joined #ocaml
krnkktz has joined #ocaml
radiopotin[m] has joined #ocaml
smondet[m] has joined #ocaml
Sumera[m] has joined #ocaml
fluxm has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mbuf has joined #ocaml
mro has quit [Quit: Leaving...]
Haudegen has quit [Quit: Bin weg.]
wonko has quit [Ping timeout: 268 seconds]
notnotdan has joined #ocaml
mbuf has quit [Quit: Leaving]
bartholin has quit [Quit: Leaving]
olle has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
vicfred has joined #ocaml
mro has joined #ocaml
Mooncairn has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
Tuplanolla has joined #ocaml
<d_bot> <EduardoRFS> Could OCaml accept this? I'm trying to understand if it would introduce any unsoundness, but seems ok to me?
<d_bot> <EduardoRFS>
<d_bot> <EduardoRFS> ```ocaml
<d_bot> <EduardoRFS> module T: sig
<d_bot> <EduardoRFS> type t = { a: int }
<d_bot> <EduardoRFS> end = struct
<d_bot> <EduardoRFS> type t = { mutable a: int }
<d_bot> <EduardoRFS> end
<d_bot> <EduardoRFS> ```
<d_bot> <EduardoRFS> Goal is to have circular structures with abstractions while keeping it open for the external to read and create but internally provide a `recursive` function that allows to do the same as `let rec`
<d_bot> <octachron> If I am not mistaken, this is forbidden by the semantic.
<d_bot> <octachron> Aka, this would break some of the allowed optimization for immutable values.
<d_bot> <EduardoRFS> HMMM so the lambda can rely on the interface to know if a block is mutable or not? Seems very weird
<d_bot> <EduardoRFS> no, that's cannot be right, because you can do mutable blocks with immutable types no?
<d_bot> <EduardoRFS>
<d_bot> <EduardoRFS> ```ocaml
<d_bot> <EduardoRFS> let rec v = 1 :: v
<d_bot> <EduardoRFS> ```
<d_bot> <EduardoRFS> lol, this is an immutable block
<d_bot> <EduardoRFS> wtf
<d_bot> <octachron> It is a muted once block
<d_bot> <EduardoRFS> I wish we had first class this power
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
vicfred has quit [Quit: Leaving]
<d_bot> <octachron> It is not exactly easy to capture the rules of https://ocaml.org/api/Obj.html#VALset_field in a type system.
<d_bot> <EduardoRFS> yeah, I read that, I'm using new_block + set_field to make a `val recursive : (value -> shape) -> value`
<d_bot> <EduardoRFS> where shape is part of value
<d_bot> <EduardoRFS> but if it's mutated only once and inside of the function that created it, then that's not a problem for things like flambda right?
<dmbaturin> Does any library provide a version of String.escaped that doesn't escape all unicode characters, only quotes/newslines etc.?
<d_bot> <EduardoRFS> Also added `Sys.opaque_identity` just because now my assumptions are broken
<companion_cube> m-months :p
<companion_cube> oops
<dmbaturin> companion_cube: M-months have p-passed since I've s-seen such a t-ypo. :)
<companion_cube> it's m-my up b-buffer you m-m-monster
<dmbaturin> companion_cube: On a serious side, I'm quite close to having a working TOML formatter that can preserve the original user's style (e.g. foo = { ... } vs [foo]). Need that string escaping now though, String.escaped actually makes invalid TOML since the spec disallows any escaped but the "standard" ones (and, well, normal unicode characters aren't non-printable and shouldn't be escaped anyway).
Hrundi_V_Bakshi has joined #ocaml
<companion_cube> the spec doesn't have any escaping?!
<dmbaturin> companion_cube: It does. I'm a real TOML lawyer now... https://toml.io/en/v1.0.0#string
<companion_cube> oh I see, you mean String.escaped escapes too much?
<dmbaturin> Yes. For example:
<dmbaturin> top # String.escaped "—" ;;
<dmbaturin> - : string = "\\226\\128\\148"
<dmbaturin> Strings.escaped escaped everything that isn't a printable _ASCII_ character.
<companion_cube> ahah damn, I see
mro has quit [Ping timeout: 272 seconds]
Submarine has joined #ocaml
Submarine has quit [Quit: Ex-Chat]
<octachron> There is such function in the toplevel implementation. It could be exposed.
<dmbaturin> octachron: Any chance to do that in 4.13? I'll happily make a PR.
<octachron> None. It would be in 4.14
<dmbaturin> Well, for now I'll just use a reimplmenentation then.
<dmbaturin> octachron: What would be the proper way to expose it? Move it to stdlib and call it from the Oprint module?
<octachron> Yes
<dmbaturin> Ok, I'll do it then.
cedric has joined #ocaml
shawnw has joined #ocaml
vizard has quit [Ping timeout: 272 seconds]
olle has joined #ocaml
henistein has joined #ocaml
<henistein> I want to call a function1 that depends of function2 and function2 depends of function1, is there some way to solve it?
<d_bot> <NULL> Mutually recursive functions:
<d_bot> <NULL> ```ocaml
<d_bot> <NULL> let rec f1 args =
<d_bot> <NULL> ...
<d_bot> <NULL> and f2 args =
<d_bot> <NULL> ...
<d_bot> <NULL> ```
<henistein> oh amazing, thank you!
<henistein> the return type of this two functions has to be the same or not?
<henistein> oh nvm , ofc it has to be
dhil has quit [Ping timeout: 244 seconds]
<Armael> it doesn't necessarily need to be, it depends on how you use f1 and f2
Mooncairn has left #ocaml [Leaving]
olle has quit [Ping timeout: 244 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 272 seconds]
cedric has quit [Quit: Konversation terminated!]
Tuplanolla has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 272 seconds]
Wilfred has joined #ocaml