{"id":22873306,"url":"https://github.com/frederiktobner/zenlox","last_synced_at":"2025-07-15T17:40:11.070Z","repository":{"id":183083781,"uuid":"650770561","full_name":"FrederikTobner/ZenLox","owner":"FrederikTobner","description":"The Lox language implemented in Zig","archived":false,"fork":false,"pushed_at":"2023-09-10T13:04:20.000Z","size":305,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-13T14:18:24.097Z","etag":null,"topics":["interpreter","programming-language","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FrederikTobner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-07T19:15:35.000Z","updated_at":"2023-11-01T17:25:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b6e598d-2325-4d00-a6fb-8059769702a2","html_url":"https://github.com/FrederikTobner/ZenLox","commit_stats":null,"previous_names":["frederiktobner/zenlox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrederikTobner%2FZenLox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrederikTobner%2FZenLox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrederikTobner%2FZenLox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrederikTobner%2FZenLox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrederikTobner","download_url":"https://codeload.github.com/FrederikTobner/ZenLox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237522321,"owners_count":19323733,"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":["interpreter","programming-language","virtual-machine"],"created_at":"2024-12-13T14:18:31.675Z","updated_at":"2025-02-06T17:56:49.438Z","avatar_url":"https://github.com/FrederikTobner.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZenLox\n\n[![Build ZenLox](https://github.com/FrederikTobner/ZenLox/actions/workflows/build.yaml/badge.svg)](https://github.com/FrederikTobner/ZenLox/actions/workflows/build.yaml)\n[![Tests](https://github.com/FrederikTobner/ZenLox/actions/workflows/test.yaml/badge.svg)](https://github.com/FrederikTobner/ZenLox/actions/workflows/test.yaml)\n[![Zig Version](https://img.shields.io/badge/zig-0.11.0-orange)](https://ziglang.org/)\n\n[Lox](https://craftinginterpreters.com/the-lox-language.html), the beloved educational programming language, crafted in Zig, infused with an added touch of serenity and Zen.\n\nZenlox is a dynamically typed, object oriented, high-level scripting language.\n\nZenlox is currently in an experimental state. Some of the language features that are currently included, might change or not be included in the upcoming versions of the interpreter.\n\n## Values\n\nIn Zenlox values are grouped into four different types:\n\n* booleans,\n* numbers,\n* undefiened (null)\n* and [Zenlox objects](https://github.com/FrederikTobner/Zenlox#objects) (e.g. a string or a class instance)\n\n## Objects\n\nIn Zenlox everything besides the three base data types is considered to be a zenlox object.\nEven functions and classes are considered to be a cellox object.\nThis means that you can for example get the reference to a function and assign it to a variable.\n\n### Strings\n\nStrings in Zenlox are defined using double quotes.\n\n```Zenlox\nvar name = \"Zenlox\";\n```\n\nStrings are immutable, which means that you can't change the value of a string after it has been created. However, you can concatenate two strings using the `+` operator.\n\n```Zenlox\nvar firstName = \"Zen\";\nvar lastName = \"Lox\";\nvar fullName = firstName + lastName; // \"ZenLox\"\n```\n\nStrings are not null terminated, like in C, they are instead length prefixed.\n\n## Functions\n\nFunctions in Zenlox are defined using the `fun` keyword. The following example shows how to define a function that takes two arguments and returns their sum.\n\n```Zenlox\nfun sum(a, b) {\n    return a + b;\n}\n```\n\nBecause functions are first class citizens in Zenlox, you can assign them to variables and pass them as arguments to other functions.\n\n```Zenlox\nfun callBackFunction() {\n    print \"I am a callback function\";\n}\n\nfun callFunctionWithCallback(callback) {\n    print \"Im about to call the callback function\";\n    callback();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederiktobner%2Fzenlox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrederiktobner%2Fzenlox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederiktobner%2Fzenlox/lists"}