### Example: Install and Launch Clack Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html Demonstrates installing the 'clack' library and launching its 'clackup' script using 'ros exec'. ```bash $ ros install clack found system clack. Attempting install scripts... /Users/nitro_idiot/.roswell/bin/clackup $ ros exec clackup ### launch the web server! ``` -------------------------------- ### Installing Latest Dependencies with Roswell Source: https://roswell.github.io/Travis-CI.html Demonstrates how to install the latest versions of libraries directly from GitHub using `ros install` within the `install` section of .travis.yml. This is useful for libraries not yet available on Quicklisp. ```yaml install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh + # Using the latest fast-http and quri + - ros install fukamachi/fast-http + - ros install fukamachi/quri ``` -------------------------------- ### Launch Emacs with SLIME Setup Source: https://roswell.github.io/Initial-Recommended-Setup.html This command launches Emacs with SLIME already set up, providing a convenient way to start your Lisp development session. ```bash ros emacs ``` -------------------------------- ### Install Scripts from Quicklisp or GitHub Source: https://roswell.github.io/Home.html Install programs or scripts using 'ros install'. This can be from Quicklisp or directly from a GitHub repository. ```bash $ ros install qlot # will install a program from quicklisp $ ros install fukamachi/qlot # will install it from the GitHub ``` -------------------------------- ### View Install Options for an Implementation Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Access detailed information and compile options for installing a specific Lisp implementation, such as SBCL, by using 'ros help install [impl]'. ```bash $ ros help install sbcl ``` -------------------------------- ### Python pip install and command execution Source: https://roswell.github.io/How-to-distribute-your-software%2C-not-library%2C-on-Quicklisp-ala-python-pip.html Demonstrates how Python's pip installs packages and how installed software can be executed directly from the command line. ```bash $ pip3 install --user cfncluster Requirement already satisfied: .... $ cfncluster usage: cfncluster [-h] [--config CONFIG_FILE] [--region REGION] [--nowait] {create,update,delete,start,stop,status,list,instances,configure,version} ... cfncluster: error: too few arguments ``` -------------------------------- ### Manage Multiple Lisp Installations Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Install various Lisp implementations and list specific installed versions. Use 'ros install' for default or specific versions and 'ros list installed [impl]' to filter. ```bash $ ros install sbcl-bin # default sbcl ``` ```bash $ ros install sbcl # The newest released version of sbcl ``` ```bash $ ros install ccl-bin # default prebuilt binary of ccl ``` ```bash $ ros install sbcl/1.2.0 # A specific version of sbcl ``` ```bash $ ros list installed sbcl # Listing the installed implementations ``` -------------------------------- ### Install Roswell on FreeBSD (System-wide) Source: https://roswell.github.io/Installation.html Install Roswell system-wide on FreeBSD by navigating to the ports directory and running make install. ```bash $ cd /usr/ports/devel/roswell $ sudo make install ``` -------------------------------- ### Install and Execute Roswell Scripts Source: https://roswell.github.io/How-to-distribute-your-software%2C-not-library%2C-on-Quicklisp-ala-python-pip.html Demonstrates how to install a script from Quicklisp or GitHub and then execute it using Roswell commands. ```shell # install from quicklisp $ ros install prove # or fetch from the latest github repository [accountname]/[repo] $ ros install fukamachi/prove # launch ~/.roswell/bin/run-prove $ ros exec run-prove # Alternatively: $ PATH=~/.roswell/bin:$PATH $ which run-prove /home/guicho/.roswell/bin/run-prove $ run-prove ``` -------------------------------- ### Install Scripts with Roswell Source: https://roswell.github.io/ Roswell can install scripts directly from Quicklisp or GitHub using the 'ros install' command. Ensure roswell scripts (files with .ros extensions) are placed in a 'roswell' subdirectory for system-wide installation. ```bash $ ros install qlot # will install a program from quicklisp $ ros install fukamachi/qlot # will install it from the GitHub ``` -------------------------------- ### Install a Library via Roswell Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html Use this command to install a library from Quicklisp that provides Roswell scripts. The scripts will be copied to ~/.roswell/bin. ```bash $ ros install ``` -------------------------------- ### Install and Use Roswell Scripts for Testing Source: https://roswell.github.io/Travis-CI.html Install specific Roswell commands like `prove` using `ros install prove` and ensure `~/.roswell/bin` is in your PATH. Then, use commands like `run-prove` for testing. ```yaml language: common-lisp sudo: required env: global: - PATH=~/.roswell/bin:$PATH # !!! IMPORTANT !!! matrix: - LISP=sbcl-bin - LISP=ccl-bin - LISP=abcl - LISP=clisp - LISP=ecl matrix: allow_failures: - env: LISP=clisp install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh + - ros install prove script: - - ros -s prove -e '(or (prove:run :quri-test) (uiop:quit -1))' + - run-prove quri-test.asd ``` -------------------------------- ### Install Roswell from Debian Package Source: https://roswell.github.io/Installation.html Install Roswell on Ubuntu/Debian systems by downloading and installing a .deb package. ```bash $ curl -L https://github.com/roswell/roswell/releases/download/v19.08.10.101/roswell_19.08.10.101-1_amd64.deb --output roswell.deb $ sudo dpkg -i roswell.deb ``` -------------------------------- ### Install Common Lisp Implementations Source: https://roswell.github.io/ Use the 'ros install' command to manage Common Lisp implementations. You can install default versions, the latest released versions, specific versions, or prebuilt binaries. Use 'ros list installed [implementation]' to check installed versions and 'ros use [implementation]' to set the default. ```bash $ ros install # displays a list of all installable implementations $ ros install sbcl-bin # default sbcl $ ros install sbcl # The newest released version of sbcl $ ros install ccl-bin # default prebuilt binary of ccl $ ros install sbcl/1.2.0 # A specific version of sbcl $ ros list installed sbcl # Listing the installed implementations $ ros run -- --version # check which implementation is used SBCL 1.2.15 $ ros use sbcl/1.2.3 # change the default implementation ``` -------------------------------- ### Install SBCL from Source Source: https://roswell.github.io/Initial-Recommended-Setup.html Run this command to install SBCL by compiling it from source code, which may be necessary for certain features like jumping to implementation source code. ```bash ros install sbcl ``` -------------------------------- ### Advanced .travis.yml for Multiple Lisp Implementations Source: https://roswell.github.io/Travis-CI.html An advanced .travis.yml setup for comprehensive testing. It configures Roswell to use multiple Lisp implementations, installs project dependencies, and allows specific implementations to fail. ```yaml language: common-lisp sudo: false addons: apt: packages: - libc6-i386 env: global: - PATH=~/.roswell/bin:$PATH - ROSWELL_INSTALL_DIR=$HOME/.roswell matrix: - LISP=sbcl-bin - LISP=ccl-bin - LISP=abcl - LISP=clisp - LISP=ecl - LISP=cmucl - LISP=alisp matrix: allow_failures: - env: LISP=clisp - env: LISP=abcl - env: LISP=ecl - env: LISP=cmucl - env: LISP=alisp install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh - ros install prove - ros install fukamachi/fast-http - ros install fukamachi/quri cache: directories: - $HOME/.roswell - $HOME/.config/common-lisp script: - run-prove quri-test.asd ``` -------------------------------- ### Local Roswell Installation Source: https://roswell.github.io/Local-installation.html Clone the Roswell repository, bootstrap, configure with a local prefix, and install without sudo. Execute the installed binary from the specified local bin directory. ```bash git clone -b release https://github.com/roswell/roswell.git cd roswell sh bootstrap ./configure --prefix=$HOME/.local/ make && make install ### in this case, no sudo is required! ~/.local/bin/ros ``` -------------------------------- ### Launch Roswell Shell Source: https://roswell.github.io/How-to-setup-a-lisp-dev-environment-on-windows-with-Roswell.html Execute this command in your command prompt to start the Roswell shell. Roswell will then prompt to install MSYS2 and launch its bash environment. ```shell ros shell ``` -------------------------------- ### Install Roswell with xbps (Void Linux) Source: https://roswell.github.io/Installation.html Install Roswell on Void Linux using the xbps package manager. ```bash $ sudo xbps-install -S roswell ``` -------------------------------- ### Install Roswell on FreeBSD (User-local) Source: https://roswell.github.io/Installation.html Install Roswell locally for a specific user on FreeBSD by defining a PREFIX variable. ```bash $ cd /usr/ports/devel/roswell $ sudo make PREFIX=/usr/home//.local install ``` -------------------------------- ### Installation on FreeBSD Source: https://roswell.github.io/Installation.html Installs Roswell on FreeBSD, including setting library and include search paths for the configure script. ```bash sudo pkg install git automake curl LDFLAGS="-L/usr/local/lib/" CFLAGS="-I/usr/local/include/" ./configure ``` -------------------------------- ### Install Roswell with Scoop (Windows) Source: https://roswell.github.io/Installation.html Install Roswell on Windows using the Scoop package manager. ```bash $ scoop install roswell ``` -------------------------------- ### Project Structure Example Source: https://roswell.github.io/FAQ.html Illustrates the directory structure for placing private subprojects relative to the main project. ```text + projects/ + main.ros + src/ + t/ + subproj1/ + subproj2/ ;; or + local-projects/ + subproj1/ + subproj2/ ``` -------------------------------- ### System-wide Installation on Debian/Ubuntu Source: https://roswell.github.io/Installation.html Installs Roswell system-wide on Debian-based systems. Ensure build tools and dependencies are installed before cloning and building. ```bash sudo apt-get -y install git build-essential automake libcurl4-openssl-dev git clone -b release https://github.com/roswell/roswell.git cd roswell sh bootstrap ./configure make sudo make install ros setup ``` -------------------------------- ### Set ROSWELL_HOME Environment Variable Source: https://roswell.github.io/Initial-Recommended-Setup.html To use a different directory for Roswell's configuration and installations instead of ~/.roswell, set the ROSWELL_HOME environment variable before running `ros setup`. ```bash export ROSWELL_HOME=/tmp ``` ```bash ros setup # will create /tmp/.roswell and install files there instead of ~/.roswell ``` -------------------------------- ### Install Common Lisp Implementations Source: https://roswell.github.io/Home.html Use 'ros install' to manage Common Lisp implementations. You can install default versions, the latest releases, specific versions, or prebuilt binaries. ```bash $ ros install # displays a list of all installable implementations $ ros install sbcl-bin # default sbcl $ ros install sbcl # The newest released version of sbcl $ ros install ccl-bin # default prebuilt binary of ccl $ ros install sbcl/1.2.0 # A specific version of sbcl $ ros list installed sbcl # Listing the installed implementations $ ros run -- --version # check which implementation is used SBCL 1.2.15 $ ros use sbcl/1.2.3 # change the default implementation ``` -------------------------------- ### Install Roswell with Homebrew Source: https://roswell.github.io/Installation.html Use Homebrew to install Roswell on macOS and Linux systems. ```bash $ brew install roswell ``` -------------------------------- ### Install Common Lisp Implementations with Roswell Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Use the 'ros install' command to install specific versions or the latest releases of Common Lisp implementations like SBCL and CCL. ```bash # Installing SBCL 1.2.14 $ ros install sbcl/1.2.14 ``` ```bash # Installing the latest SBCL $ ros install sbcl ``` ```bash # Installing Clozure CL $ ros install ccl-bin ``` -------------------------------- ### Install Emacs using pacman Source: https://roswell.github.io/How-to-setup-a-lisp-dev-environment-on-windows-with-Roswell.html Use the pacman package manager within the MSYS2 bash environment to install Emacs. This is a prerequisite for setting up SLIME. ```shell pacman -S emacs ``` -------------------------------- ### Install Roswell from AUR (Arch Linux) Source: https://roswell.github.io/Installation.html Install Roswell on Arch Linux using the AUR helper 'yay'. ```bash $ yay -S roswell ``` -------------------------------- ### Installation on Red Hat-based Linux (dnf) Source: https://roswell.github.io/Installation.html Installs necessary development packages for Roswell on Red Hat-based systems using dnf. ```bash sudo dnf install automake libcurl-devel ``` -------------------------------- ### Install Roswell with Portage (Gentoo) Source: https://roswell.github.io/Installation.html Install Roswell on Gentoo Linux using the Portage package manager. Note potential binary file collisions with 'dev-libs/librouteros'. ```bash $ emerge --ask dev-lisp/roswell ``` -------------------------------- ### List Installed Common Lisp Implementations Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Check which Common Lisp implementations are currently installed on your system using the 'ros list installed' command. ```bash $ ros list installed ``` -------------------------------- ### Installation on Red Hat-based Linux (yum) Source: https://roswell.github.io/Installation.html Installs necessary development packages for Roswell on Red Hat-based systems using yum. ```bash sudo yum install automake libcurl-devel ``` -------------------------------- ### Install SBCL Source Code for SLIME Source: https://roswell.github.io/FAQ.html If using sbcl-bin with Roswell, install the source code separately to enable SLIME's jump-to-source functionality. This command downloads the source for sbcl-bin. ```bash ros install sbcl[/version] --without-install ``` -------------------------------- ### Install SLIME with Roswell Source: https://roswell.github.io/Initial-Recommended-Setup.html Use this command to install the SLIME package via Roswell. This is a prerequisite for Emacs integration. ```bash ros install slime ``` -------------------------------- ### Local Installation on Debian/Ubuntu Source: https://roswell.github.io/Installation.html Installs Roswell locally to avoid system-wide changes. Updates the user's profile to include the local bin directory in the PATH. ```bash git clone -b release https://github.com/roswell/roswell.git cd roswell sh bootstrap ./configure --prefix=$HOME/.local make make install echo 'PATH=$HOME/.local/bin:$PATH' >> ~/.profile PATH=$HOME/.local/bin:$PATH ros setup ``` -------------------------------- ### Show Available Lisp Implementations Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html View a list of all Lisp implementations that Roswell can install using the 'ros list versions' command. ```bash $ ros list versions candidates for ros list versions [impl] are: abcl-bin allegro ccl-bin clasp clisp cmu-bin ecl quicklisp sbcl-bin sbcl slime ``` -------------------------------- ### Upgrade Roswell from Source Source: https://roswell.github.io/Upgrading-Roswell.html Follow these steps to uninstall the old version, upgrade the source code, and then rebuild and install Roswell. ```bash sudo make uninstall # uninstall it before upgrading the source code, then run ``` ```bash git pull # or whatever needed to upgrade the source code of roswell ``` ```bash make # compile C-based part of roswell (`ros` binary) ``` ```bash sudo make install # install C-based binary and lisp source code to /usr/.../roswell ``` ```bash ros setup # build (compile&load&dump) the lisp-based part of roswell, using `ros` binary. Results are the dumped lisp image and are saved in ~/.roswell ``` -------------------------------- ### Install Additional Packages for Specific Lisp Implementations Source: https://roswell.github.io/Travis-CI.html For `clisp`, `abcl`, `alisp`, or `cmucl`, you may need to install additional APT packages like `openjdk-7-jre` or `libc6-i386`. ```yaml addons: apt: packages: - libc6-i386 - openjdk-7-jre ``` -------------------------------- ### Factorial Roswell Script Example Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html This example demonstrates a Roswell script that calculates the factorial of a given number. It includes the standard Roswell script header and defines both a recursive factorial function and a `main` function to handle input and output. ```lisp #!/bin/sh #|-*- mode:lisp -*| #| exec ros -Q -- $0 "$@" |# (_defun_ fact (n) (_if_ (zerop n) 1 (* n (fact (1- n))))) (_defun_ main (n &rest argv) (declare (ignore argv)) (format t "~&Factorial ~D = ~D~%" n (fact (parse-integer n)))) ``` -------------------------------- ### Configure Vim for SLIMV Source: https://roswell.github.io/Initial-Recommended-Setup.html Add these commands to your .vimrc file to integrate SLIMV with Roswell. This sets the command to start Swank, the Lisp implementation, and the default Lisp. ```vimscript let g:slimv_swank_cmd = "!ros -e '(ql:quickload :swank) (swank:create-server)' wait &" ``` ```vimscript let g:slimv_lisp = 'ros run' ``` ```vimscript let g:slimv_impl = 'sbcl' ``` -------------------------------- ### CircleCI Configuration for Roswell Projects Source: https://roswell.github.io/Circle-CI.html This YAML configuration sets up the CircleCI environment for a Roswell project. It defines PATH and LLVM_CONFIG, installs system dependencies, builds and installs pocl, installs Roswell and Common Lisp implementations, and finally runs tests. ```yaml machine: environment: PATH: ~/.roswell/bin:$PATH LLVM_CONFIG: /usr/lib/llvm-3.6/bin/llvm-config dependencies: pre: - sudo bash -c 'echo "deb http://mirrors.kernel.org/ubuntu vivid main universe" >> /etc/apt/sources.list' - sudo apt-get update - apt-cache search pocl - apt-cache search icd - apt-cache search opencl - sudo apt-get install -y libltdl3-dev libhwloc-dev ocl-icd-opencl-dev g++-4.8 clang-3.6 libclang-3.6-dev llvm-3.6-dev libedit-dev - ./build-pocl.sh - sudo make -C pocl install - curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh - ros install ccl-bin - git clone https://github.com/cffi/cffi.git ~/lisp/cffi post: - ros install cffi - ros install cffi-grovel - ros install eazy-opencl cache_directories: - ~/.roswell/ - pocl test: override: - ros -L sbcl-bin testscr.ros - ros -L ccl-bin testscr.ros ``` -------------------------------- ### CI Workflow for Roswell Projects Source: https://roswell.github.io/GitHub-Actions.html This YAML configuration sets up a GitHub Actions workflow to test a Roswell project across different Lisp implementations and operating systems. It includes steps for checking out code, installing Roswell, installing dependencies with rove, and running tests. ```yaml name: CI on: [push] jobs: test: name: ${{ matrix.lisp }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: lisp: [sbcl-bin] os: [ubuntu-latest, macOS-latest] steps: - uses: actions/checkout@v1 - name: Install Roswell env: LISP: ${{ matrix.lisp }} run: | curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh - name: Install Rove run: ros install rove - name: Run tests run: | PATH="~/.roswell/bin:$PATH" rove qlot.asd ``` -------------------------------- ### Launch Emacs with Roswell Source: https://roswell.github.io/How-to-setup-a-lisp-dev-environment-on-windows-with-Roswell.html Start Emacs using Roswell. The '&' symbol runs the process in the background, allowing you to continue using the terminal. ```shell ros emacs & ``` -------------------------------- ### Travis CI Configuration for Coveralls Source: https://roswell.github.io/Coveralls.html This configuration enables Coveralls reporting when the COVERALLS environment variable is set to true. It installs Roswell and runs tests using cl-coveralls. ```yaml language: common-lisp sudo: required env: global: - PATH=~/.roswell/bin:$PATH matrix: + - LISP=sbcl-bin COVERALLS=true - LISP=ccl-bin - LISP=abcl - LISP=clisp - LISP=ecl matrix: allow_failures: - env: LISP=clisp install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh script: + - ros -s prove -s cl-coveralls + -e '(or (coveralls:with-coveralls (:exclude (list "t")) (prove:run :quri-test)) (uiop:quit -1))' ``` -------------------------------- ### Add Roswell Bin to PATH Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html Configure your shell to directly execute scripts installed by Roswell without needing 'ros exec'. This involves adding ~/.roswell/bin to your PATH environment variable. ```bash $ echo 'export PATH="$HOME/.roswell/bin:$PATH"' >> ~/.zshrc $ clackup ### launch the web server! ``` -------------------------------- ### Roswell Script with Auto-Compilation Source: https://roswell.github.io/How-to-distribute-your-software%2C-not-library%2C-on-Quicklisp-ala-python-pip.html A sample Roswell script that includes directives for automatic compilation using SBCL. The `-m ` option in the fourth line enables this feature when the script is installed in `.roswell/bin`. ```shell #!/bin/sh #|-*- mode:lisp -*-| #| A utility library for Common Lisp dependant on SBCL exec ros -Q -L sbcl-bin -m speed -- $0 "$@" |# ``` ```lisp (defpackage #:ros.script.speed (:use #:cl)) (in-package :ros.script.speed) (defun main (&rest argv) (declare (ignore argv)) (print "Hello world")) (main) ;;; vim: set ft=lisp lisp: ``` -------------------------------- ### Measure Startup Time After Skipping Quicklisp Source: https://roswell.github.io/Reducing-Startup-Time.html After modifying the script to use `+Q`, use the `time` command again to observe the performance improvement in startup time. ```shell $ time fact.ros 10 Factorial 10 = 3628800 -fact.ros 10 0.74s user 0.21s system 95% cpu 0.994 total +fact.ros 10 0.57s user 0.19s system 97% cpu 0.780 total ``` -------------------------------- ### Initialize and Run a Roswell Project Source: https://roswell.github.io/Home.html Use 'ros init' to create a new project from a template. Edit the generated file and then execute it directly. ```shell $ ros init Usage: ros init [template] name [options...] ``` ```shell $ ros init fact Successfully generated: fact.ros ``` ```shell $ emacs fact.ros ## editing the fact.ros ... ``` ```lisp #!/bin/sh #|-*- mode:lisp -*| #| exec ros -Q -- $0 "$@" |# (defun fact (n) (if (zerop n) 1 (* n (fact (1- n))))) (defun main (n &rest argv) (declare (ignore argv)) (format t "~&Factorial ~D = ~D~%" n (fact (parse-integer n)))) ``` ```shell $ ./fact.ros 10 Factorial 10 = 3628800 ``` -------------------------------- ### Prepare for Release Source: https://roswell.github.io/Release-Roswell.html Execute this command to prepare for a new release. It will prompt for the new version number. Pressing Enter uses the default. ```shell make release-prepare ``` -------------------------------- ### Measure Executable Startup Time Source: https://roswell.github.io/Reducing-Startup-Time.html Measure the execution time of the generated executable using the `time` command. This demonstrates the substantial startup time reduction achieved by creating an executable. ```shell $ time fact 10 Factorial 10 = 3628800 -fact.ros 10 0.57s user 0.19s system 97% cpu 0.780 total +fact 10 0.00s user 0.02s system 96% cpu 0.024 total ``` -------------------------------- ### Build Binary with Private Subprojects (Command Line) Source: https://roswell.github.io/FAQ.html Use this command to build an executable, specifying local project directories for private subprojects. Ensure you use PWD for direct execution or CURDIR if using make. ```bash ros -e "(setf ql:*local-project-directories* '(#p"$(PWD)/\\"))" dump executable main.ros ``` -------------------------------- ### Implement MKCL run command Source: https://roswell.github.io/Support-New-implementation.html Create `src/cmd-run-mkcl.c` by copying `src/cmd-run-sbcl.c` and modifying the function name from `cmd_run_sbcl` to `cmd_run_mkcl`. This provides the specific implementation details for running MKCL. ```diff --- cmd-run-sbcl.c 2018-01-22 00:37:32.961614871 +0900 +++ cmd-run-mkcl.c 2018-02-27 18:29:13.276712741 +0900 @@ -1,7 +1,7 @@ /* -*- tab-width : 2 -*- */ #include "cmd-run.h" -char** cmd_run_sbcl(int argc,char** argv,struct sub_command* cmd) { +char** cmd_run_mkcl(int argc,char** argv,struct sub_command* cmd) { char* home=configdir(); char* arch=uname_m(); char* os=uname(); ``` -------------------------------- ### Measure Script Startup Time Source: https://roswell.github.io/Reducing-Startup-Time.html Use the `time` command to measure the execution time of a script. This helps in identifying performance bottlenecks. ```shell $ time fact.ros 10 Factorial 10 = 3628800 fact.ros 10 0.74s user 0.21s system 95% cpu 0.994 total ``` -------------------------------- ### Basic .travis.yml for Common Lisp with Roswell Source: https://roswell.github.io/Travis-CI.html A minimal .travis.yml configuration to set up Roswell and run tests using the prove test runner. Ensures the latest SBCL is used. ```yaml language: common-lisp sudo: required install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh script: - ros -s prove -e '(or (prove:run :quri-test) (uiop:quit -1))' ``` -------------------------------- ### Display Roswell Commands Source: https://roswell.github.io/ Run 'ros' without any arguments to see a list of available commands and their usage. Use 'ros help [command]' for detailed information on specific commands. ```bash $ ros Common Lisp environment setup Utility. Usage: ros [options] Command [arguments...] or ros [options] [[--] script-path arguments...] commands: run Run repl install Install a given implementation or a system for roswell environment update Update installed systems. build Make executable from script. use Change default implementation. init Creates a new ros script, optionally based on a template. list List Information delete Delete installed implementations config Get and set options version Show the roswell version information Use "ros help [command]" for more information about a command. Additional help topics: options Use "ros help [topic]" for more information about the topic. ``` -------------------------------- ### Skip Quicklisp Loading with Roswell Source: https://roswell.github.io/Reducing-Startup-Time.html Replace the `-Q` flag with `+Q` in the `ros` command to prevent Quicklisp from loading, which can reduce startup time. This is useful for scripts that do not require Quicklisp. ```shell #!/bin/sh #|-*- mode:lisp -*-|# #| -exec ros -Q -- $0 "$@" +exec ros +Q -- $0 "$@" |# ``` -------------------------------- ### Troubleshooting Roswell Upgrade Source: https://roswell.github.io/Upgrading-Roswell.html If you encounter issues after upgrading, try removing old configuration files and reinstalling. ```bash sudo rm -r /usr/local/etc/roswell/ ``` ```bash rm -r ~/.roswell/ ``` -------------------------------- ### Basic Roswell Script Structure Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html A basic Roswell script starts with a shell shebang and a comment block that tells Roswell to execute the script. The actual Lisp code follows, typically defining a `main` function. ```lisp #!/bin/sh #|-*- mode:lisp -*| #| exec ros -Q -- $0 "$@" |# (_defun_ main (&rest argv) (declare (ignorable argv))) ``` -------------------------------- ### Download Latest Debian Package Source: https://roswell.github.io/Installation.html Fetch the latest Roswell .deb package URL using curl and jq, then download it. ```bash curl -sOL `curl -s https://api.github.com/repos/roswell/roswell/releases/latest | jq -r '.assets | .[] | select(.name|test("\\.deb$")) | .browser_download_url'` ``` -------------------------------- ### Create Executable with `ros build` Source: https://roswell.github.io/Reducing-Startup-Time.html Use the `ros build` command to convert a Roswell script into a standalone executable. This significantly reduces startup time compared to running the script directly. ```shell $ ros build fact.ros [undoing binding stack and other enclosing state... done] [saving current Lisp image into fact: writing 4976 bytes from the read-only space at 0x20000000 writing 3168 bytes from the static space at 0x20100000 writing 52330496 bytes from the dynamic space at 0x1000000000 done] ``` -------------------------------- ### Configuring Multiple Lisp Implementations in .travis.yml Source: https://roswell.github.io/Travis-CI.html This snippet shows how to use `env.matrix` in .travis.yml to specify multiple Common Lisp implementations for testing. Travis CI will create a separate build for each listed implementation. ```yaml +env: + matrix: + - LISP=sbcl-bin + - LISP=ccl-bin + - LISP=abcl + - LISP=clisp + - LISP=ecl ... ``` -------------------------------- ### Initialize a Roswell Script Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html Use `ros init` to create a new Roswell script. The generated script includes a shell header that executes Roswell. ```shell $ ros init Usage: ros init [template] name [options...] $ ros init fact Successfully generated: fact.ros ``` -------------------------------- ### Add MKCL to Makefile.am Source: https://roswell.github.io/Support-New-implementation.html Update the `Makefile.am` in the `src` directory to include `cmd-run-mkcl.c` in the list of source files. This ensures the new implementation's source file is compiled. ```diff diff --git a/src/Makefile.am b/src/Makefile.am index 534e4a2..fbae016 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,7 @@ ros_SOURCES = ros.c opt.c download.c download_windows.c archive.c archive_window register-commands.c html.c html-sbcl-bin.c \ $(ros_utils) \ cmd-internal.c cmd-script.c \ - cmd-run.c cmd-run-sbcl.c cmd-run-ccl.c cmd-run-clasp.c cmd-run-clisp.c cmd-run-ecl.c cmd-run-abcl.c cmd-run-cmu.c cmd-run-acl.c \ + cmd-run.c cmd-run-sbcl.c cmd-run-ccl.c cmd-run-clasp.c cmd-run-clisp.c cmd-run-ecl.c cmd-run-abcl.c cmd-run-cmu.c cmd-run-acl.c cmd-run-mkcl.c \ cmd-install.c install-sbcl-bin.c install-sbcl-bin_windows.c if WITH_WIN_ICON ``` -------------------------------- ### Configure Emacs for SBCL with .sbclrc Source: https://roswell.github.io/Initial-Recommended-Setup.html This configuration allows launching SBCL with a specific .sbclrc file using Roswell. ```emacs-lisp (setq inferior-lisp-program "ros -L sbcl -Q -l ~/.sbclrc run") ``` -------------------------------- ### Display Roswell Commands Source: https://roswell.github.io/Home.html Run 'ros' without arguments to see a list of available commands and their usage. ```bash $ ros Common Lisp environment setup Utility. Usage: ros [options] Command [arguments...] or ros [options] [[--] script-path arguments...] commands: run Run repl install Install a given implementation or a system for roswell environment update Update installed systems. build Make executable from script. use Change default implementation. init Creates a new ros script, optionally based on a template. list List Information delete Delete installed implementations config Get and set options version Show the roswell version information Use "ros help [command]" for more information about a command. Additional help topics: options Use "ros help [topic]" for more information about the topic. ``` -------------------------------- ### Configure ASDF for Windows Users Source: https://roswell.github.io/Initial-Recommended-Setup.html On Windows, you may need to create this ASDF config file to help Atom find Lisp software. Adjust the path to match your system. ```lisp (:source-registry (:tree "/Users/your-name/.roswell/lisp/quicklisp/dists/quicklisp/software/") :INHERIT-CONFIGURATION) ``` -------------------------------- ### Upgrade Roswell using Makepkg (Archlinux AUR) Source: https://roswell.github.io/Upgrading-Roswell.html Update Roswell on Archlinux by downloading the new PKGBUILD file and running makepkg. ```bash makepkg -i ``` -------------------------------- ### Check and Set Default Lisp Implementation Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Verify the currently active Lisp implementation with 'ros run -- --version' and change the default using 'ros use [impl/version]'. ```bash $ ros run -- --version # check which implementation is used ``` ```bash $ ros use sbcl/1.2.3 # change the default implementation ``` -------------------------------- ### Build a self-contained executable from a script Source: https://roswell.github.io/Building-images-and-executables.html Create a self-contained executable binary from a Roswell script using `ros build` (an alias for `ros dump executable`). The executable implies `--restart main`. Specify the output file with `-o OUTPUT`. ```shell ros build my-script.ros -o my-executable ``` ```shell ros build my-script.ros ``` -------------------------------- ### Configure Emacs for SLIME Source: https://roswell.github.io/Initial-Recommended-Setup.html Add these lines to your init.el file to load Roswell's Emacs helper and set the inferior Lisp program. This configures Emacs to use Roswell for running Lisp. ```emacs-lisp (load (expand-file-name "~/.roswell/helper.el")) ``` ```emacs-lisp (_setq_ inferior-lisp-program "ros -Q run") ``` -------------------------------- ### Push Release to Repository Source: https://roswell.github.io/Release-Roswell.html After committing, use this command to push the release to the remote repository. Follow the on-screen instructions for the exact push commands. ```shell make release-push ``` -------------------------------- ### Upgrade Roswell using Yaourt (Archlinux AUR) Source: https://roswell.github.io/Upgrading-Roswell.html Use the yaourt package manager to update Roswell on Archlinux. ```bash yaourt -Sua roswell ``` -------------------------------- ### Compilation with Nix Source: https://roswell.github.io/Installation.html Compiles Roswell using Nix, ensuring necessary build tools like autoconf, automake, and curl are available. ```bash sh nix-shell -p autoconf automake curl --command 'sh -c "./bootstrap && ./configure && make"' ``` -------------------------------- ### Activate Container-Based Infrastructure in Travis CI Source: https://roswell.github.io/Travis-CI.html Set `sudo: false` to use Travis CI's faster container-based infrastructure. This configuration is compatible with `sbcl` and `ccl`. ```yaml language: common-lisp -sudo: required +sudo: false env: global: - PATH=~/.roswell/bin:$PATH + - ROSWELL_INSTALL_DIR=$HOME/.roswell matrix: - LISP=sbcl-bin - LISP=ccl-bin install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh script: - ros -s prove -e '(or (prove:run :quri-test) (uiop:quit -1))' ``` -------------------------------- ### Travis CI Configuration with run-prove for Coveralls Source: https://roswell.github.io/Coveralls.html This configuration uses the `run-prove` command for testing and integrates with Coveralls. It sets a COVERAGE_EXCLUDE environment variable to exclude specific directories from coverage. ```yaml language: common-lisp sudo: required env: global: - PATH=~/.roswell/bin:$PATH + - COVERAGE_EXCLUDE=t/ matrix: - LISP=sbcl-bin COVERALLS=true - LISP=ccl-bin - LISP=abcl - LISP=clisp - LISP=ecl matrix: allow_failures: - env: LISP=clisp install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh script: + - run-prove quri-test.asd ``` -------------------------------- ### Enable Directory Caching in Travis CI Source: https://roswell.github.io/Travis-CI.html Cache the `$HOME/.roswell` and `$HOME/.config/common-lisp` directories to significantly speed up build times by preserving dependencies and configurations between runs. ```yaml language: common-lisp sudo: false env: global: - PATH=~/.roswell/bin:$PATH - ROSWELL_INSTALL_DIR=$HOME/.roswell matrix: - LISP=sbcl-bin - LISP=ccl-bin install: - curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh +cache: + directories: + - $HOME/.roswell + - $HOME/.config/common-lisp script: - ros -s prove -e '(or (prove:run :quri-test) (uiop:quit -1))' ``` -------------------------------- ### Disable Core Compression during Build Source: https://roswell.github.io/Reducing-Startup-Time.html To further reduce startup time, disable core compression when building an executable using `ros build --disable-compression `. This avoids the overhead associated with decompression. ```shell ros build --disable-compression ``` -------------------------------- ### Generate Release Changelog Source: https://roswell.github.io/Release-Roswell.html Use this command to automatically generate the changelog based on commit history. Ensure your commit messages are descriptive. ```shell make release-changelog ``` -------------------------------- ### Set Dynamic Space Size for SBCL Source: https://roswell.github.io/Roswell-as-an-implementation-manager.html Configure the dynamic space size for SBCL when running a command by setting the 'dynamic-space-size' variable before the 'run' command. ```bash $ ros dynamic-space-size=400 run ``` -------------------------------- ### Add MKCL to Roswell run command Source: https://roswell.github.io/Support-New-implementation.html Modify `src/cmd-run.c` to include the new implementation name and its corresponding command function. This allows Roswell to recognize and execute the new implementation. ```diff diff --git a/src/cmd-run.c b/src/cmd-run.c index ab5f8ee..f23bffa 100644 --- a/src/cmd-run.c +++ b/src/cmd-run.c @@ -20,6 +20,7 @@ struct run_impl_t impls_to_run[]={ {"acl",&cmd_run_acl}, {"alisp",&cmd_run_acl}, {"allegro",&cmd_run_acl}, + {"mkcl",&cmd_run_mkcl}, }; struct proc_opt run; ``` -------------------------------- ### Running a Roswell Script Source: https://roswell.github.io/Roswell-as-a-Scripting-Environment.html Execute a Roswell script from the command line. The script takes arguments, which are passed to the `main` function within the Lisp code. ```shell $ fact.ros 3 Factorial 3 = 6 $ fact.ros 10 Factorial 10 = 3628800 ``` -------------------------------- ### Declare MKCL run command function Source: https://roswell.github.io/Support-New-implementation.html Add the declaration for the `cmd_run_mkcl` function in `src/cmd-run.h`. This makes the function visible for use in other parts of the project. ```diff diff --git a/src/cmd-run.h b/src/cmd-run.h index 9808b58..6ffeef7 100644 --- a/src/cmd-run.h +++ b/src/cmd-run.h @@ -22,6 +22,7 @@ extern char** cmd_run_ecl(int argc,char** argv,struct sub_command* cmd); extern char** cmd_run_abcl(int argc,char** argv,struct sub_command* cmd); extern char** cmd_run_cmu(int argc,char** argv,struct sub_command* cmd); extern char** cmd_run_acl(int argc,char** argv,struct sub_command* cmd); +extern char** cmd_run_mkcl(int argc,char** argv,struct sub_command* cmd); extern LVal register_runtime_options(); int setup(char* target,char* env); #define SETUP_SYSTEM(sys,msg) { ```