by debugnik · 3y ago · 0 comments
Every guest language means additional IDE plugins with platform knowledge, since most communities want idiomatic libraries, an ecosystem on top of the ecosystem, as the actual platform is only implemented in a main "systems" language, mastering it is required anyway for all the leaky abstractions on the platform, additional build toolchains,...
In the end, each polyglot platform achieves a global maximum of main language, and possibly a winner among all guest languages, even if it takes a couple of years with projects fading away until this happens.
It sucks, however so it is the outcome of human nature attention span, and not being able to keep momentum for all languages across the whole lifetime of a given platform.
The DLR made it much easier for dynamic languages on .NET to interact and share infrastructure on top of the CLR, but it also gave C# directly just enough dynamic language powers that filled most people's use cases for that niche.
Even in the current race between C# and F#, unless you are using features such as Units of Measure or Type Providers, there is often a sense of "you don't need to use F# because that feature will be eventually in C# anyway" and "F# is just a proving ground for C# ideas". The F# community continues to try to find marketing messages that aren't that and better highlight some of the niches that F# can fill that C# won't. The most recent attempts have been trying to position F# as a "data sciences" language useful for Notebook-driven development in direct comparison/competition to Python/R/Julia. C# actually is finally useful in Notebooks now and has some alright REPL support, but F# likely will always better fit that niche. It will be interesting to see if that marketing approach helps.
I think that’s more because of the amount of good Java binaries than because the JVM is good at supporting alternative languages.
Scala had to make a few design choices they would never have made if they didn’t want to target the JVM and be compatible with existing Java binaries.
Examples:
- having Option[T], but still having null, too.
- value types aren’t supported in the JVM (yet), so they’ve had to implement them using classes.
- scala’s reflection would have been easier to understand if they could have tweaked the JVM to implement it (scala had to work hard to map its type system to that of the JVM)
- scala has its own integer classes that are subtly different from both Java’s value types and it’s integer classes.
Kotlin mostly is Java with a different syntax. Like scala, it must be doing some magic to support its value classes.
Also, as another post in this thread said, some languages my need a garbage collector that behaves different from the JVM one. If so, you either adapt, or give up running on the JVM.
The reflection claim is also questionable, as Scala used to be available for the CLR as well, but that version was abandoned, while the JVM is striving. In fact, erasure of generics help with guest languages, as it doesn’t bake into the variance.
All the other alternative languages had better times behind themselves.
Groovy survives thanks Jenkins and Gradle.
I would not be surprised if Kotlin takes a majority share eventually
No JVM will ever be rewriten in Kotlin for it to matter outside Android.
The guest languages are like relying on (human or machine) speech/writing translation services to communicate with folks who only know the local lingua franca.
That added friction hobbles the minority languages.
Perhaps AI will aid in greatly reducing these issues over time (and I say this because large language translation models and text to speech + speech to text are finally reaching professional human quality while running on local hardware today). But I can't think of any other good method to hold back the floodgates of people being forced to choose between their mother tongue (with its corpus of invaluable baked in stories and perspectives) and being understood by others.