https://github.com/lynzrand/aestus
🚧[Under Construction]🚧 An experimental encoding-agnostic string library for MoonBit
https://github.com/lynzrand/aestus
moonbit string
Last synced: 4 months ago
JSON representation
🚧[Under Construction]🚧 An experimental encoding-agnostic string library for MoonBit
- Host: GitHub
- URL: https://github.com/lynzrand/aestus
- Owner: lynzrand
- Created: 2024-07-13T04:25:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T03:25:39.000Z (almost 2 years ago)
- Last Synced: 2025-10-27T02:34:30.861Z (8 months ago)
- Topics: moonbit, string
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Aestus
An experimental encoding-agnostic string library for MoonBit. **Under heavy construction, not yet usable.**
## Rationale
UTF-16 isn't really a good choice for strings. You lose compatibility with ASCII like UTF-8, and you lose direct codepoint indexing like UTF-32. It's in the middleground for compatibility with legacy systems nobody love, so we might as well just don't use UTF-16, or at least, enclose it into something that we can easily swap away.
## Design
Design reference: https://swiftdoc.org/v5.1/type/string/
For Aestus, a string is a list of Unicode code points (`Char`s). The user should make no assumptions about the underlying encoding.
You can view the string as:
- A collection of Unicode scalars (default)
- A collection of UTF-16 code points
- A collection of UTF-8 code points
A string is _not_ indexable, unless you get the index from one of the three views, which are only iterable.
## License
Copyright (c) 2024 Rynco Maekawa under MIT.
---
Aestus is named after [Sinus Aestuum](https://en.m.wikipedia.org/wiki/Sinus_Aestuum).