Commit Graph

2486 Commits

Author SHA1 Message Date
Andrew Kelley
ccadcbc715 fix examples and rename std.rand.Rand to std.rand.Random 2018-03-29 12:33:29 -04:00
Marc Tiehuis
0fd0f6fd1f Rewrite Rand functions
We now use a generic Rand structure which abstracts the core functions
from the backing engine.

The old Mersenne Twister engine is removed and replaced instead with
three alternatives:

 - Pcg32
 - Xoroshiro128+
 - Isaac64

These should provide sufficient coverage for most purposes, including a
CSPRNG using Isaac64. Consumers of the library that do not care about
the actual engine implementation should use DefaultPrng and DefaultCsprng.
2018-03-30 01:50:58 +13:00
Andrew Kelley
032fccf615 fix compile time array concatenation for slices
closes #866
2018-03-28 23:25:12 -04:00
Andrew Kelley
5627347bab
Merge pull request #865 from bnoordhuis/zig-build-stage2
skeleton stage 2 support for 'zig build'
2018-03-28 21:02:09 -04:00
Jimmi Holst Christensen
72ce146293 Fixed looking for windows sdk when targeting linux 2018-03-29 00:53:06 +02:00
Ben Noordhuis
b60b01ce97 skeleton stage 2 support for 'zig build'
Initial port of the 'zig build' logic from the stage 1 compiler to the
stage 2 compiler sans code generation and BUILD_INFO support.
2018-03-28 18:30:41 +02:00
Ben Noordhuis
db70b909a0 non-zero exit when build.zig cannot be created
Make the stage 1 compiler exit with a non-zero status code
when `zig build --init` cannot create a new build.zig file.
2018-03-28 18:30:41 +02:00
Andrew Kelley
5b00dee0c2 std.math.cast handles signed integers 2018-03-27 15:20:07 -04:00
Andrew Kelley
6cb99fdac3 fix crash when compile error in analyzing @panic call 2018-03-27 15:07:45 -04:00
Andrew Kelley
0b7b3190fd fix bitrotted code in unexpected error tracing 2018-03-27 10:44:13 -04:00
Andrew Kelley
c0a69a5075
Merge pull request #860 from jayschwa/patch-1
doc: fix typo and tighten wording in error sections
2018-03-25 23:31:12 -04:00
Jay Weisskopf
3e836f5516
doc: fix typo and tighten wording in error sections
Changes:
- Removed superfluous "when possible"
- Fixed typo in "documentationt"
- Added missing comma
- Moved definition of error union type up to first sentence
2018-03-25 18:48:07 -04:00
Andrew Kelley
aa2995ee39 fix invalid codegen for error return traces across suspend points
See #821

Now the code works correctly, but error return traces are missing
the frames from coroutines.
2018-03-24 22:07:12 -04:00
Andrew Kelley
a43c7af3d1 add comptime test for the type of suspend promise 2018-03-24 19:31:00 -04:00
Andrew Kelley
897e783763 add promise->T syntax parsing
closes #857
2018-03-24 19:25:53 -04:00
Andrew Kelley
18af2f9a27 fix async fns with inferred error sets
closes #856
2018-03-24 18:28:32 -04:00
Andrew Kelley
b1c07c0ea9 move error ret tracing codegen to zig ir
progress towards #821
2018-03-24 18:28:32 -04:00
Andrew Kelley
2cff31937f std.os.linux exposes syscall functions and syscall numbers 2018-03-24 15:57:36 -04:00
Marc Tiehuis
7350181a4a Fix os.File.mode function 2018-03-23 22:41:08 +13:00
Marc Tiehuis
3d1732ef6c Fix OpqaueType usage in exported c functions
We prefer `struct typename`. If a typedef is required, this must be done
manually after generation.
2018-03-23 20:27:11 +13:00
Andrew Kelley
7a99d63c76 ability to use async function pointers
closes #817
2018-03-22 16:56:03 -04:00
Marc Tiehuis
53588f4f12 Add missing pub specifier to atan2 2018-03-22 19:18:51 +13:00
Andrew Kelley
f885a1ab61 change async function call syntax
* instead of `async(allocator) call()`, now it is
   `async<allocator> call()`.
 * Fixes syntax ambiguity when leaving off the allocator
 * Fixes parse failure when call is a field access

This sets a precedent for using `<` to pass arguments
to a keyword. This will affect `enum`, `union`, and
`fn` (see #661)
2018-03-21 19:56:41 -04:00
Andrew Kelley
66fec3a3d7
Merge pull request #851 from zig-lang/zen_stdlib
Zen specific hacks
2018-03-20 16:16:08 -04:00
Andrea Orru
43cdfa275a Zen specific hacks 2018-03-20 16:09:30 -04:00
Andrew Kelley
1369fecccf
Merge pull request #847 from walac/master
Include libxml2 and zlib as required libraries
2018-03-20 16:05:15 -04:00
Wander Lairson Costa
543952eb87 Include libxml2 and zlib as required libraries
libxml2 is a required library, but we only find out that when the build
fails to link against it, if it is not present. The same for zlib.

We use find_library to find these two libraries and print nice fail
messages if they are not found.
2018-03-20 18:15:02 +00:00
Andrew Kelley
cb744f3a28 self-hosted build: print helpful message when libstdc++.a not found
closes #843
2018-03-20 13:48:25 -04:00
Andrew Kelley
71b4ee931e
Merge pull request #849 from zig-lang/zen_stdlib
Updates to the Zen standard library
2018-03-20 11:47:19 -04:00
Andrea Orru
0082ed0ef1 Public SplitIterator 2018-03-20 11:40:33 -04:00
Andrew Kelley
e966d375fb
Merge pull request #844 from ice1000/patch-1
Remove unnecessary rule and re-fix an old bug
2018-03-19 15:12:44 -04:00
Tesla Ice Zhang
c4544df011
Remove unnecessary rule and re-fix an old bug
The "old bug" is cause my last pr. I'm fixing it now.
2018-03-20 03:00:11 +08:00
Andrea Orru
935f10502f Message type, Undefined mailbox, read syscall, more constructors 2018-03-18 14:45:23 -04:00
Andrew Kelley
d959faa4c7 add test for addIncludeDir for test step 2018-03-17 18:19:23 -04:00
Marc Tiehuis
bea9e9c7f8 Add addIncludeDir to TestStep + fix build template
Closes #794.
2018-03-17 18:15:35 -04:00
Andrew Kelley
bbad0fa411
Merge pull request #839 from ice1000/patch-1
Fix typos in grammar section of langref
2018-03-17 14:44:17 -04:00
Andrew Kelley
453439a964
Merge pull request #840 from bnoordhuis/libdirs
add CLANG_LIBDIRS cmake build variable
2018-03-17 14:43:26 -04:00
Ben Noordhuis
c2c34c09b9 add LLVM_LIBDIRS to link directories
This seems to be the only way to get the zig build to link against llvm
libraries in a non-standard location.
2018-03-17 18:41:54 +01:00
Ben Noordhuis
4a921b2eba add CLANG_LIBDIRS cmake build variable
Mirrors LLVM_LIBDIRS, tells cmake where to look for libclang libraries.
2018-03-17 18:41:47 +01:00
Tesla Ice Zhang
cc6ac77913
Fix some explicit errors 2018-03-17 23:17:07 +08:00
Andrea Orru
df3d2115b5 Service -> Server 2018-03-16 20:27:13 -07:00
Andrea Orru
81941f9161 Add Thread option for Mailboxes 2018-03-16 01:41:45 -07:00
Andrea Orru
ce88034716 Merge branch 'master' into zen_stdlib 2018-03-15 21:17:40 -07:00
Andrea Orru
4c16deed3e Some POSIX stuff, including a primitive write 2018-03-15 17:57:56 -07:00
Andrew Kelley
f073923ea0 Release 0.2.0 2018-03-15 09:15:05 -04:00
Andrea Orru
681c62941e subscribeIRQ support 2018-03-15 04:28:45 -07:00
Andrea Orru
9b7e4b535c More precise naming 2018-03-15 02:22:03 -07:00
Andrea Orru
52ef1aadcb Merge branch 'master' into zen_stdlib 2018-03-14 22:15:33 -07:00
Andrea Orru
4fcf01adc5 IPC structure updates 2018-03-14 22:07:17 -07:00
Andrew Kelley
50e25f6cec add missing docs for setAlignStack builtin 2018-03-14 21:51:06 -04:00