3min chapter

 Rustacean Station  cover image

clap with Ed Page

Rustacean Station

CHAPTER

Clap - Is There a Way to Use Hash Maps in Python?

In python, your objects are all just hash maps internally. While in rust, you have you define a struct and as all your fields, they're all statically defined. With the way clap has grown its feature set, with the fact that everything has to be baked into clap to be able to work, we now have 20, 30 fields in a struct. And that means any time you move that struct, it has to generate all the assembly code for moving 20 30 fields. So by using any map for a lot of the different kinds of state you might want to track with an argument, we can be able to reduce our compile times, reduce our binary size and increase flexibility.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode