On 2018-05-22, Christofer Dutz wrote:

> Now I did start inspecting some options and stumbled over IKVM, which
> seems to allow compiling a Java jar into a .Net dll library. This
> should be usable in any .Net application.

Unfortunately IKVM is dead:
http://weblog.ikvm.net/default.aspx?date=2017-04-21

In my experience it used to work kind of OK, but there are sections that
are quirky. Also note there are subtle differences between .NET and Java
that may lead to Java APIs feeling wrong for C# developers. I've never
looked at PLC4X's API, but if it exposes bytes (which I expect) it will
feel quite strange when you suddenly need to deal with signed bytes
(.NET knows signed and unsigned bytes and the default "primitive" byte
type is unsigned).

The Lucene.NET folks have toyed with some automated tools that translate
Java to C# source code, but in the end have ported all of it
manually. I'm afraid there is no good solution without duplicating the
work.

For XMLUnit I've tried a few approaches including code generation from a
DSL to Java and C# but given up. There always are areas where the
generated code is not looking idiomatic and in the end I spent more time
twiddling with the generator than writing algorithmic code. I'm now
maintaining independent ports for both platforms.

Stefan

Reply via email to