PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

MiniD

MiniD

< >

MiniD is a programming language created in 2006 by Jarrett Billingsley.

#269on PLDB 16Years Old 86Users
0Books 0Papers 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...


Example from the web:
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]) }
Example from Wikipedia:
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'

Language features

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 ϴ
ini.html · minid.html · wren.html

View source

PLDB - Build the next great programming language · v2022 · Day 90 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com