aboutsummaryrefslogtreecommitdiff
path: root/doc/langref.md
AgeCommit message (Collapse)Author
2017-08-20move docs to websiteAndrew Kelley
2017-07-08better bigint/bigfloat implementationAndrew Kelley
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-09inline function call with builtin function instead...Andrew Kelley
...of special syntax. partially reverts 41144a8566a6fbd779403f6b69424bb640c94a7f closes #306
2017-05-08move docs to ziglang.orgAndrew Kelley
2017-05-07rename c_long_double to c_longdoubleAndrew Kelley
to be consistent with other c primitive type names
2017-05-06builtin functions for division and remainder divisionAndrew Kelley
* add `@divTrunc` and `@divFloor` functions * add `@rem` and `@mod` functions * add compile error for `/` and `%` with signed integers * add `.bit_count` for float primitive types closes #217
2017-05-04implement else on loops and break can give an expressionAndrew Kelley
closes #357
2017-05-03change while syntaxAndrew Kelley
Old: ``` while (condition; expression) {} ``` New: ``` while (condition) : (expression) {} ``` This is in preparation to allow nullable and error union types as the condition. See #357
2017-05-03remove test and try expressions in favor of if expressionsAndrew Kelley
See #357
2017-05-01`@import("builtin")` instead of `@compileVar`Andrew Kelley
See #226 Closes #220
2017-04-22slicing now returns correct const-nessAndrew Kelley
also remove the ability to override constness when slicing closes #334
2017-04-21update syntax for try and nullable unwrappingAndrew Kelley
closes #285
2017-04-21remove `?return` and `?defer`Andrew Kelley
closes #309
2017-04-21rename `@ptrcast` to `@ptrCast` to follow conventionAndrew Kelley
2017-04-20Add @offsetOf builtin functionRaul Leal
2017-04-18add `@fieldParentPtr` builtin functionAndrew Kelley
closes #320
2017-04-18rename `@intType` to `@IntType` to follow conventionAndrew Kelley
closes #327
2017-04-13typedefpocalypseAndrew Kelley
closes #314
2017-04-13ability to inline at function callsiteAndrew Kelley
closes #306
2017-04-08add enumTagName builtin functionAndrew Kelley
closes #299
2017-04-07ability to implicitly cast integer literal to &const IntAndrew Kelley
where Int is an integer type also introduce `@intToPtr` builtin for converting a usize to a pointer. users now have to use this instead of `(&T)(int)`. closes #311
2017-04-03delete alloca builtin functionAndrew Kelley
See #225 introduce os.EnvMap
2017-04-02fix else-if parsingJosh Wolfe
implicit semicolon rules apply recursively to the "else" clause of if and try if (a) {} else {} // implicit semicolon if (a) {} else if (a) {} // implicit semicolon if (a) {} else while (a) {} // implicit semicolon
2017-04-02fix confusion in block expression parsingJosh Wolfe
closes #292 * if, try, while, for, comptime, defer are "greedy" with {} blocks, meaning if their bodies are blocks, then no suffix operator is allowed after the block. The {} block gets "built into" the containing statement, like the body of a switch statement. * the Expression syntactic element is no longer "greedy" with {} blocks, meaning it's possible to have suffix operators after {} blocks without needing the {} block to be an rhs operand first.
2017-04-02show implicit semicolon rules in langref grammarJosh Wolfe
2017-03-31change `@bitcast` to `@ptrcast`Andrew Kelley
See #290
2017-03-31first pass at zig build systemAndrew Kelley
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`, `zig build_lib` and `zig build_exe` respectively. * `--name` parameter is optional when it can be inferred from the root source filename. closes #207 * `zig build` now looks for `build.zig` which interacts with `std.build.Builder` to describe the targets, and then the zig build system prints TODO: build these targets. See #204 * add `@bitcast` which is mainly used for pointer reinterpret casting and make explicit casting not do pointer reinterpretation. Closes #290 * fix debug info for byval parameters * sort command line help options * `std.debug.panic` supports format string printing * add `std.mem.IncrementingAllocator` * fix const ptr to a variable with data changing at runtime. closes #289
2017-03-26add stack protector safety when linking libcAndrew Kelley
* introduce zigrt file. it contains only weak symbols so that multiple instances can be merged. it contains __zig_panic so that multiple .o files can call the same panic function. * remove `@setFnVisible` builtin and add @setGlobalLinkage builtin which is more powerful * add `@panic` builtin function. * fix collision of symbols with extern prototypes and internal function names * add stack protector safety when linking against libc. To add the safety mechanism without libc requires implementing Thread Local Storage. See #276
2017-03-26add debug safety checks for remainder divisionAndrew Kelley
See #217
2017-03-26update langrefAndrew Kelley
&&= and ||= are gone
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-26new unreachable syntaxAndrew Kelley
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
2017-03-26add comptime top level declarationAndrew Kelley
closes #255
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-12slice and array re-work plus some misc. changesAndrew Kelley
* `@truncate` builtin allows casting to the same size integer. It also performs two's complement casting between signed and unsigned integers. * The idiomatic way to convert between bytes and numbers is now `mem.readInt` and `mem.writeInt` instead of an unsafe cast. It works at compile time, is safer, and looks cleaner. * Implicitly casting an array to a slice is allowed only if the slice is const. * Constant pointer values know if their memory is from a compile- time constant value or a compile-time variable. * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T still allowed. * Fix inability to pass a mutable pointer to comptime variable at compile-time to a function and have the function modify the memory pointed to by the pointer. * Add the `comptime T: type` parameter back to mem.eql. Prevents accidentally creating instantiations for arrays.
2017-02-09lots of miscellaneous things all in one big commitAndrew Kelley
* add `@compileLog(...)` builtin function - Helps debug code running at compile time - See #240 * fix crash when there is an error on the start value of a slice * add implicit cast from int and float types to int and float literals if the value is known at compile time * make array concatenation work with slices in addition to arrays and c string literals * fix compile error message for something not having field access * fix crash when `@setDebugSafety()` was called from a function being evaluated at compile-time * fix compile-time evaluation of overflow math builtins. * avoid debug safety panic handler in builtin.o and compiler_rt.o since we use no debug safety in these modules anyway * add compiler_rt functions for division on ARM - Closes #254 * move default panic handler to std.debug so users can call it manually * std.io.printf supports a width in the format specifier
2017-02-05try expression can omit variable assignmentsAndrew Kelley
2017-02-04remove volatileStore builtin; add volatile pointersAndrew Kelley
closes #238
2017-02-03add setGlobalAlign and setGlobalSection builtin functionsAndrew Kelley
closes #241
2017-02-03implement packed structsAndrew Kelley
closes #183
2017-02-02add try expressionAndrew Kelley
See #83
2017-02-02remove ability to mark if and switch as inlineAndrew Kelley
if and switch are implicitly inline if the condition/target expression is known at compile time. instead of: ``` inline if (condition) ... inline switch (target) ... ``` one can use: ``` if (comptime condition) ... switch (comptime target) ... ```
2017-02-01document setDebugSafety builtin functionAndrew Kelley
2017-01-24printf var args proof of conceptAndrew Kelley
See #167 Need to troubleshoot when we send 2 slices to printf. It goes into an infinite loop. This commit introduces 4 builtin functions: * `@isInteger` * `@isFloat` * `@canImplictCast` * `@typeName`
2017-01-23various fixesAndrew Kelley
* comptime expression is a block expression as it should be * fix var args when number of args passed is 0 * implement const value equality for structs * fix indent when rendering container decl AST * IR: prevent duplicate generation of code when it is partially compile-time evaluated * implement compile time struct field pointer evaluation * fix compile time evaluation of slicing
2017-01-23basic support for functions with variable length argumentsAndrew Kelley
See #77
2017-01-22remove staticEval builtin in favor of comptime expressionAndrew Kelley
2017-01-22introduce comptime expressionAndrew Kelley
closes #221