{"id":37193757,"url":"https://github.com/codr7/snabl","last_synced_at":"2026-01-14T22:29:58.937Z","repository":{"id":161215076,"uuid":"597474474","full_name":"codr7/snabl","owner":"codr7","description":"a simple Go scripting language","archived":false,"fork":false,"pushed_at":"2023-02-13T01:09:11.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T20:49:55.808Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codr7.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-04T17:04:16.000Z","updated_at":"2024-05-27T16:48:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebf8a95f-4ffa-497c-8901-bb622541f974","html_url":"https://github.com/codr7/snabl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codr7/snabl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fsnabl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fsnabl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fsnabl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fsnabl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codr7","download_url":"https://codeload.github.com/codr7/snabl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fsnabl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-14T22:29:58.097Z","updated_at":"2026-01-14T22:29:58.920Z","avatar_url":"https://github.com/codr7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snabl\nSnabl is a simple Go scripting language.\n\n## Setup\n\n```\ngit clone https://github.com/codr7/snabl.git\ncd snabl\ngo build main/snabl.go\n```\n```\n./snabl\n  say \"hello\"\n\nhello\n```\n```\n./snabl help\nSnabl v4\n\nUsage:\nsnabl [command] [file1.sl] [file2.sl]...\n\nCommands:\neval\tEvaluate code and exit\nread\tDump forms and exit\nemit\tDump code and exit\nrepl\tEvaluate code and start REPL\n```\n\n## Syntax\nSnabl uses strict prefix syntax with optional parens; as a consequence, functions and macros have fixed arity.\n\n## Types\n\n### Bool\nThe type of boolean values.\n\n```\n  = T F\n\nF\n```\n\n### Form\nThe type of source code forms.\n\n### Fun\nThe type of functions.\n\n```\n  defun foo(x) x\n  foo 42\n\n42\n```\n\n### Int\nThe type of integer values.\n\n### Macro\nThe type of macros.\n\n### Meta\nThe type of types.\n\n### Pos\nThe type of source code positions.\n\n```\n  1 2 3 pos\n  \nrepl@1:7\n```\n\n### Prim\nThe type of primitives, functions implemented in Go.\n\n### Slice\nThe type of slices.\n\n```\n  len [1 2 3]\n\n3\n```\n\n### String\nThe type of string values.\n\n```\n  len \"foo\"\n\n3\n```\n\n### Time\nThe type of time intervals.\n\n```\n  mins 10\n  \n10m0s\n```\n\n## Environments\nCurlies may be used to create new compile time environments.\n\n```\n  {def foo 42 foo}\n\n[42]\n  foo\n\nrepl@1:1 Error: foo?\n```\n\n## Debugging\n`debug` may be used to toggle generation of debug info and panic on errors.\n\n```\n  fail \"failing\"\n  \nError: failing\n  debug\n  \n  fail \"failing\"\n  \npanic: repl@1:6 Error: failing\n```\n\n`trace` may be used to toggle tracing of operations and stack contents.\n\n```\n  trace\n  \n1 STOP []\n  1 2 3\n  \n3 PUSH_INT 1 []\n5 PUSH_INT 2 [1]\n7 PUSH_INT 3 [1 2]\n9 STOP [1 2 3]\n3\n```\n\n## Testing\n`test expected expr` evaluates `expr` and compares the result with `expected`.\n\n```\n  test T = 1 1\n  \nT = 1 1\n  test T = 1 2\n  \nT = 1 2\nTEST FAILED repl@1:8 F\n```\n\nYou may find more examples [here](https://github.com/codr7/snabl/blob/main/test/all.sl).\n\n## Benchmarking\n`bench n expr` evaluates `expr` `n` times and returns elapsed time.\n\n```\nbench 10 sleep msecs 100\n  \n1.004674633s\n```\n\n```\n  load \"bench/fib.sl\"\n\n2.807621686s\n```\n```\n  load \"bench/fibt.sl\"\n\n1.358420848s\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodr7%2Fsnabl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodr7%2Fsnabl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodr7%2Fsnabl/lists"}