CommunityNews

CommunityNews

Structural typing in Rust

Have you ever wanted to write a structurally typed function in Rust? Do you spend a lot of time and effort getting your Rust struct s just so , and want to DRY-out data access for common field paths without declaring a new trait and implementing it for each struct (let’s say, Cat and Dog both have a name: String field)? If so, read on.

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

Most Liked

OvermindDL1

OvermindDL1

What this article is talking about isn’t structural typing, it’s nominal row typing. Rust already has a structural type, it’s the Tuple, but the examples and such they show is about a nominal row type. Very bad set of misnaming there… >.>

And yes, row typing is fun, though often not but sometimes can be zero-cost. ^.^

Popular Backend topics Top

New
First poster: bot
Part 1: Introduction to Postgrest. In Codd, we trust In the field of Computer Science and Engineering, few things come close to the dura...
New
First poster: bot
Why Zig When There is Already C++, D, and Rust? No hidden control flow No hidden allocations First-class support for no standard library...
New
CommunityNews
Idioms for the D Programming Language This thread was posted by one of our members via one of our news source trackers.
New
First poster: bot
What’s Next for Teal, the typed dialect of Lua - FOSDEM 2021. This is my talk about the latest updates on the Teal programming language,...
New
First poster: malloryerik
Everyone outside of tech has heard of JavaScript, Java, Python, Ruby and even .Net, but few if any have heard of F#. However, F# may be o...
New
CommunityNews
Functional programming is an increasing popular programming paradigm with many languages building or already supporting it. Go already su...
New
First poster: bot
Episode 299 - 10 Tips and Tricks. I don’t get around to doing these too often, but they are always a lot of fun. In this episode, we’ll ...
New
New
brainlid
In episode 81 of Thinking Elixir, we talk with Digit and Quinn Wilton about the Burrito project. It wraps up Elixir to a single binary, e...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New