Go to file
rdococ c09414a2bd Fix spelling mistake in Context:setAttribute 2022-08-02 14:23:49 +01:00
blocks Remove empty Closure:recordLuaValue method 2022-02-21 17:04:39 +00:00
screenshots Add more screenshots, thumbnail screenshot 2022-01-25 14:36:38 +00:00
textures Lift continuations from main mod 2022-02-03 14:47:54 +00:00
util Document sb2.classNamed, sb2.getClassName 2022-01-29 09:36:48 +00:00
LICENSE Reorganize files 2022-01-24 15:30:55 +00:00
base.lua Return nil for SB2 objects that don't implement recordLuaValue 2022-02-17 18:55:44 +00:00
core.lua Fix spelling mistake in Context:setAttribute 2022-08-02 14:23:49 +01:00
init.lua Lift continuations from main mod 2022-02-03 14:47:54 +00:00
mod.conf Include minimum Minetest version in mod.conf 2022-01-30 09:37:37 +00:00
readme.md Clarify experiments warning 2022-08-02 13:27:26 +01:00
screenshot.png Add more screenshots, thumbnail screenshot 2022-01-25 14:36:38 +00:00
settingtypes.txt Clarify purpose of experimental features setting 2022-02-04 10:19:04 +00:00

readme.md

Scriptblocks 2

Scriptblocks 2 is a Minetest mod and toy programming language using nodes called scriptblocks. Scriptblocks are nodes which can be used to build reusable programs.

Features

  • Support for nested expressions and variables.
  • Custom, named procedures with up to 2 named parameters and dynamic scoping.
  • First-class lists, dictionaries, and lexically scoped closures with up to 1 named parameter.
  • Coroutines, closures that can be paused and resumed.
  • Processes can run for more than one tick.
  • Ability to interface with digiline networks.

Experiments

  • Spawnable processes, providing primitives for parallelism rather than just concurrency.
  • Introspective blocks for debug purposes, such as one to report a string representation of the call stack.

These features can be accessed through the 'Enable Experiments' setting. Some of these features can cause a lot of lag, even with the limits that have been imposed. Others are only useful for debugging purposes. Either way, don't enable these on a public server!

First-class continuations have been moved to their own mod, SB2 Continuations.

Examples

This procedure calculates the factorial of a given number.

Factorial

This procedure takes a list and a closure. It calls the closure for each item in the list, and reports the results in a new list.

Map