HAL+HTK = HAUL1
HotKey's Average Language and HAL Translation Kernels
HAUL1 consists of the language HAL (HotKey's Average Language) and HTKs (HAL Translation Kernels) which can translate that HAL language into other scripting languages.
HAUL1 can also translate its own source code, which makes things really mind boggling...
Oh, and it comes with ShadowRunner, a simple VM that is written in HAL and which can be programmed for using HAL. A nice strange loop, don't you think?
The whole thing is kept very simple. It kind of combines the worst of PHP and Assembly in one package - a nightmare to program in. Well, it was just a proof of concept. ;-)
Features and Limitations
- "Flat" translation: no lexer, compiler or AST - just a simple text-translator
- First word in each line is always the command, followed by tab separated parameters
- Written in PHP :-(
- Some kind of structure/state while parsing (instructions, expressions, ...), but no "understanding" of the code
- OOP (HTKs are classes)
- Sample Code: "shadowRunner" - a small VM
- "HYBERnation" - Programs can store their state across translations!
- Goodie: SR1 can convert HAL to shadowRunner byte code!! "YO DAWG! I HEARD YOU LIKE POLYMORPHISM..."
- Works great for what it does!
- roughly 600 lines (12kb) per translation kernel
- Language is really ugly (an "assembler php hate child") - no nested expressions, looks repetitive, generally unpleasant to code in.
- Needs a boot-strapper to initially translate itself to an executable language (translateOnce.php)
- limited syntax (assembler like - the worst quirks of all output languages combined!)
- parsing is a bit messy, since we have no syntax tree
- Can only output languages that are similar in their syntactic structure (PHP, Python, JS, VBS, ...)
Maybe some sort of syntax tree is not bad after all... Especially for binary output.
- Write your code in HAL (see
- Pick an output language (JS, PHP, VBS, SR), see
src.hal/htk_*.halfor a selection
run_deploy.phpto translate the HTK for your desired language to PHP and invoke it on your own source file. This results in your source file being translated to any of the destination languages.
run_shadowRunner.phpto translate your source to ShadowRunner byte code and run it inside a ShadowRunner VM on the desired target platform.