{"id":20517583,"url":"https://github.com/julian-klode/lingolang","last_synced_at":"2025-06-13T12:04:51.216Z","repository":{"id":57525304,"uuid":"90152707","full_name":"julian-klode/lingolang","owner":"julian-klode","description":"WIP (very WIP): Linear Typing for Go (master's thesis)","archived":false,"fork":false,"pushed_at":"2017-12-19T16:48:07.000Z","size":653,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T23:44:27.009Z","etag":null,"topics":["go","golang","linear","typesystem"],"latest_commit_sha":null,"homepage":"http://lingolang.jak-linux.org/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julian-klode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-03T13:34:52.000Z","updated_at":"2024-05-22T23:19:42.000Z","dependencies_parsed_at":"2022-09-19T11:41:32.396Z","dependency_job_id":null,"html_url":"https://github.com/julian-klode/lingolang","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/julian-klode/lingolang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julian-klode%2Flingolang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julian-klode%2Flingolang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julian-klode%2Flingolang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julian-klode%2Flingolang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julian-klode","download_url":"https://codeload.github.com/julian-klode/lingolang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julian-klode%2Flingolang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259642249,"owners_count":22888982,"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":["go","golang","linear","typesystem"],"created_at":"2024-11-15T21:36:18.610Z","updated_at":"2025-06-13T12:04:51.150Z","avatar_url":"https://github.com/julian-klode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linear typing for Go\n\nThis project aims to implements annotations for linear typing in Go, so that\nGo programs can be written without worrying about accidentally sharing mutable\nstate between goroutines.\n\n[![Build Status](https://travis-ci.org/julian-klode/lingolang.svg?branch=master)](https://travis-ci.org/julian-klode/lingolang)\n[![codecov](https://codecov.io/gh/julian-klode/lingolang/branch/master/graph/badge.svg)](https://codecov.io/gh/julian-klode/lingolang)\n![Go 1.7 or newer ](https://img.shields.io/badge/Go-1.7%2B-green.svg)\n[![GoDoc](https://godoc.org/github.com/julian-klode/lingolang?status.svg)](http://godoc.org/github.com/julian-klode/lingolang)\n[![Go Report Card](https://goreportcard.com/badge/github.com/julian-klode/lingolang)](https://goreportcard.com/report/github.com/julian-klode/lingolang)\n\n## Goal\n\nProvide a set of comment-based annotations to Go programs that restrict the\npermitted operations on values, without causing an otherwise semantic change\nto the language (every program with annotations is a valid Go program, and\ndoes not perform differently if the annotations are removed).\n\nThe idea is to implement a capability-based system, with several common\nmodifiers for linear constants, linear mutable values, pure values, and\npossibly some read-only type (where others can have a write reference too).\n\nThe capability inference and checking runs after the standard Go type checker.\n\nChecking should be incremental of some sort, so existing code can be annotated\nwithout breaking it (or causing warnings). Either by making annotations turn on\nchecking of an entire package, or (within a package?) make annotations on one\nfunction/variable require annotations on all callees/users.\n\n## Problems\n\nThe annotation approach means that any capabilities are present only at\ncompile-time and cannot be recovered at run-time - in other words, the\ncapabilities are erased (like type erasure in Java). This means that it\nis not possible to use type guards or type switches to decide between mutable\nand non-mutable implementations of an interface, for instance. It seems unlikely\nthat we can even store both of them in the same interface{} value, though, so\nit does not seem like a huge problem.\n\nIf interfaces can have methods that only run on mutable receivers, then it\nwould be helpful to only have to implement the constant methods where only\nan interface with constant capabilities is requested. As our checker runs after\nthe Go type checker and does not affect the Go code at all, though, that is\nnot possible.\n\nThe capabilities model is defined for a reference-based type system. Go uses\nvalues and pointers. Maps, Arrays, and Slices can be considered references,\nthough - or: they are basically structs containing pointers. In any case, it\nseems there is no need to have an \"identity\" permission, although it might\nmake sense to have some permission for the operation of taking the address of\nsomething (the \u0026 operator).\n\n## Legal\nLinear Typing for Go is licensed under the 2 clause BSD license; basically the\nsame license as Go, just with the third clause removed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-klode%2Flingolang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulian-klode%2Flingolang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-klode%2Flingolang/lists"}