News for hackers. Stuff that matters.
Re:Zig Programming Language 0.1.1: First beta release by keithnz on Tuesday October 17, 2017 @06:49PM (#15495613)
Does Zig have a compile to C option? This would open it up to a massive embedded world.
Re:Zig Programming Language 0.1.1: First beta release by AndyKelley on Tuesday October 17, 2017 @07:14PM (#15495740)
No but we have the other way around - C to Zig. Why would you want to go to C?
Re:Zig Programming Language 0.1.1: First beta release by keithnz on Tuesday October 17, 2017 @07:39PM (#15495862)
Nearly 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.
Re:Zig Programming Language 0.1.1: First beta release by Gaelan on Tuesday October 17, 2017 @11:11PM (#15496621)
LLVM aims to solve this problem. (Side note: is there an LLVM backend for C?)
Re:Zig Programming Language 0.1.1: First beta release by tiehuis on Wednesday October 18, 2017 @12:10AM (#15496833)
There 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

[2] https://github.com/JuliaComputing/llvm-cbe

Re:Zig Programming Language 0.1.1: First beta release by jsd1982 on Tuesday October 17, 2017 @11:57PM (#15496787)
It 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.
Re:Zig Programming Language 0.1.1: First beta release by zem on Tuesday October 17, 2017 @07:20PM (#15495769)
because there are C compilers available for everything out there.
Re:Zig Programming Language 0.1.1: First beta release by iainmerrick on Tuesday October 17, 2017 @11:10PM (#15496615)
What’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)

Re:Zig Programming Language 0.1.1: First beta release by steveklabnik on Wednesday October 18, 2017 @09:22AM (#15498891)
LLVM supports compiling to android.
Re:Zig Programming Language 0.1.1: First beta release by abiox on Tuesday October 17, 2017 @09:39PM (#15496293)
i would say for using Zig with Arduino (it's possible llvm will ship AVR support in the future) and other microcontrollers.