Ocaml Becomes Rust w/ Garbage Collection?

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 210

  • @edz8659
    @edz8659 Год назад +422

    I love ocaml (I have never used it)

    • @vaisakh_km
      @vaisakh_km Год назад +15

      😂 ikr

    • @SimGunther
      @SimGunther Год назад +45

      That sums up the language landscape:
      Languages you love and languages you use extensively are (for now) mutually exclusive.

    •  Год назад +1

      I came here to say the same and you were first!

    • @RenderingUser
      @RenderingUser Год назад +6

      Same (I have never heard of it)

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz Год назад +3

      @@SimGunther except ofcourse Rust.

  • @atiedebee1020
    @atiedebee1020 Год назад +374

    Im so proud how far programming languages have come, finally local variables

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +91

      its amazing

    • @zsh7862
      @zsh7862 Год назад +9

      lua? or am i missing smth, i dont know too much about it

    • @Poem-Tree
      @Poem-Tree Год назад +25

      @@zsh7862its sarcasm

    • @SimonBuchanNz
      @SimonBuchanNz Год назад +23

      ​@@zsh7862for reference, local variables have been a thing since the creation of structured programming in the mid 50s.

    • @complexity5545
      @complexity5545 Год назад +1

      @@SimonBuchanNz This rebuttal made me chuckle.

  • @RemcoJvGrevenbroek
    @RemcoJvGrevenbroek Год назад +65

    fun fact!....... The first rust compiler was written i oCaml

  • @SimonBuchanNz
    @SimonBuchanNz Год назад +8

    Co- and Contra- variance is mostly confusing because it's not actually subtyping, but relations between subtyping relations between types. Which is a word salad that is much easier to describe with an example:
    For some generic Foo, there may be a subtype relationship between Foo and Foo, but it may be:
    * returning a T, in which case Foo is a Foo, which is covariance, or
    * it may take a T, in which case Foo is a Foo, which is contravariance, or
    * it may do both, in which case neither is a subtype, which is invariance.
    * it may even do neither, which means either may be a subtype of the other, which is bivariance! (In practice this means either they are actually the same type or it's unsound)
    The variance relation isn't a relation on the Dog or Animal, or even any of the Foo types: it's a relation on Foo instances to the T parameter: contra- if the subtypes go in the opposite direction, co- if they go in the same.
    The relation to function types is clearer when you look at them as being a fancy syntax for a generic: (A) -> R is basically just Fn.

  • @diadetediotedio6918
    @diadetediotedio6918 Год назад +6

    16:00
    C# can alloc on the stack, either by using structs or for arrays by using stackalloc type_str_unmanaged[length]

  • @josevargas686
    @josevargas686 Год назад +37

    ThePrime: you cannot have the same great communication while working remotely as you do in an office.
    Also ThePrime: most greatest communication with TJ while reading overly complex technical articles.

    • @SimonBuchanNz
      @SimonBuchanNz Год назад +2

      I'd say it as "the one person working remotely can't have the same great communication as the rest of the team working in the office", which I also think is too strong (I think it's more "it's harder" than "can't"), but is compatible with streaming

  • @casperes0912
    @casperes0912 Год назад +51

    I've written a decent bit of OCaml at university. We used OCaml to make a compiler for example. I also wrote a weak memory checker with OCaml (for C11's Release-Acquire semantics) as well as CRDTs. It has its ups and downs. If you don't type annotate it, you can get horrid compiler errors

    • @meli-overwatch9298
      @meli-overwatch9298 Год назад +1

      are you from tum?

    • @vikingthedude
      @vikingthedude Год назад

      This guy wrote CRDTs. I just learned about them last month. Damn

    • @MaxHaydenChiz
      @MaxHaydenChiz Год назад +2

      Have you used Haskell for similarly complex problems? I'd be curious of your opinion on how they compare.
      Personally, the main reason I like OCaml over Haskell is that the type inference is always decidable. So for CLI apps and other ordinary systems programming stuff, you need less manually written types (and can have the tooling just output your types into a file for you). And then for complex stuff, I tend to have fewer problems if I need to do complicated type system stuff (at least up to the point that having higher order polymorphism and the rest actually reduces code complexity; some stuff is just painful to do by hand without the help, from the Haskell compiler.).
      I've been meaning to experiment with using Coq and dependent types for those hard type-level problems. I'm told the ergonomics have gotten way better recently, and I really enjoyed the cleanliness of Idris over all the not-quite-dependent advanced types that Haskell supports.

    • @casperes0912
      @casperes0912 Год назад

      @@meli-overwatch9298 what’s tum?

    • @casperes0912
      @casperes0912 Год назад

      @@vikingthedude it was a project I took part in at university. Ultimate goal is for the implementations to be formally verified

  • @robertlenders8755
    @robertlenders8755 Год назад +29

    F# is the daughter of ocaml and has had possibly stack allocated values with structs and guaranteed stack allocated values with byreflike for a few years now.
    Local looks interesting though as it seems like it can be applied to existing types rather than declaring a new one.

    • @complexity5545
      @complexity5545 Год назад +6

      I'm not a windows guy, but when I do its C# and F# (and some C++). F# is a really good language.

    • @metaltyphoon
      @metaltyphoon Год назад +11

      @@complexity5545c# and f# hasn’t been a “windows only” thing for more than 7 years

    • @LSM07
      @LSM07 Год назад +6

      F# will always be underappreciated, unfortunately. But yes, the CLR allows for both unsafe and stack allocated stuff and has for some time. I wouldn't be surprised if they added lifetime-like annotations at some point to F#, too (which will, inevitably, be added post-hoc to C#).

    • @meowrbius
      @meowrbius Год назад +1

      @@complexity5545 How did you learn F#. Why there are no resources for it?

    • @Eugensson
      @Eugensson 8 месяцев назад

      ​@@meowrbiusthere is a lot of info by Don Syme, also an awesome series of articles "F# for fun and profit".

  • @EricSampson
    @EricSampson Год назад +16

    C# and F# let you do explicit stack allocations, re your comment about not knowing any GC langs that do

  • @rapzid3536
    @rapzid3536 Год назад +13

    Would love a series exploring F#

    • @WillEhrendreich
      @WillEhrendreich Год назад +1

      I approve this message.

    • @DMSBrian24
      @DMSBrian24 Год назад

      F# is a microsoft thing, in the functional world i'd say learn Elixir if you're fine with dynamic typing and if you want static, go with Haskell or Ocaml

    • @absolutejam
      @absolutejam Год назад +9

      ​@@DMSBrian24 what a narrow minded view 🤷‍♂️
      F# is an amazing language, has a rich ecosystem and performant runtime. And computation expressions are one of the greatest language features ever.
      But Haskell, Scala, Clojure, Elixir are all great. We shouldn't be limiting our world view based on surface level points. Try them all and evaluate them on their merits.

  • @carlpittenger
    @carlpittenger Год назад +13

    other than for example java primitives, the only garbage-collected language i'm aware of that lets you do stuff with the stack is c#: structs are inlined or on the stack, classes are on the heap. admittedly though, i'm not too familiar with modern c#.

    • @blade2663
      @blade2663 Год назад +1

      Golang also

    • @Imaltont
      @Imaltont Год назад +1

      Common Lisp can also, though exactly how it is done depends on the CL implementation.
      Edit: DYNAMIC-EXTENT in the hyperspec is what allows it, implementations that focus on performance such as SBCL does utilize it.

    • @mkwpaul
      @mkwpaul Год назад +2

      Classes in C# are always allocated on the heap, no matter what.
      Where structs are allocated depends on how they are used.
      If you have a struct field on a class, then that struct is allocated with the class instance, on the heap, it is embedded in its parent.
      if you have a local variable with the exact struct type so:
      int x = 0;
      However C# automatically and silently boxes (i.e. creates a heap-allocated copy) whenever needed. Like for example when the type of the variable is object or an interface.
      so if I write the following:
      int x = 420;
      object boxedX = x;
      IFormattable formattableX = x;
      then the 420 is initially only allocated on the stack, but when boxedX and formattableX are assigned, the value of x is copied onto the heap.
      If I have the following functions:
      public void PrintFormattable(IFormattable formattable) {
      formattable.ToString("Format", CultureInfo.CurrentCulture);
      }
      public void PrintFormattable(T formattable) where T : IFormattable {
      formattable.ToString("Format", CultureInfo.CurrentCulture);
      }
      then any non-boxed interger I pass into the first method will be automatically boxed, however it wont be boxed if I pass it into the second method.
      More recent C# versions have added a bunch of language and runtime features that let you do more low level things without unsafe. For example you can now declare a struct as a "ref struct" which will enable compile-time checks to ensure that instances of that struct are only ever allocated on the stack and never "escape" to the heap.

    • @blade2663
      @blade2663 Год назад

      @@mkwpaul That's exactly how Golang "escape analysis" works
      But with addition to explicit pointers

  • @metaltyphoon
    @metaltyphoon Год назад +47

    If prime’s pride didn’t blind him, he would see how F# is real world pragmatic OCaml

    • @xbmarx
      @xbmarx Год назад +2

      F# doesn't have modules/functors like OCaml though. It's basically just alternative syntax for C#

    • @metaltyphoon
      @metaltyphoon Год назад +7

      @@xbmarx Nice try but no. F# is pragmatic functional language. Things that F# has where OCaml doesn’t:
      1) Computational expression
      2) Perf abstraction ( stackalloc in this video)
      3) Anonymous Records
      4) Library ecosystem OCaml dreams of
      5) Slices and Ranges

    • @abuk95
      @abuk95 Год назад +5

      @@metaltyphoon but it is from microsoft ecosystem, so that is a dealbreaker

    • @metaltyphoon
      @metaltyphoon Год назад +6

      @@abuk95 oh so you want to be a SJ warrior, how about not using any GNU tools since Stallman sexual allegation? Guess what? You probably didn’t think twice and still use it. MS is not the same company from from 2 decades ago so stop pretending it is.

    • @nicolaspace1182
      @nicolaspace1182 Год назад +3

      @@metaltyphoonMicrosoft is still as evil as ever, but that doesn’t mean you shouldn’t use their tools. If the man who invented the hammer was a murdering psychopath, would you then never purchase a hammer?

  • @confusedbystander2898
    @confusedbystander2898 Год назад +49

    Very interesting. Gives of 'highly admired - barly desired' vibes for me.
    Not for Tom though ...

  • @sumansaha295
    @sumansaha295 Год назад +7

    programming languages part a/b/c on coursera was my first exposure to functional programming and ml. Excellent courses btw. At the end of the course the professor said one thing I remember, "Language design until now has all been about what not to do, and I would like to see the future programming languages about what we could do" This course was over 10 years ago, Something I think about when I see the rust borrow checker.

    • @gloverelaxis
      @gloverelaxis Год назад

      do you remember the professor's name or university? because I took a free online unit with the same structure dated 2019 from Professor Dan Grossman at the University of Wisconsin and it was the best educational experience of my life. he's a phenomenal teacher who happens to have contributed to the design of Rust

    • @sumansaha295
      @sumansaha295 Год назад +1

      @@gloverelaxis Yup it's him, I agree one of the best courses I have ever taken, but I didn't know he contributed to rust?

    • @gloverelaxis
      @gloverelaxis Год назад

      @@sumansaha295 ah awesome! yeah it was via the language named some synonym of Cyclone or Tempest or something; can't remember the specific linguistic feature it had that Rust incorporated. i'm so thankful for his work on that course; it totally opened my eyes to thinking about programming in *so* many new ways

  • @xbmarx
    @xbmarx Год назад +14

    Jane Street is also working on unboxed types in OCaml. Exciting language.

  • @MaxHaydenChiz
    @MaxHaydenChiz Год назад +9

    2 questions for you:
    1. Once you learn the language, are you going to install Jane Street's branch of the compiler to try to play with this stuff while it's in beta? Or are you just excited that it's coming in a future version?
    2. Did the youtube stream you made of the first day of OCaml get posted to one of your accounts? It became unavailable immediately after the stream ended, but I'd like to see the few parts I missed.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +2

      its on @TheVimeagen

    • @imadetheuniverse4fun
      @imadetheuniverse4fun Год назад

      @@ThePrimeTimeagen i'm guessing it's better for engagement but man it's hard to follow / find these threads across all your channels 😂

  • @KevinInPhoenix
    @KevinInPhoenix Год назад +2

    I use a GCed language that automatically puts local variables on the stack and "escapes" variables to the heap that are referenced outside of the local scope (arguments to functions). That language is Go.

  • @WizardofWestmarch
    @WizardofWestmarch Год назад +2

    I can see a use for local head prepend to a global list if those front values are only useful to that point and below in the call stack and will be thrown away after. Limits your pointer chasing as mentioned before.

  • @itacirgabral1687
    @itacirgabral1687 Год назад +3

    the beginning of a beautiful friendship

  • @MosiurRahman-dl5ts
    @MosiurRahman-dl5ts Год назад +5

    The chair has gained sentience.

  • @marble_wraith
    @marble_wraith Год назад +6

    I'm influenced... OCaml is gonna replace Rust. Dang it!

  • @ForsakenDAemon
    @ForsakenDAemon Год назад

    Types are usually covariant - I need an Animal so I can take a Dog - but function types are often contravariant in their arguments - I need a [function that takes a Dog] so I can take a [function that takes an Animal]. Basically if supertype is a supertype of subtype, array is a supertype of array (array is covariant) but function is like a subtype of function (function is contravariant). Scala taught me something, at least 🤣

  • @Titousensei
    @Titousensei Год назад +2

    If the compiler can do raise an error for variables declared local that escape, why can't it automatically detect the ones that don't escape and make the decision to allocate them on the stack?

    • @digitalspecter
      @digitalspecter Год назад

      16:26 it does

    • @Titousensei
      @Titousensei Год назад

      @@digitalspecter My point was: if it's possible to automate that, why not do it transparently by default and avoid the declaration altogether?

    • @digitalspecter
      @digitalspecter Год назад +1

      @@Titousensei Because you may want to ensure it is local and compiler to complain if you did something stupid that prevents that.

  • @HyperFocusMarshmallow
    @HyperFocusMarshmallow Год назад +3

    I recall a few years back when apple lived in Objective-C land and did reference counting using retain and release (and maybe auto release or something). And I remember finding that paradigm so much more simple and elegant than just pretending like things will be just fine, like in languages with a garbage collection only model.
    But even there you had some data structure whose name I don’t recall, some NS…Pool maybe. I really don’t remember. And you’d construct it and let it do garbage collection. It was a garbage collector.
    I haven’t thought too hard about it but if you really really need garbage collection isn’t there just some crate for it. Maybe that doesn’t end up sufficiently optimized or something.
    But I just don’t think that’s the kind of thing that needs to be baked into the language. I mean, it’s fine if it it’s, but if you don’t have it you can opt in right.

    • @SimonBuchanNz
      @SimonBuchanNz Год назад

      I found, while trying to interop with obj-c from Rust, that the docs for autorelease to be absolutely hilariously garbage. There's basically no actual explanation of what it actually does, just vague guides for using it from obj-c, and you're as l occasionally forced to use it with some APIs. Fun times!

    • @HyperFocusMarshmallow
      @HyperFocusMarshmallow Год назад

      ​@@SimonBuchanNz I honestly don't recall. Did you manage to figure it out?

    • @SimonBuchanNz
      @SimonBuchanNz Год назад

      @@HyperFocusMarshmallow I think I ended up just letting everything leak, which is fine for the specific case where nothing was in a loop.

  • @SimGunther
    @SimGunther Год назад +17

    Better to oversell a technology than a product, amirite?

  • @temper8281
    @temper8281 Год назад +5

    You know what they say. Functional languages have no side effects because no one can understand how to write and run them.

    • @mskiptr
      @mskiptr Год назад

      guide.elm-lang (dotyouknowwhat) is right there

    • @mskiptr
      @mskiptr Год назад

      Yay /s I got shadowhammered!

    • @lunafoxfire
      @lunafoxfire Год назад

      @@mskiptr i see both of your comments

    • @mskiptr
      @mskiptr Год назад

      @@lunafoxfire The first one wouldn't show up when I was logged out | in incognito mode. Now both are visible regardless
      Eh, YT is weird

  • @zaneearldufour
    @zaneearldufour Год назад +13

    I love seeing TJ playing along with your kayfabe

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +7

      ...?
      i never read that article and i am excited about ocaml... unsure about this

  • @TroubleChute
    @TroubleChute Год назад +1

    Woah may have been your 100,000th subscriber 👀Let's go

  • @njnjhjh8918
    @njnjhjh8918 Год назад +1

    Hell yes, I love both Rust and OCaml

  • @ericbwertz
    @ericbwertz Год назад +2

    Nice thumbnail -- Prime's OCaml-face.

  • @sho3bum
    @sho3bum Год назад +4

    I do ocaml professionally but I'm a junior dev so I suck at most things

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +1

      but you do it professionally! that is amazing

    • @Ottopuncher
      @Ottopuncher Год назад +1

      That's a skill finding an ocaml position. I wish !

  • @amazakee
    @amazakee Год назад +1

    any good video or article that would help me gain a deep enough understanding of GC for understanding this video?😅

    • @SimonBuchanNz
      @SimonBuchanNz Год назад +1

      Google "heap and stack" for the gist of allocation in general. For the purpose of this video, GC is just heap you don't have to call free on. Googling "mark-sweep" will give you a general idea of the basic principle.

  • @DisFunctor
    @DisFunctor Год назад +4

    OCaml seems really cool, but from my admittedly limited experience (and please do correct me if I'm wrong), it's missing a key thing that makes or breaks whether a language goes mainstream or not: good tooling. I hope Jane Street invests some more into it (and the good news is they have the financial muscle to do so), because subpar tooling has completely destroyed many a language's chance at escaping the "niche language" status.
    You might say Python tooling is not that great, and you might be right. But Python is also extremely easy to learn and currently being taught at every coding school and University as the introductory language, so you'd be comparing apples with oranges. Languages like Haskell or OCaml have a way steeper initial learning curve.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +9

      i am 10000000000000000x on your side
      if it doesn't have spectacular tooling, your language sucks (no matter how good it ackshually is). This is why i think rust has gotten so popular is more than the language, but due to cargo

    • @EricSampson
      @EricSampson Год назад +7

      F# is OCaml with wonderful tooling, just sayin’… 😇

    • @DisFunctor
      @DisFunctor Год назад

      About variance (learned it through Scala, but I think F[A] would just be syntax for F in Rust and TypeScript, difference just being the type of brackets used):
      say Dog is a subtype of Animal
      type Container[A] is invariant on A, therefore you have no information about the relationship between Container[Animal] and Container[Dog]. They will be considered different types. This is useful if you need something's type to be precise (e.g. you want operations on Container[Animal] to never be combined with operations on Container[Dog]).
      type Container[-A] is contravariant on A, therefore Container[Animal] should be considered a subtype of Container[Dog]
      type Container[+A] is covariant on A , therefore Container[Dog] is to be considered a subtype of Container[Animal]
      As a cheat sheet for remembering one of its most popular use cases: say you want to declare a function with type F[-I, +O], you can see it has two type parameters. From reading the type signature you'll know the function F "consumes" or takes I's as inputs and is meant to output or "produce" O's.
      I believe it's, conceptually the same thing in OCaml. Hope that's somewhat helpful.

    • @ruanpingshan
      @ruanpingshan Год назад +1

      @@EricSampson I remember being blown away 10 years ago when I tried F# and discovered that Visual Studio let me set breakpoints for individual expressions, not just for a whole line. Was still horrendous to debug though. Turned me off functional languages completely.

    • @meowrbius
      @meowrbius Год назад

      @@EricSampson I know C# is getting better and better. How is the F# currently going? I wanna start scratching functional paradigm a bit and thought of giving F# a try. How is F# compared to other functional languages?

  • @liquidsnake6879
    @liquidsnake6879 Год назад +4

    what is this sudden ocaml hipsterdom, every channel is suddently putting out vids about ocaml lol

    • @SimonBuchanNz
      @SimonBuchanNz Год назад +1

      Jane Street exerting their sinister fintech power 🤫

  • @KnThSelf2ThSelfBTrue
    @KnThSelf2ThSelfBTrue Год назад

    Damn people took the [params list here] { do stuff } syntax from Jai and added exclave ho boy

  • @alexanderoh1847
    @alexanderoh1847 Год назад

    c# has value types which are very similar in nature.

  • @carstenrasmussen1159
    @carstenrasmussen1159 Год назад

    It sounds like what D is doing also with scope and DIP1000

  • @aftalavera
    @aftalavera Год назад

    Ocaña is the second most loved language even tough nobody uses it!

  • @holthuizenoemoet591
    @holthuizenoemoet591 Год назад

    what is this OCaml popularity all of a sudden? Its like an sort of Erlang renaissance

  • @TheSkepticSkwerl
    @TheSkepticSkwerl Год назад +2

    For the love of all. Escape has 1 c in it!

  • @RogerValor
    @RogerValor Год назад +7

    I feel like I am the only one who does not get the point of OCaml, it looks like code that tries to get rid of some syntactic annoyances just to introduce so many new ones, that the result just looks like someone really does not want you to read their code.

    • @complexity5545
      @complexity5545 Год назад

      Boy did you say it.

    • @mskiptr
      @mskiptr Год назад +1

      As one wise commenter wrote last week _it's just Haskell, but ugly_
      Edit: this is a joke obv

    • @xybersurfer
      @xybersurfer Год назад +1

      i think that part of the problem here is that all this ugly locality stuff that Jane Street added to their version of OCaml, is giving you a bad impression. it's not normally there

    • @lunafoxfire
      @lunafoxfire Год назад

      @@xybersurfer absolutely not

    • @RogerValor
      @RogerValor Год назад

      actually started to learn ocaml just to understand what the hell is going on. who knows maybe i will like it later.

  • @Wanderer2035
    @Wanderer2035 Год назад

    Hey btw my sisters name is Julia do you think I should learn that code?

  • @yasscat5484
    @yasscat5484 Год назад

    adding keywords without a mechanism to keep backwards compatibility is probably a bad choice

  • @teej_dv
    @teej_dv Год назад +2

    nice

  • @rennelou9717
    @rennelou9717 Год назад +1

    guys, why don't you try haskell?

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +2

      i want to write something with side effects

    • @rennelou9717
      @rennelou9717 Год назад +1

      @@ThePrimeTimeagen guys, why don't you use monads?

    • @el_carbonara
      @el_carbonara Год назад +1

      @@ThePrimeTimeagen prime, haskell is perfect for that

  • @whiskeytuesday
    @whiskeytuesday Год назад

    This is a local station, for local people

  • @mettemfurfur7691
    @mettemfurfur7691 Год назад +3

    huh?

  • @mvargasmoran
    @mvargasmoran Год назад

    is this the actual TeeJ or is this a fake TJ?

  • @amj864
    @amj864 Год назад

    Julia does the stack allocated thing pretty aggressively.

    • @MaxHaydenChiz
      @MaxHaydenChiz Год назад

      I really want to like Julia. But I think they missed the mark with how their type system works and how traits are implicit instead of the building block. And at least right now, the library support isn't there. In my tests, it always takes about 2x the code that R would take for a similar analysis, At the same time, it isn't at a point where I can use it to replace the C++ portion of an R package and have it nicely integrate with CRAN. Nor does it have enough of the utility stuff that makes Python preferred for some data science use cases.
      I hope they get things sorted out eventually though. It's got a lot of good ideas.

    • @amj864
      @amj864 Год назад

      @@MaxHaydenChiz It's a tool/preference thing, Honestly, I can't do shit in anything other than Julia and it covers most of my use cases. Just thinking about C++ will give me nightmares.

    • @isodoubIet
      @isodoubIet Год назад

      @@amj864 Julia really blew it by having arrays start on 1.

    • @amj864
      @amj864 Год назад

      @@isodoubIet Christ, another one, what is the difference between 0-based and 1-based?! If you think using one or another will make or break your mental model for programming, I have bad news for you!

    • @isodoubIet
      @isodoubIet Год назад

      @@amj864 "Christ, another one, what is the difference between 0-based and 1-based?"
      0 is the right choice. 1 is not. Julia made the choice to cater to users less accustomed to programming where the difference matters, and as such it kneecapped its own development.

  • @sck3570
    @sck3570 Год назад +3

    I dont get it, why all of a sudden we are learning an old(very old) language? what gives?

    • @carlpittenger
      @carlpittenger Год назад +6

      i believe recent speed-ups, functional programming, interesting type system, etc.

    • @sck3570
      @sck3570 Год назад +3

      Haskell you say, Yay!

    • @isodoubIet
      @isodoubIet Год назад +2

      Jane Street single-handedly keeps OCaml alive basically

    • @isodoubIet
      @isodoubIet Год назад +1

      @@MateuszGrzyb-od9uo There are other functional-ish languages that would be comparably good for that. Ocaml was used because being used at JS keeps it alive.

    • @digitalspecter
      @digitalspecter 5 месяцев назад

      Well, it's more recent than Javascript..

  • @m0ff607
    @m0ff607 Год назад +2

    Eschewing?

  • @timvw01
    @timvw01 Год назад

    It will do its best, so will i.

  • @heitorvrb
    @heitorvrb Год назад

    was this guy sitting on a bouncing ball or something?

  • @HaloBolt35
    @HaloBolt35 Год назад

    TJ and Primeagen remind me of McConnell and Asmongold

  • @thesaintseiya
    @thesaintseiya Год назад

    You missed a paragraph...

  • @NamanGoel34
    @NamanGoel34 Год назад

    Swift added lifetimes already…

    • @NamanGoel34
      @NamanGoel34 Год назад

      Swift: Rust without all the manual memory management, except when you really need the most performance possible.

  • @thekwoka4707
    @thekwoka4707 Год назад

    Single = doing different things is rough...

  • @sortof3337
    @sortof3337 Год назад

    As somone who used HOT stack for 2 months. I'll say this --> to my dyslexic and ADHD brain --> rust is much much easier. Like rust is easy af compared to ocaml for me.

  • @complexity5545
    @complexity5545 Год назад +1

    My god OCaml. The next thing your going to try is TCL (which is a an even worst version of OOP functional programming). Ocaml its been a while for me. The french programming language. You guys are making your way up to why perl was created. LOL . I remember trying to refactor OCAML and having to use TypeRex and it made refactoring even worse. I then realized that I reached peak dumb-f4ck with this language. OCaml is really meant for tinkerer programmers which I define as programmers that like to keep changing code just to past the time and make sub-programmers lives more hectic. A good reason to choose OCaml over Haskell is for graphics and GUIs because OCaml is snappier and more realtime-like. Haskell has the problem of [hanging up] or pausing when the GC kicks in on graphics (back in the day).
    This was a good overview though. It made me remember stuff.

    • @totally_not_a_bot
      @totally_not_a_bot Год назад +1

      Mathematical abstractions and practical utility don't generally play nice. It's why I just gave up on haskell.

  • @neessaa8713
    @neessaa8713 Год назад +1

    Wait. Wouldn't Lifetimes as part of data type give the language a *spacetime allocator*? 🤔
    Turning the runtime Garbage Collector into an AOT Garbage Compactor, aka a Blackhole? 🥸
    And in this case, wouldn't the "side effects" be the Hawking radiations. causing the Heisenbugs? 🤯

  • @foxcirc
    @foxcirc Год назад +2

    async rust, 300 dependencies and 4 hours later I just throw it all out and use mio

  • @anon-fz2bo
    @anon-fz2bo Год назад

    ODeez

  • @ra-dro
    @ra-dro Год назад

    By tj!

  • @isodoubIet
    @isodoubIet Год назад +2

    Devs who program mainly managed languages keep falling into this trap where they think they can't get anywhere without the gc. Really value semantics + unique ownership gets you 99% of the way, shared ownership gets 0.9%, and garbage collection can be a legitimate help you with 0.1%. Managed languages optimize for the 0.1% hardest case and make your life sucky for the remaining 99.9%.
    The same devs go to Rust and run into trouble because the borrow checker is overly restrictive and forces them into awkward patterns just to shut it up. Turns out C++ had mostly the right model all along.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +2

      i disagree with this
      i think there are a variety of problems that c++ is annoying af to solve with

    • @isodoubIet
      @isodoubIet Год назад

      @@ThePrimeTimeagen C++ has many problems, but the memory strategy is basically right: it's value semantics most of the time, unique ownership for a small part of it (which could be even smaller with something like polymorphic_value), and shared_ptr (ref counting) when concurrency makes lifetimes difficult to reason about. The biggest missed opportunity are destructive moves. One of these newfangled languages could go a long way just by starting fresh from this basic model.
      The borrow checker is a win for concurrency but makes everything much more annoying with little payoff everywhere else, IMO

    • @elcugo
      @elcugo Год назад

      Biggest problem with C++ is that it needs to support code written 40 years ago. Modern C++ is kinda nice. At some point the commitee has to do a clean break.

    • @isodoubIet
      @isodoubIet Год назад

      @@elcugo Yup. In general, the cpp committee needs a strategy for fixing mistakes. There's probably some reasonable middle ground between "everything is backwards compatible forever and we never fix mistakes" and "let's hack lol".

  • @linuxrant
    @linuxrant Год назад +2

    I really don't understand yet half of what you are all talking about. I would like just to have a language as easy as python with the performance of c++... to write games and some cool programs :) and that's it. I don't want to language hop like neckbeards hop through linux distros...

    • @lucasa8710
      @lucasa8710 Год назад +1

      A had a similar idea, then I decided to implement such language and I realize the problem is way more complicated then it seems

    • @complexity5545
      @complexity5545 Год назад

      C++ is the only way. Do 3D games in Unreal.

    • @sumansaha295
      @sumansaha295 Год назад

      that sounds like Julia

    • @elcugo
      @elcugo Год назад +3

      It sounds like you should use C# or Java.

  • @Gabriel-wq4ln
    @Gabriel-wq4ln Год назад

    100K subs anytime soon

  • @tobyzieglerrr
    @tobyzieglerrr Год назад

    Ok, roast me, i like Java and i like Rust. I do not like OCÄML

  • @bloqDev
    @bloqDev Год назад +3

    Rust bad, crab good

  • @anarchymatt
    @anarchymatt Год назад +1

    Dude just learn the st monad /s

  • @AlesNajmann
    @AlesNajmann Год назад +3

    OCaml has a very polished syntax compared to Rust. Just sayin' :P

  • @stysner4580
    @stysner4580 Год назад +1

    E s c ape. Notice the order of the s and c? Not a syntax error!

    • @lunafoxfire
      @lunafoxfire Год назад

      so you're the one leaving 99 nits on every pull request

    • @stysner4580
      @stysner4580 Год назад +2

      @@lunafoxfire You really think I would leave an uneven number of nits? It's like you don't know me at all!

    • @lunafoxfire
      @lunafoxfire Год назад +1

      @@stysner4580 lol

  • @Kapendev
    @Kapendev Год назад

    No DLang?

  • @iamwhoiam798
    @iamwhoiam798 Год назад

    I can’t believe that people don’t speak about the practical difficulties of Rust such as using global or class level variables inside functions.
    mutability problems are overwhelming. Sometime can’t decide whether function should be mutable or member variable should be interior mutable.
    Value enclosed mutexes are ridiculous.

    • @dynfoxx
      @dynfoxx Год назад

      Why are value enclosed mutexes are ridiculous?

  • @KnThSelf2ThSelfBTrue
    @KnThSelf2ThSelfBTrue Год назад +1

    Damn, bash influencing the oxidation of OCAML with local. My decision to be the cringe-maxed bash ninja just keeps paying off

  • @aftalavera
    @aftalavera Год назад

    By the way Rust is the equivalent to following science! Covid and Climate change!

  • @AlgorithmAlloy
    @AlgorithmAlloy Год назад +1

    I love TJ ❤️ (In a purely sexual way if that wasn’t clear) (Joke if that wasn’t clear)