<discocaml>
<JM> > you don't want (or need) upper bounds on dependencies.
<discocaml>
<JM> That's putting a lot of trust in your dependencies 🙂
<discocaml>
<JM> While opam can help to ensure whatever version gets resolve will still be API compatible with your code, how do you know the system behaviour hasn't changed?
<discocaml>
<JM> If I'm trying to reproduce a bug from prod on my machine, knowing I'm using the exact same versions of dependencies goes a long way.
bartholin has quit [Quit: Leaving]
dhil has joined #ocaml
alfiee has joined #ocaml
<discocaml>
<wayneyam> I feel like there's some redundancy here, let me try it
<discocaml>
<wayneyam> what does `'a` do
<discocaml>
<wayneyam> is it a comparator witness? Then that makes sense
alfiee has quit [Ping timeout: 260 seconds]
Inline_ has joined #ocaml
Inline has quit [Ping timeout: 252 seconds]
jlrnick has joined #ocaml
<discocaml>
<mm3315> 'a is just a type of value which is stored in node
Inline_ is now known as Inline
<discocaml>
<mm3315> I removed `type z = Z` and now using `unit`
jlrnick has quit [Read error: Connection reset by peer]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 276 seconds]
alexherbo2 has joined #ocaml
semarie has quit [Quit: quit]
semarie has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 252 seconds]
jlrnick has joined #ocaml
alfiee has joined #ocaml
<discocaml>
<shon_18152> > That's putting a lot of trust in your dependencies 🙂
<discocaml>
<shon_18152> > If I'm trying to reproduce a bug from prod on my machine, knowing I'm using the exact same versions of dependencies goes a long way.
<discocaml>
<shon_18152> That said, use of lock files seems advisable for CI and deployment of production services or shipped artifacts, but we can (and generally do?) factor this out of package dependency specs in opam.
<discocaml>
<shon_18152> > That's putting a lot of trust in your dependencies 🙂
<discocaml>
<shon_18152> > If I'm trying to reproduce a bug from prod on my machine, knowing I'm using the exact same versions of dependencies goes a long way.
<discocaml>
<shon_18152>
<discocaml>
<shon_18152> Yeah, I think use of lock files seems advisable for CI and deployment of production services or shipped artifacts, but we can (and generally do?) factor this out of package dependency specs in opam.
jlrnick has quit [Read error: Connection reset by peer]
alfiee has quit [Ping timeout: 248 seconds]
<discocaml>
<shon_18152> That means you don't need dependabot nagging you to update configs mechanically, instead you are on more of a rolling release, but you lock to fixed versions, freeing a slice, when you need that reproducibility.
<discocaml>
<shon_18152>
<discocaml>
<shon_18152> My current thinking is that this is pretty lovely (if we can sustain it), and I am starting to suspect the need for tools like dependabot are a "ecosystem-tooling smell" 😄
wickedshell has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
<companion_cube>
I think what go does is quite interesting in practice
<companion_cube>
Deterministic, stable versioning (minimum version that works). No lockfiles required, only checksums. Then you need dependabot to bump deps explicitly but you migrate on your own terms and when you want.
<companion_cube>
Beats having your code broken by `opam upd` as a default
<discocaml>
<._null._> I can't help but feel like "minimum version that works" is sad
<companion_cube>
minimum version that at least you or one of your dependency has checked works
<companion_cube>
but if you want a recent version, depend on it explicitly
<companion_cube>
(basically it picks the minimum version that's higher than all the requirements of all dependencies+your code, iirc)
<discocaml>
<shon_18152> Is this your experience in the last few years using opam?
<discocaml>
<._null._> (direct answers can't go through the bridge)
<discocaml>
<shon_18152> (thanks!)
<discocaml>
<shon_18152> compantion_cubu: "Beats having your code broken by opam upd as a default"
<discocaml>
<shon_18152>
<discocaml>
<shon_18152> Is this your experience in the last few years using opam?
<discocaml>
<._null._> I mean, the message goes through, but not the reference to the message
<discocaml>
<._null._> being answered
<discocaml>
<shon_18152> Thanks again! -- what happens to edits?
<discocaml>
<shon_18152> companion_cube: "Beats having your code broken by opam upd as a default"
<discocaml>
<shon_18152>
<discocaml>
<shon_18152> Is this your experience in the last few years using opam?
<discocaml>
<shon_18152> oof, whoops! Sorry about that to irc folks!
<companion_cube>
it can still be my experience yes
<companion_cube>
right now I think I have sth broken by the new ppxlib for example
<discocaml>
<shon_18152> Right, I can happen. Even assuming the CI on the repo was perfect, it only works to catch problems for published deps... My thinking is probably over-indexing on the happy path for published deps.
<companion_cube>
in the absence of upper bounds in most packages, breakage is hard to avoid imho
<discocaml>
<shon_18152> Tho I still have a hunch/hope that rolling, ecosystem-wide coherence can be propagated out beyond opam (but anchored in it).
babo67_ has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 272 seconds]
Haudegen has quit [Quit: Bin weg.]
alexherbo2 has quit [Remote host closed the connection]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #ocaml
wickedshell has joined #ocaml
bibi_ has quit [Remote host closed the connection]
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
Inline_ has joined #ocaml
Inline is now known as Guest3330
Guest3330 has quit [Killed (copper.libera.chat (Nickname regained by services))]
Inline_ is now known as Inline
bartholin has quit [Ping timeout: 246 seconds]
bibi_ has joined #ocaml
<discocaml>
<yawaramin> fairly often i see the opam-repo packages have to be patched to explicitly set upper bounds on dependencies
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 245 seconds]
alfiee has joined #ocaml
<discocaml>
<octachron> Sometimes I wonder if it would not be useful to have finer-grained upper bound to indicate that a package dependency has been tested up-to-version `MM.mm`. The information would be redundant with an up-to-date opam repository but it would limit the breaking paths.
alfiee has quit [Ping timeout: 244 seconds]
<companion_cube>
if it's something people have to write by hand it's doomed to fail
bartholin has joined #ocaml
semarie has quit [Quit: quit]
bartholin has quit [Ping timeout: 260 seconds]
semarie has joined #ocaml
<discocaml>
<romain.beauxis> Do y'all know a way to attach any arbitrary value to the closure of any other arbitrary value?
<discocaml>
<romain.beauxis> Something like:
<discocaml>
<romain.beauxis> ```
<discocaml>
<romain.beauxis> let top_value = (..main value ..) in
<discocaml>
<romain.beauxis> let v = (.. first value ..) in
<discocaml>
<romain.beauxis> attach_closure ~top_value v
<discocaml>
<romain.beauxis> ```
<discocaml>
<romain.beauxis> And `v` is tied to `top_value` from a GC perspective event if it does not relate to it
<discocaml>
<romain.beauxis> For instance, say `top_value` is a `string`.
<discocaml>
<romain.beauxis> Something like:
<discocaml>
<romain.beauxis> ```
<discocaml>
<romain.beauxis> let top_value = (..main value ..) in
<discocaml>
<romain.beauxis> let v = (.. closure value ..) in
<discocaml>
<romain.beauxis> attach_closure ~top_value v
<discocaml>
<romain.beauxis> ```
<discocaml>
<octachron> You can attach a finalizer to `v`, but there are no closures in you example?
<discocaml>
<romain.beauxis> (context: WeakHash of course..)
<discocaml>
<romain.beauxis> Can a finalizer do nothing?
<discocaml>
<romain.beauxis> Here's a more concrete example one sec
alfiee has joined #ocaml
<discocaml>
<romain.beauxis> ```
<discocaml>
<romain.beauxis> type base_id = { name : string; mutable counter : int }
<discocaml>
<romain.beauxis> type id = string
<discocaml>
<romain.beauxis>
alexherbo2 has quit [Remote host closed the connection]
<discocaml>
<romain.beauxis> @octachron Looks like I'm getting `Invalid_argument` when doing it with `string`. Any way to make sure the string is considered head allocated?
<discocaml>
<romain.beauxis> *heap
<discocaml>
<romain.beauxis> Bytes.(unsafe_to_string (of_string v)) seems to do it
<companion_cube>
String.copy?
<discocaml>
<romain.beauxis> Works but with a compiler alert!
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 260 seconds]
<discocaml>
<alyxshang> I'm a Crab, Camel, and Ziguana hehe~. ❤️
<discocaml>
<alyxshang> Can I shout something out here?
<discocaml>
<amadaluzia> I have done some Python stuff for Nixpkgs
<discocaml>
<alyxshang> Can I shout something out here? (Nvim extension)
<discocaml>
<alyxshang> So? 🙈 You're saying, you're also multi-species?
<discocaml>
<gooby_diatonic> Are you a furry?
<discocaml>
<alyxshang> No, just a nerd
<discocaml>
<alyxshang> Hbu?
<discocaml>
<alyxshang> No but in all seriousness, we used to joke in the Crablang server that we're all crabs living in the ocean because of the languages mascot. Just some silly kawaii rp~.
bartholin has joined #ocaml
<discocaml>
<alyxshang> Programming communities are far too serious anyway.
<discocaml>
<alyxshang> Ppl need to lighten up a bit.
<discocaml>
<alyxshang> Best way to do so: Silly to the Max.
<discocaml>
<alyxshang> I had another look at the Zig docs this morning. I'm proud of the ziguanas, we've come a long way.
Haudegen has joined #ocaml
alfiee has joined #ocaml
<discocaml>
<gooby_diatonic> I'm an elephant
<discocaml>
<gooby_diatonic> (PHP enjoyer)
<discocaml>
<gooby_diatonic> Or just target people using things you dislike with passive agressive jabs
alfiee has quit [Ping timeout: 260 seconds]
<discocaml>
<dubious245> Trying to install ocaml on my laptop and came across this error running this `(& opam env) -split '\r?\n' | ForEach-Object {Invoke-Expression $_ }` command is not setting the environment variables outside of the shell in which they were run.
<discocaml>
<dubious245>
<discocaml>
<dubious245> So when I am getting errors when trying to run the lsp in vs-code or utop it isn't working.
<discocaml>
<edhebi> fwiw the opam env sourcing must be done _per shell_ regardless
<discocaml>
<edhebi> in powershell you'd add this to your `$PROFILE`
<discocaml>
<edhebi> fwiw the opam env sourcing must be done _per shell_ regardless afaict
Anarchos has joined #ocaml
Exa has quit [Quit: see ya!]
Exa has joined #ocaml
alfiee has joined #ocaml
alfiee has quit [Ping timeout: 276 seconds]
<discocaml>
<dubious245> The commands listed in the getting started do not automatically add it to your profile variable then.
<discocaml>
<dubious245> This breaks LSP support in VSCode unless you start it from powershell where you already re added the $env variables before launching VSCode.
Inline has quit [Ping timeout: 244 seconds]
Inline has joined #ocaml
<discocaml>
<alyxshang> Does that include me?
<discocaml>
<alyxshang> That logo always makes me giggle. 🤦♀️
<discocaml>
<gooby_diatonic> Well, not my jabs
<discocaml>
<gooby_diatonic> Maybe other ppl
<discocaml>
<gooby_diatonic> But that's how people tend to have fun in programming communities
<discocaml>
<alyxshang> If a person is being a bit uncouth, I guess a case can be made for some light jabbing.
<discocaml>
<alyxshang> Hallelujah
<discocaml>
<gooby_diatonic> Subhanallah
<discocaml>
<mm3315> ```ml
<discocaml>
<mm3315> type ('n, 'a) node =
<discocaml>
<mm3315> | Empty : (unit, 'a) node
<discocaml>
<mm3315> | Node2 : 'n * 'a * 'n -> (('n, 'a) node, 'a) node
<discocaml>
<mm3315> | Node3 : 'n * 'a * 'n * 'a * 'n -> (('n, 'a) node, 'a) node
<discocaml>
<mm3315>
<discocaml>
<mm3315> type ('n, 'a) searchTree_ =
<discocaml>
<mm3315> | Zero : 'n -> ('n, 'a) searchTree_