spade: A simple programming and debugging environment.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

A simple weakly typed, dynamic, interpreted programming langauge and terminal IDE.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.0.7, 0.1.0.7, 0.1.0.8, 0.1.0.9, 0.1.0.10
Change log ChangeLog.md
Dependencies aeson, ansi-terminal, base (>=4.16.3 && <4.17), bytestring, constraints, containers, cryptonite, Decimal, directory, exceptions, file-embed, filepath, hedgehog, hex-text, hspec, hspec-hedgehog, memory, monad-loops, mtl, ordered-containers, process, random, regex-tdfa, scientific, sdl2, sdl2-mixer, spade, stm, template-haskell, terminal, text, time, unix, unordered-containers, vector, WAVE, with-utf8 [details]
License GPL-3.0-only
Copyright 2022 Sandeep.C.R
Author Sandeep.C.R
Maintainer sandeep@sras.me
Category language, interpreter, ide
Uploaded by sras at 2022-10-04T10:07:34Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for spade-0.1.0.7

[back to package description]

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.

NOTE: This is still a very early version. The standard library is virtually non existent, and those function present are the only ones that were required to write the sample programs in the "samples" folder in this repo.

IDE Demo

A short screen recording of SPADE in action can be seen here.

Installing

Linux

Run from a portable binary.

The easiest way to run spade on Linux is to download the portable executable from here. The latest release will be named spade.run. After downloading the required .run file, make it executable and run it.

chmod +x spade.run
./spade.run

The file is a self extraction archive containing most of the shared dependencies, so it should hopefully work on most of the linux distros.

From source

Dependencies

To install depdendencies:

  apt-get install libsdl2-dev
  apt-get install libsdl2-mixer-dev
  apt-get install libtinfo-dev

You can download the source package '.tar.gz' file from hackage, and 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

Will execute the program without opening the IDE.

Reporting bugs/issues

Please use the issue tracker here.