| ... | @@ -3,19 +3,16 @@ | ... | @@ -3,19 +3,16 @@ |
| 3 | A system programming language which prioritizes optimality, safety, and | 3 | A system programming language which prioritizes optimality, safety, and |
| 4 | readability. | 4 | readability. |
| 5 | | 5 | |
| 6 | Zig is a small language, yet powerful enough to solve any computing problem. | 6 | Zig is a small, simple language, yet powerful. Zig fits into the same niche |
| | 7 | as C, except does everything better. |
| 7 | | 8 | |
| 8 | Zig intends to replace C. Therefore, porting a C project to Zig should be a | 9 | Zig ships with a build system that obviates the need for a configure script |
| 9 | pleasant experience. For every use case C can solve, the same use case must | 10 | or a makefile. In fact, existing C and C++ projects may choose to depend on |
| 10 | be handled in Zig in an equally or more satisfying way. | 11 | Zig instead of e.g. cmake. |
| 11 | | | |
| 12 | Zig is not afraid to roll the major version number of the language if it | | |
| 13 | improves simplicity, fixes poor design decisions, or adds a new feature which | | |
| 14 | compromises backward compatibility. | | |
| 15 | | 12 | |
| 16 | [ziglang.org](http://ziglang.org) | 13 | [ziglang.org](http://ziglang.org) |
| 17 | | 14 | |
| 18 | ## Existing Features | 15 | ## Feature Highlights |
| 19 | | 16 | |
| 20 | * Compatible with C libraries with no wrapper necessary. Directly include | 17 | * Compatible with C libraries with no wrapper necessary. Directly include |
| 21 | C .h files and get access to the functions and symbols therein. | 18 | C .h files and get access to the functions and symbols therein. |
| ... | @@ -45,24 +42,19 @@ compromises backward compatibility. | ... | @@ -45,24 +42,19 @@ compromises backward compatibility. |
| 45 | * Release mode produces heavily optimized code. What other projects call | 42 | * Release mode produces heavily optimized code. What other projects call |
| 46 | "Link Time Optimization" Zig does automatically. | 43 | "Link Time Optimization" Zig does automatically. |
| 47 | * Mark functions as tests and automatically run them with `zig test`. | 44 | * Mark functions as tests and automatically run them with `zig test`. |
| 48 | * Currently supported architectures: `x86_64` | | |
| 49 | * Currently supported operating systems: linux | | |
| 50 | * Friendly toward package maintainers. Reproducible build, bootstrapping | 45 | * Friendly toward package maintainers. Reproducible build, bootstrapping |
| 51 | process carefully documented. Issues filed by package maintainers are | 46 | process carefully documented. Issues filed by package maintainers are |
| 52 | considered especially important. | 47 | considered especially important. |
| 53 | * Easy cross-compiling. | 48 | * Cross-compiling is a primary use case. |
| 54 | | 49 | * Zig Build System competes with make, cmake, autotools, SCons, etc. |
| 55 | ## Planned Features | | |
| 56 | | | |
| 57 | * In addition to creating executables, creating a C library is a primary use | 50 | * In addition to creating executables, creating a C library is a primary use |
| 58 | case. You can export an auto-generated .h file. | 51 | case. You can export an auto-generated .h file. |
| 59 | * Eliminate the need for configure, make, cmake, etc. | 52 | * Currently supported architectures: |
| 60 | * Automatically provide test coverage. | 53 | * `x86_64` |
| 61 | * Ability to declare dependencies as Git URLS with commit locking (can | 54 | * Currently supported operating systems: |
| 62 | provide a tag or sha256). | 55 | * `linux` |
| 63 | * Include documentation generator. | 56 | * `freestanding` |
| 64 | * Compiler exposes itself as a library. | 57 | * Support for all popular operating systems and architectures is planned. |
| 65 | * Support for all popular architectures and operating systems. | | |
| 66 | | 58 | |
| 67 | ## Community | 59 | ## Community |
| 68 | | 60 | |
| ... | @@ -135,25 +127,6 @@ the last step will fail, but you can execute | ... | @@ -135,25 +127,6 @@ the last step will fail, but you can execute |
| 135 | `llvm-cov gcov $(find CMakeFiles/ -name "*.gcda")` and then inspect the | 127 | `llvm-cov gcov $(find CMakeFiles/ -name "*.gcda")` and then inspect the |
| 136 | produced .gcov files. | 128 | produced .gcov files. |
| 137 | | 129 | |
| 138 | ### Troubleshooting | | |
| 139 | | | |
| 140 | If you get one of these: | | |
| 141 | | | |
| 142 | ``` | | |
| 143 | undefined reference to `_ZNK4llvm17SubtargetFeatures9getStringB5cxx11Ev' | | |
| 144 | undefined reference to `llvm::SubtargetFeatures::getString() const' | | |
| 145 | ``` | | |
| 146 | | | |
| 147 | This is because of | | |
| 148 | [C++'s Dual ABI](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html). | | |
| 149 | Most likely LLVM was compiled with one compiler while Zig was compiled with a | | |
| 150 | different one, for example GCC vs clang. | | |
| 151 | | | |
| 152 | To fix this, you have 2 options: | | |
| 153 | | | |
| 154 | * Compile Zig with the same compiler that LLVM was compiled with. | | |
| 155 | * Add `-DZIG_LLVM_OLD_CXX_ABI=yes` to the cmake configure line. | | |
| 156 | | | |
| 157 | ### Related Projects | 130 | ### Related Projects |
| 158 | | 131 | |
| 159 | * [zig-mode](https://github.com/AndreaOrru/zig-mode) - Emacs integration | 132 | * [zig-mode](https://github.com/AndreaOrru/zig-mode) - Emacs integration |