When Zero Cost Abstractions Aren’t Zero Cost

Multiple targets is great, i guess. Rust can be a systems level language because of the asm!() block. If one of the targets is LLVM, gimme ASM level access to it like the x86 or ARM, etc. asm!() blocks. Rust's tokenized input generates an abstract syntax tree - might as well allow direct modification of that (maybe an ast!() block?) that way my crypto code can opt out of optimizations and just work on multiple targets without having to include assembly code for each target platform - whatever the process, whether rust's AST is fed to LLVM or translated for gcc, or WebAssembly, It shouldn't require me pulling teeth from the developers at knifepoint to get a cross platform assembly syntax. I think no one will build one, because then no one would write code in anything else...

While we're making wishes, I'd like to be able to write macros in rust that can run arbitrary compile time code and can access run time type information and program structure (the AST). Then I'd finally have a compiled language that is its own macro language. Then I'd like to have the same language be its own scripting language, provide a rust AST interpretor that runs at runtime and can directly access the other programs written in rust. Then I wouldn't be making a programming language to do basic shit like this. It's [current year], FFS, I can't believe ASM has no abstract standard to compile down to.

/r/ProgrammingLanguages Thread Parent Link - blog.polybdenum.com