AHHH: a programming language for the dreadful

Overview

AHHH: a programming language for the dreadful

Screaming into the Void but make it Turing Complete

AHHH is an esoteric programming language inspired by the all-consuming dread induced by programming.

SpoOoOoOoKy

Programming languages can shape everything about an algorithm, from its speed, effiency, and modularity all the way down to its aesthetics. In that vein, I wanted to write a programming language that was an absolute bitch to use. Just the absolute worst. A miserable experience for everyone involved. I think - in that goal - I have succeeded. Good luck...

Setup

To compile the interpreter, run:

g++ -Wall interpret_ahhh.cpp -o AHHH

Then, to run files, just call the executable with:

./AHHH file.ahhh

If you aren't using linux you either:

  1. already know how to compile c++ code on your machine, or
  2. should probably use an IDE. Here's a pretty good guide.

I've provided a number of demo files:

  • fib.ahhh
    • Explicitly generates the first ~46 Fibonacci numbers. I stopped at 46 because any larger yields overflow, since I'm using c++ ints. I could fix that, but I won't.
  • fib_inf.ahhh
    • Loops through infinitely many Fibonacci numbers. It overflows basically immediately, but the implimentation is kind of cool (and well documented).
  • hello_world.ahhh
    • You know I had to do it to 'em.
  • hello_world_expanded.ahhh
    • You know what it does, and now you know why. Same program, just with documentation.

The expanded hello world program is only 150 lines of code, but in condensed form is actually quite simple:

AHHHHhhHHHhHHHHhHHHhHHhHHHhHHhhHHhhHHhhHHhhHHhhHHhhHHhhHHhhHhHhhHhhhhhhHHhhHHHhHHHHhHHHhHHhHhHHhhHhhhHhhHhHhHhHhHhHhHhhhhhhHhHhhHhhHHhhHHhhHHhhHhHhhHhhhhhhHhHhhhHhhHhhhhhhHhHhhhHhhHhhHHhhHHhhHHhhhhhhHHhhHHHhHHHHhHHHhHHhHhHhHHHhhHhhHHHhHHHHhHHHhhHHHhHhHHhHhHhHhHhHhHhHhHhhhhhhHHhhHHHhHHHHhHHHhHHhHHhhhhhhHHhhHHHhHHHHhHHHhHHhHHHhHhHhHHHhhHhhHHHhHHHHhHHHhhHHHHHhhHhhHHHhHHHhHHHhHhHHHhHhHHhHhHhhhhhhHhHhhHhhHHhhHHhhHhHhhHhhhhhhHhHhhhHhhHhhHHhhHHhhHHhhhhhhHhHhhHhHhHhHhHhHhhHhhHhhhhhhHhHhhHhHhHhHhHhHhHhHhHhHhHhHhHhHhHhHhHhhhhhhHHhhHHHhHHHHhHHHhHHhHHhhHHhhhhhh!

If there's a glaring problem you want me to know about or you otherwise feel strongly inclined, feel free to bug me at [email protected] or yell at me on Twitter @KyleMorgenstein.

Language Mechanics

The language is pretty simple and is heavily based on COW. There's 16 (+2) commands, which are all the capitalization permutations of hhhh to HHHH. The start key is AHHH. The AHHH language has a memory head (pointer) which can be moved along a tape of memory. There are also two registers that values can be read/written from. Anything that isn't a command is a comment. See fib_inf.ahhh or hello_world_expanded.ahhh for examples of comments/documentation.

The commands are as follows:

Code Command Function
0 hhhh Searching in reverse, skip the first preceding command, and then jump back to matching HHHH command and begin execution from that HHHH command (end loop).
1 hhhH Move the pointer right one cell.
2 hhHh Move the pointer left one cell.
3 hhHH Print the current memory cell as an integer.
4 hHhh If Register 1 is empty, copy the current memory cell to the register. Otherwise, write the Register 1 value to the current memory cell.
5 hHhH If Register 2 is empty, copy the current memory cell to the register. Otherwise, write the Register 2 value to the current memory cell.
6 hHHh Add the current memory cell to the value of Register 1 and store the sum in Register 1. The memory cell is unchanged.
7 hHHH Add the current memory cell to the value of Register 2 and store the sum in Register 2. The memory cell is unchanged.
8 Hhhh If the current memory cell is nonzero, print the cell as an ASCII character. Otherwise, read in an ASCII character from the console.
9 HhhH Increment the current memory cell by one.
10 HhHh Decrement the current memory cell by one.
11 HhHH Read in an integer from the console and store it in the current memory cell (overwrites current cell).
12 HHhh Set the current memory cell to zero.
13 HHhH Double the value of the current memory cell and store it in the current memory cell.
14 HHHh Square the value of the current memory cell and store it in the current memory cell.
15 HHHH If the current memory cell is nonzero, continue to the next command. Otherwise, skip one command, and then skip ahead to the next matching hhhh command (begin loop).
16 AHHH Start program.
17 hhh! Print new line (useful after printing ASCII characters, which otherwise don't print a new line).

As you can see, this language sucks. You won't enjoy it. I think it's pretty funny, which is an accomplishment given the number of brain cells I've killed trying to get this to work. Hopefully you think it's at least passively amusing too. If not, idk, go scream about it or something.

You might also like...
A programming language made in C

1. Fang A programming language made in C 1.1. Meaning Fang stands for "Feline Language". In hopes of it being cool like a cat! On top of it, you can b

Pandex is a light but FAST programming language written in C . Pandex goal is that be hard & it's good for eductional goals

The Pandex programming language version 1.0.0.3 Pandex versions release type The Pandex version has four numbers. the first number holds 1 ( or 0 in s

Arobase is a simple programming language with a c-like syntax.
Arobase is a simple programming language with a c-like syntax.

Arobase Arobase is a simple programming language with a c-like syntax. Requirements gcc gas (gnu as) ld A 64 bits linux distribution (generated assemb

C+- is a personal project trying to make a programming language.
C+- is a personal project trying to make a programming language.

C+- A personal project trying to be a programming language with close resemblence to C/C++ (probably gonna fail at that).

Simple String_View implementation for C programming language.

Simple String_View implementation for C programming language.

🧠 An esoteric programming language based on Brainfuck

------------------------ aaa PROGRAMMING LANGUAGE ------------------------ aaa is an esoteric programming language based on Brainfuck ---------------

An open-source general-purpose programming language
An open-source general-purpose programming language

An open source general purpose high-level programming language! [OO-N-YUH] This language is gonna onya other languages Vs Code Extention Language Supp

Programming language that compiles into a x86 ELF executable.

ocean Programming language that compiles into a x86 ELF executable. The main goal at the moment is to create a C compiler, which can atleast compile i

HuTao programming language

HuTao HuTao编程语言,名字来源于往生堂第七十七代堂主 - 胡桃。 Programming language HuTao. The name is inspired from the 77th Director of the Wangsheng Funeral Parlor - Hu Tao

Comments
  • [Need help] Trying to implement fibonAHHHchi !!!

    [Need help] Trying to implement fibonAHHHchi !!!

    Hi, I'm trying to learn AHHH as my new programming language to implement linux from scratch. And I've implemented fibonacci but got some runtime error. Need help to understand what I'm doing wrong.

    AHHH
    HhhHhhhHHhhHhhHhhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhHhhHhHHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhH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
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHhhHhHhHhhhhHhhHhHhhHHhHhhhhhHhHHh
    hHhHhHhhhhHhhHhH
    

    Me reading the source code!

    opened by sharkbait2 2
  • Potential Loop Bug

    Potential Loop Bug

    When two HHHH commands are adjacent, because the first one skips the second, an error occurs since the interpreter believes that the loop brackets are unmatched. For example,

    AHHH
    HHHH
    HHHH
    hhhh
    hhhh
    

    throws an error. Is skipping the first command after each bracket intentional? It seems to do nothing except introduce problems when the following command is either HHHH or hhhh. I think it would make more sense to remove that functionality.

    opened by bangyen 2
Owner
Kyle Morgenstein
NASA JPL, PhD Student @ UT Austin working on legged odometry, locomotion, extreme terrain navigation, perception, and controls for legged robots. Previously MIT
Kyle Morgenstein
PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.

PLPv2b PLP Project Programming Language Programming Language for projects and computer science and research on computer and programming. What is PLP L

PLP Language 5 Aug 20, 2022
StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that of JavaScript's and TypeScript's

StarkScript StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that

EnderCommunity 5 May 10, 2022
frost is a programming language with a focus on low-friction systems programming.

❄️ frost frost programming language About frost is a programming language with a focus on low-friction systems programming.

null 4 Nov 12, 2021
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Wren is a small, fast, class-based concurrent scripting language Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a fami

Wren 6.1k Dec 30, 2022
Competitive Programming - Programming👨‍💻 Questions on BinarySearch💻, LeetCode💻, CodeChef💻, Codeforces💻,DSA 450

?? Hacktoberfest2021 ?? This repository is open to all members of the GitHub community. Any member can contribute. Contribute according to the steps g

Anupam Kumar Krishnan 201 Jan 7, 2023
J is an array programming language

J: From C to C++20 J is an array programming language created by Ken Iverson and Roger Hui (see image below).

Conor Hoekstra 37 Oct 28, 2022
A minimal viable programming language on top of liblgpp

This project aims to implement a minimal viable programming language on top of liblgpp. setup The project requires a C++17 compiler, CMake and liblgpp

Andreas Nilsson 73 Jun 28, 2021
A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language.

Fastcode A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language. FastCode is a procedural/str

null 28 Aug 19, 2022
Loop is an object oriented programming language

Loop Loop is an object oriented programming language. How do I build and run loop? Make sure, you installed the requirements for clang and make: Debia

Loop 24 Aug 9, 2021
C implementation of the Monkey programming language.

Development of this interpreter continues here: dannyvankooten/pepper-lang C implementation of the Monkey programming language. Bytecode compiler and

Danny van Kooten 24 Dec 30, 2022