Skip to content

Latest commit

 

History

736 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genotype logotype

Programming Language

A programming language that transpiles to idiomatic TypeScript/Rust/Python types, allowing effortless type-safe interop between languages.

WebsiteDocsLanguage TourPlaygroundDiscord

Why Genotype?

Genotype is built for teams working with multiple programming languages (e.g., TypeScript front-end with Rust back-end), building API clients, file formats and standards, gradual language migration, etc.

Genotype is a small language that you can learn in 15 minutes, but it is feature-rich and allows expressing the most complex data structures. It has generics, supports recursive data types, and allows target-specific fine-tuning via annotations.

It isn't opinionated and adapts to the ecosystem instead of creating one. Want to generate Zod schemas instead of plan types? No problem! Need a ready-to-ship package or want to generate code right into existing modules? Can do! Need support for legacy Python versions? Absolutely.

Unlike most machine-generated code, the code Genotype produces is clean, follows the idiomatic naming for types and files, and follows the common conventions.

And of course, Genotype is AI agent-ready and provides skill, llms.txt, and leaves code comment breadcrumbs to help steer LLMs into using it correctly.

Why Not Protobuf or Similar?

Genotype indeed overlaps with Protocol Buffers, but it doesn't impose the transport or storage format. It focuses on producing clean idiomatic types with minimal to no runtime instead of optimizing data transfer performance. TypeScript has no runtime at all. Rust and Python use standard Serde and Pydantic to close the gaps.

As a result, it better fits when developing API clients and web app client-server interop. It's more flexible and allows more complex data types and data shapes Protobuf cannot express directly.

Installation

macOS/Linux

Install the Genotype CLI on macOS or Linux by running the following command in your terminal:

curl -fsSL https://genotype-lang.org/install.sh | sh

Windows

Install the Genotype CLI on Windows by running the following command in PowerShell:

irm https://genotype-lang.org/install.ps1 | iex

See Installation Reference for more options, such as Cargo Binstall, building from source, etc.

Quick Start

Try it out:

mkdir hello-world && cd hello-world
gt init
gt build

This will create a build a new project with a language guide demonstrating the Genotype syntax and features.


See the Getting Started guide for more details.

License

MIT © Sasha Koss

About

Programming language that transpiles to other language types (TS, Python, etc)

Topics

Resources

Contributing

Stars

47 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages