aboutsummaryrefslogtreecommitdiff
path: root/doc
AgeCommit message (Collapse)Author
2019-03-09docgen: --cache off for testsAndrew Kelley
2019-03-09fix docgen and fix unnecessarily adding .root suffix to objectsAndrew Kelley
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.
2019-03-02@returnAddress and @frameAddress return usize nowAndrew Kelley
2019-03-02all integers returned by @typeInfo are now comptime_intSahnvour
2019-03-01fix docs typoAndrew Kelley
2019-02-28remove namespace type; files are empty structsAndrew Kelley
closes #1047
2019-02-26improve docs for unions and switching on tagged unionsAndrew Kelley
closes #1943
2019-02-26breaking changes to the way targets work in zigAndrew Kelley
* CLI: `-target [name]` instead of `--target-*` args. This matches clang's API. * `builtin.Environ` renamed to `builtin.Abi` - likewise `builtin.environ` renamed to `builtin.abi` * stop hiding the concept of sub-arch. closes #1526 * `zig targets` only shows available targets. closes #438 * include all targets in readme, even those that don't print with `zig targets` but note they are Tier 4 * refactor target.cpp and make the naming conventions more consistent * introduce the concept of a "default C ABI" for a given OS/Arch combo. As a rule of thumb, if the system compiler is clang or gcc then the default C ABI is the gnu ABI.
2019-02-25add docs for zero bit types and pointers to zero bit typesAndrew Kelley
closes #1561
2019-02-22docs for packed structsAndrew Kelley
closes #1513
2019-02-22fix `@bitCast` when src/dest types have mismatched handle_is_ptrAndrew Kelley
* separate BitCast and BitCastGen instructions * closes #991 * closes #1934 * unrelated: fix typo in docs (thanks gamester for pointing it out)
2019-02-18Some function doc tweaks (#1961)John Schmidt
* Add docs for the inline function attribute * Remove outdated comment Seems like a leftover from when implicit returns were around. * Consistent terminology
2019-02-18docs: shadowingAndrew Kelley
closes #1245
2019-02-18docs: note top level declarations are order-independentAndrew Kelley
closes #1244
2019-02-18pull request fixupsAndrew Kelley
2019-02-18make @enumToInt work on union(enum)emekoi
closes #1711
2019-02-15breaking: fix @sizeOf to be alloc size rather than store sizeAndrew Kelley
* Fixes breaches of the guarantee that `@sizeOf(T) >= @alignOf(T)` * Fixes std.mem.secureZero for integers where this guarantee previously was breached * Fixes std.mem.Allocator for integers where this guarantee previously was breached Closes #1851 Closes #1864
2019-02-14add docs for C pointersAndrew Kelley
2019-02-14fix implicit cast error unions with non-optional to optional pointerAndrew Kelley
and update self hosted compiler for C pointers See #1059
2019-02-10langref: update grammar with c pointersAndrew Kelley
See #1059
2019-02-09`@truncate`: comptime 0 when target type is 0 bitsAndrew Kelley
also if the dest type is a comptime_int, then treat it as an implicit cast. also compile error for attempting to truncate undefined closes #1568
2019-02-09docs: add threadlocal keyword to grammarAndrew Kelley
2019-02-09docgen: update for threadlocal keywordAndrew Kelley
2019-02-08fix docsAndrew Kelley
broken by c2db077574be8
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304
2019-02-07fixups, and modify std.mem.join and std.os.path.resolve APIAndrew Kelley
* zig fmt * std.mem.join takes a slice of slices instead of var args * std.mem.join takes a separator slice rather than byte, and always inserts it. Previously it would not insert the separator if there already was one, violating the documented behavior. * std.mem.join calculates exactly the correct amount to allocate and has no call to allocator.shrink() * bring back joinWindows and joinPosix and the corresponding tests. it is intended to be able to call these functions from any OS. * rename std.os.path.resolveSlice to resolve (now resolve takes a slice of slices instead of var args)
2019-02-06Merge branch 'zig-backport-std.os.path' of https://github.com/kristate/zig ↵Andrew Kelley
into kristate-zig-backport-std.os.path
2019-02-06doc/targets.md has moved to the github wikiAndrew Kelley
https://github.com/ziglang/zig/wiki/How-to-Add-Support-For-More-Targets
2019-02-05docs: clarify passing aggregate types as parametersAndrew Kelley
2019-02-01introduce --single-threaded build optionAndrew Kelley
closes #1764 This adds another boolean to the test matrix; hopefully it does not inflate the time too much. std.event.Loop does not work with this option yet. See #1908
2019-01-30introduce vector type for SIMDAndrew Kelley
See #903 * create with `@Vector(len, ElemType)` * only wrapping addition is implemented This feature is far from complete; this is only the beginning.
2019-01-29backport copy elision changesAndrew Kelley
This commit contains everything from the copy-elision-2 branch that does not have to do with copy elision directly, but is generally useful for master branch. * All const values know their parents, when applicable, not just structs and unions. * Null pointers in const values are represented explicitly, rather than as a HardCodedAddr value of 0. * Rename "maybe" to "optional" in various code locations. * Separate DeclVarSrc and DeclVarGen * Separate PtrCastSrc and PtrCastGen * Separate CmpxchgSrc and CmpxchgGen * Represent optional error set as an integer, using the 0 value. In a const value, it uses nullptr. * Introduce type_has_one_possible_value and use it where applicable. * Fix debug builds not setting memory to 0xaa when storing undefined. * Separate the type of a variable from the const value of a variable. * Use copy_const_val where appropriate. * Rearrange structs to pack data more efficiently. * Move test/cases/* to test/behavior/* * Use `std.debug.assertOrPanic` in behavior tests instead of `std.debug.assert`. * Fix outdated slice syntax in docs.
2019-01-29simpler implementation of `&&` and `||` hintsAndrew Kelley
This accomplishes the same goal, but with less changes, so that I can backport copy elision stuff easier.
2019-01-25Hint at use of and/or when &&/|| is improperly used (#1886)kristopher tate
2019-01-02@bitreverse intrinsic, part of #767 (#1865)vegecode
* bitreverse - give bswap behavior * bitreverse, comptime_ints, negative values still not working? * bitreverse working for negative comptime ints * Finished bitreverse test cases * Undo exporting a bigint function. @bitreverse test name includes ampersand * added docs entry for @bitreverse
2018-12-23hello world example can use `const` instead of `var`Andrew Kelley
2018-12-14docs: fix alphabetical sorting of builtin functionsAndrew Kelley
2018-12-13fix mistakes introduced in b883bc8Andrew Kelley
2018-12-12breaking API changes to all readInt/writeInt functions & moreAndrew Kelley
* add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-11font-family fallbacks for unsupported system-uiJay Weisskopf
2018-12-11docs: Prefer system-ui font-familyJay Weisskopf
system-ui is a new generic font-family for matching the font used in the operating system's native user interface. E.g. Roboto on Android, San Francisco on macOS, Segoe UI on Windows, etc. https://caniuse.com/#search=system-ui
2018-12-11Document explicitly ignoring expression valuesHenry Nelson
2018-11-30std.os.path: remove dependance on std.mem.join;kristopher tate
std/os/child_process.zig: windows test/cli.zig: godbolt; doc/docgen.zig
2018-11-19docs: fix some incorrect error documentationAndrew Kelley
2018-11-18all numbers with comptime known values implicitly castAndrew Kelley
to all number types. If the value does not fit, a compile error is emitted. closes #422 closes #1712
2018-11-17Updated docs to newest grammarJimmi HC
2018-11-17rename `section` keyword to `linksection`Andrew Kelley
add zig fmt support for this syntax closes #1152
2018-11-16Fixed typosVallentin
2018-11-14Manual update to new grammar.Jimmi Holst Christensen
TODO: Figure out how we can auto update this, when the grammar changes in the zig-spec repo