| ... | ... | @@ -12,25 +12,39 @@ Zig is not afraid to roll the major version number of the language if it |
| 12 | 12 | improves simplicity, fixes poor design decisions, or adds a new feature which |
| 13 | 13 | compromises backward compatibility. |
| 14 | 14 | |
| 15 | | ## Goals |
| 15 | ## Existing Features |
| 16 | |
| 17 | * Compile units do not depend on libc unless explicitly linked. |
| 18 | * Provides standard library which competes with the C standard library and is |
| 19 | always compiled against statically in source form. |
| 20 | * Pointer types do not allow the null value. Instead you can use a maybe type |
| 21 | which has several syntactic constructs to ensure that the null pointer is |
| 22 | not missed. |
| 23 | * Provides an error type with several syntatic constructs which makes writing |
| 24 | robust code convenient and straightforward. Writing correct code is easier |
| 25 | than writing buggy code. |
| 26 | * No header files required. Top level declarations are entirely |
| 27 | order-independent. |
| 28 | * Powerful constant expression evaluator. Generally, anything that *can* be |
| 29 | figured out at compile time *is* figured out at compile time. |
| 30 | * Tagged union enum type. No more accidentally reading the wrong union field. |
| 31 | * Easy to parse language so that humans and machines have no trouble with the |
| 32 | syntax. |
| 33 | * The binaries produced by Zig have complete debugging information so you can, |
| 34 | for example, use GDB to debug your software. |
| 35 | * Release mode produces heavily optimized code. What other projects call |
| 36 | "Link Time Optimization" Zig does automatically. |
| 37 | * Supported architectures: `x86_64` |
| 38 | * Supported operating systems: Linux |
| 39 | |
| 40 | ## Planned Features |
| 16 | 41 | |
| 17 | 42 | * Completely compatible with C libraries with no wrapper necessary. |
| 18 | 43 | * In addition to creating executables, creating a C library is a primary use |
| 19 | 44 | case. You can export an auto-generated .h file. |
| 20 | | * Do not depend on libc unless explicitly linked. |
| 21 | | * Provide standard library which competes with the C standard library and is |
| 22 | | always compiled against statically in source form. |
| 23 | 45 | * Generics so that one can write efficient data structures that work for any |
| 24 | 46 | data type. |
| 25 | | * No null pointer. Convenient syntax for dealing with a maybe type so that |
| 26 | | null pointer is not missed. |
| 27 | | * An error type, combined with some syntatical constructs which makes writing |
| 28 | | robust code convenient and straightforward. |
| 29 | 47 | * Eliminate the need for configure, make, cmake, etc. |
| 30 | | * Eliminate the need for header files (when using zig internally). |
| 31 | | * Tagged union enum type. No more accidentally reading the wrong union field. |
| 32 | | * Easy to parse language so that humans and machines have no trouble with the |
| 33 | | syntax. |
| 34 | 48 | * Eliminate the preprocessor, but (most) everything you can accomplish with |
| 35 | 49 | the preprocessor, you can accomplish directly in the language. |
| 36 | 50 | * Ability to mark functions as test and automatically run them in test mode. |
| ... | ... | @@ -42,22 +56,9 @@ compromises backward compatibility. |
| 42 | 56 | * Shebang line OK so language can be used for "scripting" as well. |
| 43 | 57 | * Debug mode optimizes for fast compilation time and crashing when undefined |
| 44 | 58 | behavior *would* happen. |
| 45 | | * Release mode produces heavily optimized code. What other projects call |
| 46 | | "Link Time Optimization" Zig does automatically. |
| 47 | | |
| 48 | | ### Current Status |
| 49 | | |
| 50 | | * Have a look in the example/ folder to see some code examples. |
| 51 | | * Most language features are available, but many edge cases and errors are |
| 52 | | not yet implemented. |
| 53 | | * Linux x86_64 is supported. |
| 54 | | * Building for the native target is supported. |
| 55 | | * Optimized machine code that Zig produces is indistinguishable from |
| 56 | | optimized machine code produced from equivalent C program. |
| 57 | | * Zig can generate dynamic libraries, executables, object files, and C |
| 58 | | header files. |
| 59 | | * The binaries produced by Zig have complete debugging information so you can, |
| 60 | | for example, use GDB to debug your software. |
| 59 | * Compiler exposes itself as a library. |
| 60 | * Support for all popular architectures and operating systems. |
| 61 | * Easy cross-compiling. |
| 61 | 62 | |
| 62 | 63 | ## Building |
| 63 | 64 | |