jameysharp / corrode

C to Rust translator
GNU General Public License v2.0
2.15k stars 113 forks source link

Keep Language.Rust as a separate Haskell library? #21

Open JoeyEremondi opened 8 years ago

JoeyEremondi commented 8 years ago

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?

jameysharp commented 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.

JayKickliter commented 8 years ago

I'm doing Rust codegen in Haskell, but rather naively. A standalone library would be so useful to me.

harpocrates commented 7 years ago

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.

JoeyEremondi commented 7 years ago

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.

pittma commented 6 years ago

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?

harpocrates commented 6 years ago

@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.

pittma commented 6 years ago

@harpocrates Nice! Thanks, I'll take a look.

JayKickliter commented 6 years ago

This is perfect timing for me. Thanks!

harpocrates commented 6 years ago

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:

The benefits would be mostly around breaking lines in the right places and having a principled pretty-printing approach.