Rust: Haskell, but more imperative

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

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

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

    Script and code: catalin-tech.com/haskell-rust/
    Errata:
    At 11:40 - the macro doesn't have the correct syntax, and the derived trait has to be Debug - Display is not derivable. The following print macro also needs a format string.

  • @MasterGxt
    @MasterGxt 8 месяцев назад +2

    Loved, the video, concepts are explained fairly clearly, I would love to see more Haskell content.

    • @TrustyBits
      @TrustyBits  8 месяцев назад +1

      Noted - Glad it was useful, thank you so much!

  • @Jan-gl7mn
    @Jan-gl7mn 8 месяцев назад +6

    Rust just took some old ideas from Haskell and others and found a way to write code without GC, but the syntax of Rust is ugly and terrible, coming from Haskell, Rust code looks like C++ mix with some hipster language, hard to read. Haskells main issue is bad documentation, tooling(2 gb to install the compiler..) and no backward compatibility, but Haskell's syntax is amazing, although language extensions in Haskell are annoying.

    • @TrustyBits
      @TrustyBits  8 месяцев назад +3

      Would agree - I think it's hard to come up with a way of simplifying Rust syntax while keeping the advantages it currently offers. I'm personally ok with dealing with awkward syntax in some areas in order to have the benefits, but I get why people wouldn't want to deal with it.
      Haskell is indeed elegant and beautiful (though there are certain design choices that I very much dislike), but using it to build something that you actually want to use is not the best experience - though it's getting better. Compared to Rust's tooling, a lot of languages don't look that good, in any case.

    • @steveoc64
      @steveoc64 7 месяцев назад +3

      Well spotted. Just to make the story more interesting - Rust also took old ideas from Simula I, with automatic memory management via the ownership model ... which is effectively a form of automatic garbage collection.
      That was all back in the late 1960s, where CPUs were not as fast, and allocate / free overhead was quite a bit higher. So the general solution to that performance problem was to delay and batch up garbage collection, which then led to the "mark and sweep'" style of GCs that we are familiar with today.
      Ironically, mark and sweep GC is now considered harmful to performance :)
      End of the day ... manual memory management has always been the performance king, and its always going to be the performance king. It's just got a few obvious foot guns.
      I much prefer Zig's approach to addressing those obvious foot guns, rather than attempt to invent a whole new way of restricting programmers that just gets in the way. I don't find using Rust to be enjoyable in the slightest, and that has nothing to do with the syntax. I would rather peel potatoes for a living

    • @angeldude101
      @angeldude101 Месяц назад +1

      Honestly, making Rust's syntax more like Haskell is one of the very few things that would make me like the language even more than I already do.

  • @user-sj7lk5lg3x
    @user-sj7lk5lg3x 8 месяцев назад +2

    underrated channel. 🙏🙏🙏

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

      Thank you so much!

  • @0-Kirby-0
    @0-Kirby-0 8 месяцев назад

    Content? Fantastic, learned something and had things cleared up in my head.
    Prosody? Needs work. Looking forward to more!

    • @TrustyBits
      @TrustyBits  8 месяцев назад +1

      Glad you found it useful! Thanks for the feedback - I'm working on improving the way I talk while recording.

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

    Magnificent video

    • @TrustyBits
      @TrustyBits  8 месяцев назад +1

      You're too kind! Glad you enjoyed it!

  • @Lucs-ku5cb
    @Lucs-ku5cb 8 месяцев назад +1

    Please make a video about haskell templates and Rust macros

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

      Thanks for the input!

  • @korigamik
    @korigamik 8 месяцев назад +1

    Re-upload?

    • @TrustyBits
      @TrustyBits  8 месяцев назад +5

      Yes, there was a major mistake for the monad explanation in the first version, so I updated, rerendered and re-uploaded.

  • @cassandrasinclair8722
    @cassandrasinclair8722 8 месяцев назад +5

    Perhaps Ocaml is more accurate :)

    • @TrustyBits
      @TrustyBits  8 месяцев назад +5

      You could say that OCaml is closer to Rust because it has some imperative features, while Haskell has none. (Though this makes it closer to any imperative language - which I find very uninteresting to discuss). Looking at the way the type system is designed, I find that Rust borrows more from Haskell than Ocaml (see traits / typeclasses vs modules in OCaml.

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

    id say more like scala really...