{"id":18043372,"url":"https://github.com/deedlefake/wdte","last_synced_at":"2025-04-09T22:10:28.199Z","repository":{"id":56552717,"uuid":"88701983","full_name":"DeedleFake/wdte","owner":"DeedleFake","description":"WDTE is a simple, functional-ish, embedded scripting language.","archived":false,"fork":false,"pushed_at":"2023-02-17T21:38:41.000Z","size":92162,"stargazers_count":21,"open_issues_count":33,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-23T23:51:35.624Z","etag":null,"topics":["embedded-scripting-language","golang","golang-library","hacktoberfest","scripting-language"],"latest_commit_sha":null,"homepage":"https://deedlefake.github.io/wdte","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/DeedleFake.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":"2017-04-19T04:49:12.000Z","updated_at":"2025-01-01T13:38:08.000Z","dependencies_parsed_at":"2024-06-19T11:28:58.562Z","dependency_job_id":"25db268e-02b8-46b7-99af-c08aa7c66c20","html_url":"https://github.com/DeedleFake/wdte","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeedleFake%2Fwdte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeedleFake%2Fwdte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeedleFake%2Fwdte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeedleFake%2Fwdte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeedleFake","download_url":"https://codeload.github.com/DeedleFake/wdte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119294,"owners_count":21050755,"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":["embedded-scripting-language","golang","golang-library","hacktoberfest","scripting-language"],"created_at":"2024-10-30T17:08:33.447Z","updated_at":"2025-04-09T22:10:28.178Z","avatar_url":"https://github.com/DeedleFake.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"wdte\n====\n\n[![GoDoc](https://godoc.org/github.com/DeedleFake/wdte?status.svg)](https://godoc.org/github.com/DeedleFake/wdte)\n[![Go Report Card](https://goreportcard.com/badge/github.com/DeedleFake/wdte)](https://goreportcard.com/report/github.com/DeedleFake/wdte)\n[![cover.run](https://cover.run/go/github.com/DeedleFake/wdte.svg?style=flat\u0026tag=golang-1.10)](https://cover.run/go?tag=golang-1.10\u0026repo=github.com/DeedleFake/wdte)\n\nWDTE is a simple, functional-ish, embedded scripting language.\n\nWhy does this exist?\n--------------------\n\nGood question. In fact, I found myself asking the same thing, hence the name.\n\nI had a number of design goals in mind when I started working on this project:\n\n* Extremely simple. Entire grammar is less than 20-30 lines of specification.\n* Grammar is LL(1) parseable.\n* Functional-ish, but not particularly strict about it.\n* Designed primarily for embedding.\n* Extremely easy to use from the binding side. In this case, that's primarily Go.\n\nIf you want to try the language yourself, feel free to take a look at [the playground][playground]. It shows not only some of the features of the language in terms of actually writing code in it, but also how embeddable it is. The playground runs entirely in the browser *on the client's end* thanks to WebAssembly.\n\nExample\n-------\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/DeedleFake/wdte\"\n\t\"github.com/DeedleFake/wdte/wdteutil\"\n)\n\nconst src = `\nlet i =\u003e import 'some/import/path/or/another';\n\ni.print 3;\n+ 5 2 -\u003e i.print;\n7 -\u003e + 5 -\u003e i.print;\n`\n\nfunc im(from string) (*wdte.Scope, error) {\n\treturn wdte.S().Map(map[wdte.ID]wdte.Func{\n\t\t\"print\": wdteutil.Func(\"print\", func(v interface{}) interface{} {\n\t\tfmt.Println(v)\n\t\treturn v\n\t}),\n\t}), nil\n}\n\nfunc Sum(frame wdte.Frame, args ...wdte.Func) wdte.Func {\n\tframe = frame.Sub(\"+\")\n\n\tif len(args) \u003c 2 {\n\t\treturn wdteutil.SaveArgs(wdte.GoFunc(Sum), args...)\n\t}\n\n\tvar sum wdte.Number\n\tfor _, arg := range args {\n\t\tsum += arg.(wdte.Number)\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tm, err := wdte.Parse(strings.NewReader(src), wdte.ImportFunc(im), nil)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error parsing script: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\n\tscope := wdte.S().Add(\"+\", wdte.GoFunc(Sum))\n\n\tr := m.Call(wdte.F().WithScope(scope))\n\tif err, ok := r.(error); ok {\n\t\tfmt.Fprintf(os.Stderr, \"Error running script: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n```\n\n##### Output\n\n```\n3\n7\n12\n```\n\nDocumentation\n-------------\n\nFor an overview of the language's design and features, see [the GitHub wiki][wiki].\n\nStatus\n------\n\nWDTE is in a pre-alpha state. It is filled with bugs and large amounts of stuff are subject to change without warning. That being said, if you're interested in anything, feel free to submit a pull request and get things fixed and/or implemented faster.\n\n[playground]: https://deedlefake.github.io/wdte\n[wiki]: https://github.com/DeedleFake/wdte/wiki\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeedlefake%2Fwdte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeedlefake%2Fwdte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeedlefake%2Fwdte/lists"}