Rust: Haskell, but more imperative

  Рет қаралды 3,989

Trusty Bits

Trusty Bits

6 ай бұрын

Can Rust do functional programming? - We'll be covering common principles and features between Rust and Haskell.
Script on my blog: catalin-tech.com/haskell-rust/

Пікірлер: 19
@TrustyBits
@TrustyBits 5 ай бұрын
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 5 ай бұрын
Loved, the video, concepts are explained fairly clearly, I would love to see more Haskell content.
@TrustyBits
@TrustyBits 5 ай бұрын
Noted - Glad it was useful, thank you so much!
@culturedgator
@culturedgator 5 ай бұрын
Magnificent video
@TrustyBits
@TrustyBits 5 ай бұрын
You're too kind! Glad you enjoyed it!
@user-sj7lk5lg3x
@user-sj7lk5lg3x 6 ай бұрын
underrated channel. 🙏🙏🙏
@TrustyBits
@TrustyBits 6 ай бұрын
Thank you so much!
@0-Kirby-0
@0-Kirby-0 5 ай бұрын
Content? Fantastic, learned something and had things cleared up in my head. Prosody? Needs work. Looking forward to more!
@TrustyBits
@TrustyBits 5 ай бұрын
Glad you found it useful! Thanks for the feedback - I'm working on improving the way I talk while recording.
@Lucs-ku5cb
@Lucs-ku5cb 5 ай бұрын
Please make a video about haskell templates and Rust macros
@TrustyBits
@TrustyBits 5 ай бұрын
Thanks for the input!
@korigamik
@korigamik 6 ай бұрын
Re-upload?
@TrustyBits
@TrustyBits 6 ай бұрын
Yes, there was a major mistake for the monad explanation in the first version, so I updated, rerendered and re-uploaded.
@meyou118
@meyou118 5 ай бұрын
id say more like scala really...
@Jan-gl7mn
@Jan-gl7mn 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
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
@cassandrasinclair8722
@cassandrasinclair8722 5 ай бұрын
Perhaps Ocaml is more accurate :)
@TrustyBits
@TrustyBits 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.
Intro to Functional Programming in Rust • Amit Dev • YOW! 2019
27:50
GOTO Conferences
Рет қаралды 14 М.
Rust Data Modelling Without Classes
11:25
No Boilerplate
Рет қаралды 161 М.
When someone reclines their seat ✈️
00:21
Adam W
Рет қаралды 27 МЛН
Её Старший Брат Настоящий Джентельмен ❤️
00:18
Глеб Рандалайнен
Рет қаралды 8 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
Implementing Rust Traits
12:19
Andrew Burgess
Рет қаралды 13 М.
Proving Performance - FOSDEM 2024 - Rust Dev Room
40:46
Nikolai Vazquez
Рет қаралды 3,3 М.
ARRAYLIST VS LINKEDLIST
21:20
Core Dumped
Рет қаралды 50 М.
Constructors Are Broken
18:16
Logan Smith
Рет қаралды 100 М.
Higher-order Type-level Programming in Haskell
21:28
ACM SIGPLAN
Рет қаралды 3,5 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 148 М.
Understanding Rust Closures aka. Anonymous Functions 🦀 💻
30:22
Trevor Sullivan
Рет қаралды 10 М.
why rust libraries may never exist.
7:26
Low Level Learning
Рет қаралды 221 М.