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

Use core as much as possible, add no_std attr #17

Closed
wants to merge 4 commits into from
Closed

Use core as much as possible, add no_std attr #17

wants to merge 4 commits into from

Conversation

lxrst
Copy link
Contributor

@lxrst lxrst commented Oct 22, 2023

This crate is much more minimal compared to most alternatives. Some std imports can be core instead. Also, while this crate is not no_std-compatible, using the attribute disables the libstd prelude, forcing manual imports. I find this to be a good reminder of reliance on libstd.

@mrlazy1708
Copy link
Owner

Thanks for this! Though I'm bit confused what are the possible use cases for this? Do I expect some user to have this in Cargo.toml ?

std=some-custom-implementation
tqdm="0.6"

@lxrst
Copy link
Contributor Author

lxrst commented Oct 28, 2023

what are the possible use cases for this?

Potentially smaller binaries; libstd is quite a bit heavier than libcore.

For example, making an assembler smaller than nasm:
Screenshot from 2023-10-28 at 22_15_33 425130655

Do I expect some user to have this in Cargo.toml?

No, it has no effect on the end user whatsoever.

@mrlazy1708
Copy link
Owner

I tried your branch, but it seems that the binary has almost the same size as the binary produced by current HEAD (tried both w/ and w/o the release tag). I figured that crossterm has std included so removing std on my side has little effect.

@mrlazy1708 mrlazy1708 added the enhancement New feature or request label Nov 17, 2023
@lxrst lxrst closed this by deleting the head repository Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants