companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<companion_cube> @yawaramin you don't use a web stack that already has query parameter parsing?
<companion_cube> (relatedly, I just implemented a basic multipart form parser and that was big yikes energy )
<discocaml> <yawaramin> the Go ones are not composable and flexible...my one is more verbose but more powerful and allows reuse
mange has quit [Ping timeout: 252 seconds]
Haudegen has quit [Quit: Bin weg.]
mange has joined #ocaml
mange has quit [Excess Flood]
Tuplanolla has quit [Quit: Leaving.]
Everything has quit [Quit: leaving]
switchy has joined #ocaml
<Mister_Magister> Hello again beautiful people, I am not a novice software engineer and I've been looking for some new programming language that would fit my needs, more modern than c++ and also objective becaues i love oop. Yesterday i've been looking through ocaml introduction and it seems to have everything i need in terms of oop. While i'm not quite yet convinced about the lack of types and weird matching i'm quite sure that linter probably
<Mister_Magister> solves all issues. But on that note i would like to ask you people one more questions before i decide to commit to learning ocaml. Could you provide me with some example project thats like 20-50 classes? I've seen how ocaml looks on micro scale but i gotta see it on macro scale
<discocaml> <Kali> "lack of types"? it is types, they're just inferred
<discocaml> <Kali> typed*
<Mister_Magister> i know that
<discocaml> <Kali> you can manually annotate types if you want
<Mister_Magister> like, people got very mad at auto in c++ :D
<discocaml> <Kali> also ocaml programs almost never structure code with classes, but rather with modules
<discocaml> <Kali> in fact most ocaml programs do not even use oop at all
<Mister_Magister> well modules and classes are not the same thing
<Mister_Magister> but hence i asked for some example oop project so that i can see how it looks on macro scale :P
<discocaml> <Kali> maybe check out lablgtk
<discocaml> <Kali> it's the only library i know that uses objects very extensively because it's bindings to an oop gui library
<Mister_Magister> yeah feels like oop is less and less popular these days
<discocaml> <Kali> yeah, but in ocaml's specific case, ocaml's module and type system are sufficiently complex to replace most of the things oop was supposed to be good at (encapsulation, inheritance, polymorphism) and objects also are just less performant due to the developers not putting in as much effort into that area of the language so there is a bit of a natural deterrant regardless
<Mister_Magister> hmmm so it could be that, after all, ocaml is not language for me sadly
<Mister_Magister> or i could stop crying and stop forcing oop
<discocaml> <Kali> encapsulation via abstract/private types, inheritance via `include`, and polymorphism at a type level with polymorphic types and polymorphic variants or at a module level with module subtyping
<discocaml> <Kali> i'd still recommend checking ocaml out because it will almost certainly make you learn some new ways of thinking about things
<discocaml> <Kali> it's definitely weird if you're coming from mainstream languages
<discocaml> <Kali> but it will make you a better programmer
<Mister_Magister> yeah i mean, the issue i have with oop is that its deeply rooted in my brain so i can only think oop
<Mister_Magister> yeah for sure
<Mister_Magister> i just get lost without oop, but again, i could just stop crying and do something about it xd
<discocaml> <yawaramin> thinking in OOP is fine, it's just a matter of what exactly you are looking for in a new language, what's more important
<Mister_Magister> hmmm
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
zenmov has joined #ocaml
<dh`> functional programming and object-oriented programming are all just programming
reynir has quit [Ping timeout: 248 seconds]
gentauro has quit [Ping timeout: 276 seconds]
reynir has joined #ocaml
gentauro has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Read error: Connection reset by peer]
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
<discocaml> <bluddy5> OCaml is not a good target if you're looking specifically for OOP. If you want to find out about functional languages, it's a perfect fit.
<discocaml> <bluddy5> There is some OOP support but it's discouraged
trillion_exabyte has quit [Ping timeout: 252 seconds]
<discocaml> <chrisarmstrong> I'm actually using the O in OCaml right now :ocaml:
agentcasey has joined #ocaml
olle has joined #ocaml
<Mister_Magister> >ocaml >has objective in name >is mainly functional
<Mister_Magister> we're reaching bamboozlement levels never reached before
<olle> mainly? depends on who use it? the object system is an extension on top of caml, iirc.
<olle> there's a module language in there too
* Mister_Magister its a joke
<olle> mocaml? mooocaml.
<olle> hm
<olle> Mister_Magister: sure
rgrinberg has joined #ocaml
igemnace has joined #ocaml
Haudegen has joined #ocaml
bartholin has quit [Quit: Leaving]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
<reynir> I'm not sure I would go so far as to say objects are discouraged in OCaml. Just not widely used.
<discocaml> <chrisarmstrong> It’s object oriented enough. Reminds me of prototype based languages like JS
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
chiselfuse has quit [*.net *.split]
<discocaml> <ape_logic> does anyone know of an existing implementation of reflinks/ioctl_ficlonerange syscall in ocaml?
Haudegen has quit [Quit: Bin weg.]
chiselfuse has joined #ocaml
Haudegen has joined #ocaml
rgrinberg has joined #ocaml
alexherbo2 has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
myrkraverk__ has joined #ocaml
rgrinberg has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
olle has quit [Ping timeout: 255 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Everything has joined #ocaml
Serpent7776 has quit [Ping timeout: 245 seconds]
Tuplanolla has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
pi3ce has quit [Ping timeout: 255 seconds]
Everything has quit [Quit: leaving]
alexherbo2 has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
nirvdrum has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
ygrek has joined #ocaml
<discocaml> <barconstruction> Discouraged by who?
nirvdrum has joined #ocaml
<dh`> the conventional wisdom, at a minimum
<discocaml> <doraent> I've never done anything serious in OOP, and wonder : do you know an example of something we would do easily in OOP and not with the ocaml module system ?
<discocaml> <smondet> OCaml still has one of the best OOP subsystems out there (structural subtyping, well controlled inheritance, etc.).
<discocaml> <smondet> Perfect "gateway drug": come for the slick OOP, then slowly realize it's not what you wanted for 95% of the problems...
<discocaml> <ape_logic> I've not yet tried oop in ocaml, most things that fit the "stuff data into a structure and run methods against it" pattern I just define a function that takes `t` as a parameter
<discocaml> <ape_logic> which I guess is kind of C like
<discocaml> <ape_logic> no real use for inheritance yet
<dh`> what do you mean by "OOP"? there's all kinds of interpretations
gahr has quit [Quit: leaving]
gahr has joined #ocaml
<discocaml> <ape_logic> I guess I would say gof type patterns but honestly a huge chunk of that can just be done with OCaml's more natural polymorphism
alexherbo2 has joined #ocaml
bartholin has quit [Quit: Leaving]
ygrek has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
aztex has joined #ocaml