You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present there are various commands and options for working with the Roc CLI. The difference in behaviour between options can be unclear, e.g. roc run verse roc dev.
The motivation behind this change is to align the behaviour of the CLI around two primary workflows, while still providing flexibility to use the available features through the use of flags.
RUN WORKFLOW we prioritise ease of use and productivity for the application author. This workflow is most useful when developing a script or application. Scripts and applications will run even if they are invalid and crash at runtime instead of at compile time. Assertions using inline expect will be checked, and dbg values are printed to stderr. The compiler defaults to using the development backends and surgical linker when available as this will build faster, at the expense of runtime performance.
BUILD WORKFLOW we prioritise safety and performance of the produced executable or library. This workflow is most useful when building an application for packaging and distribution. Applications will not build if they are invalid and there are any errors, though warnings are still printed. Inline expect or dbg are ignored and stripped from the produced binary. The compiler defaults to using the LLVM backend with full optimisations.
This task is to modify the Roc CLI workflows as follows;
RUN WORKFLOW
The command is roc (modified from current implementation)
Prioritise ease of use and productivity, panic/crash at run time
Run using dev backends by default (fallback to llvm without optimisations)
Prints Errors and Warnings
Prints dbg values
Proceed to run an invalid program
Check inline expect assertions and panic/crash if any fail
Supports scripting use-case with !#/usr/bin/env roc
Note roc run and roc dev commands removed as redundant
BUILD WORKFLOW
The command is roc build (modified from current implementation)
Prioritise safety and performance, panic/crash at compile time
Build an executable using llvm with full optimisations by default
Print any Warnings
Reports any Errors and will only build a valid program
Ignores dbg and strips from binary
Ignores expect and strips from binary
FLAGS
Below are some of the changes to flags that are related to this change.
--watch (new flag) (re)compile binary on any changes in the application [NOTE this flag needs further discussion and should be left for a future task]
--backend <llvm/dev> (new flag) compile binary using llvm or dev backend instead of default
--opt <none/size/speed> (new flags)
--opt none compile without optimisations, llvm only
--opt size (renamed from --opt-size) smaller binary, llvm only
--opt speed (renamed from --optimize) compile with optimisations, llvm only
The text was updated successfully, but these errors were encountered:
Zulip discussion thread
At present there are various commands and options for working with the Roc CLI. The difference in behaviour between options can be unclear, e.g.
roc run
verseroc dev
.The motivation behind this change is to align the behaviour of the CLI around two primary workflows, while still providing flexibility to use the available features through the use of flags.
expect
will be checked, anddbg
values are printed to stderr. The compiler defaults to using the development backends and surgical linker when available as this will build faster, at the expense of runtime performance.expect
ordbg
are ignored and stripped from the produced binary. The compiler defaults to using the LLVM backend with full optimisations.This task is to modify the Roc CLI workflows as follows;
RUN WORKFLOW
roc
(modified from current implementation)dbg
valuesexpect
assertions and panic/crash if any fail!#/usr/bin/env roc
roc run
androc dev
commands removed as redundantBUILD WORKFLOW
roc build
(modified from current implementation)dbg
and strips from binaryexpect
and strips from binaryFLAGS
Below are some of the changes to flags that are related to this change.
--watch
(new flag) (re)compile binary on any changes in the application [NOTE this flag needs further discussion and should be left for a future task]--backend <llvm/dev>
(new flag) compile binary usingllvm
ordev
backend instead of default--opt <none/size/speed>
(new flags)--opt none
compile without optimisations, llvm only--opt size
(renamed from--opt-size
) smaller binary, llvm only--opt speed
(renamed from--optimize
) compile with optimisations, llvm onlyThe text was updated successfully, but these errors were encountered: