Home

Software

Old Software

Downloads

about the author
contact

colophon

Software /
setlX

setlX

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)

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):
    1. Press [Win]+[Pause] key combination to open system preferences.
    2. 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.
    3. Click on ‘Environment Variables’ on the bottom, which opens another window.
    4. Select the ‘Path’ variable in the ‘System variables’ section and click on ‘Edit...’, which opens jet another window.
    5. 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

    6. Accept all changes by clicking ‘OK’ in all windows you opened before.
    7. 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

(click the image to show a higher quality version)

Interesting SetlX related projects

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

Limitations

  • Due to its implementation and execution by the Java Virtual Machine (JVM), an "out of memory error" might be encountered when executing SetlX programs using deep recursion, very large or very many sets and/or lists.
    The JVM is only able to dynamically increase its memory allocation in very limited bounds, no matter how much free memory is available. To work around these problems, edit the used launching script (‘setlX’ or ‘setlX.cmd’) with a text editor and follow the directions given at the top of the script.
  • On UNIX (-like) systems, the prompt in interactive mode does not handle control sequences correctly. This is a Java limitation and no good platform independent solutions are available. You may install the ‘rlwrap’ program to work around this issue. If present, it will be used automatically.

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
 + add statistics library by Leon Mutschke and Jonas Siefker

---v2.6.1--- 2017-04-08
 + add la_hadamard(matrixA, matrixB) procedure
 # fix sorting with different number types: sort([1, 3, 2.0, 4.0])

---v2.6.0--- 2017-01-08
 + multiplication of matrix and vector will result in a vector instead of a matrix
 + the <==> operator is now a viral operation when terms are involved
                        

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.


  • This application does not access your data automatically.
  • This application does not access your contacts, messages, location, eMails, etc.
  • This application does not collect or transmit device identification data.
  • This application does not collect or transmit telemetry.
  • This application does not track the users actions in any way.
  • This application does not include advertisement and does not transmit any data to advertising companies.
  • This application does not automatically send or receive data via any kind of network or the internet.
  • In case you are using the Google Play Store to install the Android version, then Google itself will collect various statistics about you and your device.
    Be aware that Google does not respect your privacy in any way, shape or form, even if they pretend they do.