{"id":20799874,"url":"https://github.com/xnacly/seascript","last_synced_at":"2026-04-16T02:32:12.132Z","repository":{"id":192067065,"uuid":"685985542","full_name":"xnacly/SeaScript","owner":"xnacly","description":"SeaScript is a small c superset programming language that compiles to c","archived":false,"fork":false,"pushed_at":"2023-10-23T12:12:06.000Z","size":67,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T22:34:41.786Z","etag":null,"topics":["c","compiler","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/xnacly.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}},"created_at":"2023-09-01T13:14:45.000Z","updated_at":"2025-08-13T23:48:26.000Z","dependencies_parsed_at":"2023-09-02T11:42:20.807Z","dependency_job_id":"98f5ff63-1c19-4b17-8515-a8844fd0212e","html_url":"https://github.com/xnacly/SeaScript","commit_stats":null,"previous_names":["xnacly/seascript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xnacly/SeaScript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnacly%2FSeaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnacly%2FSeaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnacly%2FSeaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnacly%2FSeaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xnacly","download_url":"https://codeload.github.com/xnacly/SeaScript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xnacly%2FSeaScript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31868494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c","compiler","go"],"created_at":"2024-11-17T18:10:34.437Z","updated_at":"2026-04-16T02:32:12.109Z","avatar_url":"https://github.com/xnacly.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SeaScript\r\n\r\nSeaScript is a small language that compiles to C. SeaScript is intended to improve the c experience drastically with the following features:\r\n\r\n- result types\r\n- functions attached to structs\r\n- omitting most of the typ declarations\r\n- providing useful data structures, such as growing arrays and hash maps\r\n- 0 cost abstractions for functional approaches, such as filter, map, forEach\r\n- template strings\r\n- booleans\r\n- 0 cost interoperability with the c ecosystem\r\n\r\nSeaScript is designed to automatically provide allocation and deallocation for\r\ndata structures and abstractions. The goal is to compute valid, performant and\r\nsafe c while allowing the developer to use a language that's minimal, nice to\r\nread and that provides the base line of features required for modern\r\napplications.\r\n\r\n## Compiler usage\r\n\r\n```\r\n$ cat main.sea\r\n#include \u003cstdio.h\u003e\r\nputs(\"Hello (Sea)World!\")\r\n$ seacc main.sea\r\n$ cat main.c\r\n#include \u003cstdio.h\u003e\r\n#include \u003cstdlib.h\u003e\r\n\r\nint main(void) {\r\n  puts(\"Hello (SeaWorld)\");\r\n  return EXIT_SUCCESS;\r\n}\r\n```\r\n\r\n## Syntax\r\n\r\n```seascript\r\n:: include header files\r\n#include \u003cstdio.h\u003e\r\n\r\n:: variables\r\nage = 24\r\nmoney = 129.01\r\nname = \"anon\"\r\n\r\n:: lists\r\nlist = [5 4 3 2 1]\r\nfriends = [\"jonathan\" \"mike\"]\r\n\r\n:: functions\r\nsquare [n: number]: number {\r\n    return n*n\r\n}\r\n\r\n:: single line function\r\nprinter2n [a: number b: number]: void {\r\n    printf(\"%d %d\\n\" a b)\r\n}\r\n\r\n:: calling functions\r\nprinter2n(square(12) square(2))\r\n\r\n:: iterating over lists\r\nlist.each(n {\r\n    printf(\"%f\\n\" n)\r\n})\r\n\r\n:: c block\r\n@c{\r\n    void print(int a, int b) {\r\n        printf(\"%d %d\\n\", a, b);\r\n    }\r\n}\r\n\r\n:: using functions defined in c block\r\nprint(1 2)\r\n\r\n:: results\r\nsqrt [n: number]: Result[number] {\r\n    if n \u003c 0 {\r\n        return Result{error: \"can't compute sqrt for negative numbers\"}\r\n    }\r\n    res = sqrt(n)\r\n    if res \u003c 0 {\r\n        return Result{error: \"couldn't compute sqrt of {n}\"}\r\n    }\r\n    return Result{value: res}\r\n}\r\n\r\n:: consuming results\r\nres = sqrt(-5).unwrap() :: this will fail and stop the process\r\nprint(res)\r\n\r\n:: structs\r\nperson = {\r\n    age: 24,\r\n    money: 102_910.99,\r\n    name: \"seal\",\r\n    toString [s: self]: string {\r\n        return \"{s.name} | {s.age} | {s.money}\",\r\n    }\r\n}\r\n\r\n:: accessing struct properties\r\nisTeenager = person.age \u003e 13 \u0026\u0026 person.age \u003c 20\r\n\r\n:: updating struct properties\r\nif isTeenager {\r\n    person.age = 14\r\n} else if person.age == 20 {\r\n    person.age = 0\r\n} else {\r\n    puts(\"unhandled age\")\r\n}\r\n\r\n:: calling struct functions\r\nputs(person.toString())\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnacly%2Fseascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxnacly%2Fseascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnacly%2Fseascript/lists"}