Geal / crates_you_should_do

list of Rust crates ideas you could take as first project
15 stars 0 forks source link

parsing ISO8601 dates in webasm #1

Open Geal opened 7 years ago

Geal commented 7 years ago

I'll let you find a nice crate name :)

Description

(original idea from @jtanguy)

This is a library, written in Rust, compiled to webasm (so it can be called from Javascript code), that can parse ISO8601 dates (strings that have this format: "1977-04-22T01:00:00-05:00") and handle recurrence.

Why is it a nice idea?

This could be a good example of what you could do with Rust code compiled to Web Assembly. Personally, I'd love to see something like Moment.js done in Rust!

Skills you'll learn

Resources to get started

Here is an existing ISO8601 parser in nom that could be extended, and the associated blogpost. For webasm, see all the work done by @badboy. You can now use webasm from stable Rust.

Mentor(s)

Freyskeyd commented 7 years ago

I think I will try to do it^^

Geal commented 7 years ago

great! You can start by playing around with the rust->webasm toolchain, and see how you can expose an API and Rust types to JS

Freyskeyd commented 7 years ago

Yep.

How do you see this crate? As a complete clone of momentJS? Like a MomentRS?

Geal commented 7 years ago

start small, with just a way to recognize some dates, then we'll see if a new time library would be interesting

Geal commented 7 years ago

BTW the wasm target is now enabled on stable: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1200-2017-08-31

sharksforarms commented 6 years ago

Maybe this could compile to be used in wasm? https://github.com/chronotope/chrono