3 ms·
No but we have the other way around - C to Zig. Why would you want to go to C?
by AndyKelley 9y ago
No but we have the other way around - C to Zig. Why would you want to go to C?
- zem 9y agobecause there are C compilers available for everything out there.
- keithnz 9y agoNearly every platform has a C compiler. Many embedded platforms have almost no language alternatives. No way Zig ( or Rust, or Go ) is ever going to target them all.
- Gaelan 9y agoLLVM aims to solve this problem. (Side note: is there an LLVM backend for C?)
- tiehuis 9y agoThere was, but it was removed in LLVM 3.1 [1]. It seems as there have been some attempts to revitalize it [2] but these are targeting older versions and would probably require a lot more work to ever get back in-tree. [1] http://releases.llvm.org/3.1/docs/ReleaseNotes.html http://releases.llvm.org/3.1/docs/ReleaseNotes.html [2] https://github.com/JuliaComputing/llvm-cbe https://github.com/JuliaComputing/llvm-cbe
- abiox 9y agoi would say for using Zig with Arduino (it's possible llvm will ship AVR support in the future) and other microcontrollers.
- iainmerrick 9y agoWhat’s the story for running Zig on Android right now? Translating to C would have been my first guess. (I see you have a call for Android devs to help make it better! But I’m wondering if there’s some awkward hacky way to use it right now)
- steveklabnik 9y agoLLVM supports compiling to android.
- jsd1982 9y agoIt opens up the language to embedded use cases like with PICs or other esoteric targets which don't fit the flat memory models assumed by modern languages including LLVM backends. When your memory model requires banking or any other form of non-linear or non-paged access, you're often in the proprietary C compiler with language extensions territory.