Commit Graph

154 Commits (cf654b52d68f20a403965e70371a9ad193370d8c)

Author SHA1 Message Date
Andrew Kelley 1a90a5e63a translate-c is building again, but I have 1 `@panic` in there 2020-05-23 16:24:03 -04:00
Andrew Kelley 8c10178a1e golly jeepers it's taking a long time to update translate-c 2020-05-20 13:53:53 -04:00
Andrew Kelley 017ecc5148 self hosted repl: close executables between updates
This allows the executable to be executed
2020-05-16 15:44:20 -04:00
Andrew Kelley b0375978ba self-hosted: remove `zig libc` command for now
Since it depends on the C++ Windows SDK code. For now, self-hosted is
staying pure self hosted, no C/C++ components.
2020-05-16 13:25:39 -04:00
Andrew Kelley 294bfb3321 stage2 zir tests passing 2020-05-15 23:54:13 -04:00
Andrew Kelley f2feb4e47a move Module to its own file 2020-05-15 21:44:33 -04:00
Andrew Kelley e1d4b59c5b self-hosted: update main.zig
After this commit there are no more bit rotted files.
The testing program that was in ir.zig has been moved to main.zig
Unsupported command line options have been deleted, or error messages
added.

The compiler repl is available from the build-exe, build-lib,
build-obj commands with the --watch option.

The main zig build script now builds the self-hosted compiler
unconditionally. Linking against LLVM is behind a -Denable-llvm
flag that defaults to off.
2020-05-15 15:20:42 -04:00
xackus cd20e0cc67 rename mem.separate to mem.split 2020-04-04 17:37:51 -04:00
Andrew Kelley 9e7ae06249
std lib API deprecations for the upcoming 0.6.0 release
See #3811
2020-03-30 14:23:22 -04:00
Andrew Kelley 27affde592
(breaking) clarify openDir API
* remove deprecated `std.fs.Dir` APIs
 * `std.fs.Dir.openDir` now takes a options struct with bool fields for
   `access_sub_paths` and `iterate`. It's now much more clear how
   opening directories works.
 * fixed the std lib and various zig code calling the wrong openDir
   function.
 * the runtime safety check for dir flags is removed in favor of the
   cheaper option of putting a comment on the same line as handling
   EBADF / ACCESS_DENIED, since that will show up in stack traces.
2020-03-18 16:10:57 -04:00
Andrew Kelley dbde5df568
clean up some self-hosted bitrot + don't assume libstdc++
closes #4682

The self-hosted compiler is still bit rotted and still not compiling
successfully yet. I have a more serious rework of the code in a
different branch.
2020-03-17 23:03:45 -04:00
daurnimator 1cbf352cfb
Remove unused std.Buffer imports 2020-03-06 18:49:13 -05:00
daurnimator 0b0de22fd1
std: format contents of sentinel terminated many pointers
std: add std.meta.Sentinel to get sentinel of a type
2020-03-01 13:04:29 -05:00
Andrew Kelley 4616af0ca4
introduce operating system version ranges as part of the target
* re-introduce `std.build.Target` which is distinct from `std.Target`.
   `std.build.Target` wraps `std.Target` so that it can be annotated as
   "the native target" or an explicitly specified target.
 * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
   struct which has the tag as well as version range information.
 * `std.elf` gains some more ELF header constants.
 * `std.Target.parse` gains the ability to parse operating system
   version ranges as well as glibc version.
 * Added `std.Target.isGnuLibC()`.
 * self-hosted dynamic linker detection and glibc version detection.
   This also adds the improved logic using `/usr/bin/env` rather than
   invoking the system C compiler to find the dynamic linker when zig
   is statically linked. Related: #2084
   Note: this `/usr/bin/env` code is work-in-progress.
 * `-target-glibc` CLI option is removed in favor of the new `-target`
   syntax. Example: `-target x86_64-linux-gnu.2.27`

closes #1907
2020-02-28 14:51:53 -05:00
Andrew Kelley 3fce8008cc
skip self-hosted for now as we work towards async I/O
1. behavior tests with --test-evented-io
 2. std lib tests with --test-evented-io
 3. fuzz test evented I/O a bit, make it robust
 4. make sure it works on all platforms (kqueue, Windows IOCP,
    epoll/other)
 5. restart efforts on self-hosted
