MiniD is a programming language created in 2006 by Jarrett Billingsley.
#986on PLDB | 18Years Old | 0Repos |
The MiniD (has been renamed Croc) programming language is a small, lightweight, extension language in the vein of Lua or Squirrel, but designed to be used mainly with the D programming language. It supports both object-oriented and imperative programming paradigms, as well as some simple functional aspects. Distributed under the licence of zlib/libpng, MiniD is free software.. Read more on Wikipedia...
module matrix
local SIZE = 30
function mkmatrix(rows, cols)
{
local count = 1
local m = array.new(rows)
for(i: 0 .. rows)
{
m[i] = array.new(cols)
for(j: 0 .. cols)
{
++count
m[i][j] = count
}
}
return m
}
function mmult(rows, cols, m1, m2, m3)
{
for(i: 0 .. rows)
{
for(j: 0 .. cols)
{
local val = 0
for(k: 0 .. cols)
val += m1[i][k] * m2[k][j]
m3[i][j] = val
}
}
return m3
}
function main(N)
{
local n = 1
if(isString(N))
n = toInt(N)
local m1 = mkmatrix(SIZE, SIZE)
local m2 = mkmatrix(SIZE, SIZE)
local mm = mkmatrix(SIZE, SIZE)
for(i: 0 .. n)
mmult(SIZE, SIZE, m1, m2, mm)
writefln(mm[0][0], " ", mm[2][3], " ", mm[3][2], " ", mm[4][4])
}
function first(x: array|string) = x[0]
writeln(first([1, 2, 3])) // prints 1
writeln(first("hello")) // prints h
writeln(first(45)) // error, invalid parameter type 'int'
Feature | Supported | Example | Token |
---|---|---|---|
MultiLine Comments | ✓ | ||
Binary Literals | ✓ | // 0[bB][01][01_]* | |
Integers | ✓ | // ([0-9][0-9_]*)(?![.eE]) | |
Floats | ✓ | // ([0-9][0-9_]*)(?=[.eE])(\.[0-9][0-9_]*)?([eE][+\-]?[0-9_]+)? | |
Hexadecimals | ✓ | // 0[xX][0-9a-fA-F][0-9a-fA-F_]* | |
Comments | ✓ | // A comment | |
Line Comments | ✓ | // A comment | // |
Semantic Indentation | X |