Coder Social home page Coder Social logo

ice1000 / kt2dart Goto Github PK

View Code? Open in Web Editor NEW
84.0 6.0 4.0 96 KB

:flashlight: [Deprecated] Transpile Kotlin codes into Dart, Make Flutter Great Again

License: GNU Affero General Public License v3.0

Haskell 99.50% Kotlin 0.50%
haskell parser parser-combinators kotlin dart flutter

kt2dart's Introduction

Kt2Dart

Build status

This is a transpiler which consumes Kotlin codes and convert them into Dart.

I made some CodeWars Katas inspired from this repo:

Why Kt2Dart

Because I want to Make Flutter Great Again.

Flutter, written in Dart, is an awesome mobile developing framework. But Dart is too weak, for the dynamic typing and null-unsafety.

Kotlin is much more powerful. If we can combine the beautiful flutter and the powerful/safe Kotlin, our world will be peaceful forever.

Also, since your dart codes are transpiled from Kotlin, you can use Sound Dart (the term Strong Dart refers to the same thing) compiler to compile the generated Dart codes.

You may find it better to use Kotlin's JavaScript mode (to enable the use of the dynamic type).

Limitations

Kt2Dart supports full-featured Kotlin (because I write this parser according to the strict grammar definition),

but I will not add any support for transpiling:

  • Extensions
  • Labels (label break/continue, label return)
  • import as
  • Anonymous Classes
  • if and when as expressions
  • Typed closures (dart's closure type Function is not generic)
  • Desctructing declaration ({ (a: Int, b: Int): Pair<Int, Int> -> xxx })

While these features are not fully supported:

  • Naming (names like System.`in` are transpiled into System.in directly)
  • Generics (Dart's generics are covariant)

Such (advanced) language features of Kotlin are too complex to transpile (it needs too much analyzing while Kt2Dart is just a simple tool).

And this tool will raise warnings as comments when these stuffs are detected.

Why Haskell

Yeah, as you see, I'm using Haskell in this project. Because Parser Combinators are easy and convenient I want to practise my Haskell skills.

I'm a beginner to Haskell, so if you find any naive code, feel free to tell me (by issuing or mailing) (I'm using hlint).

kt2dart's People

Contributors

ice1000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kt2dart's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.