<companion_cube>
I assume astring has this feature, containers certainly does
<companion_cube>
Both are saner dependencies than compiler-libs
<discocaml>
<yawaramin> any moderately complex project likely already has astring or something similar in its transitive deps anyway
oriba has joined #ocaml
no-name4 has joined #ocaml
emp_ has joined #ocaml
ursa-major has quit [*.net *.split]
no-name has quit [*.net *.split]
emp has quit [*.net *.split]
dmoerner has quit [*.net *.split]
thizanne has quit [*.net *.split]
no-name4 is now known as no-name
oriba has quit [Ping timeout: 252 seconds]
ursa-major has joined #ocaml
dmoerner has joined #ocaml
thizanne has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw_ has joined #ocaml
<discocaml>
<dubious245> What makes for a bad type system? In your opinion? Asking this in general as a curiosity while working on my compiler.
<discocaml>
<contificate> I don't care for overcomplicated stuff or esolang-esque slop as is present in C++
<discocaml>
<yawaramin> unsoundness ie the possibility of the runtime type being different from the static type
semarie has quit [Quit: quit]
semarie has joined #ocaml
<discocaml>
<raiinyzen> why OCaml? why do you (yes you) like it?
cr1901 has quit [Read error: Connection reset by peer]
<dh`>
for me, because it has working sum types and haskell isn't fit for large projects
<discocaml>
<dubious245> It compiles.
<discocaml>
<dubious245>
<discocaml>
<dubious245> I find how the expression and functions evaluate to be very intuitive to me and this makes writing code very easy. Refactoring code and refining it is very easy and even enjoyable.
<discocaml>
<dubious245>
<discocaml>
<dubious245> While I have some disagreements with its type system I do enjoy that it is statically typed and it tries to get the most from its static typing without bringing that extra weight into the runtime. That last part is **fascinating** to me. Like a moth staring at a flame.
<discocaml>
<dubious245>
<discocaml>
<dubious245> It has a native build system and package manager and I do not have to jump through hoops to include other libraries or build large project.
<discocaml>
<dubious245>
<discocaml>
<dubious245> It isn't very opinionated for the most part. It doesn't raise a fuss if I implement something functionally or imperatively. I can blend the two styles in ways that are comfortable to me.
cr1901 has joined #ocaml
<discocaml>
<dubious245> Oh and the code is compact wile still reading very well. It has several tools for removing too many parens that some functional languages suffer from.
myrkraverk has quit [Ping timeout: 276 seconds]
Serpent7776 has joined #ocaml
nirvdrum7411 has joined #ocaml
nirvdrum741 has quit [Ping timeout: 244 seconds]
nirvdrum7411 is now known as nirvdrum741
Haudegen has joined #ocaml
bartholin has joined #ocaml
<discocaml>
<._null._> Undecidability
<discocaml>
<froyo> if it's decidable and sound, or asks me to annotate only when I need features which I know the decidability of isn't possible, then: not having wildcards to skip parts of the sig when I want to annotate.
<discocaml>
<froyo> (Rust lol)
myrkraverk has joined #ocaml
myrkraverk_ has joined #ocaml
<discocaml>
<froyo> (I mean rust fails both the pre and post conditions here. It requires annotations on every function definition)
myrkraverk has quit [Ping timeout: 260 seconds]
<discocaml>
<froyo> (and it isn't decidable in the general case)
<discocaml>
<froyo> anyway it's the difference between a constraining attitude and a specifying one
olle has joined #ocaml
sleepydog has quit [Ping timeout: 248 seconds]
philipwhite_ has quit [Read error: Connection reset by peer]
philipwhite has joined #ocaml
ymherklotz has quit [Write error: Connection reset by peer]
whereiseveryone has quit [Write error: Connection reset by peer]
richardhuxton has quit [Write error: Connection reset by peer]
Ankhers has quit [Write error: Connection reset by peer]
lane has quit [Write error: Connection reset by peer]
immutable has quit [Read error: Connection reset by peer]
lane has joined #ocaml
whereiseveryone_ has joined #ocaml
richardhuxton has joined #ocaml
sleepydog has joined #ocaml
Ankhers_ has joined #ocaml
ymherklotz has joined #ocaml
immutable has joined #ocaml
Ankhers_ is now known as Ankhers
whereiseveryone_ is now known as whereiseveryone
myrkraverk has joined #ocaml
myrkraverk_ has quit [Ping timeout: 245 seconds]
Haudegen has quit [Quit: Bin weg.]
<discocaml>
<contificate> not only that but, by comparison with other languages, it compiles very fast
<discocaml>
<contificate> just such a nice experience to sit in emacs, see merlin say your buffer typechecks (immediately, ignore enormous - generated - files), and then build it very quickly
<discocaml>
<contificate> other language have slow tooling by comparison and it's not even close
<discocaml>
<contificate> other languages have slow tooling by comparison and it's not even close
hsw_ is now known as hsw
Haudegen has joined #ocaml
hidjgr has joined #ocaml
hidjgr has quit [Changing host]
hidjgr has joined #ocaml
olle has quit [Ping timeout: 268 seconds]
nirvdrum741 has quit [Remote host closed the connection]
nirvdrum741 has joined #ocaml
<discocaml>
<uberpyro181> What makes this question hard is that different languages are tools optimized to do different things. I would expect a scripting language to have a less restrictive and less burdensome type system than a language for game development, and I would want a heavy type system if I care about proving any properties about my code.
<discocaml>
<uberpyro181> How a type system is designed depends on what featuers are present in the term language, e.g. runtime macros make static typing very difficult
<discocaml>
<uberpyro181> How a type system is designed depends on what features are present in the term language, e.g. runtime macros make static typing very difficult
<discocaml>
<uberpyro181> Or if subtyping is desired, that could change the approach significantly
<discocaml>
<uberpyro181> I guess in some sense, the best type system is the one that verifies every proeprty that you care about and admits everything you don't
<discocaml>
<uberpyro181> as a play off the usual saying that "low level code is everything you don't care about"
<discocaml>
<uberpyro181> but in a vacuum, there are specific properties that you might care about
<discocaml>
<uberpyro181> obvious proof and rewriting properties like confluence, soundness, principal types, etc
<discocaml>
<uberpyro181> stability of substitution
Haudegen has quit [Remote host closed the connection]
<discocaml>
<uberpyro181> I guess it also comes down to the philosophical question of why some of these properties matter, e.g. why do we expect substitution to always be a total function
<discocaml>
<uberpyro181> I think during the design of ML there was a fair amount of discussion for some of these things, e.g. what are the properties you would expect to hold
<discocaml>
<uberpyro181> aside from stuff you might expect like decidability, soundness, principal types, there is also stuff you might want like complete inference, extensibility (e.g. how easily can you extend case analyses), modularity (how well can you reuse code or build it from components), etc
<discocaml>
<uberpyro181> if the question is really "what makes a system bad" rather than "good", i guess that makes it a lot easier, because there are a lot of ways it can go wrong
<discocaml>
<contificate> I'm in the rare camp that thinks SML is "acceptable", so it's hard to sway me on a lot of things
<discocaml>
<contificate> I don't think the type system matters too much, there's some niceties here and there - but the reality is like
<discocaml>
<contificate> if you dropped GADTs from OCaml, I wouldn't flinch - if pattern matching disappeared, I'd never use it again
<discocaml>
<contificate> that kind of importance of actual features over rules for combining terms of those features
<theblatte>
is there a way to tell opam I don't want it to recompile the world due to "upstream or system changes"? it happens almost every time I have to do an opam operation on my work-managed machine, maybe because some system packages get updated
<discocaml>
<yawaramin> as far as i remember it doesn't recompile the world, usually the compiled artifacts can be reused if the package versions didn't change
<theblatte>
well it starts by recompiling ocaml itself, so then all the other packages need recompilation because of that
<theblatte>
ocaml and ocaml-variants get hit with "upstream or system changes", everything else follows
<discocaml>
<yawaramin> this should be happening only when 'opam upgrade' is run, and then only if if it somehow changes the compiler version
<discocaml>
<octachron> This is can happen if the opam package changes too
<discocaml>
<dubious245> The question is specifically what makes a bad type system; either what features seem completely at odds with your typical goals or makes for a very negative experience. Everyone has different end goals and ideals for a 'good' system and they will happily share that on the internet. They dont always articulate why some systems are bad to them. I think its good to look around and behind to see what people think makes for a bad type system, ra
Haudegen has quit [Quit: Bin weg.]
<theblatte>
yawaramin: this is never because I ran opam upgrade :/
<theblatte>
I work on an unrelated opam package and do a lot of pinning/unpinning/adding/removing that package, and half the time this results in the world getting rebuilt
<theblatte>
opam doesn't say anything more about why it wants to rebuild ocaml so I guess it's going to be hard to debug further
<discocaml>
<yawaramin> oh ok, if you are developing a project with multiple packages, have you tried vendoring with dune instead of the opam pin workflow?
<discocaml>
<yawaramin> dune should be more intelligent about rebuilding
<theblatte>
I don't want to vendor llvm :)
<theblatte>
well, I guess vendoring doesn't have to come with an actual checkout, but there's going to be hassle either way
<discocaml>
<yawaramin> i mean 'vendor' like just check out the repo in your project and gitignore it 🙂
<discocaml>
<mbacarella> holy cannoli, claude code just blew my mind
<discocaml>
<mbacarella> I have some ocaml service that calls getenv in a bunch of places and I've been manually maintaining a list at the top of my main function that probes for all of the env vars to exist. the idea here being to make sure you don't roll something out that depends on an env var that you don't notice isn't set until much later.
<discocaml>
<mbacarella> I have a surly comment at the top of that function that says "must resist urge to parse all *.ml files into an AST and generate this function at build time" and decided this might be something I should throw claude code at
<discocaml>
<mbacarella> and... it succeeded 🤯
<discocaml>
<mbacarella> it parsed everything with ppxlib, crawled the AST looking for getenv calls, generated the check_env_vars function and even set up the dune rules
<discocaml>
<mbacarella> cost: $2.64
trillion_exabyte has quit [Ping timeout: 252 seconds]
<discocaml>
<mbacarella> programming done by humans is OVER
<discocaml>
<yawaramin> leave the Claude. take the cannoli
<discocaml>
<mbacarella> somewhere in the middle claude got frustrated and tried to switch to using regexes and I said no, use ASTs, and it was like "oh yeah good point"
<discocaml>
<mbacarella> so, even LLMs get lazy
<discocaml>
<mbacarella> all programmers are now PMs, sorry
<discocaml>
<mbacarella> all human programmers are now PMs, sorry
<discocaml>
<froyo> theblatte: if opam tracks ocaml from system, and the system upgrades ocaml from underneath it, opam needs to recompile everything iirc
<discocaml>
<froyo> vs installing it directly thru opam
<dh`>
...where if you update it, it still recompiles everything?
<discocaml>
<._null._> Yes, but ocaml won't be upgraded behind your back
<discocaml>
<froyo> it would be if it's provided by the package manager
<discocaml>
<froyo> opam has that registered as the ocaml-system pseudo-package
<discocaml>
<froyo> and because when ocaml upgrades, paths & magic numbers may change, exes and libs built with old ocaml need recompilation
<discocaml>
<froyo> $ opam info --sw=system-alias ocaml-system -f synopsis
<discocaml>
<froyo> The OCaml compiler (system version, from outside of opam)
<discocaml>
<froyo> dh`: oh. true I guess
<discocaml>
<froyo> but in that case you invoked opam upgrade on your own
<discocaml>
<froyo> whereas opam complains and suggests a recompilation seemingly spontaneously if: ocaml was installed via the system's package manager, and got recently upgraded
<discocaml>
<froyo> and I even think opam upgrade won't upgrade ocaml until you allow it to touch the switch invariants anyway
<discocaml>
<froyo> so it's _more_ your intention
<discocaml>
<froyo> does it make sense why I went with the other scenario then
<discocaml>
<froyo> damn nevermind then. I missed the message where they said they're doing pins/unpins/etc
bibi_ has joined #ocaml
trillion_exabyte has joined #ocaml
<dh`>
right, I think the message herein is "don't let the system autoupdate" and "don't forget to update other things after doing system updates"