2020-02-07 12:30:16 -05:00
Andrew Kelley 0abaee79af
fix self-hosted compiler regression 2020-01-21 01:51:21 -05:00
Andrew Kelley f3dd9bbdac
improve `zig targets` 2020-01-20 13:40:25 -05:00
Andrew Kelley 8f29d14073
stage1 is building. `zig targets` now self-hosted 2020-01-20 01:42:31 -05:00
Andrew Kelley ae324985a6
clean up a TODO in self-hosted 2020-01-09 15:31:49 -05:00
David Cao 8e57dd57ca
add --eh-frame-hdr conditionally 2020-01-07 15:58:40 -05:00
Andrew Kelley 7c1dbfab72
self-hosted: manually parse args 2019-12-11 02:08:33 -05:00
Andrew Kelley f205d23e65
implement async function call with `@call`
this removes the last usage of var args in zig std lib
2019-12-09 15:27:26 -05:00
Andrew Kelley fe4963412f
update self-hosted compiler to new format API 2019-12-08 23:17:03 -05:00
Andrew Kelley 4af5c38674
fixes for self-hosted compiler 2019-12-01 19:22:03 -05:00
Andrew Kelley b36c07a95a
Merge remote-tracking branch 'origin/master' into remove-array-type-coercion 2019-12-01 09:56:01 -05:00
Andrew Kelley 413f9a5cfc
move `std.fs.Dir.cwd` to `std.fs.cwd`
update to non-deprecated std.fs APIs throughout the codebase

Related: #3811
2019-11-30 15:35:27 -05:00
Andrew Kelley 6936243ee1
fix self-hosted compiler regressions 2019-11-29 21:49:08 -05:00
Andrew Kelley bf3ac66150
remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
Vexu 4d8a8e65df
add more workarounds 2019-11-27 10:17:37 +02:00
Vexu 0d55075de4
fix command functions not being async pointers 2019-11-26 22:38:05 +02:00
Vexu 128034481a
solve recursion in self hosted 2019-11-26 18:25:29 +02:00
Vexu 36849d8a7b
fixes and cleanup in self hosted 2019-11-26 11:52:12 +02:00
Jonathan S 4014a8e4b4 Avoid deprecated cwd-based functions for opening directories, preferring to open explicitly relative to `Dir.cwd()`. 2019-11-25 23:46:48 -05:00
Vexu d40f204ec0
self hosted compiler: small miscellaneous fixes 2019-11-23 21:57:24 +02:00
Vexu 133579d7c0
fix casts 2019-11-23 19:36:26 +02:00
Vexu 03cc81665b
Merge branch 'master' into modernize-stage2 2019-11-23 19:13:48 +02:00
Andrew Kelley 0237e7a701 std.io.getStdOut and related fns no longer can error
Thanks to the Windows Process Environment Block, it is possible to
obtain handles to the standard input, output, and error streams without
possibility of failure.
2019-11-13 04:01:40 +00:00
Vexu 56ea07f4fc
self hosted compiler: comment out event.fs stuff 2019-11-07 10:30:56 +02:00
Vexu c6076a1360
self hosted compiler: use enum literals 2019-11-07 10:30:56 +02:00
Vexu 9394d14815
self hosted compiler: unify Target and std.Target 2019-11-07 10:30:47 +02:00
Vexu 6dd4a276de
self hosted compiler: update to new std.event 2019-11-07 10:30:37 +02:00
Vexu cb20093614
self hosted compiler: remove await async pattern 2019-11-07 10:30:11 +02:00
Vexu b06e5b8c68
self hosted compiler: fix internal build info 2019-11-07 10:29:58 +02:00
stratact e78d3750c5
Use 8192 sized buffers and remove allocator parameters 2019-10-19 14:04:51 -04:00
Sahnvour f08c6e4fe6 changing occurrences of HashMap with []const u8 as keys for StringHashMap 2019-09-03 23:53:05 +02:00
Andrew Kelley 13b5a4bf8c
remove `cancel` 2019-08-15 14:05:12 -04:00
Andrew Kelley 5092634103
avoid the word "coroutine", they're "async functions" 2019-08-13 14:14:19 -04:00
Andrew Kelley 54e716afdc
remove coroutines implementation and promise type 2019-07-19 18:18:44 -04:00
Andrew Kelley b735764898
different array literal syntax when inferring the size
old syntax:  []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}

closes #1797
2019-06-09 19:26:32 -04:00
Andrew Kelley 0c6ab61b22
tests passing on linux 2019-05-26 23:35:26 -04:00