-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
14 changed files
with
39 additions
and
104 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,5 +1,5 @@ | ||
on: | ||
pull_request: | ||
# pull_request: | ||
|
||
name: CI manager | ||
|
||
|
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,5 +1,5 @@ | ||
on: | ||
#pull_request: | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 9 * * *" | ||
|
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
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,20 +1,14 @@ | ||
|
||
# Platform switching | ||
|
||
To run, `cd` into this directory and run this in your terminal: | ||
|
||
```bash | ||
roc run | ||
roc --build-host --suppress-build-host-warning rocLovesC.roc | ||
``` | ||
|
||
This will run `main.roc` because, unless you explicitly give it a filename, `roc run` | ||
defaults to running a file named `main.roc`. Other `roc` commands (like `roc build`, `roc test`, and so on) also default to `main.roc` unless you explicitly give them a filename. | ||
|
||
## About this example | ||
|
||
This uses a very simple platform which does nothing more than printing the string you give it. | ||
|
||
The line `main = "Which platform am I running on now?\n"` sets this string to be `"Which platform am I running on now?"` with a newline at the end, and the lines `packages { pf: "c-platform/main.roc" }` and `provides [main] to pf` specify that the `c-platform/` directory contains this app's platform. | ||
## About these examples | ||
|
||
This platform is called `c-platform` because its lower-level code is written in C. There's also a `rust-platform`, `zig-platform`, and so on; if you like, you can try switching `pf: "c-platform/main.roc"` to `pf: "zig-platform/main.roc"` or `pf: "rust-platform/main.roc"` to try one of those platforms instead. They all do similar things, so the application won't look any different. | ||
They use a very simple [platform](https://www.roc-lang.org/platforms) which does nothing more than printing the string you give it. | ||
|
||
If you want to start building your own platforms, these are some very simple example platforms to use as starting points. |
This file was deleted.
Oops, something went wrong.
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,5 +1,9 @@ | ||
app [main] { pf: platform "c-platform/main.roc" } | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesZig.roc` | ||
# may require: | ||
# ubuntu: sudo apt install build-essential clang | ||
# fedora: sudo dnf install clang | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesC.roc` | ||
|
||
main = "Roc <3 C!\n" |
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,5 +1,10 @@ | ||
app [main] { pf: platform "zig-platform/main.roc" } | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesZig.roc` | ||
# To run: | ||
# cd examples/platform-switching/zig-platform | ||
# mkdir glue | ||
# cp crates/compiler/builtins/bitcode/src/* ./glue | ||
# cd - | ||
# roc --build-host --suppress-build-host-warning rocLovesZig.roc | ||
|
||
main = "Roc <3 Zig!\n" |
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
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