<discocaml>
<lowlowcode_96272> Hello guys, Im struggling to use a file watcher in Ocaml any suggestions ? Fswatch doesnt works on debian, the package is broken...
h00man_bean has joined #ocaml
<discocaml>
<aantron> I'm currently looking into using Cohttp in Dream. In case it helps planning or prioritizing the work
<discocaml>
<aantron> Mainly because cohttp-eio itself has a direct-style API
<discocaml>
<aantron> In how it reads and writes streams
trillion_exabyte has quit [Ping timeout: 268 seconds]
trillion_exabyte has joined #ocaml
waleee has joined #ocaml
h00man_bean has quit [Quit: Client closed]
mro has quit [Remote host closed the connection]
<discocaml>
<lukstafi> Anyone using François Pottier's visitors? There's a few packages that depend on visitors, but not many. Anyone here having considered visitors decided against using them?
cr1901 has quit [Read error: Connection reset by peer]
<discocaml>
<lukstafi> The visitors package automates this (and more) but using classes.
alexherbo2 has quit [Remote host closed the connection]
<companion_cube>
`visitors` seems nice, but it's another dep, yada yada
<companion_cube>
my biggest qualm with fpottier's libraries is the absence of semver
<companion_cube>
I kind of hate it
cr1901 has joined #ocaml
<discocaml>
<lukstafi> 😅
gooby323 has quit [Ping timeout: 260 seconds]
<discocaml>
<lukstafi> If we popularized `visitors`, they would become more familiar, which would make using them easier...
<discocaml>
<lukstafi> They solve some issues where Haskell boasts it's better than OCaml.
<discocaml>
<gooby_clown> Such as?
<discocaml>
<lukstafi> Functions that are polymorphic wrt. data shapes, e.g. applicatives.
Tuplanolla has joined #ocaml
<discocaml>
<otini_> Do you mean applicative functors? I fail to see how ocaml doesn’t have them (altough my mental model of an applicative functor is `'a option`, so I may be wrong)
<discocaml>
<lukstafi> What `visitors` does, you can do in Haskell by some combination of type classes and kinds... E.g. you can write a function that collects strings from values of various ADT types.
<discocaml>
<anmonteiro> Not really but thanks. There are a few production users outside Dream who’ve asked for releases
<companion_cube>
can't represent Traversable at all, oh well
<discocaml>
<lukstafi> and `Foldable`
jabuxas has quit [Ping timeout: 272 seconds]
<discocaml>
<gooby_clown> If I'm understanding well, this would force us to either define our types as classes, or wrap our existing types in classes similarly to how we do with modules atm, no? I am not much of a fan of either options to be honest. This also kind of reminds me of F#, where each AST is a class underneath, so you can attach static methods and have a general operator look them up, mimicking higher kinded polymorphism in a sense
jabuxas has joined #ocaml
jabuxas has quit [Quit: oops :p]
jabuxas has joined #ocaml
mbuf has quit [Quit: Leaving]
<discocaml>
<lukstafi> That's in response to my answer where I claim `visitors` can do these things (sort of, with a stretch) -- so the datatypes remain ADTs and records, but work is done at code generation time. So it's more in the C++ vein.
m5zs7k has quit [Ping timeout: 240 seconds]
m5zs7k has joined #ocaml
olle has joined #ocaml
<discocaml>
<gabyfle> Hey, would you say that the super dope typing system in OCaml makes you weaker in other languages ?
<discocaml>
<gabyfle> In my school we don't learn any OCaml and I'm focus on AI so I have lot of projects in Python
<discocaml>
<gabyfle> The problem is that I love so much OCaml that all my personal projects are done with this language, and when I'm switching to Python, I end up debugging my algorithms so much more than in OCaml because of typing
<discocaml>
<gabyfle> Usually, when I write an algorithm in OCaml and that the type checker pass, it works
<discocaml>
<gabyfle> When writing in Python, my algorithm are super dumb and I pass much more time debugging them than writing them
<discocaml>
<gabyfle> I'm wondering if relying to much on the strong typing is a good thing or not regarding to the logic wise. I've used Owl for some project (and I'm even building a very big one with owl), and even for machine learning or for dealing with NDarrays, I feel like when I'm doing this with OCaml its way more robust than in Python even tho I'm the same guy writing it (btw I'm not using any GPT to write my projects hehe, so the problem is really with my
<dh`>
types are good
<dh`>
the problem is the other languages being unsafe
<dh`>
you will make roughly speaking the same mistakes, but in python you have to debug them at runtime
<dh`>
but the latter is also expensive and ultimately dynamically typed languages just aren't a winner
<dh`>
of course, anyone here will tell you that, I'm sure you can find someone in #python or #scheme to tell you that static typing is a straitjacket
<discocaml>
<Kali> dynamically typed languages have their place (easy serialization) but rarely is it much more than a really really annoying footgun when you're trying to anything other than that
<discocaml>
<Kali> as much as i love lua it being dynamically typed meant that nil errors would take forever to find the source of and it was usually just something like forgetting to give an argument
<companion_cube>
tbh "easy serialization" isn't even an argument now
<companion_cube>
it's more "unchecked deserialization", it's not easier than serde and the likes
<discocaml>
<Kali> yeah not if you have good derivers
gzar has joined #ocaml
toastal has left #ocaml [Error from remote client]
olle has quit [Ping timeout: 255 seconds]
olle has joined #ocaml
jabuxas has quit [Ping timeout: 256 seconds]
olle has quit [Ping timeout: 268 seconds]
Tuplanolla has quit [Quit: Leaving.]
bartholin has quit [Quit: Leaving]
olle has joined #ocaml
<discocaml>
<limp.biskit> i actually quite like bits of javascript but every attempt to add a more concrete type system to that language makes it worse, yet working without one is like pulling teeth on a large codebase
<discocaml>
<limp.biskit> the prototype system sucks, classes are weird and typescript working at all is an engineering miracle
<discocaml>
<limp.biskit> i like ruby, but that has it's fair share of issues that make me not adopt it for large codebases
olle has quit [Ping timeout: 268 seconds]
Serpent7776 has quit [Ping timeout: 260 seconds]
m5zs7k has quit [Ping timeout: 268 seconds]
m5zs7k has joined #ocaml
jabuxas has joined #ocaml
<discocaml>
<darrenldl> not much point in always restricting yourself to the low(est) denominator of the domain, cause otherwise what's the point of using ocaml/other language : v
<discocaml>
<darrenldl>
<discocaml>
<darrenldl> but yes i've found myself slow to a crawl in python, while typescript and c# are fine. dynamic typing + asinine name scoping rules makes python a really upsetting choice for me most of the time
<discocaml>
<darrenldl> actually swap "otherwise what's the point of using ..." with just "what's the point"
<discocaml>
<gabyfle> Damn, I'm not alone to find the name scoping in Python disturbing sometimes
<discocaml>
<darrenldl> being only fluent in python does not make you a better python programmer, being pretty fluent in a few good languages makes you a better python programmer, not worse, if anything
<discocaml>
<darrenldl> some colleague brought up python's import not being consistent depending on where you use it
<discocaml>
<darrenldl> compared to ocaml's open and let open in which is the same wherever you use it
<discocaml>
<limp.biskit> i really don’t like python and fail to understand why it endures and ruby doesn’t
<discocaml>
<darrenldl> popularity of tools and languages is a lot of trial by circumstance and luck sadly : v
<discocaml>
<limp.biskit> pythons tooling is horrific though
<discocaml>
<darrenldl> yeah i hate python's domination likewise
<discocaml>
<darrenldl> i will never not be amazed by super large code bases written in python, e.g. borgbackup, but i feel that's also the reason it's so slow in making any changes/overhaul/refactor
<discocaml>
<limp.biskit> the fact pipx exists should be enough to want people to use npm or opam
<discocaml>
<darrenldl> i still have zero clue which one i should use
<discocaml>
<limp.biskit> i guess it’s probably lucky adoption. go has benefited from the same things, although that runtime and tooling is actually compelling
<discocaml>
<darrenldl> oh yeah, python's "functional programming" facilities are also barely useful most of the time because of how few things facilitate that style
<discocaml>
<limp.biskit> google is big (!)
<discocaml>
<darrenldl> go also answers many modern day needs, e.g. green threads, low-level ish code
<discocaml>
<limp.biskit> yeah, go’s runtime is excellent and beat most to the punch
<discocaml>
<darrenldl> go also answers many modern day needs, e.g. green threads+multicore, low-level ish code
<discocaml>
<limp.biskit> they’ll never have effects though 😉