3 ms·
> And worse, what if the language omits crucial features that are present in C? Features that C advanced programmers rely on? Seems like this might be a good p
by nkurz 4y ago
> And worse, what if the language omits crucial features that are present in C? Features that C advanced programmers rely on?
Seems like this might be a good place to ask: which of the C replacement languages mentioned (or not mentioned) support inline assembly? Do any of them do it better than GCC/Clang? For me, I feel like the ability to drop to assembly in a pinch is a necessary feature. I'm sure I could technically get by linking an external file, but I'd be more interested in a language with inline ASM support than one that doesn't allow it. Thanks!
- cogman10 4y agoPretty much all of them at this point. Rust: https://doc.rust-lang.org/nightly/reference/inline-assembly.html https://doc.rust-lang.org/nightly/reference/inline-assembly.... D: https://dlang.org/spec/iasm.html https://dlang.org/spec/iasm.html Ada: https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/inline_assembler.html https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ug... Cobol: https://www.ibm.com/docs/en/cobol-zos/6.2?topic=appendixes-applications-cobol-assembler https://www.ibm.com/docs/en/cobol-zos/6.2?topic=appendixes-a... Pascal: https://wiki.freepascal.org/Asm https://wiki.freepascal.org/Asm Python: https://pypi.org/project/il/ https://pypi.org/project/il/ You can almost name a language and find a route to inline assembly :D
- nkurz 4y agoDo you happen to know if is also true for the C replacement languages mentioned in the article: C3, Zig, Odin, Jai and eC?
- Cyberdog 4y agoZig: https://ziglang.org/documentation/master/#Assembly https://ziglang.org/documentation/master/#Assembly
- jamesfinlayson 4y agoZig seems to as well, though I haven't looked closely enough at any of them to see if the support goes beyond x86/x64 (or even ARM).
- cogman10 4y agoC3: Currently being looked into https://github.com/c3lang/c3c#current-status https://github.com/c3lang/c3c#current-status Zig: https://ziglang.org/documentation/master/#Assembly https://ziglang.org/documentation/master/#Assembly Odin: Looks like it's a dead language, but it was on the docket. https://github.com/odin-lang/Odin/blob/master/misc/roadmap.md https://github.com/odin-lang/Odin/blob/master/misc/roadmap.m... Jai: https://github.com/Jai-Community/Jai-Community-Library/wiki/Advanced#inline-assembly https://github.com/Jai-Community/Jai-Community-Library/wiki/... eC: No clue. Not a great name for googling.