{"slug": "tinys-python-shaped-syntax-with-rust-semantics", "title": "TinyS – Python-shaped syntax with Rust semantics", "summary": "TinyS is a new programming language that offers Python-shaped syntax with Rust semantics, transpiling to Rust and compiling to native binaries without a garbage collector or runtime. The language, detailed in a GitHub repository, supports ownership, borrowing, lifetimes, traits, and Result-based errors from Rust, while providing Python-like indentation-based syntax and immutable-by-default variables.", "body_md": "If you are an AI developer wanting to learn rust, you can take all your python knowledge and put it into TinyS ;-)\n\n**Python-shaped syntax, Rust semantics, native binaries.**\n\nYou write indentation-based `.sn`\n\nsource; it transpiles to Rust and compiles to\na native binary. No GC, no runtime — ownership, borrowing, lifetimes, traits,\nand `Result`\n\n-based errors all carry over from Rust unchanged.\n\n```\n.sn source  →  generated .rs  →  rustc / Cargo  →  native binary\n```\n\nPython's *look*, not Python's *guarantees*: conditions must be `bool`\n\n, matches\nare exhaustive, no implicit truthiness, no implicit conversion, no `null`\n\n.\n\n| TinyS | Rust |\n|---|---|\n`def f(x: i32) -> i32:` |\n`fn f(x: i32) -> i32 {}` |\n`list[i32]` / `dict[str,i32]` |\n`Vec<i32>` / `HashMap<…>` |\n`ref T` / `mut ref T` |\n`&T` / `&mut T` |\n`at value` |\n`*value` |\n`.a` , `.source` |\n`'a` , `'source` |\n`Result[User, Error]` |\n`Result<User, Error>` |\n`match` / `case` |\n`match` arms |\n`and` / `or` / `not` |\n`&&` / `||` / `!` |\n`str` / `ref str` |\n`String` / `&str` |\n`from rust.regex import …` |\n`use regex::…` |\n\n``` python\nfrom rust.serde import Serialize, Deserialize\n\n#[derive(Debug, Clone, Serialize, Deserialize)]\nstruct User:\n    id: u64\n    name: str\n\nimpl User:\n\n    def greeting(self: ref Self) -> str:\n        return format(\"Hello, {}\", self.name)\n\ndef main() -> void:\n    user = User(id=1, name=\"Ada\")\n    print(user.greeting())\n```\n\n**Immutable by default**—`count = 0`\n\n, opt into mutation with`mut total = 0`\n\n.**Borrowing is a keyword**—`ref`\n\n/`mut ref`\n\ninstead of`&`\n\n/`&mut`\n\n; dereference with`at`\n\n;`move`\n\nfor explicit ownership transfer.**Errors**—`Result`\n\n/`Option`\n\n,`?`\n\npropagation,`none`\n\nfor absence. No exceptions.**Pattern matching**— exhaustive, an expression;`_`\n\nwildcard,`|`\n\nalternatives,`if`\n\nguards,`as`\n\nbinds the whole value.**Control flow is expression-oriented**—`if`\n\n,`match`\n\n, and`loop`\n\nproduce values.**Async**—`async def`\n\nwith postfix`.await`\n\n.**Rust interop is always visible**— crates come through the`rust`\n\nroot (`from rust.serde import …`\n\n); macros are imported and called without`!`\n\n.**Packaging**—`tinys.toml`\n\nmaps onto Cargo; modules follow the file layout.\n\nFull design drafts live in [doc/draft/](/ewiger/TinyS/blob/main/doc/draft); see the [README](/ewiger/TinyS/blob/main/README.md)\nfor the complete tour.", "url": "https://wpnews.pro/news/tinys-python-shaped-syntax-with-rust-semantics", "canonical_source": "https://github.com/ewiger/TinyS/blob/main/TLDR.md", "published_at": "2026-07-22 00:41:05+00:00", "updated_at": "2026-07-22 00:52:13.397082+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["TinyS", "Rust", "Python", "Cargo"], "alternates": {"html": "https://wpnews.pro/news/tinys-python-shaped-syntax-with-rust-semantics", "markdown": "https://wpnews.pro/news/tinys-python-shaped-syntax-with-rust-semantics.md", "text": "https://wpnews.pro/news/tinys-python-shaped-syntax-with-rust-semantics.txt", "jsonld": "https://wpnews.pro/news/tinys-python-shaped-syntax-with-rust-semantics.jsonld"}}