{"id":20459763,"url":"https://github.com/rosbit/go-elisp","last_synced_at":"2026-06-01T04:31:51.335Z","repository":{"id":144249323,"uuid":"501119851","full_name":"rosbit/go-elisp","owner":"rosbit","description":"an embeddable Lisp","archived":false,"fork":false,"pushed_at":"2023-07-03T10:02:24.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T11:16:57.774Z","etag":null,"topics":["embeddable","extension","golang","lisp"],"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/rosbit.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-08T06:00:19.000Z","updated_at":"2022-06-11T06:35:48.000Z","dependencies_parsed_at":"2025-01-15T23:53:39.226Z","dependency_job_id":"f2732531-d03a-435a-b0bc-ca64ff42ac30","html_url":"https://github.com/rosbit/go-elisp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rosbit/go-elisp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fgo-elisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fgo-elisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fgo-elisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fgo-elisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosbit","download_url":"https://codeload.github.com/rosbit/go-elisp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosbit%2Fgo-elisp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33760645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["embeddable","extension","golang","lisp"],"created_at":"2024-11-15T12:17:12.838Z","updated_at":"2026-06-01T04:31:51.317Z","avatar_url":"https://github.com/rosbit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-elisp, an embeddable Lisp\n\n[Zygomys](https://github.com/glycerine/zygomys) is an embedded scripting language implemented in pure Go.\n\n`go-elisp` is a package extending the Zygomys and making it a **pragmatic embeddable** language.\nWith some helper functions provided by `go-elisp`, calling Golang functions or modules from Zygomys, \nor calling Zygomys functions from Golang are both very simple. So, with the help of `go-elisp`.\n\n### Usage\n\nThe package is fully go-getable, so, just type\n\n  `go get github.com/rosbit/go-elisp`\n\nto install.\n\n#### 1. Evaluate expressions\n\n```go\npackage main\n\nimport (\n  \"github.com/rosbit/go-elisp\"\n  \"fmt\"\n)\n\nfunc main() {\n  ctx := elisp.New()\n\n  res, _ := ctx.Eval(\"(+ 1 2)\", nil)\n  fmt.Println(\"result is:\", res)\n}\n```\n\n#### 2. Go calls Lisp function\n\nSuppose there's a Lisp file named `a.lp` like this:\n\n```scheme\n(def add [a b] (+ a b))\n```\n\none can call the Lisp function `add` in Go code like the following:\n\n```go\npackage main\n\nimport (\n  \"github.com/rosbit/go-elisp\"\n  \"fmt\"\n)\n\nvar add func(int, int)int\n\nfunc main() {\n  ctx := elisp.New()\n  if _, err := ctx.EvalFile(\"a.pl\", nil); err != nil {\n     fmt.Printf(\"%v\\n\", err)\n     return\n  }\n\n  if err := ctx.BindFunc(\"add\", \u0026add); err != nil {\n     fmt.Printf(\"%v\\n\", err)\n     return\n  }\n\n  res := add(1, 2)\n  fmt.Println(\"result is:\", res)\n}\n```\n\n#### 3. Lisp calls Go function\n\nLisp calling Go function is also easy. In the Go code, make a Golang function\nas Lisp user function by calling `MakeUserFunc(\"funcname\", function)`. There's the example:\n\n```go\npackage main\n\nimport \"github.com/rosbit/go-elisp\"\n\n// function to be called by Lisp\nfunc adder(a1 float64, a2 float64) float64 {\n    return a1 + a2\n}\n\nfunc main() {\n  ctx := elisp.New()\n\n  ctx.MakeUserFunc(\"adder\", adder)\n  ctx.EvalFile(\"b.lp\", nil)  // b.lp containing code calling \"adder\"\n}\n```\n\nIn Lisp code, one can call the registered function directly. There's the example `b.lp`.\n\n```scheme\n(display (adder 1 100)) ;the function \"adder\" is implemented in Go \n```\n\n#### 4. Set many user functions and global variables at one time\n\nIf there're a lot of functions and variables to be registered, a map could be constructed and put as an\nargument for functions `EvalFile` or `Eval`.\n\n```go\npackage main\n\nimport \"github.com/rosbit/go-elisp\"\nimport \"fmt\"\n\ntype M struct {\n   Name string\n   Age int\n}\nfunc (m *M) IncAge(a int) {\n   m.Age += a\n}\n\nfunc adder(a1 float64, a2 float64) float64 {\n    return a1 + a2\n}\n\nfunc main() {\n  vars := map[string]interface{}{\n     \"m\": \u0026M{Name:\"rosbit\", Age:1}, // to Lisp map\n     \"adder\": adder,                // to Lisp user function\n     \"a\": []int{1,2,3}              // to Lisp array\n  }\n\n  ctx := elisp.New()\n  if _, err := ctx.EvalFile(\"file.lp\", vars); err != nil {\n     fmt.Printf(\"%v\\n\", err)\n     return\n  }\n\n  res, err := ctx.GetGlobal(\"a\") // get the value of var named \"a\". Any variables in script could be get by GetGlobal\n  if err != nil {\n     fmt.Printf(\"%v\\n\", err)\n     return\n  }\n  fmt.Printf(\"res:\", res)\n}\n```\n\n### Status\n\nThe package is not fully tested, so be careful.\n\n### Contribution\n\nPull requests are welcome! Also, if you want to discuss something send a pull request with proposal and changes.\n__Convention:__ fork the repository and make changes on your fork in a feature branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Fgo-elisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosbit%2Fgo-elisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosbit%2Fgo-elisp/lists"}