H++

From Esolang
Jump to navigation Jump to search

H++ is an esolang by User:Fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff in 2025. The language about determining if a code snippet will halt.

Declaration

A declaration has the form:

name { code }

where name is the name of the function, while code is a list of statements separated by semicolons.

Statements

Function Calls

A function call is just a simple identifier followed by a semicolon.

Conditional statements

A conditional statement has the form

if (cond) { code }

where cond is either a simple name, or many conditions separated by && or ||. Note that || has more precedence than &&.

A simple name evaluates to true if the function with that name always goes into an infinite loop, and false otherwise.

I/O Statements

An output statement has the form:

print string;

where string is a quoted string.

I/O Functions

cat

The cat function reads a line from input and outputs it.

char

The char function reads a single character and outputs it.

Execution

When the program starts, the main function is run.

Examples

Hello, World!

main {
  print "Hello, World!";
}

Cat Program

main {
  cat;
}

One Time Cat

main {
  char;
}

Infinite Loop

main {
  main;
}

Computability

The programming language is computable, because the program cannot negate its own result. For example, the argument used in the Halting problem would not work, because something like this is impossible:

main {
  if (!main) {main;}
}

Because of this, all functions can be determined by defaulting recursive values to false.

For example, this could be determined:

main {if (main && true) {main;}} true {true;}

By saying that main is false, the if branch would not execute, so that program would halt, which is correct, since main is assumed as false.