rusty-cheddar
rusty-cheddar copied to clipboard
Create interfaces to popular languages (python, ruby, etc.)
Probably require moving to a ParseSess based error handling.
Store the languages requested as a vector of trait-objects.
Hopefully be able to stop special casing C (so generating a header file would just be a case of requesting the C interface).
It would be great to have the entire compiling logic as a trait, then people could implement their own languages.
Maybe something along the lines of
struct Options {
module: syntax::ast::Path,
compiler: Vec<Box<Compiler>>,
}
struct Cheddar {
input: Source,
// So that all interfaces are put in the same place.
output_dir: PathBuf
options: Options,
custom: String,
session: syntax::parse::ParseSess,
}
trait Compiler {
fn compile_type(new: Ident, old: Ty);
fn compile_fn(name: Ident, params: ..., return: ...);
...
}