MaSH (Making Stuff Happen)

About MaSH

MaSH introduces new programmers to Java using staged subsets of the language. The system specifies several clearly specified subsets of the Java language that eliminate the boilerplate that interferes with early learning of the purely procedural aspects of the Java language and a precompiler that adds the required boilerplate to produce a working Java program. The boilerplate that the precompiler adds is specified in an auxilliary source file. Therefore programs can be created that run in diverse environments: on a console; on a robot; or in a graphical user interface.

-

Examples

Java MaSH
/*
** file:       Sum1.java
** created:    25/5/8
** author:     Andrew Rock
** purpose:    A program to read two numbers
**             and print their sum.
*/

import java.util.*;

public class Sum1 {

   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      System.out.print("Enter a number: ");
      int x = sc.nextInt();
      System.out.print("Enter a number: ");
      int y = sc.nextInt();
      int z = x + y;
      System.out.print("The sum is: ");
      System.out.println(z).
   }
   
}
/*
** file:       Sum1.mash
** created:    25/5/8
** author:     Andrew Rock
** purpose:    A program to read two numbers
**             and print their sum.
** MaSH level: statements
*/

import console;

print("Enter a number: ");
int x = readInt();
print("Enter a number: ");
int y = readInt();
int z = x + y;
print("The sum is: ");
println(z);
/*
** file:       GoUntilPush.java
** created:    25/5/8
** author:     Andrew Rock
** purpose:    A program to drive a motor until
**             a touch sensor is pushed.
*/

import josx.platform.rcx;

public class GoUntilPush {

   public static void main(String[] args) 
   throws Exception {
      Sensor.S1.setTypeAndMode(
         SensorConstants.SENSOR_TYPE_TOUCH,
         SensorConstants.SENSOR_MODE_BOOL);
      Motor.A.forward();
      while (Sensor.S1.readBooleanValue()) {
      }
      while (!Sensor.S1.readBooleanValue()) {
      }
      Motor.A.stop();
   }

}
/*
** file:       GoUntilPush.mash
** created:    25/5/8
** author:     Andrew Rock
** purpose:    A program to drive a motor until
**             a touch sensor is pushed.
** MaSH level: statements
*/

import rcx;

setUpSensor(1, TOUCH);
motorForward(A, 7);
waitForPush(1);
motorStop(A);
Degugger window for Hanoi.mash

-

Downloads

Binary bundles

All you need to download if you're a student. Pick the one for your operating system.

platform GHC version package date
Windows 32-bit 7.8.3 mash-windows.zip 2015-02-22
Mac OS X (Snow Leopard or later) 10.10.2 7.8.3 mash-mac.zip 2015-02-22
Ubuntu (10.04) Intel 7.8.3 mash-linux-i386.zip 2015-02-22

Documentation

-

License

MaSH is available for use and modification under the terms of the GNU General Public License, version 2. That means any student or teacher can download and use this software for free, though there's no guarantee that it's going to work or be useful. The source code is provided, and you may modify it. Teachers are especially encouraged to develop new MaSH environments.

If you do find MaSH useful, please let me know, and I'll let you know about MaSH developments.

If you find a bug or deficiency in the MaSH tools or environments, let me know. (I'm not implying that the bugs will be fixed on any timescale that will suit you.)

-

MaSH Online

Try MaSH Online.

-

Log of recent changes

2015-02-22

Code clean-up and maintenance.

console2 environment deleted.

2014-07-30

console2 environment added.

2014-06-21

javaj implemented.

2014-06-18

MaSH Online completed.

2014-06-17

Made the debugger window slightly bigger.

Made it easier to find the downloads that matter.

More math methods added to all environments except RCX.

2014-06-14

mashj tool complete.

2014-06-08

All MaSH Haskell modules compile without any warnings.

2013-06-03

Added atan2 to all environments.

2012-05-25

nxt documentation fix.

2012-03-05

nxt environment bug, affects motor selection, fixed.

2012-02-07

mashn.bat fixed for Lejos_NXT-0.9.

Last modified Sun Feb 22 15:31:00 AEST 2015 by Andrew Rock.