Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGet ideas from other projects #99
Comments
This comment has been minimized.
This comment has been minimized.
|
There is also https://github.com/dherman/esprit by @dhermann I'll try to set up some benchmarks across the Rust-based parsers to see how Ratel fares. If anything, we can at least be the testbed for performance. |
This comment has been minimized.
This comment has been minimized.
FreeMasen
commented
Nov 15, 2018
•
|
Thanks for reaching out! I am not sure I am willing to abandon my crates at this point but I think communicating is a key to success. One of the big reasons I started down the rust+js path was because I was looking for some modular crates to pick and choose what part of the process I was trying to work through. For example, if I wanted to transpile from rust to js it would be a lot easier if I could just transform a Modularity being the key here, by having a reader(parser) and a writer(codegen) built around a solid AST you empower the community to build things you might never think of. If someone wanted to write a codegen library that read in Another thing that I have been getting questions about/thinking about is the ability to use your parser to on supersets of js, primarily JSX and typescript. Looking over your crates here (not super thoroughly) I don't see any kind of comment handling mechanism. A number of js dev-tools utilize comments so including a way to communicate them might be valuable. Thanks again for reaching out! |
This comment has been minimized.
This comment has been minimized.
|
Aye, modularization is definitely somewhere Ratel has to improve. I've already tried some stuff in the In trait Module<'ast>: Parse<'ast> {
type Statement: Statement<'ast>;
}
trait Statement<'ast>: Parse<'ast> {
type LoopStatement: Statement<'ast>; // For specialization that involves `break` and `continue`
type Expression: Expression<'ast>;
}
trait Expression<'ast>: Parse<'ast> {
type AsyncExpression: Expression<'ast>; // For specialization within async function bodies that permits `await` expressions
}It might be a terrible idea and going the dynamic route might be easier (even if it means that the types permit constructing potentially invalid grammar), but I'm curious what other people think. |
This comment has been minimized.
This comment has been minimized.
kdy1
commented
Nov 29, 2018
|
Author of swc here. Can we join our efforts? I've implemented almost all transcompilers in swc, but it's quite slow. So I want to make it fast, or merge it into ratel. |
This comment has been minimized.
This comment has been minimized.
|
@kdy1 I'd be more than happy to join, I also don't particularly care about branding so the merge can be either way. I'd say have a look at the AST on |
This comment has been minimized.
This comment has been minimized.
kdy1
commented
Nov 30, 2018
•
|
Currently ratel's span does not contain hygiene information. swc use span hygiene to implement block scoping. hygiene based variable mangement makes implementing other passes simple. They can just declare a variable named Also note that swc uses rustc's libsyntax internally which is quite heavy, so I think right way to go is merging swc into ratel and droping the dependency. |
This comment has been minimized.
This comment has been minimized.
|
I'm hoping to look into adding hygiene to the AST today. My idea would be to create a new |
This comment has been minimized.
This comment has been minimized.
kdy1
commented
Dec 2, 2018
•
|
Does ratel targets stable rust? It's (currently) done by putting Also note that rustc is quite good at optimizing the visitor. |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure specialization based visitor is a good idea. Specialization is a very hot topic currently, and whether and how it would be stabilized is uncertain. I'd prefer the traditional approach utilizing hardcoded trait methods. If you are concerned about optimization, would you mind benchmarking both specialization based method and the one without? |
This comment has been minimized.
This comment has been minimized.
kdy1
commented
Dec 2, 2018
|
I'll just go with traditional one. I thought there's no way to visit |
ishitatsuyuki commentedNov 14, 2018
There are several other Rust projects (some launched recently) that deals with JavaScript sources. Let's see if we can get some ideas from their design.
https://github.com/nathan/pax by @nathan
https://github.com/swc-project/swc by @kdy1
https://github.com/FreeMasen/RESS by @FreeMasen
On this thread, let's focus on differences or ideas on:
Library authors: are you interested in joining force with Ratel? Are there anything on library design that we should change? (Pardon this friendly ping, sorry if you get annoyed by a notification. Feel free to unsubscribe in any case.)