{"id":19596850,"url":"https://github.com/cdiggins/plato","last_synced_at":"2026-03-07T21:32:20.615Z","repository":{"id":37600379,"uuid":"325881124","full_name":"cdiggins/plato","owner":"cdiggins","description":"A simple and efficient cross-platform programming language. ","archived":false,"fork":false,"pushed_at":"2025-04-26T14:57:07.000Z","size":116969,"stargazers_count":91,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-15T21:52:25.582Z","etag":null,"topics":["functional-programming","learn-to-code","programming-language","teaching"],"latest_commit_sha":null,"homepage":"","language":"C#","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/cdiggins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2020-12-31T22:17:07.000Z","updated_at":"2025-07-23T11:00:19.000Z","dependencies_parsed_at":"2024-12-25T11:14:47.765Z","dependency_job_id":"589b8e28-7779-4da2-9234-c6b00a409ef2","html_url":"https://github.com/cdiggins/plato","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cdiggins/plato","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fplato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fplato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fplato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fplato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdiggins","download_url":"https://codeload.github.com/cdiggins/plato/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdiggins%2Fplato/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30231634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: 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":["functional-programming","learn-to-code","programming-language","teaching"],"created_at":"2024-11-11T08:56:56.396Z","updated_at":"2026-03-07T21:32:20.594Z","avatar_url":"https://github.com/cdiggins.png","language":"C#","readme":"# Plato Overview\n\n**Plato** is a high-performance cross-platform programming language designed for 2D and 3D geometry algorithms and data structures.  \n\n## Plato Examples\n\nThe [Plato.Geometry](https://github.com/ara3d/Plato.Geometry) contains a large library of \nPlato functions and types in the [`/plato-src`](https://github.com/ara3d/Plato.Geometry/tree/main/plato-src) folder.\n\n## About the Language\n\nPlato is a statically typed functional language that looks and behaves like an \nobject-oriented scripting language, but with a lot less complexity.  \n\nThe most notable features of Plato are:\n\n- all types are immutable\n- there are no implicit `this` parameters   \n- no distinction between methods and functions -- all functions are like C# extension methods  \n- no visibility modifiers (e.g., public, private, protected, internal), \n- no virtual or abstract methods. \n- support for generic types and generic methods\n- default implementations common functions (e.g., like C# records) \n    - constructors\n    - conversion to string\n    - implicit casts to/from tuples\n    - immutable setters (i.e., `WithX` functions) \n- operator overloading -- implied by special named functions\n- functions with no parameters are treated like properties\n\n## Motivation \n\nPlato is being used to **develop cross-platform libraries** that form the basis for software we are developing at \n[Ara 3D](https://ara3d.com). We do a lot of computational geometry work in different languages\nand recreating and maintaining high-performance code for multiple platforms and languages was too costly and burdensome for a\nsmall company. \n\nNo existing language provides the appropriate mix of simplicity, abstraction, and performance. \n\n## About the Implementation and Tooling\n\nPlato is being designed to allow multiple implementations. We are actively developing and using a Plato to C# compiler.\n\nThe Plato to C# compiler is all open-source, and was built in tandem with the [Parakeet parsing library](https://github.com/ara3d/parakeet). \n\n## Why Plato Instead of C# \n\nUsing Plato instead of C# has the following advantages:\n\n1. Code can be reused in other contexts (e.g., JavaScript, WASM, Rust, GLSL)\n2. Significantly reduces the amount of boilerplate code a user has to write\n3. Code is easier to read and maintain \n4. _WIP:_ Code will be faster  \n\n## Plato Performance \n\nCurrently the Plato compiler produces code which is on par with well-written code in C# in terms of performance. \n\n# Plato in Depth\n\nThe top-level abstractions in Plato are: \n\n* Libraries - collections of functions  \n* Types - data structures\n* Interfaces - abstract data types \n\n## Libraries\n\nA Plato library contains only functions. It is similar to a static class with extension methods in C#. \nLibrary functions can be called using a dot syntax using the first parameter on the left of a dot. \nFurthermore, any function with no arguments, can be invoked as if it was a parameter. \nFunction parameters can be a mix of either types or interfaces. \n\nFor example:\n\n```\nlibrary MyLibrary\n{ \n    Square(x: Number): Number\n        =\u003e x * x;\n\n    SumSquares(v: Vector): Number\n    {\n        var r = v[0].Square;\n        for (var i=1; i \u003c v.Count; ++i)\n            r += v[i].Square;\n        return r;\n    }\n\n    Magnitude(v: Vector): Number\n        =\u003e v.SumSquares.Sqrt;\n} \n```\n\n### Types\n\nA type is a concrete data structure. \nIt is similar to a record, struct, or class in other languages. \nIt contain fields, and decares the interfaces that it implements. \nUnlike traditional object-oriented languages, it does not have member functions (aka methods). \n\n```plato\ntype Vector2D\n    implements Vector\n{\n    X: Number;\n    Y: Number;\n}\n```\n\n### Interface\n\nAn interface is an abstract data type. \nIt declares a list of functions that can be called on any type implementing the interface.\nIn the context of the interface, the implementing type is called `Self`.\n\nInterface can inherit from other interfaces. \n\n```plato\ninterface IArray\u003cT\u003e\n{\n    Count(xs: Self): Integer;\n    At(xs: Self, n: Integer): T;\n}\ninterface IVector\n    inherits IArray\u003cNumber\u003e, INumerical, IEquatable, ICoordinate\n{\n}\n```\n\n## Generic Functions  \n\nPlato transforms any function that uses interfaces into a generic function. Every interface reference becomes a constrained type parameter. \n\nSo for example:\n\n ```typescript\n\t    //  https://en.wikipedia.org/wiki/Quadratic_function\n\t    Quadratic(x: Number, a: INumerical, b: INumerical, c: INumerical): INumerical\n\t        =\u003e a * x.Sqr + b * x + c;\n```\n\nBecomes in C# :\n\n```csharp\n\t    //  https://en.wikipedia.org/wiki/Quadratic_function\n\t    public static T Quadratic\u003cT\u003e(this double x, T a, T b, T c) where T : INumerical\u003cT\u003e\n\t        =\u003e a * x.Sqr() + b * x + c;\n```\n\nThis is a simplification made for users who don't understand type parameter, that has a trade-off in that things are less precise. \n\nThe original function signature doesn't strictly say that the return type and the parameters a, b, and c, are all the same. This is just something the language assumes. \n\nIf you have two parameters that can be different but use the same interface, usually they won't be type constrained. In this case you can explicitly use a system called Type Variables. \n\nFor example:\n\n```typescript\n\tZip(xs: IArray\u003c$T0\u003e, ys; IArray\u003c$T1\u003e, f: Function2\u003c$T0, $T1, $TR\u003e): IArray\u003c$TR\u003e \n\t\t=\u003e xs.Count.MapRange(i =\u003e f(xs[i], ys[i])); \n```\n\nIn this case the Type parameters are implied, by the use of TypeVariables (type names preceded by a $). \n\n```csharp\n\tpublic static IArray\u003cTR\u003e Zip\u003cT0, T1, TR\u003e(this IArray\u003cT0\u003e xs, IArray\u003cT1\u003e ys, System.Func\u003cT0, T1, TR\u003e f) =\u003e xs.Count.MapRange(i =\u003e f(xs[i], ys[i])); \n```\n\n## Visual Syntax \n\nPlato is designed so that it can be translated to/from a visual data-flow graph. This visual syntax is called `PlatoFlow`, and is under development.  \n\n## Building Plato \n\nPlato tools and libraries are not intended for general usage yet. \nThis repository currently compiles only when used as a submodule from within \nthe [Ara3D main repository](https://github.com/ara3d/ara3d).   \n\n## Status\n\nWhile the language design is still undergoing a few minor tweaks, it is starting to reach a stable equilibrium. \n\n## Ideas for Contributions\n \nSome ideas for highly motivated and patient people who are interested in contributing to the Plato project:\n\n* Optimizers - in particular Plato to Plato rewriting tools\n* Type checking and inference tools \n* Transpilers to other languages (e.g., JavaScript, GO, Rust, Dart, Java, C++, GLSL, etc.) \n* Support for Plato syntax in popular coding tools (e.g., VS Code, Visual Studio, Avalon Edit, Scintilla, etc.)\n\n## Feedback\n\nI am always interested in feedback in any form. You can find [me on LinkedIn](https://www.linkedin.com/in/cdiggins/) \nor mail me at [cdiggins@gmail.com](mailto:cdiggins@gmail.com).\n\n\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdiggins%2Fplato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdiggins%2Fplato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdiggins%2Fplato/lists"}