silver has quit [Read error: Connection reset by peer]
[rg] has joined #ocaml
crowley95 has quit [Quit: Bye bye ✋]
crowley95 has joined #ocaml
[rg] has quit [Ping timeout: 240 seconds]
[rg] has joined #ocaml
[rg] has quit [Client Quit]
rople has quit [Ping timeout: 276 seconds]
rople has joined #ocaml
tormen_ has joined #ocaml
rople has quit [Ping timeout: 240 seconds]
tormen has quit [Ping timeout: 240 seconds]
rople has joined #ocaml
vesper11 has quit [Ping timeout: 252 seconds]
vesper11 has joined #ocaml
Nahra has quit [Ping timeout: 265 seconds]
gravicappa has joined #ocaml
brettgilio has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
brettgilio has quit [Ping timeout: 250 seconds]
narimiran has joined #ocaml
dborisog has joined #ocaml
brettgilio has joined #ocaml
mbuf has joined #ocaml
pierpal has quit [Ping timeout: 250 seconds]
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
pierpal has joined #ocaml
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
vsiles has joined #ocaml
jim7j1ajh is now known as jimt
barockobamo has joined #ocaml
_whitelogger has joined #ocaml
vicfred has quit [Quit: Leaving]
<mbuf>
In https://pastebin.com/yt71R9ZH, what is the meaning of "1 + l + r" in the tree_size function? What does it do?
<sim642>
It calculates the size of the tree by using the size of the left and right subtree
<mbuf>
How can we add a number with a value of type tree?
<sim642>
l and r are not of type tree there, they're integers
<Leonidas>
mbuf: fold_tree is not fold
<mbuf>
sim642, ohh!
<mbuf>
sim642, the return value of (fold_tree f e l) gets the value in l, and similarly for r?
oni-on-ion has quit [Remote host closed the connection]
<sim642>
Yeah, you can also see it by looking at the type of fold_tree
eagleflo has quit [Ping timeout: 276 seconds]
<mbuf>
Leonidas, just trying the example from John Whitington's "More OCaml" book
oni-on-ion has joined #ocaml
<sim642>
The argument function has type 'a -> 'b -> 'b -> 'b, where 'b isn't necessarily a tree. In your case it's int, just like the second argument 0
<mbuf>
sim642, I see
mfp has joined #ocaml
kakadu has joined #ocaml
kakadu has quit [Ping timeout: 252 seconds]
Nahra has joined #ocaml
Nahra has joined #ocaml
kakadu has joined #ocaml
rople has quit [Ping timeout: 240 seconds]
mbuf has quit [Quit: Leaving]
barockobamo2 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
wagle_ has joined #ocaml
jim7j1ajh has joined #ocaml
tormen has joined #ocaml
mbuf has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
infinity0_ has joined #ocaml
infinity0 has quit [Killed (adams.freenode.net (Nickname regained by services))]
barockobamo has quit [Read error: Connection reset by peer]
wagle has quit [Remote host closed the connection]
jimt has quit [Ping timeout: 240 seconds]
tormen_ has quit [Remote host closed the connection]
<Leonidas>
anyone know what the 'Warning: .dune files are ignored since 2.0. Reinstall the library with dune >= 2.0 to get rid of this warning and enable support for the subsystem this
<Leonidas>
library provides.
<Leonidas>
'
<Leonidas>
means? I installed all the libraries with dune 2.x so I don't know what I can do about it
ggole has joined #ocaml
Haudegen has joined #ocaml
Nahra has quit [Ping timeout: 246 seconds]
<rgrinberg>
Leonidas, hmm do you have environment where I can see this?
<rgrinberg>
Also, could you do find -iname "*.dune" in your opam environment
<Leonidas>
rgrinberg: it is all of janestreet v0.11
<rgrinberg>
Yeah, those packages are still building with jbuilder. That's the problem.
<rgrinberg>
We could make dune shut up about this, but there are actually some edge cases where things won't work
<Leonidas>
ah, ok. the error message is a bit misleading.
<Leonidas>
should I create a PR to constrain them to dune < 2?
<xvilka>
Hi! anyone remembers how to show the reverse dependencies (installed) for opam package?
<xvilka>
can't find anything in the man page, sorry
<rgrinberg>
xvilka opam list --depends?
<rgrinberg>
Leonidas I think that would just invalidate correct build plans. Note that jbuilder is now a separate package. But some artifacts that jbuilder installs, dune 2.0 can no longer read.
<xvilka>
rgrinberg: it shows everything, but not the installed only
<rgrinberg>
I suppose we should just have a way to disable gtihs warning
<rgrinberg>
xvilka --installed?
<Leonidas>
rgrinberg: hmm. It then proceeds to fail to build our code, but maybe that's some different issue where our libraries are not actually compatible with dune 2 (like, they compile fine but then it seems like nothing is installed)
<xvilka>
rgrinberg: roger, it works. Thanks!
<Leonidas>
ohwell, thanks for your help, will need to spend some time investigating.
<rgrinberg>
Leonidas the warning system in dune is a bit adhoc. I think we just need a systematic way to disable any kind of warning
<rgrinberg>
Unfortunately our backlog is massive...
<Leonidas>
yeah, I don't mind that warning that much.
<Leonidas>
it is just frustrating to come to work on monday and see that the builds are failing because of two unrelated breakages
<rgrinberg>
but note that if you're using an old version of ppx_inline_test or ppx_driver things might not work for you because of this.
<rgrinberg>
Leonidas opam repository upates break your builds?!
<Leonidas>
ppx generated code that fails due to warnings in dune is my pet peeve ;)
<Leonidas>
rgrinberg: yes, since the version constraints are not tight enough.
<Leonidas>
But a package that breaks in 1.2.4 whereas 1.2.2 was fine is just frustrating
<rgrinberg>
the warnings are the good guy here, they tell you this might happen. It's weird if they caused the faeilure
<rgrinberg>
Leonidas sounds like you need a hefty dose of lock files.
<Leonidas>
and there is no first party opam locking support so it is all a bit fragile to begin with
<rgrinberg>
Isn't opam lock builtin now?
<Leonidas>
yeah, replace opam with esy, instead of trying to build esy with opam tools :/
<Leonidas>
does it make lockfiles and does opam install honor them?
<xvilka>
Leonidas: story of my life (about breakages). The more complex your system is (the more deps it has), the more sudden breakage probability is
<Leonidas>
In all fairness the last time I looked at this it was opam 1.x time and back then it wasn't really usable.
<rgrinberg>
I believe it's better since 2.0
<rgrinberg>
but indeed, if reproducible builds are important to you, you should look into nix or esy
<Leonidas>
yeah, I saw opam2nix being properly announced on discuss and I have to say it is intriguing
<Leonidas>
especially since I can use it to derive docker containers directly
<xvilka>
I also recommend Nix, though currently investigating Guix for this purpose. Will make your life easier and you can do the revision of your deps every N months
<Leonidas>
yet dependencies breaking on patch releases is like death by a thousand cuts and opam doing the wrong thing by default (updating all the way up) is a really bad experience
<rgrinberg>
Leonidas one thing I realized is that traditional semver doesn't mean all that much for a language that's as strict as OCaml
<rgrinberg>
practically any change could be breaking something
<Leonidas>
rgrinberg: that is true, but sometimes the breakage is because of mutability in opam-repository
<rgrinberg>
And now I also know to never realize on SAT solvers for anything. No matter how fancy they might look :)
<rgrinberg>
and the 3rd conclusion is that mutable package management is a bad idea :)
<Leonidas>
don't tell companion_cube :p
<xvilka>
SAT is just heuristics after all, not a completely formal method
<Armael>
that doesn't mean anything
<xvilka>
yes, but it doesn't guarantee to be correct from my understanding
<Armael>
what
<rgrinberg>
We should probably blame the way the problem is posed to the solver, rather than the solver itself :P
<Armael>
unless it has a bug, a sat solver will always produce a correct solution (or timeout, in practice)
<rgrinberg>
Our constraints are far too optimistic
<Armael>
also, package installation is harder than SAT
<Armael>
(because you typically have optimisation constraints like "minimize the number of new packages and the version lag")
<xvilka>
Armael: SAT is NP-complete problem
<Armael>
yes, and?
<Armael>
NP <> undecidable
<xvilka>
nvm, I might be wrong, I am CS rookie anyway
<simpson>
xvilka: SAT is not a problem in practice; it takes effort to find hard SAT instances. The worst instances that you'll see in package management are the sort where some essential low-level library (say, libc) has two incompatible versions and every piece of software needs to use the same version. This happens in e.g. Debian but not Nix.
<simpson>
rgrinberg: I've often imagined a SAT solver with a non-bad API. Still only a fantasy though.
mbuf has quit [Quit: Leaving]
<rgrinberg>
Yeah, but just to clarify my earlier comment: the real issue is that our constraints validate many incorrect build plans
<Armael>
(let me reiterate that SAT solvers are *not* heuristics, they are complete and very efficient in practice -- but then typically package installation problems are not just SAT...)
<rgrinberg>
So we always play catch up by trying to invalidate a few more failing build plans here and there. This is pretty futile however
<rgrinberg>
Especially given that a good user experience should guarantee 0 build failures
<Armael>
yeah I feel one part of the problem is that we have incorrect metadata (build paths that are marked as valid but do not build in practice)
<Armael>
something that could be solved with better tooling
<Armael>
but also makes it hard to build better tooling
<rgrinberg>
we could generate better metadata with dune. but i fear it will not be a qualitative step forward
<rgrinberg>
Just another little tweak
spew has joined #ocaml
<companion_cube>
package management requires more than SAT, yes
<companion_cube>
you need an optimization target as well (maximize versions)
<Drup>
rgrinberg: I disagree, if you have perfect metadata, then the solver approach is always correct
<Leonidas>
yeah, also depexts are also woefully inadequate, since they are completely incapable of working with different versions of the packages or distributions
<companion_cube>
0 build failures --> lock files
<Leonidas>
companion_cube: still no
<Drup>
(ofc, that's impossible, but if you are super close to it, it becomes "normal")
<Leonidas>
debian renames libmysql again, all builds break
<companion_cube>
:D
<companion_cube>
ok, but you can't do magic
<companion_cube>
0 build failures that are caused by OCaml
<rgrinberg>
Drup yeah, I should say that my initial comment was wrong. The solver isn't at fault
<Leonidas>
companion_cube: I mean, if you could say "for debian 9 it is…" or things like "this requires gtk 3.22 and won't just work when there is any kind of gtk 3 package"
<companion_cube>
I don't use depext anyway
<companion_cube>
I'd be happy with lockfiles for pure OCaml packages already
<rgrinberg>
The point here is that when you search for valid build plans, it's far more costly to claim that an invalid build plan is valid, than skip over some valid build plans
<companion_cube>
cause right now, it's build failures all the time, and it's all within OCaml…
<Leonidas>
yeah, if you don't depend on these pesky bits of C code
<companion_cube>
C code + external libraries, you mean
<rgrinberg>
companion_cube indeed, imagine if git had a sha1 collision every other day
<Leonidas>
yeah
<rgrinberg>
this is basically the user experience in opam
<companion_cube>
ahah
<companion_cube>
yeah, pretty much
<companion_cube>
I dread `opam upg`
<rgrinberg>
i don't dread it because i barely use it :D
<Leonidas>
`opam upgrade` is `opam ensure-the-build-is-completely-busted-afterwards`
<Leonidas>
We have a policy of never using it
<Leonidas>
`opam install --deps-only .` instead
<rgrinberg>
Yup, it's quite useless of a command
Serpent7776 has quit [Quit: Leaving]
smazga has joined #ocaml
tane has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
brettgilio has quit [Ping timeout: 246 seconds]
ziyourenxiang has quit [Ping timeout: 246 seconds]
<oni-on-ion>
i use opam upgrade =(
<companion_cube>
I do too, it's just that I tend to do it as rarely as possible
<oni-on-ion>
mostly after i've been awol and not keeping up to date otherwise (computer break). now reminding myself that i've got to message the tuareg devs because they fixed the symbol-coloring
Haudegen has quit [Quit: Bin weg.]
q9929t has joined #ocaml
q9929t has quit [Client Quit]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #ocaml
kjak has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jao has joined #ocaml
Tsukimaru has joined #ocaml
barockobamo2 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
jmiven has quit [Quit: bye]
jmiven has joined #ocaml
<narimiran>
so, how do you convert an int to its binary representation? if it were octal/hex i would use `sprintf`, but there's no such things for binary (`%b` is for bools)
<narimiran>
alternatively, is there a `divmod`?
<theblatte>
there's %x for hexadecimal but nothing for binary as far as I can tell
pierpal has quit [Ping timeout: 240 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
vicfred has joined #ocaml
jao has quit [Remote host closed the connection]
jao has joined #ocaml
jao is now known as Guest85731
Guest85731 has quit [Remote host closed the connection]
pierpal has joined #ocaml
jao- has joined #ocaml
sagax has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
dborisog has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
ggole has quit [Quit: Leaving]
Serpent7776 has joined #ocaml
<companion_cube>
so, dune2 requires 4.06 in the end?
jnavila has joined #ocaml
Anarchos has joined #ocaml
klntsky has quit [Ping timeout: 260 seconds]
klntsky has joined #ocaml
andreas303 has quit [Ping timeout: 260 seconds]
andreas303 has joined #ocaml
amiloradovsky has joined #ocaml
pierpal has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
amiloradovsky has quit [Ping timeout: 265 seconds]
b has joined #ocaml
Tsukimaru has quit [Ping timeout: 260 seconds]
b is now known as Guest33935
keep_learning has quit [Remote host closed the connection]
Nahra has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
monoxmpp has joined #ocaml
monoxmpp has left #ocaml [#ocaml]
monoxmpp has joined #ocaml
oni-on-ion has quit [Read error: Connection reset by peer]
Guest33935 has quit [Quit: Leaving]
kakadu_ has quit [Remote host closed the connection]
Serpent7776 has quit [Quit: leaving]
Haudegen has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
monoxmpp has left #ocaml ["Disconnected: Received SIGTERM"]
monoxmpp has joined #ocaml
jnavila has quit [Remote host closed the connection]
monoxmpp has left #ocaml ["Disconnected: closed"]
monoxmpp has joined #ocaml
obadz has joined #ocaml
obadz has left #ocaml [#ocaml]
monoxmpp has left #ocaml [#ocaml]
monoxmpp has joined #ocaml
monoxmpp has quit [Remote host closed the connection]
monoxmpp has joined #ocaml
monoxmpp has quit [Remote host closed the connection]