Patrefans
noboilerplate from patreon
noboilerplate patreon

In Search of Code Purity

🕑 Added 2024-01-16 16:30:52 +0000 UTC
In Search of Code Purity

Comments

Renoir Boulanger

Question about iterators being not allowed in const functions. (Context: I’m from TypeScript, PHP, Hack, some Python Web dev) What I understand of generator functions is that the function returns a thing (i.e. output) that the system knows the “contract” on how to get back to it and get the next value. This is definitely runtime realm. PHP7, TypeScript (ES2015 with more syntax), ECMAScript 2015, … They had to add some symbol in the syntax probably for the parser to do that difference in its bytecode (or equivalent) machine readable blobs. (Darn. I lost the question… after some time. Maybe that’s what follows) A pure function is supposed to be also a small unit of work. If one has to iterate, maybe it’s because something needs to be broken up some more. Say it’s to find a prime number you want to do. The checking about whether or not the input is prime can be pure. Assuming there’s no math “function” to find the next in sequence. But not the function blog articles would suggest next_prime to get another prime. Or type next_prime = (previous: number) => number We can’t know how many hoops will be needed. (Darn. That wasn’t the question. Sorry)

Renoir Boulanger

“Ship it”. In academia in software engineering related to Web. There isn’t much. Emilia Mendez being one I remember most from. Because a Web app is essentially shipping container and content in contrast to having to have software updates. As the reason to just shoot from the hip. > “binary holder” 🤌 I’m a Web dev. Fascinated by server, protocol, renderer, DOM, etc. But. Rust compiles into Web Assembly (!!) You’ve mentioned TypeScript. Maybe Deno and typing system as part of it more native? Maybe we can build binaries smaller than equivalent code written in v8 Node realm.

No Boilerplate

Everything is possible with a macro, you can write haskell inside Rust TODAY if you so chose ;-)

No Boilerplate

ha! well done! I will put the actual url in the public video, that's a good idea!

No Boilerplate

Yes, all videos eventually are published. This one drops on Friday!

Grzegorz Wierzowiecki

Found them https://www.teepublic.com/stores/no-boilerplate ! (tshirts I mean ;))

Tim Urian

Great vid! I would be interested to know what it is like to work on a codebase that is full of pure functions. What is easier, what is harder? How much does it turn out can be pure? I am of course already sold on the idea that it would make me feel much happier and secure when changing code :)

AArexx AAron Ruscetta

Most of this is over my head, but I'm hoping for some trickle down understanding from an occasional b-rain storm. Will this make it to your YouTube channel? I'd like to share it with a couple of fellow Rust fans.

Ahmed Haracic

This video has compelled me to order the rust programming language book.

Grzegorz Wierzowiecki

Finally I feel I am not alone! I was searching ways to achieve purity in "more practical" (then haskell) programming languages... ended up decade ago deep diving into LLVM compiler, to eventually build "pure" keyword into languages... exploring Elixir/Erlang and others... proving properties and purity are beautiful.. thank you for putting this together. Both: once it will be shareable on yt I can point others without need of me trying to explain ... second new fresh look and perspective on Rust "Purish function" (not writting to not make a spoiler to others that wanna watch ;)). I still wonder if we could make a macro #[pure] macro or to put above those Purish functions (or clippy check) that would prevent other macros inside 🤔.

No Boilerplate

Yeah! I might be paraphrasing that actually, "Javascript is Lisp in C's clothing" - I've heard that many times :-)

Anastasia Middleton

It's not a mistake/errata, but I'm remembering how I got into Computer Science by falling in love with Javascript. Learning about the history of Javascript, it's background connection to lisp and smalltalk, hiding in a c-like shell helped me spiral into an obsession with languages and why they all exist, and what makes one better than another for a given person or task. All that came flooding back with the "Rust is Haskell standing on Lisp hiding in a C-syntax to sneak into Production" line. Been fiddling with Rust in my free time, but I'll be doing more over this week.

No Boilerplate

Ooh, as a title suggestion? Not bad! I'll bear it in mind!

Thomas Picard

“Having my cake, and eating it too”?

No Boilerplate

PR here if you spy a mistake, thank you! https://github.com/0atman/noboilerplate/pull/57


More Creators