A lightweight, fast embeddable scripting language.
Go to file
2021-04-25 20:49:39 +05:30
include garbage collection implementations. 2021-04-25 20:49:39 +05:30
src garbage collection implementations. 2021-04-25 20:49:39 +05:30
test garbage collection implementations. 2021-04-25 20:49:39 +05:30
.gitignore a list of TODOs created 2021-02-16 23:58:03 +05:30
LICENSE
ms_configure.py garbage collection implementations. 2021-04-25 20:49:39 +05:30
README.md a list of TODOs created 2021-02-16 23:58:03 +05:30
SConscript vm implementations 2021-02-11 23:05:43 +05:30
SConstruct Merge branch 'master' of https://github.com/ThakeeNathees/miniscript 2021-02-13 23:32:35 +05:30
TODO.txt fiber implemented and calling convention fixed. 2021-02-25 14:33:06 +05:30

MiniScript Language

MiniScript is a simple, fast, embeddable, functional, dynamic-typed, bytecode-interpreted, scripting language written in C. It uses the mark-and-sweep method for garbage collection. MiniScript is is syntactically similar to Ruby. The frontend and expression parsing techniques were written using Wren Language and their wonderful book craftinginterpreters as a reference.

What MiniScript looks like


## Find and return the maximum value in the [list].
def get_max(list)
  ret = list[0]
  for i in 1..list.length
    ret = max(ret, list[i])
  end
  return ret
end

## Return a list where each element returns true with function [fn] and
## belongs to [list].
def filter(list, fn)
  ret = []
  for elem in list
    if fn(elem)
      list_append(ret, elem)
    end
  end
  return ret
end

## A list of range literal, first class functions and more types.
list = [42, null, 0..10, function() print('hello') end, [3.14]]
nums = filter(list, is_num)
print("Max is", get_max(nums))