Skip to content

About

Standard library modules (.mil) for the minilang language; shared as a submodule of minilang-compiler and minilang-boot

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

minilang-syslib

Standard library modules for the minilang language. Each .mil file is a module loaded with require.

This repository is shared as a git submodule of both:

Modules

Module Provides
builtin declarations for C-implemented native methods (sqrt, abs, time, clock_ms, getenv, cwrite, exit, csystem)
math abs, min, max, clamp, pow, gcd, lcm, isEven, isOdd, factorial, fib, cos, sin, pi (trig in degrees, ×1000)
string isEmpty, startsWith, endsWith, contains, repeat, countChar, reverse, split, lines, words, join, indexOf, replace, toUpper, toLower, …
list range, copy, push, pop, first, last, insert, remove, slice, concat, reverse, sum, min, max, fill, swap, equal
sort ints, intsDesc, strings, insert, bsearch, bsearchStr, isSorted
json JSON parse/serialize using tagged pairs [type, payload]
io read, write, append, exists, readLines, pathJoin, basename, dirname, ext, stem, withExt
rand seed, next, int, range, chance, pick, shuffle (reproducible LCG)
word example module showing nested require

Usage

require math;
println toString(math.cos(60));     // 501

require sqrt from builtin;           // C-native integer square root
println toString(sqrt(144));        // 12

License

The library code is licensed under GPL-3.0 (matching the minilang compiler).

About

Standard library modules (.mil) for the minilang language; shared as a submodule of minilang-compiler and minilang-boot

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors