{"id":37107479,"url":"https://github.com/codr7/gofu","last_synced_at":"2026-01-14T12:55:03.931Z","repository":{"id":161215060,"uuid":"387285640","full_name":"codr7/gofu","owner":"codr7","description":"Go scripting language toolkit","archived":false,"fork":false,"pushed_at":"2021-07-30T14:09:05.000Z","size":24996,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T19:56:20.105Z","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":"2021-07-18T23:05:51.000Z","updated_at":"2024-05-27T16:49:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"70b18c30-f5b2-4f1f-b9e2-a9091d3a0e28","html_url":"https://github.com/codr7/gofu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codr7/gofu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fgofu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fgofu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fgofu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fgofu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codr7","download_url":"https://codeload.github.com/codr7/gofu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codr7%2Fgofu/sbom","scorecard":{"id":298392,"data":{"date":"2025-08-11","repo":{"name":"github.com/codr7/gofu","commit":"59f3bd758e44ebb2b9076df47232a9a9dee945f4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: bin/repl:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T20:06:29.510Z","repository_id":161215060,"created_at":"2025-08-17T20:06:29.511Z","updated_at":"2025-08-17T20:06:29.511Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","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-14T12:55:03.258Z","updated_at":"2026-01-14T12:55:03.925Z","avatar_url":"https://github.com/codr7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gofu\n## a scripting language toolkit in Go\n\n### intro\n[gofu](https://github.com/codr7/gofu) aims to provide a flexible toolkit for creating custom scripting languages in Go.\n\n### functions\nFunctions have a name, an argument list, a result list and a body.\n\n```go\np := gofu.Pos(\"Test\", -1, -1)\n\nadd := gofu.Func(\"+\", []gofu.Type{types.Int(), types.Int()}, []gofu.Type{types.Int()},\n\tfunc(pos gofu.TPos, thread *gofu.TThread, _func *gofu.TFunc, pc *int) error {\n\t\tstack := thread.Stack()\n\t\tstack.Push(types.Int(), stack.Pop().Value().(int) + stack.Pop().Value().(int))\n\t\treturn nil\n\t})\n\nscope := gofu.Scope()\t\nscope.BindSlot(\"+\", types.Func(), add)\n\nblock := gofu.Block()\nc := forms.Call(p, forms.Id(p, \"+\"), forms.Literal(p, types.Int(), 35), forms.Literal(p, types.Int(), 7))\nc.Compile(scope, block)\nblock.Emit(ops.Stop())\n\nthread := gofu.Thread(scope)\nblock.Run(thread, 0)\n```\n\nThe same thing could be accomplished by manually emitting operations.\n\n```go\nblock.Emit(ops.Push(types.Int(), 35))\nblock.Emit(ops.Push(types.Int(), 7))\nblock.Emit(ops.Call(p, add))\nblock.Emit(ops.Stop())\n```\n\n`fimps.Compile` may be used to compile function bodies.\n\n```go\nfimp, err := fimps.Compile(forms.Literal(p, []gofu.Type{types.Int()}, 42), block)\nfortyTwo := gofu.Func(\"fortyTwo\", nil, []gofu.Type{types.Int()}, fimp)\nscope.BindSlot(\"fortyTwo\", types.Func(), f)\n```\n\n#### multiple dispatch\nThe following example will dispatch to the right function based on the argument and push `\"Bool!\"` on the stack.\n\n```go\nf1 := gofu.Func(\"foo\", []gofu.Type{types.Bool()}, []gofu.Type{types.Int()},\n    func(pos gofu.TPos, thread *gofu.TThread, _func *gofu.TFunc, pc *int) error {\n\t    stack := thread.Stack()\n\t    stack.Pop()\n\t    stack.Push(types.String(), \"Bool!\")\n\t    return nil\n    })\n\nf2 := gofu.Func(\"foo\", []gofu.Type{types.Int()}, []gofu.Type{types.Int()},\n    func(pos gofu.TPos, thread *gofu.TThread, _func *gofu.TFunc, pc *int) error {\n\t    stack := thread.Stack()\n\t    stack.Pop()\n\t    stack.Push(types.String(), \"Int!\")\n\t    return nil\n    })\n\nm := gofu.Multi(\"foo\", 1, f1, f2)\nblock.Emit(ops.Push(types.Bool(), true))\nblock.Emit(ops.Call(p, m))\nblock.Emit(ops.Stop())\t\n```\n\n### macros\nMacros are called at compile time and may emit different code depending on arguments.\n\n```\nscope.BindSlot(\"reset\",\n\ttypes.Macro(),\n\tgofu.Macro(\"reset\", 0,\n\t\tfunc(pos gofu.TPos, args []gofu.Form, scope *gofu.TScope, block *gofu.TBlock) error {\n\t\t\tblock.Emit(ops.Reset())\n\t\t\treturn nil\n\t\t}))\n```\n\n### types\nThe following list of types are provided but optional, anything implementing `gofu.Type` may be used as a type.\n\n* Any: Any - Anything\n* Bool: Any - t/f\n* Char: Any - Characters\n* Func: Any Target - Functions\n* Int: Any Num - Integers\n* Maybe[T]: Any - Contains T or Nil\n* Meta: Any - The type of types\n* Multi: Any Target - Multimethods\n* Nil - Nothing, it's only value being `_`\n* Num: Any - Parent of all numbers\n* Seq[T]: Any - Parent of all sequences\n* Stack[T]: Any Seq[T] - Stacks of values\n* String: Any Seq[Char] - Strings\n* Target: Any - Callable values\n\n### repl\nA primitive [REPL](https://github.com/codr7/gofu/blob/main/utils/repl.go) is provided, it reads one form at a time and prints the stack after each evaluation.\n\n```\n$ cd bin\n$ ./mk\n$ ./repl\ngofu v1\n  +(35 7)\n[42]\n```\n\nParens may be used to group forms.\n\n```\n  (1 2 3)\n[1 2 3]\n```\n\nThe stack may be directly modified using `d` and `reset`.\n\n```\n  (1 2 3)\n[1 2 3]\n  d\n[1 2]\n  reset\n[]\n```\n\nCode may be executed conditionally using `if`.\n\n```\n  if(t 1 2)\n[1]\n  if(f 3 4)\n[1 4]\n```\n\nFunctions may be called by suffixing names with argument lists.\n\n```\n  +(35 7)\n[42]\n```\n\nNew functions may be defined using `func`.\n\n```\n  func(foo () (Int) 42)\n[]\n  foo\n[42]\n```\n\nValues may be bound to identifiers using `bind`.\n\n```\n  bind(foo 42)\n[]\n  foo\n[42]\n```\n\nThe REPL is heavily parameterized and assumes very little about the actual language.\n\n```\nscope := gofu.Scope()\nblock := gofu.Block()\nthread := gofu.Thread(scope)\nutils.Repl(scope, parsers.Any(), block, thread)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodr7%2Fgofu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodr7%2Fgofu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodr7%2Fgofu/lists"}