-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,106 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
docs/_site | ||
*.ignore | ||
test-ignore-* | ||
vendor | ||
builds/* | ||
!builds/.gitkeep | ||
.idea/ | ||
.vscode/ | ||
packages.abs.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ os: | |
- osx | ||
|
||
go: | ||
- "1.12.x" | ||
- "1.13.x" | ||
|
||
before_script: | ||
- go get -u | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.12 | ||
FROM golang:1.13 | ||
|
||
RUN apt-get update | ||
RUN apt-get install bash make git curl jq -y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Installing 3rd party libraries | ||
|
||
The ABS interpreter comes with a built-in installer for 3rd party libraries, | ||
very similar to `npm install`, `pip install` or `go get`. | ||
|
||
The installer, budled since the `1.8.0` release, is currently **experimental** | ||
and a few things might change. | ||
|
||
In order to install a package, you simply need to run `abs get`: | ||
|
||
``` bash | ||
$ abs get github.com/abs-lang/abs-sample-module | ||
🌘 - Downloading archive | ||
Unpacking... | ||
Creating alias... | ||
Install Success. You can use the module with `require("abs-sample-module")` | ||
``` | ||
|
||
Modules will be saved under the `vendor/$MODULE-master` directory. Each module | ||
also gets an alias to facilitate requiring them in your code, meaning that | ||
both of these forms are supported: | ||
|
||
``` | ||
⧐ require("abs-sample-module/sample.abs") | ||
{"another": f() {return hello world;}} | ||
⧐ require("vendor/github.com/abs-lang/abs-sample-module-master/sample.abs") | ||
{"another": f() {return hello world;}} | ||
``` | ||
|
||
Note that the `-master` prefix [will be removed](https://github.com/abs-lang/abs/issues/286) in future versions of ABS. | ||
|
||
Module aliases are saved in the `packages.abs.json` file | ||
which is created in the same directory where you run the | ||
`abs get ...` command: | ||
|
||
``` | ||
$ abs get github.com/abs-lang/abs-sample-module | ||
🌗 - Downloading archive | ||
Unpacking... | ||
Creating alias... | ||
Install Success. You can use the module with `require("abs-sample-module")` | ||
$ cat packages.abs.json | ||
{ | ||
"abs-sample-module": "./vendor/github.com/abs-lang/abs-sample-module-master" | ||
} | ||
``` | ||
|
||
If an alias is already taken, the installer will let you know that you | ||
will need to use the full path when requiring the module: | ||
|
||
``` | ||
$ echo '{"abs-sample-module": "xyz"}' > packages.abs.json | ||
$ abs get github.com/abs-lang/abs-sample-module | ||
🌘 - Downloading archive | ||
Unpacking... | ||
Creating alias...This module could not be aliased because module of same name exists | ||
Install Success. You can use the module with `require("./vendor/github.com/abs-lang/abs-sample-module-master")` | ||
``` | ||
|
||
When requiring a module, ABS will try to load the `index.abs` file unless | ||
another file is specified: | ||
|
||
``` | ||
$ ~/projects/abs/builds/abs | ||
Hello alex, welcome to the ABS (1.8.0) programming language! | ||
Type 'quit' when you're done, 'help' if you get lost! | ||
⧐ require("abs-sample-module") | ||
{"another": f() {return hello world;}} | ||
⧐ require("abs-sample-module/index.abs") | ||
{"another": f() {return hello world;}} | ||
⧐ require("abs-sample-module/another.abs") | ||
f() {return hello world;} | ||
``` | ||
|
||
## Supported hosting platforms | ||
|
||
Currently, the installer supports modules hosted on: | ||
|
||
* GitHub | ||
|
||
## Next | ||
|
||
That's about it for this section! | ||
|
||
You can now head over to read a little bit about [errors](/misc/error). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.