pasa / asdl-rs

Apache License 2.0
10 stars 1 forks source link

Make ASDL model more idiomantic #7

Closed matklad closed 5 years ago

matklad commented 5 years ago
pasa commented 5 years ago

I guess it will be difficult to design a model suited for quote! and template engines like tera equally good. I still hope to keep asdl available for other languages and templates will be preferable for it. I suggest to keep two models in this case. One current with some changes and one as you said. In separate crates ofcourse. By the way, the new rust-analizer codegen is really impressive. Didn't know that you can do such tricks in rust.

pasa commented 5 years ago

Made commit with suggested changes. f3f2e38167b80ffbe3fded047426288833eae79e Old model was moved to the asdl_tera crate. New model placed in main asdl crate.

matklad commented 5 years ago

I guess it will be difficult to design a model suited for quote! and template engines like tera equally good.

I think the solution here is to have a dead-simple core model, which is not specific to any code-gen solution, and is concerned with pure ASDL. Various codegen backends can then decorate the core model with something required for an engine.

pasa commented 5 years ago

I guess it will be difficult to design a model suited for quote! and template engines like tera equally good.

I think the solution here is to have a dead-simple core model, which is not specific to any code-gen solution, and is concerned with pure ASDL. Various codegen backends can then decorate the core model with something required for an engine.

Agree. Your suggested model is implemented here.