{"id":19986637,"url":"https://github.com/paul-go/truth","last_synced_at":"2025-07-03T07:35:46.728Z","repository":{"id":57380349,"uuid":"140905596","full_name":"paul-go/Truth","owner":"paul-go","description":"A Domain Representation Language","archived":false,"fork":false,"pushed_at":"2020-07-26T22:19:53.000Z","size":19023,"stargazers_count":24,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-28T05:44:06.628Z","etag":null,"topics":["format","homoiconic","meta-language","meta-programming","type-safety","type-system"],"latest_commit_sha":null,"homepage":"https://www.truthlanguage.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paul-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-14T01:11:16.000Z","updated_at":"2024-10-05T22:54:31.000Z","dependencies_parsed_at":"2022-09-05T14:31:20.816Z","dependency_job_id":null,"html_url":"https://github.com/paul-go/Truth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-go%2FTruth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-go%2FTruth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-go%2FTruth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-go%2FTruth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paul-go","download_url":"https://codeload.github.com/paul-go/Truth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252304776,"owners_count":21726611,"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":["format","homoiconic","meta-language","meta-programming","type-safety","type-system"],"created_at":"2024-11-13T04:29:49.893Z","updated_at":"2025-05-04T07:31:30.791Z","avatar_url":"https://github.com/paul-go.png","language":"TypeScript","readme":"![](./hero.jpg)\n\n## Introduction\n\nTruth is a method for classifying conscious understanding. It does so by providing the human a computationally-aware method of indicating _what things are_ (\"is-a\" relationships), and what they have (\"has-a\" relationships). Through these declarations of existence, a body of information is gradually formed that is guaranteed to be devoid of inaccuracies and falsehoods.\n\nTruth was not constructed by fiat. It's characteristics are not a mere convenient recipe designed to address some transient need. Rather, it's a design that was uncovered through ontological and epistemological reasoning, and refined through intense scrutiny. Because of this, many of the rules can be intuited without reading any documentation, and instead by simply walking through the line of reasoning intellectually.\n\nIn Truth, there is no inherent distinction between structure and data, nor is there a concept of a binary class/instance relationship. Everything is an abstract *Type*. Constraints are introduced by establishing is-a relationships between types.\n\n**Truth is not a system for expressing computation**. Truth is immutable, stateless, unconditional and timeless. Therefore, writing Truth is not to be considered an act of *programming*.\n\n## Language Overview\n\nIn the beginning, Truth is formless and empty. There exists absolutely nothing–no strings, numbers, or data types of any kind. There are no keywords or built-in framework. The main construct is the `:`, called the *Joint*, which loosely translates to \"is a kind of\":\n\n```\nPlant\nTree : Plant\n```\n\nSeparate lines in Truth are like sentences, each being a separate statement of existence. And so in English, the above Truth translates to \"There exists what we call Plant. There also exists what we call Tree, which is a kind of Plant\".\n\n*Has-a* relationships are expressed through indentation. The indentation pattern is infinitely recursive, allowing statements to be nested as many levels as necessary.\n\n```\nNumber\nPlant\nTree : Plant\n\tHeight : Number\n\t\tMinimum : Number\n\t\tMaximum : Number\n```\n\n## Patterns \u0026 Aliases\n\nIn Truth, there are *Patterns*, which are regular expressions that essentially say \"when a term to the right of a joint is encountered that conforms to this pattern, make it a ...\". As stated above, Truth does not have any built-in data types. They must be established by the user, with patterns being one of the core mechanisms by which this is done. Lines that start with a `/` are interpreted as Patterns:\n\n```\nDecimal\n/\\d+\\.\\d+ : Decimal\nPi : 3.1415926\nPhi : 1.6180339\n```\n\nThis Truth establishes a rule that any term composed from 1 or more digits, followed by a dot, followed by 1 or more digits is assumed to be a Decimal. And so we have two constants declared, Pi and Phi, which are inferred as Decimals.\n\n## Inheritance\n\nSingle and multiple inheritance are foundational constructs of cognition, and so they exist in Truth. The Truth compiler accepts any inheritance hierarchy forming an arbitrarily complex directed acyclic graph. Below, we demonstrate a classic diamond-shaped inheritance structure:\n\n```\nString\nNumber\nLanguage\n\nEmployee\n\tName : String\n\t\nEngineer : Employee\n\tSpecialization : Language\n\t\nSalesman : Employee\n\tCommission Rate : Number\n\t\nSales Engineer : Engineer, Salesman\n```\n\nFrom this Truth, the compiler would be able to infer that `Sales Engineer` has a `Name`, a `Specialization` and a `Commission Rate`, all without these being declared explicitly.\n\n## Faults\n\nThere are many ways by which falsehoods may contaminate Truth. Fortunately, the Truth compiler is able to detect these and call them out. One such falsehood is described below, specifically on the last line:\n\n```\nLanguage\n\nSystems Language : Language\nC++, Rust : Systems Language\n\nQuery Language : Language\nSQL, GraphQL : Query Language\n\nEngineer\n\tSpecialization : Language\n\nSystems Engineer : Engineer\n\tSpecialization : Systems Language\n\nRobert : Systems Engineer\n\tSpecialization : Rust\n\nJoseph : Systems Engineer\n\tSpecialization : SQL\n```\n\nAn *Engineer* has a *Specialization*, which is a *Language*. A *Systems Engineer* is defined as a kind of engineer whose specialization is more specifically a *Systems Language*. Joseph purports to be a Systems Engineer, however, his specialization is *SQL*, which is a *Query Language*, and hence the falsehood.\n\n## Project Status\n\n- The Truth compiler is being actively developed by a real company with enterprise customers and a sound business model. It's being used to tackle some of the most challenging data complexity problems.\n\n## Installing\n\n```\nnpm install truth-compiler --save\n```\n\n## Longevity\n\nTruth is being actively developed by a real company with enterprise customers and a sound business model. It's being used to tackle some of the most challenging data complexity problems.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-go%2Ftruth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaul-go%2Ftruth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-go%2Ftruth/lists"}