From: tm@netcom.com (Toshiyasu Morita)
Subject: ANNOUNCE: Kyoto Modern Language for Atari 2600/6502 machines
Keywords: Kyoto Modern Language Atari 2600 6502
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Fri, 18 Dec 1992 10:32:15 GMT

Due to the large number of people requesting Atari 2600 
programming tools we've done a port of Kyoto "Modern 
Language" version 6.7 for the 6502.
 
Kyoto Modern Language is a language developed by the 
University of Kyoto (of Kyoto Common Lisp) designed to 
produce highly optimized object code for modern microprocessors.
Kyoto Modern Language has been in production use since 1985, 
and has been widely accepted in the microcontroller industry to 
produce the smallest, fastest code possible.
 
Kyoto Modern Language (hereafter "Kyoto ML" for brevity)
is a very small, simple language consisting of only 56 commands.
The compiler is highly optimized and very small (under 5,000 lines)
and compiles over 50,000 lines per second on a lightly loaded Sun-3.
 
Here are some sample benchmarks comparing Kyoto ML with GCC 2.2.2
on the 6502:
 
   Benchmark:     KML -O5clae  GCC 2.2.2 -O2 (--host=sysvr3, --target=apple2)
 
    Sieve            8.64         10.42  (times in seconds)
    Bubblesort       4.33          5.88
    BitBLT          14.82         17.91
 
    Ghrindstone     6,342         2,311  (iterations)
    Khrackstone     5,261         2,745
                        
 
As you can see, Kyoto ML outperforms GCC for the 6502 on all 
benchmarks. Kyoto ML's massive loop optimization produces 
especially spectacular results on loop-intensive benchmarks
such as the Ghrindstone and Khrackstone.
 
Kyoto ML uses a highly experimental parsing technique 
(LALR with fuzzy lookahead) and to reduce the token lookup 
time all tokens have been reduced to two printable character, 
and all variable names are required to be four characters.
In addition, all variable names are required to be written in 
reverse double-character order. Although these limitations may
seem quite severe we've found the compilation performance 
increase (typically over 50x) to be well worth the somewhat
cryptic appearance of the source code.
 
As a sample of Kyoto ML, "a9" is the command to load scratchpad
variable 1 with a constant value. To store the scratchpad 
variable 1 value in a storage variable, use the command "8d".
To do an indexed store with scratchpad variable 2, use the command "9d".
 
So, to move 256 bytes from array BEEF to FEED, use
 
a2 00     <- initialize scratchpad location 2 to 0
bd ef be  <- load scratchpad location 1 with *(BEEF + scratch2)
9d ed fe  <- store scratchpad location 1 at *(FEED + scratch2)
ca        <- decrement scratchpad location 2
d0 f7     <- if previous operation was nonzero then branch to 
             2nd function call.
60        <- return() command
 
Since Kyoto ML produces such fast code it is often necessary 
to degrade performance of the resulting executable, and command
which inserts a NOP (no-operation) into the object code (ea) is available.     
 
In addition, our port of Kyoto ML also supports all variants of 
the 6502, including the standard MOS Technology 6502, the 
Rockwell 6502 (use -Rockwell, supports BBS, BBR, etc) and the
Western Design Center 6502 (use -WDC, supports PHX, PLX, PHY, PLY, etc).
 
The 6502 port of Kyoto ML is currently available at 123.79.55.29
(ftp.kuruteru.kyoto.edu) in pub/languages/KML/cpu6502. If you 
are unable to connect to ftp.kuruteru.kyoto.edu please be patient,
because sometimes our ftp server is quite heavily loaded.
 
 
For more information on Kyoto ML please send email to
"kml-request@hitsukoi.kyoto.edu".


Newsgroups: rec.games.video