Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain binary size in "Small Example"? #1493

Closed
a21152 opened this issue Nov 21, 2023 · 3 comments
Closed

Explain binary size in "Small Example"? #1493

a21152 opened this issue Nov 21, 2023 · 3 comments
Assignees

Comments

@a21152
Copy link

a21152 commented Nov 21, 2023

It might be worth comparing and explaining (in lecture notes?) the binary size of a "hello world" example built by Rust vs. C.

On Linux, my stripped (strip -s ) version of rust "hello world" is 367K, compared to C's 15K.

@djmitche
Copy link
Collaborator

Thanks! We actually just took that example out, for a variety of reasons, but basically because it's way too early in the course to be getting into the weeds on issues like that.

I suspect students may sometimes bring up the question of binary size, or it would fit naturally in the bare-metal course. I don't think we need to address it specifically in the fundamentals course.

@a21152
Copy link
Author

a21152 commented Nov 22, 2023

ACK actually optimizing the binary size, e.g. via https://github.com/johnthagen/min-sized-rust, can be tricky. But since the "fundamental" course also serve as a "Rust language" overview, and in the beginning we mention Rust is suited for embedded to servers, and that it does not have a runtime etc. It might still worth briefly mention that Rust is optimized for compilation speed, easy of debugging etc. and the binary size (especially for the hello-world) can be dramatically bigger than that of the of C so to minimize suspension especially for students from embedded space. I will leave that up to you though. Please feel free to close the issue.

@djmitche djmitche self-assigned this Nov 22, 2023
@djmitche
Copy link
Collaborator

Fixed in #1073.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants