Kotlin on .NET platform

.NET is very fragmented now. The have 3 different not compatible platforms (.NET Framework, .NET Core, XAMARIN). The are going to make some cleanup with .NET Standard. I suppose it will take some time.

PS
And in this case I would like to have F# on JVM :smiley:

1 Like

Some points-

  • Compared to native, .net already has a gc and large standard library, So, porting should be easier. There are version of PHP(http://www.peachpie.io/) and Python(https://github.com/Microsoft/Pyjion) running on top of .net runtime.
  • Just like Java, Kotlin will appeal to C# devs a lot, which may not be true for some other languages like C, C++ or Go.
  • Native devs tend to not like runtime dependencies and gc.
  • F# on .net is not a problem. JVM already had Scala.
  • Kotlin already has Javascript as a target. So, Kotlin architecture is not JVM specific.
  • Jetbrains is already on .net foundation.
  • If you follow discussion on roslyn, the current open source C# compiler in Github, you will find C# is trying to be something like Kotlin. But maintaining backward compatibility is holding them back.
  • Kotlin has a converter from Java. A similar C# to Kotlin converter will be very useful to attract C# devs. And Jetbrains already parse C# for Resharper. and this conversion will be idiomatic for C# devs, which is not true for other platform devs. C# devs could not even move to F# that easily.
  • Jetbrains has Resharper with a large audience base. They can use it to push Kotlin. And a full featured IDE Rider is also on the way.

I see an unique opportunity for Kotlin in .net ecosystem. With it, it may become the ultimate garbage collected C-family language (Rust is the non-GC LLVM king), for every platform. In my simple knowledge I see more value in porting to .net than porting to LLVM/native for Kotlin. Please do it.

5 Likes

Perhaps it’s not quite as easy:
JVM → Android, PC (Windows, OSX & Linux), Server(servlet container)
JS → Web, Server(nodejs)
Native → Android, iOS, PC (Any), almost any other target, Server(fastcgi)
.net → Windows phone, windows store, mono (linux, osX)

Then look at the market shares.

3 Likes

I was looking at the developes’ mindshare, not platform marketshares. Is there any other developer groups, other than Java devs, Kotlin is a very good option(not just another option)? Given the native implementation is done, I think no. Considering Kotlin for different language devs-

  • Scala to Kotlin? Probably not enough reasons.
  • C? Probably sticking with C or going towards Rust or Go.
  • C++? Same as C.
  • Javascript? Sticking with itself. Typescript can be another viable option. Kotlin became just another minor option.
  • Python? Sticking with itself.
  • PHP? Stick with itself or move to Javascript/Ruby/Python.
  • Obj-C? Move to Switft.

C#? Hell yeah, if supported!

1 Like

Given that previous attempts to build alternative languages on the CLR (Boo, Nemerle, Scala.NET, even F#) saw extemely limited adoption, the “hell yeah” doesn’t actually sound believable. And C# is a much more modern, full-featured and nicely designed language than Java 8.

4 Likes

I am really glad to see someone from JetBrains team responding. :slight_smile:
Other than Nemerle, those languages look very different from C#, and there was no one to make big push behind them. I assume, Kotlin was inspired by Nemerle and C# a lot. Nemele was acquired by JetBrains so far I knew. And Jetbrains has that ability to make the big push. Why would people use Kotlin instead of C#, given C# is already a nicely designed language? Because Kotlin has some features C# will probably never achieve because of backward compatibility.

However, I know a company like JetBrains will not start something just by a forum thread. I would request to assess the potential market value of Kotlin for .net in a formal way and compare that to potential of native market, if not done already. I may be wrong, but I think the value of former will be greater. That’s all.

We’ve done the assessments, and the result of those assessments is to invest into Kotlin Native and to not invest into Kotlin on the CLR.

3 Likes

Then I rest my case. Looking forward to Kotlin Native.

No, more like:

.net → Windows phone, Windows Store, PC(any), mono/Xamarin (linux, Mac, Android, iOS), Server

.Net (really the CLR) has an extremely large market share

Native may have a bigger market share but would be a LOT more work.

2 Likes

With .Net Core adoption on Linux C# should " kick ass Java :smiley: " → takes some market shares from Java on server side, gets some more open source projects …

The Kotlin programming model is very close to the Java model, in order to give very smooth interoperability. In those places where the C# and the Java programming model differ, you cannot be the same or close to both of them. Interop between Kotlin and JS is necessarily less smooth than with Java. If Kotlin were to target the CLR it could not interoperate as closely with C# as it does with Java now, because it has been designed to be similar to Java. Being similar to C# would require a redesign of much of the language, and being similar to both C# and Java would probably involve some trade offs which would make interop with either language less smooth compared to what it has now for Java.

1 Like

In general, the problem is not only the language, and its semantics, but the standard library as well. Javascript doesn’t have much of a standard library, and especially not one that would conflict with the Kotlin library. .net has a standard library (often shared across the languages) that is not necesarilly compatible with the kotlin libraries. This doesn’t mean that Kotlin doesn’t work, it means that interoperation will be limited.

Disclamer: I understand JB has already assessed this and taken their decision.

Here is another use case that we have encountered: having Kotlin work on CLR would allow to run .NET DLL easily.
We have this issue where I work, and there are no easy way to handle this easilly, especially when we do not hold the source code of the DLLs.

Just decompile it… seriously

I’m starting to believe that you are all Microsoft bots that are trying to push/force adoption of .NET in linux, it’ll never happen, nobody want Azure bullshit

1 Like

I experimented a little bit with IKVM (https://www.ikvm.net/) last year, but the project is quite dead for many years now. It compiles JVM bytecode so it works with Kotlin as well.

1 Like

How is that anywhere constructive? I’m sure you intended to spell Microsoft with a $ instead of an s so you could be edgy. We get it, you don’t like Microsoft; but the truth is there are a great many people that do – get over it, nobody wants your judgmental boorish comments.

As for the idea, I think it has merit but it really isn’t something Jetbrains should be working on – the comment by @vsazel makes more since as an inception point if someone wants to carry that torch forward. Otherwise, Kotlin can stand on its own; even if it loses a few use cases.

I have 0 respect for companies with inhumain practices (see what happened to RoboVM)

Definitely your prerogative, and I understand the consternation – same with OSX and FoundationDB (open source, goodbye, technology snagged), Google with Motorola Mobility, etc. With that said, the overall base cannot be ignored in and of itself. It is too early to note that .NET will become ubiquitous, but to scream how will never happen and how everyone hates [y] because of personal anxiety isn’t really logical and is merely hyperbole. I greatly enjoy using .NET and the CLR, I enjoy the OSX products (which I use at home) the Windows products which I use at the office, and the linux products that I deploy my containers into and on top of. Every problem is not a nail and a good solution isn’t avoided merely because I dislike the company that made it. Otherwise I’d have a hard time buying my food.

The discussion has gone far into off-topic territory, so I’m closing this thread. To reiterate, JetBrains has no plans to work on Kotlin for .NET at this time.