hlang

Version, currently master branch1 version
  • master branchlatestSep 2, 2020

github.com/marek12306/hlang

Hlang interpreter/REPL

3 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  hlang:
    github: marek12306/hlang
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
deepivin

Dependencies

Runtime Dependencies

  • readline*github: crystal-lang/crystal-readline

README

Hlang

Weird and completly useless esoteric programming language with H letter and symbols.

Features:

  • Interpreter
  • REPL
  • Translation from/into English
  • Code generation from text

Building

$ shards install
$ crystal build main.cr -o h --release

Examples

FileResult
69Prints number 69
abcdPrints letters from A to Z
abcd_loopPrints letters from A to Z in infinite loop
bruhBRUH!
fibPrints first 6 numbers of fibonacci
h_kbdPrints H if H is pressed
thinkingShows thinking emoji

Specification

  • 1 64-bit register
  • 1 stack of 64-bit integers
CharEffect
Hadds 1 to register
hsubstracts 1 from register
!prints unicode character from register
?prints number from register
,adds number from register to stack
.resets stack
_resets register
+adds all numbers from stack to register
-substracts all numbers from stack to register
*multiplies all numbers from stack to register
/divides all numbers from stack to register
<gets char input from stdin
=sets register to 1 if first item of stack is equal to second else sets to 0
(loops as many times as there are in register
)loop end
[executes code if register != 0 (simple if)
]end of if
@loop index
$Stack size
#Gets item from stack (register is index)
^Deletes item from stack (register is index)

Other characters are ignored.