{"id":13484561,"url":"https://github.com/vinivendra/Gryphon","last_synced_at":"2025-03-27T16:31:00.255Z","repository":{"id":37439309,"uuid":"129149682","full_name":"vinivendra/Gryphon","owner":"vinivendra","description":"The Swift to Kotlin translator.","archived":true,"fork":false,"pushed_at":"2024-04-15T20:58:23.000Z","size":19214,"stargazers_count":607,"open_issues_count":39,"forks_count":45,"subscribers_count":18,"default_branch":"release","last_synced_at":"2025-03-01T13:38:00.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://vinivendra.github.io/Gryphon/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinivendra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-11T20:22:33.000Z","updated_at":"2025-01-22T15:48:31.000Z","dependencies_parsed_at":"2022-07-12T14:02:36.741Z","dependency_job_id":"2d63fe86-823c-43c7-bc81-c9b207153d92","html_url":"https://github.com/vinivendra/Gryphon","commit_stats":{"total_commits":1753,"total_committers":13,"mean_commits":"134.84615384615384","dds":"0.25898459783228756","last_synced_commit":"1f6e7f678e560ae9dc587dc91b99c12c484144fa"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinivendra%2FGryphon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinivendra%2FGryphon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinivendra%2FGryphon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinivendra%2FGryphon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinivendra","download_url":"https://codeload.github.com/vinivendra/Gryphon/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245882309,"owners_count":20687862,"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":[],"created_at":"2024-07-31T17:01:26.181Z","updated_at":"2025-03-27T16:30:58.886Z","avatar_url":"https://github.com/vinivendra.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# ⚠️ Repository archived\n\nThis project has been archived and is no longer maintained. The original maintainer is no longer able to dedicate the time required to keep Gryphon up to date with the recent Swift releases. The code is preserved here for any who may want it, and the original `Readme.md` follows below:\n\n-----\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/vinivendra/Gryphon/raw/release/Gryphon%20Logo%20dark.svg\"\u003e\n  \u003cimg src=\"https://github.com/vinivendra/Gryphon/raw/release/Gryphon%20Logo.svg\" alt=\"Gryphon logo\" height=\"70\"\u003e\n\u003c/picture\u003e\n\n# The Swift to Kotlin translator\n\n[![Swift package manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen)](https://www.firsttimersonly.com/)\n[![open ethical](https://img.shields.io/badge/open-ethical-%234baaaa)](https://ethicalsource.dev)\n[![licensed ethically](https://img.shields.io/badge/licensed-ethically-%234baaaa)](https://ethicalsource.dev)\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/vinivendra/Gryphon)\n[![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://www.firsttimersonly.com/)\n[![Follow on Twitter](https://img.shields.io/twitter/follow/gryphonblog?label=Follow\u0026style=social)](https://twitter.com/gryphonblog)\n\nGryphon is a program that translates Swift code into Kotlin code. It was created to enable mobile app developers to share parts of an iOS app's codebase with Android.\n\n- **Risk-free.** Stop using Gryphon whenever you want - you'll still be able to read and understand your Kotlin code, even the computer-generated parts.\n- **No editing needed.** Translated Kotlin files work the same as the Swift files they came from.\n- **Xcode integration.** Translate your iOS code to Android, compile the Android app, and see Kotlin's errors and warnings in the Swift lines that originated them - all without leaving Xcode.\n- **Custom-made.** Use special comments and templates to customize your Kotlin translation, and use any platform-specific features you want - even in translated source files.\n\n## 👍 Status\n\nGryphon is now in preview! 🎉\n\nThis means the main systems and ideas have already been implemented - for instance, it's been translating a complete version of its own codebase for a while now. However, users often find new bugs to be fixed. If that's the case, feel free to report a [new issue](https://github.com/vinivendra/Gryphon/issues/new/choose) on GitHub.\n\nYou can also check out the currently supported translations for the Swift standard library [here](https://github.com/vinivendra/Gryphon/blob/development/Status.md).\n\n## 📲 Installing\n\nGryphon supports both **macOS** and **Linux**. You can install it with:\n\n### Homebrew\n\nUse [Homebrew](https://brew.sh) to install Gryphon and its dependencies automatically:\n\n```` bash\n$ brew install vinivendra/gryphon/gryphon\n````\n\n### Mint\n\nUse [Mint](https://github.com/yonaskolb/Mint) to install Gryphon using the Swift package manager:\n\n```` bash\n$ mint install vinivendra/Gryphon\n````\n\n### GitPod\n\nTry it out on [GitPod](https://www.gitpod.io) before downloading:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/vinivendra/Gryphon)\n\n### Building from source\n\nClone the repo run the installation script:\n\n```` bash\n$ git clone https://github.com/vinivendra/Gryphon.git\n$ cd Gryphon\n$ ./Scripts/install.sh\n````\n\n### Docker\n\nInstall it in a [Docker](https://www.docker.com) container:\n\n```` bash\n$ git clone https://github.com/vinivendra/Gryphon.git\n$ cd Gryphon\n$ docker build -t gryphon .\n$ docker run -it --rm --privileged -v /absolute/path/to/current/directory/:/app/Gryphon gryphon\n# ./Scripts/install.sh\n````\n\n## 📖 Guides\n\nCheck out the [Tutorial](https://vinivendra.github.io/Gryphon/gettingStarted.html) to get started. It covers the basic information needed to begin using Gryphon, whether you want to [translate command line programs](https://vinivendra.github.io/Gryphon/translatingCommandLinePrograms.html), [translate a new iOS app to Android](https://vinivendra.github.io/Gryphon/translatingANewiOSAppToAndroid.html), or [add Gryphon to an existing app](https://vinivendra.github.io/Gryphon/addingGryphonToAnExistingApp.html).\n\nThere are also more advanced guides on  [using collections](https://vinivendra.github.io/Gryphon/collections.html), [using translation comments](https://vinivendra.github.io/Gryphon/translationComments.html), and [using templates](https://vinivendra.github.io/Gryphon/templates.html)\n\n\n## 📘 Frequently asked questions\n\n#### What is Gryphon?\n\nGryphon is a command line application that can translate Swift code into Kotlin code. It was especially designed to enable app developers to translate platform-independent parts of their iOS apps into code they can use in their Android apps.\n\n#### Can I compile and run the translated code or do I need to fix it first?\n\nGryphon's output code is meant to behave just like the input code that created it. It's still possible technically to generate Kotlin code that doesn't compile - for instance, if you try to translate unsupported Swift features, or if there's a bug - but as a rule, **you should be able to translate, compile and run supported code without the need for post-translation edits**.\n\n#### Will I be able to understand the translated code?\n\nOne of Gryphon's main goals is to make sure translated code can be understood by human beings. As a rule, **if you understand the input Swift code, you should also be able to understand the translated Kotlin code** - if you don't, feel free to [file a bug report](https://github.com/vinivendra/Gryphon/issues).\n\nThis is done within some realistic constraints: the priority is that the translated code has to behave correctly, for instance. Gryphon attempts to find a \"reasonably understandable Kotlin\" middle ground somewhere between \"machine-code-like Kotlin\" and \"perfectly idiomatic Kotlin\".\n\n#### Can I translate anything written in Swift?\n\nGryphon's support for Swift features is constantly evolving. **It is currently capable of translating many of the main features one might expect** - classes, structs, enums, closures, extensions, protocols, etc - enough that it currently translates around 97% of a version of its own codebase (the other 3% are platform-specific files). Some Swift features are just waiting to be implemented, while others can't be translated to Kotlin and may never be supported.\n\n#### What Swift versions can Gryphon translate?\n\nGryphon currently supports **Swift 5.2 to 5.5**. It will use whatever Swift version was used to build it, so if you build the Gryphon binary using Swift 5.5 then that's the version it will assume all your Swift code is in. You can find out which Swift version your Gryphon binary uses by running `gryphon --version`.\n\nDue to some technical limitations, only Swift 5.3, 5.4 and 5.5 are being tested in the latest versions of Gryphon. If you have any difficulties with Swift 5.2, please [let us know](https://github.com/vinivendra/Gryphon/issues/new/choose).\n\n#### Can Gryphon help translate my existing iOS app?\n\n**Yes - but it will need some adaptations (though probably less than your average multiplatform framework)**. This depends on your application - how similar app's architecture is to its Android counterpart, how often your code uses Swift features unsupported by Gryphon, etc.\n\nIt's worth noting that, like [other transpilers](https://developers.google.com/j2objc/) for app development, Gryphon is best suited for translating platform-independent logic code. There's currently no support for translating calls to UIKit, for instance - and there's no telling if that will happen someday.\n\nIt is recommended that you start by translating only a few platform-independent parts of your code, adding new files incrementally. It might help to use architectures with clear separations between UI code and logic code - like [MVP](https://en.wikipedia.org/wiki/Model–view–presenter) and [MVC](https://en.wikipedia.org/wiki/Model–view–controller) to separate the code that can be translated. For more information, check out [Adding Gryphon to an existing app](https://vinivendra.github.io/Gryphon/addingGryphonToAnExistingApp.html).\n\n#### Can I use Gryphon to translate a non-iOS app?\n\n**Yes.** While Gryphon's main focus is on iOS-to-Android support, it is primarily a Swift to Kotlin translator, and it doesn't require anything iOS-specific to run. You can use it on Linux to translate command line tools, for example. Even Gryphon's own source code can be translated, and that's just a command-line tool with nothing iOS-related.\n\n#### Will it ever support translating Kotlin code to Swift? What about other languages?\n\n**Probably not.** The challenges involved in translating Swift code into Kotlin are very specific for these two languages. Translating Kotlin into Swift would require a new front-end for Kotlin, a new back-end for Swift, and all-new logic in the middle to turn one into the other - basically, a whole new Gryphon. The same goes for other combinations of languages.\n\n#### How can I help?\n\nThanks for the offer!\n\nIf you want to suggest a way to improve Gryphon, feel free to [open a new issue](https://github.com/vinivendra/Gryphon/issues/new/choose). All bug reports and feature requests are welcome and encouraged - we can't fix it if we don't know about it!\n\nIf you would like to contribute directly, first check out the [contributor's guide](https://vinivendra.github.io/Gryphon/contributing.html) to learn to set up your environment. Then, if you're looking for inspiration, take a look at some [good first issues](https://github.com/vinivendra/Gryphon/labels/good%20first%20issue) (if you're new to Gryphon) or the beginner-friendly [first timers only](https://github.com/vinivendra/Gryphon/labels/first-timers-only) (if you're new to open source) - or, if you already know what you want to do, [open an issue](https://github.com/vinivendra/Gryphon/issues/new/choose) and let's talk about it.\n\nIf you're going to contribute, you should probably read the [code of conduct](https://github.com/vinivendra/Gryphon/blob/master/CODE_OF_CONDUCT.md) too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinivendra%2FGryphon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinivendra%2FGryphon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinivendra%2FGryphon/lists"}