chore: migrate Travis CI to container-based builds and update README links

- Switch Travis CI from sudo-based apt-get to addons.apt.packages for gcc-multilib
- Enable container-based builds with `sudo: false`
- Update README.md call-to-action links to point to getting-started and browser playground
- Replace `printList_` with `printAll` in IO class and remove redundant `IO.` prefixes
- Add IO.read() method documentation and update IO.print docs for up to 16 arguments
- Reorganize community page with Libraries, Language bindings, and Tools sections
- Add wrenjs JavaScript binding and Sublime Text syntax highlighting
- Fix typo "no where" to "nowhere" in fibers documentation
- Add indentation to preprocessor defines in wren_common.h for consistency
- Remove unreachable `return 0` after UNREACHABLE() in wren_compiler.c
- Fix Windows color output by wrapping text in str() in test script
This commit is contained in:
Bob Nystrom
2015-07-19 19:49:23 +00:00
18 changed files with 254 additions and 191 deletions
+19 -8
View File
@@ -10,18 +10,21 @@ There's one Wren user group, and it's the [official Wren mailing
list](https://groups.google.com/forum/#!forum/wren-lang). Please join it and
say hello! There are no strangers to Wren, just friends we haven't met yet.
## Third-party libraries
## Libraries
There are some third-party libraries that are written in Wren. Here's the list:
- [wren-test](https://github.com/gsmaverick/wren-test), a testing framework
- [Please](https://github.com/EvanHahn/wren-please), an assertion library
- [wren-colors](https://github.com/gsmaverick/wren-colors) for printing colored
messages to the terminal
- [3D vectors for Wren](https://github.com/EvanHahn/wren-vector3d)
- [Please](https://github.com/EvanHahn/wren-please): An assertion library.
- [wren-colors](https://github.com/gsmaverick/wren-colors): Print colored
messages to the terminal.
- [wren-test](https://github.com/gsmaverick/wren-test): A testing framework.
- [wren-vector3d](https://github.com/EvanHahn/wren-vector3d): 3D vectors.
A few people have also added Wren bindings for other languages:
## Language bindings
Want to host a Wren VM within another language. Try these:
- [JavaScript: ppvk/wrenjs](https://github.com/ppvk/wrenjs)
- [Rust: tilpner/wren-sys](https://github.com/tilpner/wren-sys)
- [Rust: pwoolcoc/wren-sys](https://github.com/pwoolcoc/wren-sys)
- [Rust: pwoolcoc/wren-rs](https://github.com/pwoolcoc/wren-rs)
@@ -30,8 +33,16 @@ A few people have also added Wren bindings for other languages:
If you want Wren syntax highlighting in your editor, look no further:
- [Vim](https://github.com/lluchs/vim-wren)
- [Emacs](https://github.com/v2e4lisp/wren-mode.el)
- [Sublime Text](https://github.com/munificent/wren-sublime)
- [Vim](https://github.com/lluchs/vim-wren)
## Tools and Utilities
Things that make life easier:
- [The Wren Nest](http://ppvk.github.io/wren-nest/): Run and share Wren in your
browser.
Do you have anything to add here? Send a [pull request][]!
+38 -22
View File
@@ -7,38 +7,54 @@ The IO class can be used to read and write to and from the console.
### IO.**print**(objects...)
Prints any number of things to the console and then prints a newline
character. If you don't pass it a string, it will be converted to a string for
you. When passed multiple things, Wren outputs one after another.
Prints a series of objects to the console followed by a newline. Each object is
converted to a string by calling `toString` on it. This is overloaded to
support up to 16 objects. To pass more, use `printAll()`.
> IO.print("I like bananas")
I like bananas
> IO.print("Oranges", 10)
Oranges10
> IO.print("I like bananas")
I like bananas
> IO.print("Oranges", 10)
Oranges10
>
### IO.**printAll**(sequence)
Iterates over [sequence] and prints each element, then prints a single newline
at the end. Each element is converted to a string by calling `toString` on it.
> IO.printAll([1, [2, 3], 4])
1[2, 3]4
### IO.**write**(object)
Prints a single thing to the console, but does not print a newline character
afterwards. If you pass it something that isn't a string, it will convert it to
a string.
Prints a single value to the console, but does not print a newline character
afterwards. Converts the value to a string by calling `toString` on it.
> IO.write(4 + 5)
9>
> IO.write(4 + 5)
9>
In the above example, the result of `4 + 5` is printed, and then the prompt is
printed on the same line because no newline character was printed afterwards.
### IO.**read**()
Reads in a line of text from stdin. Note that the returned text includes the
trailing newline.
> var name = IO.read()
John
> IO.print("Hello " + name + "!")
Hello John
!
>
### IO.**read**(prompt)
Reads in and returns a line of text from the console. Takes a single string to
be used as a prompt. Pass an empty string for no prompt. Note that the returned
line of text includes the newline character at the end.
Displays `prompt` then reads in a line of text from stdin. Note that the
returned text includes the trailing newline.
> var name = IO.read("Enter your name: ")
Enter your name: John
> IO.print("Hello " + name + "!")
Hello John
!
>
> var name = IO.read("Enter your name: ")
Enter your name: John
> IO.print("Hello " + name + "!")
Hello John
!
>
+1 -1
View File
@@ -113,7 +113,7 @@ of the `yield()` call:
This prints "sent". Note that the first value sent to the fiber through call is
ignored. That's because the fiber isn't waiting on a `yield()` call, so there's
no where for the sent value to go.
nowhere for the sent value to go.
Fibers can also pass values *back* when they yield. If you pass an argument to
`yield()`, that will become the return value of the `call` that was used to
+5 -3
View File
@@ -41,8 +41,9 @@ a familiar, modern [syntax][].
and [an easy-to-use C API][embedding]. It compiles cleanly as C99, C++98
or anything later.
If you like the sound of this, [give it a try][try]! Even better, you can
[contribute to Wren itself][contribute].
If you like the sound of this, [let's get started][started]. You can even try
it [in your browser][browser]! Excited? Well, come on and [get
involved][contribute]!
[syntax]: syntax.html
[src]: https://github.com/munificent/wren/tree/master/src
@@ -51,5 +52,6 @@ If you like the sound of this, [give it a try][try]! Even better, you can
[classes]: classes.html
[fibers]: fibers.html
[embedding]: embedding-api.html
[try]: getting-started.html
[started]: getting-started.html
[browser]: http://ppvk.github.io/wren-nest/
[contribute]: contributing.html