Open JoeyEremondi opened 8 years ago
Absolutely! I intended to split Language.Rust.AST
out to its own package eventually. It's just that so far I've only been implementing the parts I immediately needed, so I don't think it's ready for separate release.
If you want, you could use my AST as a basis/example to build a new language-rust
package yourself! You have my permission to relicense that module under any of BSD2, BSD3, or MIT; I don't care which. I would suggest modeling it after Rust's libsyntax AST to capture the full generality of Rust syntax rather than the limited version I'm using; that's what I intended to do eventually. And I'd suggest versioning it identically to the rustc release that it follows.
Also, I would be happy to re-write Corrode in terms of an external language-rust
if one existed, or to take a pull request doing so.
I'm doing Rust codegen in Haskell, but rather naively. A standalone library would be so useful to me.
FWIW, I'm currently working on a language-rust
library. The pretty-printing is mostly complete now, but the parsing is still a WIP. I am still a couple months away from really having something I think corrode should trust.
Nice! I didn't end up doing the project where I'd need the Rust/Haskell stuff, but I'm sure it will be useful in the future.
This is something I think we'd be interested in too, and I'd be thrilled to take on some of the work. Is it still a thing that's under consideration?
@pittma I've been delaying release forever, but I've made https://github.com/harpocrates/language-rust. It is done, I just need to clean up comments and release to Hackage.
@harpocrates Nice! Thanks, I'll take a look.
This is perfect timing for me. Thanks!
FYI, language-rust
is now complete and on Hackage. If there is any interest, I don't mind writing up a PR to use that instead of the Language.Rust.AST
module.
I haven't done so yet mainly because:
prettyprinter
language-rust
has the FULL Rust AST and it is pretty big)The benefits would be mostly around breaking lines in the right places and having a principled pretty-printing approach.
The Language.Rust module would be very useful for other people who are generating Rust from Haskell. In particular, I've been looking at writing a Rust backend to Elm for quite a while, and this would be very useful, since Elm is written in Haskell.
Would you consider releasing it separately on Hackage? Possibly with a more permissive license, that would allow it to be used in MIT or or BSD licensed projects?