{"id":15443187,"url":"https://github.com/manishmeganathan/tunalang","last_synced_at":"2025-12-15T17:15:40.532Z","repository":{"id":57618326,"uuid":"375952105","full_name":"manishmeganathan/tunalang","owner":"manishmeganathan","description":"A dynamically typed, interpreted programming language.","archived":false,"fork":false,"pushed_at":"2021-07-20T14:02:54.000Z","size":248,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T23:40:29.788Z","etag":null,"topics":["dynamic-typing","golang","interpreter","pratt-parser","programming-language","repl","tree-walk-interpreter"],"latest_commit_sha":null,"homepage":"https://github.com/manishmeganathan/tunalang","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manishmeganathan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-11T08:10:13.000Z","updated_at":"2023-12-13T17:21:10.000Z","dependencies_parsed_at":"2022-09-14T12:52:09.633Z","dependency_job_id":null,"html_url":"https://github.com/manishmeganathan/tunalang","commit_stats":null,"previous_names":["manishmeganathan/tuna"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manishmeganathan%2Ftunalang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manishmeganathan%2Ftunalang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manishmeganathan%2Ftunalang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manishmeganathan%2Ftunalang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manishmeganathan","download_url":"https://codeload.github.com/manishmeganathan/tunalang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247521301,"owners_count":20952331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic-typing","golang","interpreter","pratt-parser","programming-language","repl","tree-walk-interpreter"],"created_at":"2024-10-01T19:33:39.094Z","updated_at":"2025-12-15T17:15:35.228Z","avatar_url":"https://github.com/manishmeganathan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Tuna Programming Language\n![banner](banner.png)\n\nA dynamically typed, interpreted programming language.\n\n![latest tag (SemVer)](https://img.shields.io/github/v/tag/manishmeganathan/tunalang?color=brightgreen\u0026label=latest%20tag\u0026sort=semver)\n![latest release (SemVer)](https://img.shields.io/github/v/release/manishmeganathan/tunalang?color=brightgreen\u0026label=latest%20release\u0026sort=semver)\n![License](https://img.shields.io/github/license/manishmeganathan/tunalang)\n![Go Version](https://img.shields.io/github/go-mod/go-version/manishmeganathan/tunalang)\n![Test Status](https://img.shields.io/github/workflow/status/manishmeganathan/tunalang/Go%20Tests?label=tests\u0026style=plastic)\n![Issues](https://img.shields.io/github/issues/manishmeganathan/tunalang)\n\n### Supported Platforms\n![Windows Support](https://img.shields.io/badge/platform-windows-blue)\n![MacOSX Support](https://img.shields.io/badge/platform-macosx-blue)\n![Linux Support](https://img.shields.io/badge/platform-linux-blue)\n\n## Overview\n**Tuna** is a dynamically typed, interpreted programming language. This project is heavily inspired by and derived from the books **'Writing An Interpreter in Go'** \u0026 **'Writing A Compiler in Go'** by **Thorsten Ball** and the *Monkey* programming language.\n\nAs of *v1.0*, the language is fully functional as interpreter and supports functionality such as\n- Simple data types - **Integers**, **Strings** and **Booleans**.\n- Compound data types - **Lists** and **Maps**.\n- **Prefix**, **Infix** and **Index** operations.\n- **Conditional** and **Return** statements.\n- **Global** and **Local** variable bindings.\n- **First-class** functions and **Closures**.\n- Simple **Built-In** functions.\n\n## Usage\nThe only way to use **Tunalang** currently is through the REPL (this will change).\n1. [Install](#installation) **Tunalang** .\n2. Run ``tunalang`` to start the **Tuna REPL**.\n3. Code Away!\n\n## Installation\n\n### From Binary\n\n1. Download the binary for the target platform from the latest release. All **Tunalang** releases are available [here](https://github.com/manishmeganathan/tunalang/releases).\n2. Save the binary to a directory of choice.\n3. Add the path to that directory to the ``PATH`` environment variable.\n4. **Tunalang** is now install and can be invoked using the ``tunalang`` command.\n\nNote: If a binary is not availabe for your platform. Raise an issue or install from source. Any platform that is supported by the Go runtime will support **Tuna**.\n\n### From Source\n\nInstalling from source requires an installation of **Git** and **Go** v1.16+. An installation of **Make** is useful but not necessary. **Make** for Windows is available on Chocolatey and can be installed with ``choco install make``.  \n\n1. Clone the repository and change directory into it.\n```\ngit clone https://github.com/manishmeganathan/tunalang.git \ncd tunalang\n```\n2. Compile and Install the binary.\n\nIf the ``make`` command is available, run the following.\n```\nmake install\n```\nOtherwise, run this.\n```\ngo install .\n```\n3. **Tunalang** is now install and can be invoked using the ``tunalang`` command. Some platform might require a manual configuration for the Go binary source to be added to path.\n\n## Components\n\n### The Lexer\nThe lexer converts string inputs into lexicological token that can be parsed. It is defined in ``lexer`` package along with the definitions for the lexicological tokens used in Tuna.\n\n### The Parser\nThe parser is a top-down recursive descent parser that is often called a **Pratt parser**. It is defined in ``parser`` package. Its role is to converts the tokens generated by the lexer into an **Abstract Syntax Tree**. The nodes of the AST are defined in the ``syntaxtree`` package.\n\n### The Evaluator\nThe evaluator is a tree-walking evaluator implemented in the ``evaluator`` package that recursively walks down the AST and evaluates it into objects that are defined by ``object`` package.\n\n### The REPL\nThe read-eval-print loop accepts an input and interprets/evaluates it on the fly and prints the output. It is the primary interface to interact with the **Tuna** programming language.\n\n\n## Examples\n```bash\nlet name = \"Tunalang\";\nlet inspirations = [\"Monkey\", \"Rust\", \"Wren\"];\n\nlet data = {\n    \"name\": name,\n    \"version\": \"v1.0.0\"\n};\n\nlet printdata = fn(data) {\n    let name = data[\"name\"];\n    let version = data[\"version\"];\n\n    puts(name + \" - \" + version);\n};\n\nprintdata(book);\n# =\u003e prints: \"Tunalang - v1.0.0\"\n```\n\n```bash\nlet fibonacci = fn(x) {\n    if (x == 0) {\n        0\n    } else {\n        if (x == 1) {\n            return 1;\n        } else {\n            fibonacci(x - 1) + fibonacci(x - 2);\n        }\n    }\n};\n\nlet map = fn(arr, f) {\n    let iter = fn(arr, accumulated) {\n        if (len(arr) == 0) {\n            accumulated\n        } else {\n            iter(rest(arr), push(accumulated, f(first(arr))));\n        }\n    };\n    iter(arr, []);\n};\n\nlet numbers = [1, 1 + 1, 4 - 1, 2 * 2, 2 + 3, 12 / 2];\nmap(numbers, fibonacci);\n# =\u003e returns: [1, 1, 2, 3, 5, 8]\n```\n\n## Future Development\n- Unicode Lexer [[#1]](https://github.com/manishmeganathan/tunalang/issues/1)\n- Macro System [[#6]](https://github.com/manishmeganathan/tunalang/issues/6)\n- Bytecode Compiler and Virtual Machine (Tuna v2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanishmeganathan%2Ftunalang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanishmeganathan%2Ftunalang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanishmeganathan%2Ftunalang/lists"}