riju/langs/factor.yaml

39 lines
788 B
YAML

id: "factor"
aliases:
- "fact"
name: "Factor"
install:
manual: |
install -d "${pkg}/opt/factor"
install -d "${pkg}/usr/local/bin"
ver="$(curl -sSL https://factorcode.org/ | grep -Eo 'release\?os=linux[^>]+>[^<]+' | sed -E 's/[^>]+>//' | head -n1)"
wget "https://downloads.factorcode.org/releases/${ver}/factor-linux-x86-64-${ver}.tar.gz" -O factor.tar.gz
tar -xf factor.tar.gz -C "${pkg}/opt/factor" --strip-components=1
ln -sT /opt/factor/factor "${pkg}/usr/local/bin/factor-lang"
repl: |
HOME="$PWD" factor-lang
input: |
123 234 *
main: ".factor-rc"
template: |
IN: main
USE: io
"Hello, world!" print
createEmpty: ""
run: |
HOME="$PWD" factor-lang
scope:
code: |
USE: math
: x ( -- x ) 123 234 * ;
input: |
USE: main
x