aboutsummaryrefslogtreecommitdiff
path: root/example/hello_world/hello.zig
AgeCommit message (Collapse)Author
2019-07-16retire the example/ folder, rename test-build-examples to "standalone"Andrew Kelley
closes #2759
2018-12-23hello world example can use `const` instead of `var`Andrew Kelley
2018-01-31*WIP* error sets converting std libAndrew Kelley
2018-01-25syntax: functions require return type. remove `->`Andrew Kelley
The purpose of this is: * Only one way to do things * Changing a function with void return type to return a possible error becomes a 1 character change, subtly encouraging people to use errors. See #632 Here are some imperfect sed commands for performing this update: remove arrow: ``` sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig") ``` add void: ``` sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig") ``` Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-07replace `%return` with `try`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2017-11-07std.io: introduce buffered I/O and change APIAndrew Kelley
I started working on #465 and made some corresponding std.io API changes. New structs: * std.io.FileInStream * std.io.FileOutStream * std.io.BufferedOutStream * std.io.BufferedInStream Removed: * std.io.File.in_stream * std.io.File.out_stream Now instead of &file.out_stream or &file.in_stream to get access to the stream API for a file, you get it like this: var file_in_stream = io.FileInStream.init(&file); const in_stream = &file_in_stream.stream; var file_out_stream = io.FileOutStream.init(&file); const out_stream = &file_out_stream.stream; This is evidence that we might not need any OOP features - See #130.
2017-10-31breaking change to std.io APIAndrew Kelley
* Merge io.InStream and io.OutStream into io.File * Introduce io.OutStream and io.InStream interfaces - io.File implements both of these * Move mem.IncrementingAllocator to heap.IncrementingAllocator Instead of: ``` %return std.io.stderr.printf("hello\n"); ``` now do: ``` std.debug.warn("hello\n"); ``` To print to stdout, see `io.getStdOut()`. * Rename std.ArrayList.resizeDown to std.ArrayList.shrink.
2017-10-01update hello world examplesAndrew Kelley
edge cases matter See #510
2017-04-04API for command line argsAndrew Kelley
closes #300
2016-03-01rewrite how importing worksAndrew Kelley
* Introduce the concept of packages. Closes #3 * Add support for error notes. * Introduce `@import` and `@c_import` builtin functions and remove the `import` and `c_import` top level declarations. * Introduce the `use` top level declaration. * Add `--check-unused` parameter to perform semantic analysis and codegen on all top level declarations, not just exported ones and ones referenced by exported ones. * Delete the root export node and add `--library` argument.
2016-01-25compiler enforces checking for errorAndrew Kelley
See #23
2016-01-25syntax: back to -> for return type, no more =>Andrew Kelley
2016-01-24update std lib to use error type and global variablesAndrew Kelley
2016-01-23main returns %voidAndrew Kelley
2016-01-20parsing error value decls and error value literalsAndrew Kelley
and return with '?' or '%' prefix
2016-01-16better main symbol prototypeAndrew Kelley
closes #64
2016-01-15rename "use" to "import"Andrew Kelley
2016-01-13all types are now expressionsAndrew Kelley
See #22
2015-12-15implicit casting from constant size array to stringAndrew Kelley
closes #36
2015-12-15std: even more efficient inline assemblyAndrew Kelley
2015-12-14instead of *mut and *const, & and &constAndrew Kelley
closes #33
2015-12-12std: print_str no longer requires length argumentAndrew Kelley
add explicit casting support from array to string
2015-12-09ability to call external variadic functionsAndrew Kelley
2015-12-06fix hello world exampleAndrew Kelley
2015-12-03add labels and gotoAndrew Kelley
2015-12-01string literals have type *const u8Josh Wolfe
2015-11-30refactor code to prepare for multiple filesAndrew Kelley
verbose compiler output is now behind --verbose flag