Mint Language
An interpreted programming language written in Java

Mint is a dynamically typed general purpose programming language. It has all your traditional control flow statements, such as while loops and for loops. You can also define functions, use lists, and build objects using object constructors.

I'm Oliver, the creator of Mint. Originally I made this language as an experiment in parsing. Using Python, I wrote a prototype interpreter that could do things like evaluate math expressions using precedence rules. When the project started getting large, I switched to Java, and so the Mint language is now built on top of the JVM. This was done during the summer of 2012, with many improvements added later on.


The language has influences from Ruby and Python. Here are some code examples:

// Returns list of fibonacci numbers
sub fibonacci(n)
    current = 0
    next = 1
    sequence = []
    for i = 0; i <= n; i++
        sequence.append(current)
        temporary = next
        next += current
        current = temporary
    end
    return sequence
end

print fibonacci(25)
// Differentiate function f with respect to x
sub differentiate(f)
    dx = 0.0001
    sub fPrime(x)
        df = f(x + dx) - f(x)
        return df / dx
    end
    return fPrime
end

sub square(x)
    return x ^ 2
end

// Derivative of 'x squared' is 2x
twice = differentiate(square)
print twice(16) // approximately 32
sub containsWord(sentences, targetWord)
    for each sentence of sentences
        if targetWord in sentence
            return true
        end
    end
    return false
end

sentences = ["House is red.", "Balloon is lead."]
print containsWord(sentences, "red")
print containsWord(sentences, "head")

Mint's internal Java implementation is licensed under the GNU Affero General Public License v3.

Mint should not be confused with MINT, a motion programming language created by ABB Group. Unfortunately, I was unaware of this other language before I named my project.