Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

MiniD

< >

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

#983on PLDB 18Years Old 0Repos
Homepage · Wikipedia

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 X

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements

Built with Scroll v154.3.0