Mittwoch, 5. Dezember 2007

Use of AsciiMASH Dynamic Link Library (DLL) with Mono/Linux

Because of the binary compatibility from Mono to Microsofts .NET Framework is it also very simple to be used the AsciiMASH Dynamic Link Library by Mono with Linux. At first you have to copy the DLL to the local user folder on your Linux system (using of a USB stick is recommend). Next you create a simple text document (for example with gedit) like the following example and stores it into the same folder as the AsciiMASH DLL with the name Sample.cs.

using System;
using AsciiMASH;

class Sample
{
   static void Main(string[] args)
   {
      string Code = "65[:+]91";

      AsciiMASH_Interpreter AI = new AsciiMASH_Interpreter();
      AI.Run(Code);
   }
}


Open a terminal program (change into the local user folder if not happened) and execute the following command line.

mcs Sample.cs -out:Sample.exe -r:AsciiMASH.dll

Now the upper example source code will be compiled and it creates an executable file with the name Sample.exe. To start the AsciiMASH interpreter, Mono with the parameter of the executable file name must start - the whole alphabet is print on the screen.

mono Sample.exe

Montag, 26. November 2007

AsciiMASH language specification 1.0.0 released

AsciiMASH is of Brainf*** and Befunge inspired socalled esoteric programming language and is well suitable to learn the basics of the computer engineering and can lead to the improvement of structural thinking. Basis of AsciiMASH is the right and left shifting of a pointer on a modifiable linear data field. With its efficient instructions is it very simply to write compact and solution-oriented programs, often with only one program line.

Here the "Hello World" example: "Hello world!"0'[:>]

21 instructions are available at the current language specification 1.0.0:


Download the instruction document here.

Feature list:
- Interpreter language (no compiling time necessary)
- Loops constructions with arbitrary condition values
- To Brainf *** improved ALU (arithmetic-logical unit)
- Stack-oriented (256 bytes large push-pop stack)

Other examples of AsciiMASH:

1. Prints the alphabet (A-Z)
    65[:+]91
2. Division (225 by 13) with residual value computation (MODULU function)
    225_>0#>13_'/_>>*_<=
3. Prints the first 54 prime numbers (Sieve of Eratosthenes):
    '2>2[_>254/-[<_<#>_<~>>-]<+_<0#>]128'2>0[['%+>>0#]<+<_>>0#-.32:<]54

Download the Dynamic Link Library (DLL for console application) for .NET 1.1 and .NET 2.0.

Download sample projects for Visual Studio 2005 and SharpDevelop 1.1