General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. https://ziglang.org
Find a file
Andrew Kelley 376d443ae3 add Aro as a C frontend
Problems to solve in this branch before merging:

 * Liveness and AIR printing want a ZIR instance. This issue is
   addressed by #10784.
 * linker: updateFunc / updateDecl want a Module instance which
   currently represents only Zig code. These functions should be changed
   to accept a Compilation, not a Module. The relevant state that it
   needed to touch on Module should be moved to Compilation instead.
 * `Decl` needs to be shared by both the C frontend and the Zig
   frontend. It currently has Zig-only fields and the functions to
   create Decl objects don't really fit the API that the C frontend
   needs.
 * A lot of the incremental compilation infrastructure doesn't quite
   match up, for example Decl objects being owned by Namespaces which is
   a Zig concept. Maybe there could be 1 Namespace globally across all C
   files and 1 more Namespace per C file for functions and globals
   declared `static`.
 * There is common code to be extracted from Sema that is shared with
   Aro frontend. All the helper functions having to do with the
   air_instructions and air_extra arrays.

There are many instances of calling `@panic("TODO")` that need to be
cleaned up.

There is a lot of compiler options that Zig is not communicating to Aro,
for example we do not pass the -D switches that we pass to Clang yet.
Need to audit `addCCArgs` and do the equivalent things for setting up
the Aro Compilation.

The Aro code is copied from https://github.com/Vexu/arocc, commit
7a0e54227e1ea2b2df8aa7bd2b7075f735109317. The only patches are to delete
Codegen and replace it with our own, and to delete main.zig, and add
Type and Value to lib.zig.

I believe the current plan is for main Aro development to happen
upstream on the arocc repository and periodically sync it downstream
with the Zig repository. It's up to @Vexu whether to keep that process
or change it in the future.
2022-02-04 19:42:03 -07:00
.builds ci: update tarballs for LLVM 13 2021-10-01 16:07:42 -07:00
.github github issues: add a honeypot template for questions 2021-11-30 14:42:58 -07:00
ci ci: azure: update to newer msys2 release 2022-01-29 11:28:57 -07:00
cmake stage1: Fix missing LLD library 2022-02-04 01:45:44 -05:00
deps Revert "Include dbg.h to third-party libs" 2020-10-03 21:29:29 -04:00
doc Various documentation fixes 2022-02-04 21:27:50 +02:00
lib stage2: remove anytype fields from the language 2022-02-01 19:06:40 -07:00
src add Aro as a C frontend 2022-02-04 19:42:03 -07:00
test Sema: fixes to fieldVal, resolveStructFully, Type.eql 2022-02-03 23:59:32 -07:00
tools spirv: improve generator 2022-01-28 14:38:57 +01:00
.gitattributes mark tsan as linguist-vendored 2021-06-25 12:46:23 +03:00
.gitignore std/build: change default install prefix to zig-out 2021-04-29 23:58:45 +02:00
build.zig stage2: make --debug-log work by default for debug builds 2022-01-31 21:11:41 -07:00
CMakeLists.txt stage1: add f80 type 2022-01-28 11:45:04 -07:00
CODE_OF_CONDUCT.md CODE_OF_CONDUCT: change Freenode to Libera.chat 2021-07-03 20:28:17 -04:00
CONTRIBUTING.md Update CONTRIBUTING.md 2022-01-19 14:29:55 -05:00
LICENSE Y++ 2021-12-31 19:58:21 -05:00
README.md readme: dynamic logo light/dark 2022-01-03 17:45:09 -07:00

ZIG

A general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Resources

Installation

License

The ultimate goal of the Zig project is to serve users. As a first-order effect, this means users of the compiler, helping programmers to write better software. Even more important, however, are the end-users.

Zig is intended to be used to help end-users accomplish their goals. Zig should be used to empower end-users, never to exploit them financially, or to limit their freedom to interact with hardware or software in any way.

However, such problems are best solved with social norms, not with software licenses. Any attempt to complicate the software license of Zig would risk compromising the value Zig provides.

Therefore, Zig is available under the MIT (Expat) License, and comes with a humble request: use it to make software better serve the needs of end-users.

This project redistributes code from other projects, some of which have other licenses besides MIT. Such licenses are generally similar to the MIT license for practical purposes. See the subdirectories and files inside lib/ for more details.