Giter VIP home page Giter VIP logo

janett's Introduction

Janett

Janett translates Java syntax, constructs and calls to Java libraries to C# / .Net counterparts. Janett tries to automate this process as much as possible and preserve manual changes, making re-translation possible.

Janett takes a different way compared to JLCA:

  • It helps you to keep your main code-base on Java and translate it to .Net. It is not a tool for JUMPing.
  • It aims to translate libraries and frameworks rather than applications (Swing, JSP, EJB, ...) , however it caries out this task right.
  • It released as open source (under LGPL license), and to support open source projects.

Currently, Janett can translate Classifier4J and a lot of infrastructures are in place. Version number shows that Janett has beta quality and that there are KnownIssues, but we recommend trying Janett.

While supporting Janett, we try to translate some projects as a case. For the next release, we are going to work on some parts of Spring framework.

We invite developers to contribute and users to help us with extensibility mechanisms.

Why

We predict Java language will remain source of inspiration in open-source space for a while:

  • Mature ecosystem involves open source foundations like Apache as well as multi-billion dollar businesses
  • There are more professional developers who do open-source as a day-job
  • More universities and research institutes use Java as their projects language
  • Open source Java will probably influence this situation more

Large body of Java open source projects seems compelling in .Net. Many Java projects translated to .Net in recent years but translating manually takes days and months even for experienced developers.

Virtual machines like IKVM can not solve this problem (see IKVMCompiler)

Current Java to .Net translation tool (JLCA) only translates nearly 80% of your code so preserving manual changes is possible only for small projects (see JLCAssistant) As a result:

  • Some projects were discontinued when developers lose interest or has not enough time to contribute (e.g. NVelocity or older Lucene ports)
  • Major version changes again take long time to port (e.g. Hibernate 3)
  • Lots of interesting and well-known projects are not ported (e.g. FreeMarker)

How

Janett translates your source code through these steps:

  • Parsing Java source code to AST using infrastructure provided by NRefactory
  • Transforming constructs in Java which have no counterparts in C# (e.g. anonymous classes)
  • Refactoring code to adhere .Net conventions (making methods PascalStyle, Properties instead of accessors, ...)
  • Mapping: Replacing call to Java or other third party libraries
    • Virtualization: using java libraries provided by IKVM or J#
    • Emulation: stubbing java libraries using delegation or inheritance of .Net libraries
    • Native: replacing java libraries with .Net ones
  • In Native mode test cases may failed because replaced methods have different behavior so Correction is required:
    • Inspection and modification of resulting code with Adapter classes (see ReaderRead)
    • Stubbing some classes to be implemented from scratch (see ClassifierResourceClass)
    • Using helper classes instead of calling .Net libraries directly (see StringSplit)
  • Preserving manual changes automatically (by diff and patch) while you re-translate

janett's People

Contributors

edrishn avatar mehdimo avatar

Watchers

 avatar

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.