juliancoleman / orchestra

A dependency-free, pure-function String manipulation library
MIT License
1 stars 0 forks source link

Add some Rust lang functions #16

Open juliancoleman opened 5 years ago

juliancoleman commented 5 years ago

JS Strings are stored as utf-16, so if I want them stored as utf-8 (rather, utf-8-like, since they will still be utf-16 when converted back), we could filter a string, keeping only values that lie within a certain codepoint range.

https://doc.rust-lang.org/std/string/struct.String.html https://doc.rust-lang.org/std/primitive.str.html

juliancoleman commented 5 years ago

Because JS isn't a memory-safe language (in that memory is dynamically allocated), there are a number of functions that simply can't be added unless I made a new String class, which I won't do. The biggest question is: do I want to use generators where Rust uses iterators? Also, if I find out that this whole bytes thing isn't going to work out like I planned it to, then that sucks, but at least I'd have learned something