| Author: | Sam Clippinger <samc_freesoftware (at) silence (dot) org> | ||||
| Copyright: | Sam Clippinger | ||||
| License: | GNU GPL | ||||
| Current version: |
20030211 source 20030211 binaries |
Archived versions: |
Source packages Binary packages |
Documentation |
README Integrators start here Scripters start here (EBNF) |
| Dependencies: | None | ||||
| Build target: | Importable JAR file | ||||
| Source language: | Java | ||||
| Build environment: | Java JDK 1.2.0 or better | ||||
| Description: |
SMUSHcode started life in 1997 as a term project for a "Compilers and
Translators" class.
Originally written in C++, it was conceived as a functional (as opposed to
procedural) scripting language. After the class was over, it was reimplemented
in Java as a good way to learn a new language. It exists now as a solution
without a problem -- it works great and is very extendable, it just isn't
currently needed for anything.
Currently, the examples and the EBNF are a new SMUSHcode programmer's only way to learn the language. The API documentation is amazingly thorough (a good way to learn javadoc, no?) but for some reason refers to the language as "SMUSHcode75". The reasons for the "75" are long lost in the misty past... SMUSHcode is a functional scripting language that any LISP or Scheme hacker would have no problem picking up quickly (whether they would want to is a different issue). Most newer and/or self-taught programmers are not familiar with the idea of a functional language, so in a nutshell it is this: Everything is a function. Every function returns a value. Functional languages do not encourage the concept of "Do A. Do B unrelated to A. Do C unrelated to A or B." (that is procedural programming). Functional programming instead follows the model of "Do A, then use A's result to do B, then use B's result to do C.". To give a better example, a procedural language might evaluate the Pythagorian theorem thus:
A functional language would evaluate it thus:
Curiously, the author had never studied functional programming and only learned
Scheme one semester after designing SMUSHcode. It seemed oddly
familiar...
This project's GNUmakefile is also interesting; it was written before the Ant project was available. Using GNU make, it dynamically explores a package structure, rebuilds class files as necessary, runs javadoc and creates JAR files. It is documented and easy to customize. |
||||