Randoom.org : Software / setlX (original) (raw)

Computers make very fast, very accurate mistakes.

In General

Overview
most recent version: 2.7.2 (changes)
release date: 2019-06-03
dependent on: Java JRE 7 (1.7) or higher
license: BSD
development state: sort of active

setlX is an interpreter for the high level programming language SetlX (set language extended).

The most distinguishing feature of this language is the support it offers for sets and lists. As set theory is the language of mathematics, many mathematical algorithms that are formulated in terms of set theory have very straightforward implementations in SetlX.

Designed mostly by Karl Stroetmann, the SetlX language is an evolution of Setl by Jack Schwartz. It was specifically conceived to make the unique features of Setl more accessible to today's computer science students.

This interpreter is currently the SetlX reference implementation. The complete code repository can be checked out at github. You may send bug reports and/or questions about setlX via e-mail to setlx@randoom.org, or via github.

Installing setlX on a Unix-like OS (Linux, MacOS X, etc.)

  1. Make sure that a Java runtime, which is compatible, is installed and working.
    You can verify this by executing:
    java -version
    inside a terminal (-emulator).
  2. Download the setlX zip file.
  3. Unzip the downloaded file into a directory of your choosing.
  4. Copy all ‘setlX*.jar’-files into some folder, which is accessible by all users, who should be able to execute setlX (e.g. ‘/usr/local/setlX/’).
    You may also copy them into the home directory of some user, when she is the only setlX-user on the system (e.g.‘/home/<user>/programs/setlX/’).
  5. Copy the contents of the default ‘setlXlibrary’ into some folder for each user (e.g. ‘/home/<user>/setlXlibrary/’).
  6. Open the ‘setlX’-script in your favorite editor (either ‘vi’ or ‘emacs’ of course).
  7. Change the contents of the ‘setlXJarDirectory’-variable to the path where you copied the jar-files, e.g.
    setlXJarDirectory="/usr/local/setlX/"
  8. Change the ‘setlXlibraryPath’-variable to the path where setlX should look for library files, e.g.
    setlXlibraryPath="$HOME/setlXlibrary/"
  9. Save and close the file.
  10. Copy the modified ‘setlX’-script into some folder, which is in the search path of all users which should be able to execute setlX (e.g. ‘/usr/local/bin’).
    When only used by one user, you may copy it into the ‘bin’ directory in her home instead (e.g. ‘/home/<user>/bin’).
  11. Make the script executable, e.g.
    chmod +x /usr/local/bin/setlX
  12. (Optional) You should also install the ‘rlwrap’ utility (see Limitations section). If present, it will be used automatically.

Installing setlX on MacOS X with homebrew

setlX may be installed easily if you use homebrew. Just follow the very short instructions by Niklas Korz at github.com/niklaskorz/homebrew-setlx.

Installing setlX on Android (4.0.4 or higher)

Get it on Google Play

If you can not use the Android Market, or do not want to, you can download the apk directly.

A deprecated version for Android 2.3.4 up until 3.2 is also available.

Installing setlX on Microsoft Windows

  1. Make sure that a Java runtime, which is compatible, is installed and working.
    You can verify this by executing:
    java -version
    inside a ‘Command Prompt’.
  2. Download the setlX zip file.
  3. Unzip the downloaded file into a directory of your choosing.
  4. Copy all ‘setlX*.jar’-files and the ‘setlX.cmd’-file into some folder, which is accessible by all users, who should be able to execute setlX (e.g. ‘C:\Program Files\setlX\’).
  5. Copy the contents of the default ‘setlXlibrary’ into some folder for each user (e.g. ‘C:\Program Files\setlX\library’).
  6. Open the copied ‘setlX.cmd’-script in your favorite editor.
  7. Change the contents of the ‘setlXJarDirectory’-variable to the path where you copied the jar-files, e.g.
    set setlXJarDirectory=C:\Program Files\setlX\
  8. 'Change the ‘SETLX_LIBRARY_PATH’-variable and set it to the path where setlX should look for library files, e.g.
    set SETLX_LIBRARY_PATH=C:\Program Files\setlX\library
  9. Save and close the file.
  10. Add the folder where you placed the files into to the search-path (requires Administrator privileges):
  11. Press [Win]+[Pause] key combination to open system preferences.
  12. On Windows Vista or newer:
    Click on ‘Advanced system settings’ on the left pane, which opens a new window.
    On Windows XP or older:
    Click the ‘Advanced’ tab in the current window.
  13. Click on ‘Environment Variables’ on the bottom, which opens another window.
  14. Select the ‘Path’ variable in the ‘System variables’ section and click on ‘Edit...’, which opens jet another window.
  15. Add a semicolon (‘;’) followed by the full path to the folder where you installed setlX to the very end of the string in the ‘Variable value’ field. The new value should look like:
    <previous value>;C:\Program Files\setlX
  16. Accept all changes by clicking ‘OK’ in all windows you opened before.
  17. End you current session and login into Windows again.

Getting started with setlX

  1. Now you can start the interpreter by executing:
    setlX
    inside a terminal (-emulator).
  2. The interpreter will launch and present you with a prompt, where you may start typing SetlX code.
    One example code-fragment would be:
    for (l in [83,101,116,108,88]) {print(char(l));}
  3. After you are done, you can leave the interpreter by typing:
    exit;
    into the interpreters prompt.
  4. You may continue by reading the in depth tutorial explaining all major features of SetlX.

Executing Files

To execute a file, start the interpreter with the path to the SetlX source file as an argument:

setlX <path>/<name>.stlx

Various SetlX code files are available, which demonstrate some features of the language.

Screenshot

screenshot of version 0.7.7

(click the image to show a higher quality version)

Once you are converted to be a true believer in the language, there are some related projects to look at:

Limitations

Disclaimer

You may distribute setlX under the terms of the BSD license.

This program uses the ANTLR parser generator, which is also licensed under the BSD license.

The functions for plotting require jfreechart, which is licensed under the LGPL license.

Change Log

---v2.7.2--- 2019-06-03

Raising 0 to the power of some negative number will result in some more useful exception

---v2.7.1--- 2018-10-15

Fix issue with parameter of setPenColor()

Unix launch script: prevent usage of rlwrap inside emacs

---v2.7.0--- 2017-10-03

---v2.6.1--- 2017-04-08

fix sorting with different number types: sort([1, 3, 2.0, 4.0])

---v2.6.0--- 2017-01-08

The full change log can be viewed here.

Downloads

Privacy statement for the Android and Java applications

This application does neither collect, process, store, nor phone-home any of your data, private or otherwise.
The only way to perform actions similar to this must be explicitly performed via SetlX-code you need to enter and execute yourself.