All Projects → felko → ton-lang

felko / ton-lang

Licence: other
A visual programming language, evaluated as a cellular automaton

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ton-lang

cas
Cellular Automata Simulator
Stars: ✭ 22 (-63.33%)
Mutual labels:  cellular-automata
rlifesrc
A Game of Life pattern searcher written in Rust. 用 Rust 搜索生命游戏中的图样。
Stars: ✭ 15 (-75%)
Mutual labels:  cellular-automata
logic-life-search
Cellular automata search program
Stars: ✭ 23 (-61.67%)
Mutual labels:  cellular-automata
netomaton
A Python library for working with Network Automata, Cellular Automata, and other discrete dynamical systems
Stars: ✭ 38 (-36.67%)
Mutual labels:  cellular-automata
cabasa
A generic 2D cellular automaton simulator
Stars: ✭ 21 (-65%)
Mutual labels:  cellular-automata
ws-ldn-10
Generative design workshop (Clojure/ClojureScript)
Stars: ✭ 26 (-56.67%)
Mutual labels:  cellular-automata
forma
A Lua toolkit for computational geometry on a grid
Stars: ✭ 34 (-43.33%)
Mutual labels:  cellular-automata
Roguelike-Procedual-Cave-Generator
A procedurally generated, cave-like dungeon/map creator for rogue-like games using the cellular automata method. During its development, I solved a common/limiting problem with this algorithm that might explain why it is not more commonly implemented in such games.
Stars: ✭ 26 (-56.67%)
Mutual labels:  cellular-automata
evoplex
Evoplex is a fast, robust and extensible platform for developing agent-based models and multi-agent systems on networks. It's available for Windows, Linux and macOS.
Stars: ✭ 98 (+63.33%)
Mutual labels:  cellular-automata
python-algorithms-and-simulations
Different algorithms and simulations from gravity simulations to cellular automata, implemented in python.
Stars: ✭ 21 (-65%)
Mutual labels:  cellular-automata
Growing-Neural-Cellular-Automata-Pytorch
Extended experiments of "Growing Neural Cellular Automata" https://distill.pub/2020/growing-ca/
Stars: ✭ 47 (-21.67%)
Mutual labels:  cellular-automata
alchemy
Generate any a-by-( b + c ) finite rectangle SVG containing potentially Infinitely many a-by-( 2 * b ) finite rectangles animated along a number line of ( ( c - b ) / a )^n scale symmetry.
Stars: ✭ 29 (-51.67%)
Mutual labels:  cellular-automata
Generative-Art-Sketches
A Generative Art Gallery with the idea of creating a virtual Art Gallery with my creations. I have tried my hands on creating some visually appealing art using Cellular Automata, Recursive Grammar, Phyllotaxis, Sandpiles, Perlin Noise, IFS, Tiling.
Stars: ✭ 24 (-60%)
Mutual labels:  cellular-automata
terrame
TerraME is a programming environment for spatial dynamical modelling
Stars: ✭ 33 (-45%)
Mutual labels:  cellular-automata
The Powder Toy
Written in C++ and using SDL, The Powder Toy is a desktop version of the classic 'falling sand' physics sandbox, it simulates air pressure and velocity as well as heat.
Stars: ✭ 3,128 (+5113.33%)
Mutual labels:  cellular-automata
PyGameofLife
Conway's Game of Life using python's matplotlib and numpy
Stars: ✭ 40 (-33.33%)
Mutual labels:  cellular-automata
conwayste
Multiplayer Conway's Game of Life (desktop app + server) implemented in Rust
Stars: ✭ 22 (-63.33%)
Mutual labels:  cellular-automata
ALPACA
A Language for the Pithy Articulation of Cellular Automata
Stars: ✭ 21 (-65%)
Mutual labels:  cellular-automata
Mixed Cell Cellullar Automata
The Mixed-Cell Cellullar Automata (MCCA) provides a new approach to enable more dynamic mixed landuse modeling to move away from the analysis of static patterns. One of the biggest advantages of mixed-cell CA models is the capability of simulating the quantitative and continuous changes of multiple landuse components inside cells.
Stars: ✭ 33 (-45%)
Mutual labels:  cellular-automata
Algorithms
Free hands-on course with the implementation (in Python) and description of several computational, mathematical and statistical algorithms.
Stars: ✭ 117 (+95%)
Mutual labels:  cellular-automata

ton-lang

ton-lang is a visual programming language whose interpreter is implemented as a cellular automaton, meaning that each cell is transformed at every frame depending on its direct neighbors.

Evaluating programs as cellular automata gives some interesting features such as partial evaluation. On the other hand some features can be hard to implement — at least the way I've approached the problem — e.g. I'm still trying to figure out how to implement recursion.

Installing

Run the following command to install the editor/interpreter

$ python3.8 setup.py install --user

Make sure that the site-packages directory is in your path.

Dependencies:

  • pygame v2
  • fire
  • numpy

Usage

CLI

  • Creating a new file: ton new <path>
  • Editing an existing file: ton edit <path>
  • (Upcoming) Render the evaluation of a program as a gif: ton run <program-path> <gif-output-path>

Editor

Cells

Cells are divided in three main categories:

  • Links: wires connecting cells, visually "pulling" values to processors
  • Processors: cells that actually do computations, inputs are shown as blue pins and outputs as red pins, drawn on the border of the cell.
  • Values: for now only booleans, integers and lists

Additionally, programs can be separated in modules with "chips", which are basically sub-programs.

Eventually I'd like to implement quotes (as in e.g. lisp) which would make processors behave as values temporarily (and therefore movable through wires)

Controls

  • Left-click: write the selected cell
  • Right-click: delete the pointed cell
  • Scrolling: change the cell type in the toolbar
  • Ctrl+S: save the current program
  • Ctrl+R: reload the program from disk (going back to the last saved state)
  • Ctrl+Q: quit the editor
  • Ctrl+L: Clears the board
  • s+scroll: switch the state of the cell, which depends on the pointed cell (cycles through values for value-cells, rotates the pins for processor-cells)
  • Space: evaluates 1 step
  • Enter: evaluate continuously (toggle)
  • Tab: edit the selected chip
  • Esc: go to parent program
  • Shift+Esc: go to root program
  • M: save selected chip to toolbar
  • D: print JSON-representation of a cell in the console for debugging
  • I: shows information about a cell directly in the editor

Examples

  • Using chips to define a subroutine that increments an integer:

  • Manipulating lists

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].