{"id":34031873,"url":"https://github.com/duck-compiler/duckc","last_synced_at":"2026-05-25T08:04:44.360Z","repository":{"id":311694580,"uuid":"1002498289","full_name":"duck-compiler/duckc","owner":"duck-compiler","description":"duck-lang is a modern, compiled and batteries included programming language for full-stack web-development on the go runtime","archived":false,"fork":false,"pushed_at":"2026-05-19T06:04:45.000Z","size":4151,"stargazers_count":146,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-19T09:25:18.803Z","etag":null,"topics":["compiler","fullstack","golang","react","tailwindcss","webdev"],"latest_commit_sha":null,"homepage":"https://duck-lang.dev","language":"Rust","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/duck-compiler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-15T15:50:07.000Z","updated_at":"2026-05-08T09:42:18.000Z","dependencies_parsed_at":"2026-01-09T10:06:45.152Z","dependency_job_id":null,"html_url":"https://github.com/duck-compiler/duckc","commit_stats":null,"previous_names":["duck-compiler/duckc"],"tags_count":167,"template":false,"template_full_name":null,"purl":"pkg:github/duck-compiler/duckc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck-compiler%2Fduckc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck-compiler%2Fduckc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck-compiler%2Fduckc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck-compiler%2Fduckc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duck-compiler","download_url":"https://codeload.github.com/duck-compiler/duckc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duck-compiler%2Fduckc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33386236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","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":["compiler","fullstack","golang","react","tailwindcss","webdev"],"created_at":"2025-12-13T18:29:06.075Z","updated_at":"2026-05-23T07:13:26.678Z","avatar_url":"https://github.com/duck-compiler.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \u003cimg src=\"https://duck-lang.dev/duck.png\" width=\"200\" alt=\"Duck Programming Language Logo\"\u003e\n\n\u003cb\u003eDuck\u003c/b\u003e\u003cbr /\u003e\nthe programming language for modern full-stack web-development\n\n\u003cbr /\u003e\n\n\u003ca href=\"https://duck-lang.dev/\"\u003eWebsite\u003c/a\u003e | \u003ca href=\"https://duck-lang.dev/docs/category/tour-of-duck\"\u003eTour of Duck\u003c/a\u003e | \u003ca href=\"https://blog.duck-lang.dev/\"\u003eBlog\u003c/a\u003e | \u003ca href=\"https://github.com/duck-compiler/duckc/tree/main/std\"\u003eStandard Library\u003c/a\u003e\n\n\u003cbr /\u003e\n\n\u003c/div\u003e\n\n\u003e ⚠️ We're in an early Alpha Stage and not production ready yet. \n\n[![Discord](https://img.shields.io/discord/1375234462983524383.svg?label=Discord\u0026logo=Discord\u0026colorB=7289da\u0026style=for-the-badge)](https://discord.gg/J6Q7qyeESM)\n\nDuck is a modern, compiled and batteries included programming language for full-stack web-development, that's built on top of the go ecosystem, it leverages the concepts of duck-typing onto a fast and reliable platform while introducing JSX like server-side templating and client-side react components as first-class citizens.\n\nThis repository hosts the source code for [Duck](https://duck-lang.dev). It contains the compiler, it's build tool [dargo](https://github.com/duck-compiler/duck-spielwiese/blob/main/docs/002-dargo.md), the standard library and documentation.\n\n## ✨ Key Features\n* **Compiles to Go**: The program compiles down to a native Go binary, easy cross-compilation, and the performance of Go.\n* **Structural \"Duck\" Typing**: Based on Go structs, but flexible. You don't need explicit interface declarations; if the shape matches, it fits.\n* **Compiletime enforced mutability checks**: mutations to references are explicit and must be annotated, with the `\u0026mut`.\n* **Web Native**:\n  * **SSR**: Built-in HTML template parsing for server-side rendering.\n  * **Components**: Use React components directly within templates (with native JS support).\n  * **Duckwind**: Includes [Duckwind](https://github.com/duck-compiler/duckwind), a feature-complete Tailwind CSS alternative written in Rust that integrates directly with the language.\n\n-------------\n\n## 🛠️ Installation\n\nDuck supports **MacOS**, **Linux** and **Windows**. To manage your installation, use `duckup`, our official toolchain installer and version manager.\n\n**Homebrew**\n```sh\nbrew tap duck-compiler/duckup\nbrew install duckup\n```\n\n**Unix install script**\n```\ncurl -fsSL https://duckup.sh | bash\n```\n\n**Windows install script**\n```\npowershell -c \"irm https://win.duckup.sh | iex\"\n```\n\n**Manual duckup install**\nDownload the latest release of `duckup` for your OS from the [duckup](https://github.com/duck-compiler/duckup) repository.\n \n**Completing Installation**\n\n```sh\n# To install the latest toolchain\nduckup update\n\n# To check if everything is setup correctly\nduckup env\n\n# To see if the installation was successful, run following command\ndargo help\n```\n\n-------------\n\n## 👋 \"Hello, World\" in Duck\n\n\n```bash\n# To create a new project, run \ndargo new \u003cproject_name\u003e # you can leave the project name empty and you'll be prompted for a project name\n```\n\nThis will setup a project with `src/main.duck` looking somewhat like:\n\n```rust\nuse std::io::{println};\n\nfn main() {\n     println(\"Hello, World\");\n}\n```\n\nrun.\n```bash\n# Compile and run your application:\ndargo run\n```\n\n-------------\n\n\n## 📖 Language Quick Tour\n\n### Structural Typing\n\nDuck uses structural typing (duck typing) on top of Go structs. You don't need to define strict types for everything; partial matches work automatically.\n\n```rust\ntype User = { name: String, email: String, age: Int };\n\n// This function only cares that the argument has a 'name' field\nfn print_name(u: { name: String }) {\n    println(u.name);\n}\n\nfn main() {\n    let u = User { name: \"Duck\", email: \"robing@gmail.com\", age: 5 };\n    \n    // Works perfectly because 'User' satisfies the shape { name: String }\n    print_name(u); \n}\n```\n\n### Client Side Rendering with React\n\nDuck is built for the web. You can define React components that include native JavaScript and reference them directly in your [server side templates](#Server-Side-Rendering-with-Duckx) server-side templates.\n\n```jsx\ncomponent Counter(props: { initial_value: Int }) jsx {\n    // Write this component using jsx and preact\n    const [value, setValue] = useState(props.initial_value);\n\n    return (\n    \u003c\u003e\n        \u003cdiv\u003e\n            \u003cdiv\u003eCurrent value: {value}\u003c/div\u003e\n            \u003cbutton onClick={() =\u003e setValue((v) =\u003e v + 1)}\u003eIncrement\u003c/button\u003e\n            \u003cNoSSRProps some_client_value={\"i was passed in the browser\"}/\u003e\n        \u003c/div\u003e\n    \u003c/\u003e\n    );\n}\n```\n\n### Server Side Rendering with Duckx\nTemplates are rendered on the server, but the can also contain react client components or other templates.\nYou can pass props to a template which are never leaked to the client, as long as you don't display them in the html or use them as a className for example.\n\n```jsx\ntemplate SSRWithParam(props: { color: String, text: String }) duckx {\n    \u003cdiv style=\"color: {props.color}\"\u003e{props.text}\u003c/div\u003e\n}\n```\n\n### Use SSR templates and CSR react components all together in one final template\n\n```jsx\ntemplate FullPage(props: { values: Int[] }) duckx {\n    \u003c\u003e\n        \u003c!DOCTYPE html\u003e\n        \u003chtml lang=\"en\"\u003e\n        \u003chead\u003e\n            \u003ctitle\u003eMy page written in Duck SSR\u003c/title\u003e\n            \u003cmeta charset=\"utf-8\"/\u003e\n        \u003c/head\u003e\n        \u003cbody\u003e\n            \u003cSimple/\u003e\n            \u003cCounter initial_value={54}/\u003e\n            \u003cSSRWithParam color={\"green\"} text={\"green text\"}/\u003e\n            {\n                const z = give_me_a_value();\n                \u003cp\u003eI am a computed html. z: {z}\u003c/p\u003e\n            }\n\n            \u003cul\u003e\n                {*props.values.iter().map(fn(e: \u0026Int) -\u003e Html { \u003cli\u003e{*e}\u003c/li\u003e }).into_list().as_ref()}\n            \u003c/ul\u003e\n        \u003c/body\u003e\n        \u003c/html\u003e\n    \u003c/\u003e\n}\n```\n\n### Creating the HTTP Server\n```rs\nfn main() {\n    std::web::HttpServer::new(.verbose)\n        .serve_template(\"/\", FullPage({values: [10, 123, 45]}))\n        .listen(\":8080\");\n}\n```\n\nAll of the above can be written in a single `.duck` file and can be run via `dargo run` \net voilà you have a server-side rendered html featuring a interactive client-side rendered component listening on `localhost:8080`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduck-compiler%2Fduckc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduck-compiler%2Fduckc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduck-compiler%2Fduckc/lists"}