Kotlift alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view Kotlift alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode editor is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight Multiplatform logging framework for Kotlin. A convenient and performant logging facade. -
lingua
The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike -
Humanizer.jvm
Humanizer.jvm meets all your jvm needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities. -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
kassava
This library provides some useful kotlin extension functions for implementing toString(), hashCode() and equals() without all of the boilerplate. -
solr-undertow
Solr / SolrCloud running in high performance server - tiny, fast startup, simple to configure, easy deployment without an application server. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library written in Kotlin designed to support relevant neural network architectures in natural language processing tasks -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
kasechange
๐ซ๐๐ข๐ ฟ Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
PrimeCalendar
PrimeCalendar provides all of the java.util.Calendar functionalities for Persian, Hijri, and ... dates. It is also possible to convert dates to each other. -
log4k
Lightweight logging library for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Kotlift or a related project?
README
Kotlift
[Kotlift: The first source-to-source language transpiler from Kotlin to Swift](banner.png)
Kotlift is the first source-to-source language transpiler from Kotlin to Swift.
Kotlift helps you to write business logic once, and reuse most of the code on iOS. Porting an app from Android to iOS will be faster and less error-prone. With Kotlift, Kotlin truly is the Swift of Android.
The program is not intended to support the full Kotlin or Swift language, but most of the generated Swift code will be valid. All framework interfacing code from Android or iOS/Cocoa is not supported. Many functions from the Kotlin stdlib are the same in Swift, therefore less logic has to be rewritten.
Supported versions: Kotlin 1.0.1, Swift 2.2
Supported features
The following language features are currently transpiled, but some edge cases might produce invalid Swift code.
- Variables, arrays and lists
- Basic types (String, Boolean, Double, Float, Long, Int, Short, Byte)
- Functions with parameters
- If and elvis operator
- For and while loops
- String interpolation
- Main function calling (in Swift playground)
- Custom rewrites (comment the preceding line with
// SWIFT: this.will(be.replaced)
to replace the following line) - Null safety, safe calls, null coalescing
- Basic try-catch
- @Throws annotation / throws
- Casting
- Ranges and iteration
- When / switch case
- Classes with none or one constructor
- Inheritance
- Abstract classes
- Interfaces / protocols
- Data classes (constructor and description will be generated)
- Generics
- Extension functions
- Companion objects / static class properties
- Properties with getters and setters / backing fields / computed properties
- Visibility modifiers
- Basic lambdas / closures
- Maps / dictionaries
- Sets
- Very basic smart casts
- Enums
See also the testcases in Kotlin and the generated Swift files.
Unsupported features
The following features are currently unsupported, but are ordered by likelihood to be implemented soon:
- (Data) classes, functions or getters & setters with opening & closing brackets in same line or without brackets at all
- Line-wrapped function and class definitions
- Unnamed constructor parameter
- Unnamed function parameters (except the first one)
- Auto inferred function return types
- Finally / defer
- Full support for smart casts
- ...
Usage
The repository contains an IntelliJ project. Usage of the precompiled jar:
java -jar moshbit.kotlift.jar test-src dest replacementFile.json test-dest
- parameter: folder of Kotlin source files. (mandatory)
- parameter: destination folder where Swift code should be written to. (mandatory)
- parameter: replacement file, used for standard language replacements and may be customized. (mandatory)
- parameter: Swift testcase folder. If given, all files in the destination folder are compared to the files in this folder. (optional)
Kotlift uses various regular expressions and a simple structure tree.
For advanced Kotlift usage in your project, modify replacementFile.json to customize
replacements (such as .toString()
to .mySwiftyToStringFunction()
). Include the kotlift.swift file
in your project for a basic mapping of the most important Kotlin std-lib functions that are different in Swift.
Dependencies
- Kotlin 1.0.1
Contribution guidelines
For every transpiled language feature there is a Kotlin test file in test-src and a Swift file in test-dest. Executing Kotlift with a fourth argument not only transpiles all test files, but also checks them for any differences.
Pull requests are welcome. If you add new features, please add Kotlin and Swift test files.
Please contact [email protected] for any inquiries.