davidgiven / ack

The Amsterdam Compiler Kit
http://tack.sf.net
Other
416 stars 59 forks source link

Status of EM languages #292

Open rochus-keller opened 6 months ago

rochus-keller commented 6 months ago

Does anyone know, whether the documentation in https://tack.sourceforge.net/olddocs/em.pdf of the EM language family is still precise and representative enough for the recent version of the toolkit (i.e. the most recent commit on the default branch, or the 6.0pre5 release)? If not, how about the old 5.6 release? If I would use the mentioned document to build a new front or back end creating or using the specified EM, would it still work with the rest of the tools?

davidgiven commented 6 months ago

Yup, it's still accurate. We haven't made any spec changes (that I can remember!) since then.

If you're interested in doing either, there's a robust EM reading/writing library supplied. See https://github.com/davidgiven/ack/blob/default/modules/src/em_mes/em_mes.3 for the writer and https://github.com/davidgiven/ack/blob/default/modules/src/read_em/read_em.3 for the reader. It's not as trivial as it sounds because EM files can have two different encodings depending on whether you want plain text or binary.

rochus-keller commented 6 months ago

Great, thanks.

Somewhere you wrote that the generated code is good enough for CISC, but bad for RISC. How about the peephole and global optimizer? Is the resulting EM code significantly more efficient? Are there any performance results, e.g. on a CISC machine with and witouth the EM optimizer stages?

Has anyone ever tried to reuse the TCC backend, i.e. feed EM code to the TCC code generator? That would make all TCC backends accessible in one batch (i.e. i386, AMD64, arm, arm64, Risc-V).