diff --git a/qcm/README.md b/qcm/README.md new file mode 100644 index 000000000..20eece3b5 --- /dev/null +++ b/qcm/README.md @@ -0,0 +1,130 @@ +--- +title: qcm +homepage: https://youg-otricked.github.io/QuantumC +tagline: | + QuantumC - An explicit programming language for systems developers. +description: | + QCM is the official QuantumC toolchain. It installs, updates, and manages QuantumC compilers, packages, and projects. +--- + +QCM is the official command-line tool for QuantumC. + +Like `go` for Go, QCM installs and manages the QuantumC toolchain, packages, and +projects. + +- installing QuantumC versions +- switching compiler versions +- managing packages +- creating and building projects + +Install/Update qcm: + +```sh +webi qcm@stable +# OR +qcm upgrade +``` + +### Files + +``` +~/.config/envman/PATH.env +~/.local/opt/qcm/ +~/.local/bin/qcm +~/.qcm/ +``` + +### Cheat Sheet + +QCM has two groups of commands: + +- **Project commands** manage the current QuantumC project and its packages. +- **Tooling commands** manage installed QuantumC compiler versions and the local + toolchain. + +Install the latest QuantumC compiler: + +```sh +qcm tooling install latest +``` + +List installed compiler versions: + +```sh +qcm tooling list +``` + +Switch compiler versions: + +```sh +qcm tooling use x0.18.0 +``` + +Create a new QuantumC project: + +```sh +mkdir hello +cd hello +qcm init +``` + +Build and run the current project: + +```sh +qcm run build +``` + +### Core Ideals + +QuantumC has 4 core ideals; + +1. Your Memory, Your Problem - QuantumC lets you do anything (yes, anything), + but also will let you segfault your segfault. +2. Forced Cleanliness - QuantumC syntax is designed to be explicit and clean. + This sometimes trades away terseness, but makes a better DX. +3. No Hiding - QuantumC does not hide away features or pretend they are the + standard library when they are intrinsic. +4. No Excessive Syntax - QuantumC does not have any repetitive ridiculous + syntax - no capture lists on lambdas, no + `fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { ... }` + +### Hello World + +1. Install the latest version of the QuantumC compiler + ```sh + qcm tooling install latest + ``` +1. Make and enter your project + ```sh + mkdir -p ./hello && cd hello + ``` +1. Create your `scope.yaml` & `main.qc` file + ```sh + qcm init # the rest of setup will be done in the wizard + ``` +1. Edit `main.qc` + + ```sh + cat << EOF > ./main.qc + int main() { + `qout("Hello, World!"); + return 0; + } + EOF + ``` + +1. Build and run your `./hello` + ```sh + qcm run build # default command in your scope.yaml, equivelant to qc main.qc -o + ./hello + ``` + You should see your output: + ```text + > Hello, World! + ``` + +## Learn More + +QuantumC documentation: + +https://youg-otricked.github.io/QuantumC diff --git a/qcm/install.sh b/qcm/install.sh new file mode 100644 index 000000000..3edd55378 --- /dev/null +++ b/qcm/install.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e +set -u + +__init_qcm() { + WEBI_SINGLE=true + + pkg_get_current_version() { + qcm --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2 + } + pkg_post_install() { + webi_post_install + "$pkg_dst_cmd" setup --no-export + } +} + +__init_qcm diff --git a/qcm/releases.conf b/qcm/releases.conf new file mode 100644 index 000000000..9ab7b37d3 --- /dev/null +++ b/qcm/releases.conf @@ -0,0 +1 @@ +github_releases = Youg-Otricked/quantum-c-version-manager diff --git a/quantumc/README.md b/quantumc/README.md new file mode 100644 index 000000000..04e3ae662 --- /dev/null +++ b/quantumc/README.md @@ -0,0 +1,131 @@ +--- +title: QuantumC +homepage: https://youg-otricked.github.io/QuantumC +tagline: | + QuantumC - An explicit programming language for systems developers. +alias: qcm +description: | + QCM is the official QuantumC toolchain. It installs, updates, and manages QuantumC compilers, packages, and projects. +--- + +QCM is the official command-line tool for QuantumC. + +Like `go` for Go, QCM installs and manages the QuantumC toolchain, packages, and +projects. + +- installing QuantumC versions +- switching compiler versions +- managing packages +- creating and building projects + +Install/Update qcm: + +```sh +webi qcm@stable +# OR +qcm upgrade +``` + +### Files + +``` +~/.config/envman/PATH.env +~/.local/opt/qcm/ +~/.local/bin/qcm +~/.qcm/ +``` + +### Cheat Sheet + +QCM has two groups of commands: + +- **Project commands** manage the current QuantumC project and its packages. +- **Tooling commands** manage installed QuantumC compiler versions and the local + toolchain. + +Install the latest QuantumC compiler: + +```sh +qcm tooling install latest +``` + +List installed compiler versions: + +```sh +qcm tooling list +``` + +Switch compiler versions: + +```sh +qcm tooling use x0.18.0 +``` + +Create a new QuantumC project: + +```sh +mkdir hello +cd hello +qcm init +``` + +Build and run the current project: + +```sh +qcm run build +``` + +### Core Ideals + +QuantumC has 4 core ideals; + +1. Your Memory, Your Problem - QuantumC lets you do anything (yes, anything), + but also will let you segfault your segfault. +2. Forced Cleanliness - QuantumC syntax is designed to be explicit and clean. + This sometimes trades away terseness, but makes a better DX. +3. No Hiding - QuantumC does not hide away features or pretend they are the + standard library when they are intrinsic. +4. No Excessive Syntax - QuantumC does not have any repetitive ridiculous + syntax - no capture lists on lambdas, no + `fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { ... }` + +### Hello World + +1. Install the latest version of the QuantumC compiler + ```sh + qcm tooling install latest + ``` +1. Make and enter your project + ```sh + mkdir -p ./hello && cd hello + ``` +1. Create your `scope.yaml` & `main.qc` file + ```sh + qcm init # the rest of setup will be done in the wizard + ``` +1. Edit `main.qc` + + ```sh + cat << EOF > ./main.qc + int main() { + `qout("Hello, World!"); + return 0; + } + EOF + ``` + +1. Build and run your `./hello` + ```sh + qcm run build # default command in your scope.yaml, equivelant to qc main.qc -o + ./hello + ``` + You should see your output: + ```text + > Hello, World! + ``` + +## Learn More + +QuantumC documentation: + +https://youg-otricked.github.io/QuantumC diff --git a/quantumc/install.sh b/quantumc/install.sh new file mode 100644 index 000000000..ca0cd4903 --- /dev/null +++ b/quantumc/install.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +set -u +__redirect_alias_quantumc() { + echo "'QuantumC@${WEBI_TAG:-stable}' is an alias for 'qcm@${WEBI_VERSION-}'" + WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"} + curl -fsSL "$WEBI_HOST/qcm@${WEBI_VERSION-}" | sh +} +__redirect_alias_quantumc diff --git a/quantumc/releases.conf b/quantumc/releases.conf new file mode 100644 index 000000000..8dc169a7b --- /dev/null +++ b/quantumc/releases.conf @@ -0,0 +1 @@ +alias_of = qcm diff --git a/test/install.sh b/test/install.sh index 4acfc3ec3..7cc7951d4 100644 --- a/test/install.sh +++ b/test/install.sh @@ -63,6 +63,7 @@ __rmrf_local() { prettier \ powershell \ pwsh \ + qcm \ rclone \ rg \ ripgrep \ @@ -160,6 +161,7 @@ __rmrf_local() { prettier \ powershell \ pwsh \ + qcm \ rclone \ rg \ ripgrep \ @@ -262,6 +264,7 @@ __test() { powershell \ prettier \ pwsh \ + qcm \ rclone \ rg \ ripgrep \