{"id":13610608,"url":"https://github.com/odddollar/Leafscript","last_synced_at":"2025-04-12T22:34:20.911Z","repository":{"id":188845360,"uuid":"297629884","full_name":"odddollar/Leafscript","owner":"odddollar","description":"Lightweight programming language (proof of concept)","archived":false,"fork":false,"pushed_at":"2022-05-18T03:56:35.000Z","size":787,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-07T16:44:18.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/odddollar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-22T11:39:06.000Z","updated_at":"2024-09-10T22:57:38.000Z","dependencies_parsed_at":"2023-08-17T05:26:35.039Z","dependency_job_id":"d6f5733f-ffa8-4754-9118-e7f3903c780a","html_url":"https://github.com/odddollar/Leafscript","commit_stats":null,"previous_names":["odddollar/leafscript"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odddollar%2FLeafscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odddollar%2FLeafscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odddollar%2FLeafscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odddollar%2FLeafscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odddollar","download_url":"https://codeload.github.com/odddollar/Leafscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642308,"owners_count":21138350,"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":[],"created_at":"2024-08-01T19:01:46.258Z","updated_at":"2025-04-12T22:34:20.603Z","avatar_url":"https://github.com/odddollar.png","language":"Go","readme":"# Leafscript\nLeafscript is a lightweight programming language created as a proof of concept by someone with no idea how to write a language.\nIt's written entirely in Golang, and was inspired by the speed and simplicity of Lua. It can be compiled from source to a binary .exe file using the command: ```go build Leafscipt```\n\n## Usage\nPrograms can be run from the command line using the Leafscript binary file.\n\n```leafscript --run [PATH TO .lfs FILE] --debug [SET TO FALSE BY DEFAULT]```\n\nE.g. \n\n```leafscript --run program.lfs```\n\nIncludes a basic debugger that prints a list of all variables every line. E.g. \n\n```leafscript --run program.lfs --debug true```\n\n\n## Features\nIt supports:\n- Creating and modifying variables (strings, ints and floats)\n- Performing mathematical operations on numeric variables\n- String concatenation\n- For loops\n- If/else statements\n- Breaks in for loops\n- Nested if/for\n- Basic debugging mode that prints all variables every line\n\nNo plans to implement in near future\n- Array variables\n- Error messages\n\n## Examples\n\n***Ensure tabs are used to indent and not spaces. Spaces do not work***\n\nAdditional language examples are contained within the \"Examples\" file\n\n#### Find all the factors of a number\n```\nvar number = inputint \"Enter a number to find factors of: \"\n\nfor x math number+1\n\tif math number%x == 0\n\t\tprint concat math x \u0026 \" is a factor of \" \u0026 math number\n\tendif\nendfor\n```\n\n#### Print all binary numbers from 0 to 15\n```\nfor x 2\n\tfor y 2\n\t\tfor z 2\n\t\t\tfor i 2\n\t\t\t\tprint concat math x \u0026 \" \" \u0026 math y \u0026 \" \" \u0026 math z \u0026 \" \" \u0026 math i\n\t\t\tendfor\n\t\tendfor\n\tendfor\nendfor\n```\n\n#### Print all primes up to a given number\n```\nvar number = inputint \"Enter a number to find primes up to: \"\nvar total = 0\n\nfor x math number\n\tvar y = 0\n\tfor i math x\n\t\tif math x%i == 0\n\t\t\tvar y = math y+1\n\t\tendif\n\tendfor\n\n\tif math y \u003c 2\n\t\tprint concat math x \u0026 \" is prime\"\n\t\tvar total = math total+1\n\tendif\nendfor\n\nprint concat math total \u0026 \" primes found\"\n```\n\n## Changelog\n\n#### v1.0\n\n- Initial release\n\n#### v1.1\n\n- Modified command line interface to use more robust argparse library\n- Added ability to package .lfs files to .exe using PackageFile.exe\n\n#### v1.1.1\n\n- Fixed imports\n\n#### v1.2\n\n- Removed poor implementation of packaging files to binary\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodddollar%2FLeafscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodddollar%2FLeafscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodddollar%2FLeafscript/lists"}