Learning Ocaml Part 2

  Рет қаралды 23,410

TheVimeagen

TheVimeagen

Күн бұрын

Пікірлер: 59
@cheebadigga4092
@cheebadigga4092 Жыл бұрын
It all kinda makes more sense when you're looking at the code through the lens of your college maths teacher ("sets" instead of "arrays", etc)
@ДмитрийВасильев-я6б
@ДмитрийВасильев-я6б Жыл бұрын
Can i have set of all odd numbers?
@mskiptr
@mskiptr Жыл бұрын
​@@ДмитрийВасильев-я6б ```ghci > let oddNaturals = iterate (+ 2) 1 :: [Integer] > > take 5 oddNaturals [1,3,5,7,9] ```
@LusidDreaming
@LusidDreaming Жыл бұрын
C++ diehards are a textbook example of the sunken cost fallacy. By the time you realize what a convoluted mess it is, you've already dedicated half a decade to learning the language and all your remaining friends are C++ nuts. So you just have to convince yourself it was worth it.
@haniffaris8917
@haniffaris8917 7 ай бұрын
Keep convincing yourself that.
@mskiptr
@mskiptr Жыл бұрын
14:00 Not overloading operators and using distinct symbols for dissimilar operations is great. However, (+) for Ints and (+) for Floats is arguably the same operation. You can resolve this problem using a slightly more powerful version of traits. More specifically, you can have a Numerical trait that requires your type T to provide addition and friends (+) : T -> T -> T. And that's exactly what _Haskell_ does! All the numerical types implement Num. But dissimilar operations get distinct names. You have (/) for floating division, but div for rounded-down (integer) division and quot for truncated-to-0 one. And list concatenation is (++).
@mskiptr
@mskiptr Жыл бұрын
41:00 Haskell has excellent imperative programming support. That's what State, ST and the do notation are for.
@mskiptr
@mskiptr Жыл бұрын
50:30 If you love that, you will be amazed by Haskell 😉 edit: and there's no operator overloading there btw
@mskiptr
@mskiptr Жыл бұрын
1:03:20 That's really weird. In Haskell that would just be: main = do sum
@rogergalindo7318
@rogergalindo7318 Жыл бұрын
yes, there always must be one of us haskellers, showing prime the good of the proper pure functional programming
@47bytes
@47bytes Жыл бұрын
You *could* also implement this in OCaml it's just that the stdlib doesn't.
@stuff9282
@stuff9282 Жыл бұрын
Awesome! Ocaml 5 (finally) comes with multicore support. I can see ocaml having a renaissance in the coming years. Its rock solid, and has arguably the best type system out there. Its not as academic (it has opt-in mutation, and while loops) as Haskell and has strict evaluation. Ocaml has predictable and good performance. Finally, the ecosystem has really grown in the last 5 years. Dune is a solid build tool, and while taking a few days to grasp, is very flexible. There is solid libraries, and the community is growing fast (active ocaml discuss forum, and discord)
@kodingamedev
@kodingamedev Жыл бұрын
i can defo see myself using ocaml over haskell for my fp needs when they add typeclasses
@somebody_on_the_internetz
@somebody_on_the_internetz Жыл бұрын
Hmm F# had multicore support for years and it still didn't take off , so I don't really see it for ocaml.
@chris-pee
@chris-pee Жыл бұрын
OCaml doesn't seem to offer anything that F# doesn't offer, and the tooling is slightly worse, so I don't expect any big popularity (from either tbh).
@insertoyouroemail
@insertoyouroemail Жыл бұрын
Haskell also has while loops and mutation.
@stretch8390
@stretch8390 8 ай бұрын
@@chris-pee You know where F# came from, right?
@NiDeCo
@NiDeCo Жыл бұрын
/me having learned Haskell as a first language and professionally working in it for 6+ years: "Wait, you're excited about pattern matching? That's like the most basic thing... do other language not have a compiler that just knows when you're being a dum-dum? 🤔"
@okuno54
@okuno54 10 ай бұрын
Prime keeps saying how offended the Haskellers are gonna be, but like... bro, this is your gateway drug; I'll be reading your whitepapers soon ;)
@TheVimeagen
@TheVimeagen 10 ай бұрын
I can feel the pull already
@kenneth_romero
@kenneth_romero Жыл бұрын
14:00, so does that mean languages like BQN and APL do this as well, since they have so many symbols that they use? They're able to just infer quickly as a certain symbol can only be used on certain types?
@tonywtyt
@tonywtyt Жыл бұрын
Ocaml has been around for quite awhile, but I just never dug into it. I need to read up on the history of it more to get a feel for how/why it was developed. I appreciate the fact that I've subscribed and get to ride the camel with you!
@AnthonyBullard
@AnthonyBullard Жыл бұрын
Had to catch all of the parts I missed. Thanks Prime, and congrats on 100k
@trannusaran6164
@trannusaran6164 Жыл бұрын
now you're almost ready for the most spiritual experience in computer science: the metacircular evaluator
@mmj5916
@mmj5916 13 күн бұрын
I can feel the ocaml drug flowing through me, where were you in my life?
@bearwolffish
@bearwolffish Жыл бұрын
More Ocaml, for the soul.
@AdoreHorror
@AdoreHorror Жыл бұрын
aren't croissants originally Turkish?
@PetrSUsername
@PetrSUsername Жыл бұрын
37:10 this is absolutely unreadable without any brackets etc. What is function, what is parameter, what is what. :/
@danvilela
@danvilela Жыл бұрын
"double semicolon".. I stopped there..
@cheebadigga4092
@cheebadigga4092 Жыл бұрын
btw PowerShell when? :D
@maxmustermann4487
@maxmustermann4487 Жыл бұрын
bro your is so entertaining. I neeeeeeeed moooooore Ocaml. Trust me, do more streams and upload the m and u will get more klicks
@balduin_b4334
@balduin_b4334 Жыл бұрын
yesss sir
@hashi856
@hashi856 Жыл бұрын
First
@NickWindham
@NickWindham Жыл бұрын
I vote for Golang videos. It’s a language people will actually use.
@MrHamsterbacke756
@MrHamsterbacke756 Жыл бұрын
Not very interesting though
@musdevfrog
@musdevfrog Жыл бұрын
nah, there is nothing to learn.
@alurma
@alurma Жыл бұрын
OCaml is Go on steroids
@alurma
@alurma Жыл бұрын
Okay concurrent ML is Go on steroids
@jonforhan9196
@jonforhan9196 Жыл бұрын
I vote OCaml
@kahnfatman
@kahnfatman 10 ай бұрын
59:30 "Suddenly it's lisp" 🥲 1:06:29 Ctrl_D should do the trick as well
HTMX
41:47
TheVimeagen
Рет қаралды 71 М.
Learning OCAML Part 1
49:53
TheVimeagen
Рет қаралды 79 М.
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Problems 1 - 9 : 99 Ocaml Questions
1:33:30
TheVimeagen
Рет қаралды 20 М.
Reflections On A Decade Of Coding | Prime Reacts
28:59
ThePrimeTime
Рет қаралды 123 М.
Rant: Entity systems and the Rust borrow checker ... or something.
1:01:51
Ocaml - Advent Of Code Day 1
41:08
TheVimeagen
Рет қаралды 25 М.
zig will change programming forever
9:34
Low Level
Рет қаралды 382 М.
How OCaml Makes Ints Speedy | Prime Reacts
20:21
ThePrimeTime
Рет қаралды 56 М.
Ocaml My Caml
1:15:43
TheVimeagen
Рет қаралды 13 М.
Code Review: Ocaml
35:52
TheVimeagen
Рет қаралды 38 М.
My Zig Experience | Prime Reacts
38:13
ThePrimeTime
Рет қаралды 158 М.
50 BILLION MESSAGES PER DAY WITH 32 ENGINEERS | Prime Reacts
14:58
ThePrimeTime
Рет қаралды 570 М.