You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Christofer Dutz <ch...@c-ware.de> on 2018/05/22 09:43:11 UTC
Should be investigate using IKVM or similar to start supporting .Net?
Hi,
while most of us are quite familiar with Java development and I for example have no usable experience with .NET, most people in the industry I talked to, are more at home in the .Net world.
Now the ideal solution would be to implement a best-of-breed driver for every protocol in multiple languages. Unfortunately I don’t see this happening for PLC4X soon.
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.
I know this sounds sub-optimal, but eventually such a sub-optimal solution is still better than what’s available for .Net and maybe better than having nothing comparable at all.
Before investigating this option, I thought it might be better to ask here if any of you here have any experience with this sort of thing.
Input and feedback highly appreciated ;-)
Chris
Re: Should be investigate using IKVM or similar to start supporting
.Net?
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Stefan,
thanks for that information ... will definitely look into that :-)
I would so hope that we could get someone on board that is a little more familiar with .Net that could start working on this sort of thing.
.Net development on my Mac definitely wouldn't be a treat ... however getting this working in our maven build would be a well welcomed challenge for me.
Chris
Am 29.05.18, 15:32 schrieb "Stefan Bodewig" <bo...@apache.org>:
On 2018-05-24, Christofer Dutz wrote:
> yeah ... I read about that ... but thought: "Wouldn't be the only dead
> stuff we're all using" ;-)
Unfortubately .NET has evolved a bit since then, I don't think IKVM
works on .NET Core at all.
> Cross-Compiling would have been an easy way out but one we could
> probably setup quite fast. But I do agree that it would not be the
> desirable path.
When I said Lucene.Net tried cross-compilation but gave up on this, I
apparently was wrong. The "contributing guide" still says
https://www.tangiblesoftwaresolutions.com/product_details/java_to_csharp_converter.html
was used (with a donated license, it seems). AFAIR cleaning up the ports
still required significant work.
And yes, I am aware you are looking for a quick win rather than the
ideal solution. :-)
Stefan
Re: Should be investigate using IKVM or similar to start supporting .Net?
Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-05-24, Christofer Dutz wrote:
> yeah ... I read about that ... but thought: "Wouldn't be the only dead
> stuff we're all using" ;-)
Unfortubately .NET has evolved a bit since then, I don't think IKVM
works on .NET Core at all.
> Cross-Compiling would have been an easy way out but one we could
> probably setup quite fast. But I do agree that it would not be the
> desirable path.
When I said Lucene.Net tried cross-compilation but gave up on this, I
apparently was wrong. The "contributing guide" still says
https://www.tangiblesoftwaresolutions.com/product_details/java_to_csharp_converter.html
was used (with a donated license, it seems). AFAIR cleaning up the ports
still required significant work.
And yes, I am aware you are looking for a quick win rather than the
ideal solution. :-)
Stefan
Re: Should be investigate using IKVM or similar to start supporting
.Net?
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Stefan,
yeah ... I read about that ... but thought: "Wouldn't be the only dead stuff we're all using" ;-)
I was thinking of implementing the .Net version with DotNetty ... but didn't quite know if this is actually a good port or some hackish thing.
Cross-Compiling would have been an easy way out but one we could probably setup quite fast. But I do agree that it would not be the desirable path.
Chris
Am 22.05.18, 12:29 schrieb "Stefan Bodewig" <bo...@apache.org>:
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
Re: Should be investigate using IKVM or similar to start supporting .Net?
Posted by Stefan Bodewig <bo...@apache.org>.
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