pintariching / rustle

Svelte compiler rewritten in Rust
MIT License
1.37k stars 35 forks source link

General utilities rewrite #7

Closed pintariching closed 2 years ago

pintariching commented 2 years ago

One place to start would be rewriting all the utilities from here: https://github.com/sveltejs/svelte/tree/master/src/compiler/utils

A lot of them are used further up in the parsing and compiling.

Antonio-Bennett commented 2 years ago

I would love to help with this :)

pintariching commented 2 years ago

@Antonio-Bennett Feel free to open a PR on anything you like 😁

Antonio-Bennett commented 2 years ago

@pintariching okay thanks! Anything you're currently working on that I shouldn't duplicate?

pintariching commented 2 years ago

Most of it is commited to main right now, so feel free to pick up anything

linrium commented 2 years ago

I need to review the PR implement locate_character module before implementing the error :)

akshatagarwl commented 2 years ago
pintariching commented 2 years ago

Yeah that makes sense. No point in implementing these.

mplayer78 commented 2 years ago

Hi there, I'd love to help with this (although I am pretty new to rust). It occurs to me that some of these functions will not be required as Rust's type safety will make it difficult for them to be called so it will be fixed at the calling level. For example the flatten function will take [1, [2, 3, [4, 5]]] => [1, 2, 3, 4, 5] but this would be challenging to even create a vec with this shape. It seems that we'd be doing some funny encoding (and wrapping stuff in Boxes) to just decode it after?? (Excuse me if I have completely missed some very basic concept in Rust!!)

pintariching commented 2 years ago

It could be that the flatten function doesn't need to be used as with trim_start and trim_end. I haven't seen where it's used yet. If you're new and want a challenge you can try and implementing it as a challenge, but know that it may not be used :sweat_smile: