The Heck Programming Language
Mashpoe (15)

The Heck Programming Language

I think the best way to demonstrate what's cool about heck is to just show some working code:

func factorial(num) {

    if (num == 1) {
        return 1

    return num * factorial(num - 1)

print("5! is:")
print(factorial(5)) // prints 120

I assume you're probably wondering what's so special about that code. It just looks like a standard scripting language; a python clone!

It's not!

Heck is an attempt to use type inference as well as other extremely smart compile-time checks to make simple code fast. Heck is a statically-typed, compiled programming language, with a one-liner hello world:

print("hello world")

The main design philosophy behind Heck is that if a human can understand your code, a computer should be able to as well. After all, the point of a programming language is to allow humans to communicate with computers more easily.

Many language features make code harder to read for humans, and others make it more tough on computers.

For example, many people believe dynamic typing is easier for humans to understand and harder for computers, because computers cannot determine data types when reading code for a dynamically-typed language, while humans can.

We believe this to be completely false. A program is only a good program if you can look through the code and quickly understand it. Most of the time, Python code is very easy to understand, and any programmer with a good amount of experience should be able to tell you the types of every variable, even though the data types aren't explicitly defined.

The only reason a computer can't tell what the types will be
is because of a few rare edge cases, such as reassigning variable types:

a = 6

if randomCondition():
    a = "hello"

# now you don't know what type "a" is, and neither does the computer :(

Heck simply removes these weird edge cases and reads through your code in two passes in order to fully understand everything that's going on:

// during the first pass,
// nothing about the function "add" is not known
print(add(5, 6))

func add(a, b) {
    return a + b

Many languages avoid interpreting code in two passes at all cost, but they only ever miss out because of this.

Looking through code in this manner allows other kinds of compile-time checks as well:

let A: int

func printA() {

// ERROR: use of uninitialized variable "A"

A = 6

// OK

In the future, Heck will have reference types, and this functionality will be used to automatically do lifetime checks, ensuring that your code is completely safe.

Heck also compiles extremely fast. In fact, since the challenge asked for "wild and exciting" ideas, our team thought this would be a perfect opportunity to target one of the most underappreciated modern web technologies: WebAssembly. The Heck compiler was written from scratch in C in order to be extremely lightweight, and this allows it to be packaged into a JavaScript library.


Heck.js is an experimental JS library that allows programmers to quickly run Heck code on the web. Heck.js has a very simple JavaScript API that allows it to quickly make calls in the browser:


        <script src="heck.js"></script>
            getRandomNumber: function() {
                return Math.random();
        <script type="heck">
        // import a function from JavaScript
        import func getRandomNumber() -> float
        // prints a random number to the console

Heck supports most common programming constructs. You can try heck in the main repl. There is a folder titled "examples" that you can look through in order to get an idea of the language.

You can also check out the docs and heck.js.

Our team name is @HeckLanguage and the members are @Deadly_Ore and @Mashpoe!

(Edit: I fixed up the submission, before the repl wasn't included properly)

You are viewing a single comment. View All
Mashpoe (15)

@AkshantLanjewar Memory may be set to zero by default on some platforms but this is definitely not the usual case. Uninitialized pointers in C will not always be set to NULL and numbers will not always be set to zero. This can happen but it is only guaranteed for static memory (e.g. global variables) and it is never safe to assume statically allocated (values allocated on the stack) or dynamically allocated (e.g. with new or malloc()) memory is set to zero. See the Wikipedia section on memory management in C.

Higher level languages like Java may initialize references to null but this is simply not the case for languages like C, C++, or Rust. Rust is unique because like Heck, it keeps track of which values have been initialized before their use at compile time, but most lower-level compiled languages do not automatically set values to null because of its inherent overhead.

Anyway, thanks for looking at my language and providing criticism. I really appreciate when people care enough about my work to look at it and give feedback :)