greyblake / whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
https://whatlang.org/
MIT License
969 stars 109 forks source link

Generate Languages with a Rust Build script #15

Closed Dr-Emann closed 7 years ago

Dr-Emann commented 7 years ago

The kind of code generation done by lang_generator.rb seems like it would be ripe for generation with a build.rs file. It can be set up to automatically be re-run when any of the source files change.

greyblake commented 7 years ago

I thought about replacing this somehow with macros, but I guess it's not possible to read data files with macros to build Rust AST.

Thanks, I'll take a look at build.rs when I have time.

Dr-Emann commented 7 years ago

It might also be possible to move the whatlang-ffi repo into a subfolder of this one, and generate the c headers automatically as well.