Designed by Mike Taylor, beginning Tuesday 24th August 1999
Copyright © Mike Taylor, 1999.
This document may be freely redistributed provided it is not modified in any way. Specifically, the authorship must remain clear. All feedback is extremely welcome, and should be emailed to the author at mike@tecc.co.uk.
This is the home page of ETA, the programming language that not only resembles natural language, but can resemble whatever specific natural language you want (with the exception of those that require non-Latin characters: apologies to Chinese and Japanese programmers.)
ETA is the language in which:
No heat: "hello.eta", written by Mike Taylor ** FUNGICIDE ** -- Fungus calendar -- CURTSEY: Fungal toe! Fungal toe! Fungal hoe! -- (Burnt programmer nucleus) Ooooooo! CRUDDY 2nd TOE: Nine(!) fungal hyaena toe5! Dungy alfalfa, penalty superlunary -- Oh, blubber! Ooooooo!
... prints the classic message, ``Hello, world!''.
Here you will find everything you need to start programming in ETA: a comprehensive specification for ETA, and for its assembler, EAS; sample ETA and EAS programs; and interpreters that will enable you to run ETA programs and compile EAS programs into ETA.
In time, I hope an ETA user-community will grow up, contributing to the ETA standard library (see below), and writing programs of terrifying elegance and beauty to meet the challenges described in the ETA manual. In the meantime, all feedback should be emailed to the author (address above).
The following sample programs are available:
hello.eta | The classic ``Hello, world!'' program. |
hello2.eta | An alternative implementation of ``Hello, world!''. |
pip.eta | Copy standard input to standard output. |
pip2.eta | A smaller copy-input-to-output program. |
fact.eta | Print the recursively-calculated factorial of the number on the standard input stream. |
bottles.eta | Print the lyrics to ``99 Bottles of Beer on the Wall''. |
crlf.eta | Test whether the interpreter handles CR/LF sequences correctly. |
The following sample code is available:
Standard Library Functions (see the EAS manual, chapter 5: The Standard Library) | |
multiply.eas | Function to multiply two numbers together by repeatedly adding one of them to an initially-zero accumulator. (Is there a more efficient algorithm?) |
writestr.eas | Variadic function to print a NUL-terminated string. |
writenum.eas | Function to print its single argument as a decimal integer. |
readnum.eas | The converse of printnum.eas: Function yielding the value of a decimal integer written to standard output. |
Miscellaneous |
|
true.eas | A reimplementation of the Unix utility /bin/true |
hello.eas | The classic ``Hello, world!'' program. |
hello2.eas | An alternative implementation of the ``Hello, world!'' program using the standard library WRITESTR function (see above). |
pip.eas | Copy standard input to standard output. |
pip2.eas | Compressed version of pip.eas, all on two lines. |
reverse.eas | Copy input to output, reversed byte-for-byte. (This is done by stacking up all the bytes of the input file, so some implementations will fail for large files.) |
fact.eas | Program to calculate factorials by defining and (recursively) calling a function, FACT; also uses the standard READNUM, WRITENUM, MULTIPLY and WRITESTR functions. |
bottles.eas | Print the lyrics to ``99 Bottles of Beer on the Wall'', using the standard WRITENUM and WRITESTR functions. |
There are two significant documents: the ETA manual describes the ETA language itself, including extensive tutorial examples drawn from the pool of sample code above. In addition, the EAS manual describes EAS, the ETA assembler, which may be used to circumvent some of the more onerous aspects of ETA programming - though the true purist will shun it. Again, example code is included, primarily from the pool above.
The documents should be read in the specified order: ETA first, then EAS.
The Reference ETA Interpreter is a Perl script, available in two forms: the master version and the compressed/obfuscated version. (Improvements to the compression/obfuscation of the latter are welcomed.)
By definition, the behaviour of the reference implementation is always correct. Whenever its behaviour differs from that if another interpreter in a area concerning which the ETA manual is ambiguous, the behaviour of the reference implementation should be emulated. (Any such ambiguities should be emailed to the author at the address above).
Harvey Thompson (harveyt@sco.COM) has written an unofficial ETA interpeter in C, which runs about thirty times as fast as the reference implementation.
EAS, the ETA assembler is another Perl script.
(By the way, I've only been writing Perl for two and a bit months, so I freely admit that the Perl code in both the ETA interpreter and the EAS assembler is probably pretty non-idiomatic. I bet you can guess I've been writing C for a decade, right? By all means point out my code's unecessary C-o-centricisms to me - I'm keen to improve my Perl.)
EAS, the ETA interpreter is a trival shell-script that invokes eas on a named EAS file, then invokes eta on the result. As a by-product, the assembled ETA file is left next to the EAS source.
ETAword is a trivial hack to find words from the system dictionary that can be incorporated into an ETA program containing a known sequence of significant characters.
ETAinst is a truly trivial hack to find the significant characters in candidate words for an ETA program. This will tell you (for example) what your name does, so that you can interpolate it in an ETA program.
If you like what you see here, you may find wish to download an entire ETA distribution: a copy of this page, the sample programs, the manuals, both versions of the reference interpreter, the unofficial interpreter, the assembler, the support utilities, etc.
Source filename: rawindex.html
Last update: Wed Sep 29 15:15:41 1999