# S.P.A.D.E S.P.A.D.E stands of Simple Programming And Debugging Environment. It contains a simple programming language and a built-in Terminal based IDE. The following is a small spade program that draws a bunch of random circles in red color, in an SDL window. ``` graphicswindow(400, 400, true) setcolor(255, 0, 0) for i = 1 to 100 circle(random(10, 300), random(10, 300), random(10, 40)) endfor render() ``` The entire language and function reference is available in the IDE in an easily searchable way. Press F1 or use the help menu to access it. ### IDE Demo Some short screen recordings of SPADE IDE and programs are listed below. [Hello world!](https://vimeo.com/835322221) [Draw a bunch of random circles](https://vimeo.com/835319686) [List all files in a directory](https://vimeo.com/835324278) [Paratrooper (game) clone attempt](https://vimeo.com/835347764) ### Installing ##### Run from a portable binary. If you are on Linux then you can, 1. Download the appimage executable from [here](https://sras.me/releases/spade.run) 2. Make it executable using `chmod +x spade.run` 3. Run it using command `./spade.run`. If you get an error mentioning a requirement for 'FUSE', you can extract the program from the app image and run it as shown below. ``` ./spade.run --appimage-extract ./squashfs-root/AppRun ``` #### From source To install depdendencies: ``` apt-get install libsdl2-dev libsdl2-mixer-dev \ libsdl2-ttf-dev \ libsdl2-gfx-dev \ libtinfo-dev ``` You will need the `cabal` tool. Once you have either of these, running `cabal install spade` will install it for you. Or you can download the source package, '.tar.gz' file from hackage, and again use cabal or stack tool to build and install it. After extracting the source to a folder, running either of the following commands in the folder should build and install it. ``` cabal build && cabal install ``` ``` stack build && stack install ``` #### Building on Raspberry PI You should be able to install this in a Raspberry Pi 3 or later iterations. The following steps appear to work for a succesful build on a Raspberry Pi 3. 1. Install GHC version 9.0.1 following steps described https://www.haskell.org/ghc/blog/20200515-ghc-on-arm.html 2. Install `stack tool` using `apt-get install haskell-stack` 3. Increase the swap space to 2GB, disable GUI by booting into terminal mode, and then build the program using `stack build --system-ghc`. Depending on your setup, the initial build can take a very long time, like a couple of days. ### Getting started The program should be started by providing a file name. For example, ``` spade /tmp/temp.spd ``` If the file does not exist, it will be created on save. If it exist then contents will loaded into the editor. Other than this are no provisions to select or open a file from within the IDE. The user is supposed to only work with a single file at one time. To interpret a spade program without starting the IDE, you can use the `run` command. ``` spade run /tmp/temp.spd ``` Some sample programs should be available [here](https://hackage.haskell.org/package/spade/src/samples/) Will execute the program without opening the IDE. ### Reporting bugs/issues Please use the issue tracker [here](https://bitbucket.org/sras/spade/issues).