{"id":20642422,"url":"https://github.com/ipld/go-datalark","last_synced_at":"2025-04-16T01:41:22.121Z","repository":{"id":38209950,"uuid":"408048416","full_name":"ipld/go-datalark","owner":"ipld","description":"Use IPLD from Starlark -- read and write data, and play programmagically in an interpreted language!","archived":false,"fork":false,"pushed_at":"2022-11-27T01:41:12.000Z","size":139,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-25T09:51:20.454Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipld.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}},"created_at":"2021-09-19T06:15:47.000Z","updated_at":"2023-05-26T12:54:28.000Z","dependencies_parsed_at":"2023-01-23T17:00:08.800Z","dependency_job_id":null,"html_url":"https://github.com/ipld/go-datalark","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fgo-datalark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fgo-datalark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fgo-datalark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fgo-datalark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipld","download_url":"https://codeload.github.com/ipld/go-datalark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182797,"owners_count":21226123,"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":[],"created_at":"2024-11-16T16:09:06.451Z","updated_at":"2025-04-16T01:41:22.102Z","avatar_url":"https://github.com/ipld.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-datalark\n===========\n\nBindings for IPLD in Starlark.\n\n**Starlark** is a dynamic interpreted language that is easy to embed in golang programs\n(and also has interpreters in Rust, and in Java -- it can probably go anywhere).\nThe syntax is python-like and easily approachable for developers from many backgrounds.\n(Remarkably, it's also *non-turing complete* and inherently sandboxed -- it has no access to a host enviroment\n(unless you intentionally give the interpreter sandbox custom functions that can do that!).)\n\n**IPLD** is a data interchange standard, with emphasis on utility in the decentralized web.\n\n**Marrying Starlark and IPLD** gives you a data interchange format that can talk to many kinds of APIs\nand is great for building new protocols...\n_and_ gives you a full-fledged (yet sandboxed, safe) langauge you can use for anything\nfrom basic templating (e.g. for config files) all the way to being a generic data transform language.\n\n\nFeatures\n--------\n\n- Wrap `ipld.Node` values from golang and hand them to a Starlark interpreter to read.\n\n- Get constructor functions you can hand to a Starlark interpreter so it can make basic `ipld.Node`s (maps, strings, lists, etc etc).\n\n- Combined with `bindnode.Wrap`: easily expose arbitrary golang structs and types to a Starlark interpreter environment to read as if they were dicts and lists and regular starlark values.\n\n- Combined with [IPLD Schemas](https://ipld.io/docs/schemas/): get constructor functions you can hand to a Starlark interpreter to make _those types_.\n\t- ... so that you can access all of IPLD Schema's validation powers from within Starlark!\n\t- ... so that you can use kwargs initialization to create struct types with syntactic grace.\n\t- ... so that you can have dotted access to struct fields in the Starlark syntax, just like you'd expect.\n\t- ... so that, together with `bindnode`, you can fill in golang native structs from Starlark with ease!\n\n- Does it support [ADLs](https://ipld.io/glossary/#adl)?  Of course it does!\n\t- ADLs are just `ipld.Node`s, so they work with datalark just like any other nodes do.  No fuss.\n\n- Use Starlark's regular `print` function to get the IPLD debug printout format for data, for rapid development and easy debugging.\n\n- Well-behaved as a library: go-datalark doesn't wrap the Starlark interpreter or do any other weird non-composable hacks:\n  it just gives you functions and variables that you hand into the Starlark environment\n  (and, a few helper functions to make that even easier to do).\n  That's it.  It's totally composable.\n\n\nStatus\n------\n\nDatalark should currently be considered in an alpha or beta status.\nIt's working, but there is currently no promise of API stability.\nSome features may also be missing.\n\nThe best way to increase the stability and completeness of datalark is to start using it!\nWe're adding features as the demand for them is found.\n\n\nNaming Convention\n-----------------\n\nVariables used in the engine of datalark occasionally use prefixes, for example names such as \"skey\" and \"starVal\" and \"hostItem\". The prefixes in total are \"host\", \"star\", \"node\", and the single letter prefixes \"h\", \"s\", \"n\" and \"g\", \"t\", \"m\" respectively.\n\nWhile we normally avoid things like [Hungarian Notion](https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/) and just let the type system do its job, the prefixes in use here are doing something different. Since datalark exists as a middle layer between two type systems (ipl and starlark), we end up with lots of different kinds of objects that all represent the same abstract data. For example, a string could be a \"datalark.String\", or a \"starlark.String\", or a \"ipld.datamodel.Node\" of type \"string\", or a native go-lang \"string\". Often these types all appear at once in the same function, and this is not something a type system alone does not do a good job of differentiating. Trying to use only unprefixed names will lead to either confusing or inconsistent code across functions, and code that is much more difficult to read.\n\nThe variable name prefixes in use:\n\n```\nprefix      type system           examples\n\nh/g/host    datalark              hval, hostVal\ns/t/star    starlark              skey, starObj\nn/m/node    ipld.datamodel.Node   nodeMapIter\n(plain)     go-lang native value  name, err\n```\n\nContributing\n------------\n\nIf you'd like to dive deep in on code, there's a [HACKME](engine/HACKME.md) guide\nin the engine package which gives some pointers for how to orient yourself in the code.\n\nIf you want to get in touch with folks working on this for a chat:\nthis project is part of the IPLD community, so you can follow any of the suggestions\nin https://github.com/ipld/ipld#finding-us -- there's a matrix chat, and a discord bridged to it,\nand you should find some friendly folks there.\n\n\nLicense\n-------\n\nSPDX-License-Identifier: Apache-2.0 OR MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipld%2Fgo-datalark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipld%2Fgo-datalark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipld%2Fgo-datalark/lists"}