-
Notifications
You must be signed in to change notification settings - Fork 24
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
#![no_std] where possible? #144
Comments
Thanks for filing this, @CAD97! I've been thinking about it and am more inclined towards not making it a priority, specially because alternate solutions are already available for critical algorithms. Also, during the implementations, we think as we're no_std and, as you've mentioned, we're not allocating memory in runtime (with possibly one or two exceptions), but maintaining two variations makes everything much slower. Do you really think it's going to be harder to do so later if we don't start now? I think if we do that later, we can better draw the line for what needs a local implementation (like What do you think? |
I think, for the UCD at least, we should At the same time, there's a voice in the back of my head saying "what use case is there for unicode processing in a no-std environment?" But I still think it is worth it to enable It's definitely easier to turn TL;DR |
Yeah, agreed generally. Although, it needs some CI configuration to test everything clearly. When |
Given #21, |
Re #21, the idea is to change the table-creation and data-table matching codes to perform ASCII lookups via a direct array lookup, and all the rest of Unicode via b-tree search. |
It seems that in the future we could even drop the |
Many of the packages are now |
A common feature among unicode crates is that many of them are
no_std
or are opt-outstd
.Do we want to support the
no_std
use case? If we do, we should do so soon to avoid includingstd
things in our crates.For the UCD at the very least,
no_std
does not seem difficult.char_property
works as-is with#![no_std] use core as std
. (caveat: my small test didn't cover the macro...)char_range
works so long as theBound
-based construction API is gated onstd
support.utils
hasiter_all_chars
still (why? that should probably be removed since we haveCharRange
) which returns aBox
, but works if that is dropped.A quick search of the
ucd
directory shows one use ofstd::collections
, which is in a test. Other than that, I don't think any non-core
apis are used in ucd.std::ascii
fn can be easily shimmed for those that are being used (I know they exist some places). I mean, we're writing a text-processing library, I hope we could shim it 😆.Working in a
no_std
would also force us to think Iterator-first, as we would no longer have allocating APIs available at all.normal
has one use ofVecDeque
. Other than that,String
, andstd::ascii
, I don't think we're using any non-core APIs in the libraries. (I of course exclude the source generation tools.)The text was updated successfully, but these errors were encountered: