enso/build
Kaz Wesley 7f52a8238d Space-precedence does not apply to value-level operators (#10597)
In a sequence of value-level operators, whitespace does not affect relative precedence. Functional operators still follow the space-precedence rules.

The "functional" operators are: `>> << |> |>> <| <<| : .`, application, and any operator containing `<-` or `->`. All other operators are considered value-level operators.

Asymmetric whitespace can still be used to form *operator sections* of value-level operators, e.g. `+2 * 3` is still equivalent to `x -> (x+2) * 3`.

Precedence of application is unchanged, so `f x+y` is still equivalent to `f (x + y)` and `f x+y * z` is still equivalent to `(f (x + y)) * z`.

Any attempt to use spacing to override value-level operator precedence will be caught by the new enso linter. Mixed spacing (for clarity) in value-operator expressions is allowed, as long as it is consistent with the precedences of the operators.

Closes #10366.

# Important Notes
Precedence warnings:
- The parser emits a warning if the whitespace in an expression is inconsistent with its effective precedence.
- A new enso linter can be run with `./run libraries lint`. It parses all `.enso` files in `distribution/lib` and `test`, and reports any errors or warnings. It can also be run on individual files: `cargo run --release --bin check_syntax -- file1 file2...` (the result may be easier to read than the `./run` output).
- The linter is also run as part of `./run lint`, so it is checked in CI.

Additional language change:
- The exponentiation operator (`^`) now has higher precedence than the multiplication class (`*`, `/`, `%`). This change did not affect any current enso files.

Library changes:
- The libraries have been updated. The new warnings were used to identify all affected code; the changes themselves have not been programmatically verified (in many cases their equivalence relies on the commutativity of string concatenation).

(cherry picked from commit e5b85bf16e)
2024-07-24 11:57:24 +01:00
..
base Custom Windows Installer & Uninstaller (#9815) 2024-05-07 16:22:11 +00:00
build Space-precedence does not apply to value-level operators (#10597) 2024-07-24 11:57:24 +01:00
ci_utils Space-precedence does not apply to value-level operators (#10597) 2024-07-24 11:57:24 +01:00
ci-gen Bump Rust Toolchain (#9517) 2024-03-24 23:45:55 +00:00
cli Space-precedence does not apply to value-level operators (#10597) 2024-07-24 11:57:24 +01:00
enso-formatter remove unused rust modules (#9540) 2024-03-27 12:19:38 +00:00
install Build script cleanups (#9931) 2024-05-13 13:56:28 +00:00
macros Bump Rust Toolchain (#9517) 2024-03-24 23:45:55 +00:00
.gitignore Build script merge (#3743) 2022-10-10 23:38:48 +02:00
README.md Build Script Post-Gui1 Cleanup (#9376) 2024-03-12 20:25:51 +01:00


Enso Language

[WIP] Enso CI Build Scripts

The code under this directory is under ongoing intensive development. As such it has not been reviewed or cleaned up yet.

General principles

  • Written in Rust.
  • Portable. Works on any platform that Enso targets.
  • Do not duplicate functionality that is already available in tools being part of our tech stack.
  • Supports both developers and CI use-cases (and environments). Developers can call it locally to do anything that CI does.
  • Does not require much setup work. Where feasible sets things up for the user.

Concepts

Target

  • Can be built locally from sources. Building yields artifacts.
  • Artifacts are self-contained to a single filesystem directory.
  • Artifacts can be downloaded from a remote location rather than built with the same effect.
  • Can contain other targets.
  • Artifacts can be platform-specific.
  • Artifacts must be releasable as CI run artifacts or release assets.

Usage

While the script is invoked using cargo run, the convenience run script is provided in the repository root.

The general usage form is:

./run <command> [options]

The command itself is usually a combination of target name and subcommand, like ide build or backend test.

At every layer, the --help command can be used to get more information. Note that the information depends on the command, so running ./run --help will not give you the same information as ./run ide --help nor ./run ide build --help.

Targets

IDE

IDE is the top level target for our project. It consists of GUI and Backend targets.

Sources consist mostly of TS code for the Electron client and packaging.

Artifacts are platform specific and consist of the single image file.

GUI

GUI is the front-end part of the project. It also packages WASM-compiled parser written in rust.

Artifacts are portable across the platforms and consist of the web page that can be served either using Electron client (as IDE does) or using a web server (like the Cloud version of Enso).

Backend

Backend is the back-end part of the project, as seen from the IDE perspective. It contains a Project Manager bundle that includes:

  • Project Manager native image;
  • Enso Engine distribution (with the Standard Library);
  • GraalVM distribution.

These components are not represented as "Targets" (in terms of build script) but could be and likely will be in the future.