{"id":16599444,"url":"https://github.com/danisss9/typenative","last_synced_at":"2026-03-03T03:18:14.946Z","repository":{"id":86094117,"uuid":"580577068","full_name":"danisss9/TypeNative","owner":"danisss9","description":"Build native applications using Typescript","archived":false,"fork":false,"pushed_at":"2024-03-01T00:52:07.000Z","size":26283,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T06:45:30.857Z","etag":null,"topics":["clang","cpp","native-apps","typescript"],"latest_commit_sha":null,"homepage":"","language":"C","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/danisss9.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":"2022-12-20T22:47:31.000Z","updated_at":"2024-02-24T02:29:20.000Z","dependencies_parsed_at":"2024-03-01T01:49:27.735Z","dependency_job_id":"c3138c8a-4257-4ef3-b0f8-741a836d07f0","html_url":"https://github.com/danisss9/TypeNative","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/danisss9%2FTypeNative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisss9%2FTypeNative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisss9%2FTypeNative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisss9%2FTypeNative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danisss9","download_url":"https://codeload.github.com/danisss9/TypeNative/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242533179,"owners_count":20144838,"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":["clang","cpp","native-apps","typescript"],"created_at":"2024-10-12T00:11:33.652Z","updated_at":"2026-03-03T03:18:14.922Z","avatar_url":"https://github.com/danisss9.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeNative\n\nBuild native applications using Typescript.\n\n## PreRequisites\n\n- [Nodejs v24](https://nodejs.org/en) or newer.\n- [Go 1.21](https://go.dev/doc/install) or newer.\n\n## Get Started\n\n- Write a file `test.ts` with content `console.log('Hello World!');` or any other message\n- Run `npx typenative --source test.ts --script`\n\n## Typescript Syntax Support\n\nTypeNative currently supports a focused subset of TypeScript syntax elements that are transpiled to Go code. The support is grouped by topic for easier scanning.\n\n**Basic Types**\n\n| Feature        | Supported | Notes                                                         |\n| -------------- | :-------: | ------------------------------------------------------------- |\n| number         |    ✅     | Transpiled to `float64`                                       |\n| boolean        |    ✅     | Transpiled to `bool`                                          |\n| string         |    ✅     |                                                               |\n| null           |    ✅     |                                                               |\n| any            |    ✅     | Used for type inference                                       |\n| Nullable types |    ✅     | `T \\| null` / `T \\| undefined` transpiled to Go pointer types |\n\n**Variables \u0026 Objects**\n\n| Feature               | Supported | Notes                            |\n| --------------------- | :-------: | -------------------------------- |\n| Variable declarations |    ✅     | `let` and `const`                |\n| Object literals       |    ✅     | Transpiled to Go struct literals |\n\n**Operators**\n\n| Feature                  | Supported | Notes                          |\n| ------------------------ | :-------: | ------------------------------ |\n| Arithmetic operators     |    ✅     | `+`, `-`, etc.                 |\n| Comparison operators     |    ✅     | `==`, `!=`, `===`, `!==`, etc. |\n| Logical operators        |    ✅     | `\u0026\u0026`, `\\|\\|`                   |\n| Increment/Decrement      |    ✅     | `++`, `--`                     |\n| Non-null assertion (`!`) |    ✅     | Stripped during transpilation  |\n| Ternary expressions      |    ✅     | `condition ? a : b`            |\n| Nullish coalescing       |    ✅     | `??` operator                  |\n| Optional chaining        |    ✅     | `obj?.prop`, `arr?.[i]`        |\n\n**Control Flow**\n\n| Feature            | Supported | Notes                              |\n| ------------------ | :-------: | ---------------------------------- |\n| If/Else statements |    ✅     | Fully supported                    |\n| Switch statements  |    ✅     | Case and default statements        |\n| For loops          |    ✅     | Standard `for` loops               |\n| For...of loops     |    ✅     | Iteration over arrays              |\n| While loops        |    ✅     | Transpiled to Go's `for` loops     |\n| Do...while loops   |    ✅     | Implemented with conditional break |\n| Try/Catch/Finally  |    ✅     | `throw` → `panic`; catch/finally via `defer`/`recover` |\n\n**Data Structures \u0026 Array Methods**\n\n| Feature                    | Supported | Notes                                                            |\n| -------------------------- | :-------: | ---------------------------------------------------------------- |\n| Arrays                     |    ✅     | Basic array operations                                           |\n| Array methods              |    ✅     | `push`, `join`, `slice`                                          |\n| Higher-order array methods |    ✅     | `.map()`, `.filter()`, `.some()`, `.find()`                      |\n| Method chaining            |    ✅     | Chaining array methods such as `.map(...).filter(...).join(...)` |\n| Map                        |    ✅     | `Map\u003cK, V\u003e` → Go `map[K]V`; `.set()`, `.get()`, `.has()`, `.delete()`, `.clear()`, `.size` |\n| Set                        |    ✅     | `Set\u003cT\u003e` → Go `map[T]struct{}`; `.add()`, `.has()`, `.delete()`, `.clear()`, `.size` |\n\n**Functions**\n\n| Feature                      | Supported | Notes                                                        |\n| ---------------------------- | :-------: | ------------------------------------------------------------ |\n| Function declarations        |    ✅     | Transpiled to Go functions                                   |\n| Arrow functions              |    ✅     | Transpiled to anonymous functions                            |\n| Closures over mutable state  |    ✅     | Functions capturing and mutating outer variables             |\n| Function types               |    ✅     | `() =\u003e number`, `(x: number) =\u003e string` as type annotations  |\n| Generics (functions/classes) |    ✅     | Type parameters via Go generics                              |\n| Default parameter values     |    ✅     | `function(x = defaultValue)`                                 |\n\n**Classes \u0026 Interfaces**\n\n| Feature             | Supported | Notes                                                          |\n| ------------------- | :-------: | -------------------------------------------------------------- |\n| Classes             |    ✅     | Transpiled to Go structs with constructor and receiver methods |\n| Class inheritance   |    ✅     | `extends` via embedded structs, `super()` supported            |\n| Interfaces          |    ✅     | Transpiled to Go interfaces, supports `extends`                |\n| Optional properties |    ✅     | `prop?: Type` in interfaces/types                              |\n| Enums               |    ✅     | `enum` declarations and member access                          |\n\n**Async \u0026 Timing**\n\n| Feature     | Supported | Notes                                                             |\n| ----------- | :-------: | ----------------------------------------------------------------- |\n| Async/Await |    ✅     | `async` functions return Go channels, `await` reads from channels |\n| Promises    |    ✅     | `new Promise` transpiled to channel + goroutine pattern           |\n| setTimeout  |    ✅     | Mapped to Go's `time.AfterFunc`                                   |\n\n**Built-in Functions \u0026 Utilities**\n\n| Feature               | Supported | Notes                                                 |\n| --------------------- | :-------: | ----------------------------------------------------- |\n| console.log           |    ✅     | Mapped to `fmt.Println`                               |\n| console.time/timeEnd  |    ✅     | Performance measurement via `time.Now` / `time.Since` |\n| assert                |    ✅     | Transpiled to `panic` on failure                      |\n| parseInt / parseFloat |    ✅     | Mapped to Go's `strconv` package                      |\n\n**Math Methods**\n\n| Feature                   | Supported | Notes                                             |\n| ------------------------- | :-------: | ------------------------------------------------- |\n| Math.random               |    ✅     | Mapped to `rand.Float64()`                        |\n| Math.floor / ceil / round |    ✅     | Mapped to `math.Floor`, `math.Ceil`, `math.Round` |\n| Math.abs / sqrt / pow     |    ✅     | Mapped to corresponding `math` functions          |\n| Math.min / max            |    ✅     | Mapped to `math.Min`, `math.Max`                  |\n\n**String Methods**\n\n| Feature                    | Supported | Notes                                         |\n| -------------------------- | :-------: | --------------------------------------------- |\n| Template literals          |    ✅     | Backtick strings with `${expr}` interpolation |\n| toUpperCase / toLowerCase  |    ✅     | Via `strings` package                         |\n| trim / trimStart / trimEnd |    ✅     | Via `strings` package                         |\n| split / includes / indexOf |    ✅     | Via `strings` package                         |\n| startsWith / endsWith      |    ✅     | Via `strings` package                         |\n| replace / replaceAll       |    ✅     | Via `strings` package                         |\n| charAt / substring / slice |    ✅     | Direct Go string indexing/slicing             |\n| concat / repeat            |    ✅     | String concatenation and `strings.Repeat`     |\n\n**Number / Object Methods**\n\n| Feature  | Supported | Notes                                                 |\n| -------- | :-------: | ----------------------------------------------------- |\n| toString |    ✅     | Universal `toString()` via `fmt.Sprintf` for any type |\n\n**RegExp**\n\n| Feature        | Supported | Notes                                               |\n| -------------- | :-------: | --------------------------------------------------- |\n| Regex literals |    ✅     | `/pattern/flags` transpiled to `regexp.MustCompile` |\n| new RegExp()   |    ✅     | Constructor with optional flags                     |\n| test()         |    ✅     | Mapped to `regexp.MatchString`                      |\n| exec()         |    ✅     | Mapped to `regexp.FindStringSubmatch`               |\n\n**Unsupported / Roadmap**\n\n| Feature         | Supported | Notes                            |\n| --------------- | :-------: | -------------------------------- |\n| Modules/Imports |    ❌     | `import` / `export` declarations |\n\nTypeNative is currently in early development and new features are being added regularly. The goal for `1.0` release is for TypeNative to transpile itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanisss9%2Ftypenative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanisss9%2Ftypenative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanisss9%2Ftypenative/lists"}