In my case we exposed a large multi-component/service platform-like product (partly written in Scala) that accepts plugins also written in Scala by other companies. If a customer buys a plugin built with one version of Scala (say 2.11) and deploys it in our platform that was to be upgraded to 2.12 or later, it won't work (well, there is some chance that it may, but it is not guaranteed). For this reason we can't let plugins to be developed in Scala. This is a real problem.
Scala-Java interop is great but not great enough to have the platform still be written in Scala due to many "small" things LIKE differences in vararg calls and the fact that we can't really give ScalaDoc API reference to Java developers and cannot link between the two. This linking is absolutely required, as we do need to link from JavaDoc of "downstream" components back to ScalaDoc and vice versa for complete, readable documentation.
The IDE toolset is not great enough. Note that my experience is limited to Eclipse + Scala IDE. There were or still are various issues with how to ensure matching Scala libraries between what is in Scala IDE and what is to be used in production and various freezing, debugging and downright "not producing any bytecode but not showing any errors either" oddities. Even though Scala and Java source can be mixed, something we had to rely on, every so often the IDE would enter an odd state with tons of errors that seem to make no sense and do not help really find what the cause is. Sometimes a clean-build helped (such things should not have happened), but not always.
We even hit some Scala's own deficiencies/inconsistencies over time, such as http://stackoverflow.com/questions/5676301/scala-currying-and-default-arguments. Developers get scared of the gazillion symbolic operators that all look alike and are hard to remember. Yes, once you memorize them they are useful in writing more compact code, but that code only looks more cryptic and unreadable to everyone else. Saving a few characters here-and-there is not always the best thing, especially when it comes to identifiers.
Finally, I was not lucky enough to have all developers in our large team(s) either respect or be willing to accept and learn Scala. This has nothing to do with Scala the language, anything different from what they are used to (Java) would face the same problem, but it was nevertheless a continuous source of nagging and complaining that I had to spend/waste time fighting. Sometimes these complaints had a point. For example, generic type system is better than Java's, but it is also more strict (for a reason). However, it continues to miss features that can make it useful for very complex cases and the strictness complicates Java interop.
Worse yet, separating some sub-expressions into individual 'vals' seemed to eliminate spurious errors/bugs when these are embedded inside more complex expressions - even though they should not really.
This turned learning Scala not only into learning how to use its features but also how to avoid the mines in its 'dark zone'. Could these have been my and other developers' 'user errors'. Improbably but possibly - and that does not lessen the problem. A language that only a few can use is a language that only a few can use, whatever the reason is.
P.S. We haven't moved away from Scala yet. We just decided that we have no choice. I have yet to figure out how to rewrite a ton of Scala (2.11) code into four tons of Java so that I can start using Java 8 as well. I can't move to 2.12 either as it isn't out yet and see no light at the end of that tunnel.
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have been enjoying Scala for many years so far. Unfortunately, I have reached the point at which I am forced to abandon it and move away to Java (8). I am not seeking help and am not trying to stop people from starting with or using Scala. Far from it - I am in specific circumstances that make some of the issues much greater than for most. I am posting this in hope that this will help shape the future of Scala in a way that will eliminate the problems I am facing today.There are many nagging issues with Scala development, just like there are with any other language. A reader of this post should NOT take this as a sole source of information deciding whether or not to use Scala. Scala the language is great and has helped us develop a lot of functionality very quickly, with a very small team. Even starting with it is not that hard because Java developers could start writing Java-like Scala code with very little effort and then evolve from there. Not the best Scala code, but it works. I will be focusing only on the negative and only on Scala (I could list many negatives for anything else).To get it over with with the main reason I will begin with it - binary compatibility. With Scala there is no guarantee that (binary) code compiled with one version of Scala compiler will work with the code compiled with another version. There has been a lot of focus on organizing and providing fresh versions of libraries to alleviate this problem but that only works in specific cases. In my case we exposed a large multi-component/service platform-like product (partly written in Scala) that accepts plugins also written in Scala by other companies.
If a customer buys a plugin built with one version of Scala (say 2.11) and deploys it in our platform that was to be upgraded to 2.12 or later, it won't work (well, there is some chance that it may, but it is not guaranteed).
For this reason we can't let plugins to be developed in Scala.
This is a real problem. I wish Scala finds a way to standardize and finalize how code is generated so that binary compatibility issues never occur again - i.e. newer platforms should always be able to run old (byte)code.
I
Scala-Java interop is great but not great enough to have the platform still be written in Scala due to many "small" things LIKE differences in vararg calls and the fact that we can't really give ScalaDoc API reference to Java developers and cannot link between the two. This linking is absolutely required, as we do need to link from JavaDoc of "downstream" components back to ScalaDoc and vice versa for complete, readable documentation.The IDE toolset is not great enough. Note that my experience is limited to Eclipse + Scala IDE. There were or still are various issues with how to ensure matching Scala libraries between what is in Scala IDE and what is to be used in production and various freezing, debugging and downright "not producing any bytecode but not showing any errors either" oddities. Even though Scala and Java source can be mixed, something we had to rely on, every so often the IDE would enter an odd state with tons of errors that seem to make no sense and do not help really find what the cause is. Sometimes a clean-build helped (such things should not have happened), but not always.We even hit some Scala's own deficiencies/inconsistencies over time, such as http://stackoverflow.com/questions/5676301/scala-currying-and-default-arguments. Developers get scared of the gazillion symbolic operators that all look alike and are hard to remember. Yes, once you memorize them they are useful in writing more compact code, but that code only looks more cryptic and unreadable to everyone else. Saving a few characters here-and-there is not always the best thing, especially when it comes to identifiers.Finally, I was not lucky enough to have all developers in our large team(s) either respect or be willing to accept and learn Scala. This has nothing to do with Scala the language, anything different from what they are used to (Java) would face the same problem, but it was nevertheless a continuous source of nagging and complaining that I had to spend/waste time fighting. Sometimes these complaints had a point. For example, generic type system is better than Java's, but it is also more strict (for a reason). However, it continues to miss features that can make it useful for very complex cases and the strictness complicates Java interop. Worse yet, separating some sub-expressions into individual 'vals' seemed to eliminate spurious errors/bugs when these are embedded inside more complex expressions - even though they should not really. This turned learning Scala not only into learning how to use its features but also how to avoid the mines in its 'dark zone'. Could these have been my and other developers' 'user errors'. Improbably but possibly - and that does not lessen the problem. A language that only a few can use is a language that only a few can use, whatever the reason is.P.S. We haven't moved away from Scala yet. We just decided that we have no choice. I have yet to figure out how to rewrite a ton of Scala (2.11) code into four tons of Java so that I can start using Java 8 as well. I can't move to 2.12 either as it isn't out yet and see no light at the end of that tunnel... and then there is that binary compatibility issue as well, to reappear again with Dotty :(
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
But Java-level compatibility comes at a high cost: the language is relatively stagnant, and old pitfalls and awkwardness stay in the language and library essentially forever.
If you view Scala not as another Java but as a Java library, the current level of binary compatibility (source is pretty good even between major versions, binary breaks) is not terribly different than you expect from other major Java libraries. For instance, remember when Jackson went from 1.x to 2.x? Breakage all over the place. What if some libraries require Jackson 1 and some 2? Aaaaah!
I think it's reasonable to expect within-version binary compatibility for Scala, but if your requirements are really so high for stability, well, you have to decide which projects are going to dictate the allowed versions, and force everything else to follow along with the same dependencies. You have this problem within 100% Java. (Possibly somewhat ameliorated by modules in Java 9, but a lot of the time that won't work either because it doesn't magically translate data structures for you.)
You can always just not upgrade!
Also, "We are going to sell this plugin to you for $$$$ but we are too lazy to upgrade it when new versions come out" is not the kind of proposition that I would be interested in. Any system where I'm buying plugins that aren't even maintained to work with recent versions would send me running. Maybe in your ecosystem this is considered perfectly okay. I think it's on the wrong side of history, though.
That's a good point. Anyone could write a tool that makes this happen, though. Javadoc is perfectly happy with in-line URLs, so you "just" have to know where to point.
It's a non-negligible effort, I admit.
Scala can't solve social problems of Scala not being Java.
This might be too late for you, but my understanding is that the new TASTY intermediary format for Scala will (help) solve binary compatibility issues, including between Scala 2.x and Dotty. It's a bit early to tell if it will work in practice, but in theory it sounds very, very good:
Perhaps the plugins could be submitted in source format, and have your plugin system compile them?
Couldn't you just stay on one scala version? How is that worse than Java?
So could you have the plugins written in Java (or some scripting language) and keep your own codebase in Scala?
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate+unsubscribe@googlegroups.com.
Also, "We are going to sell this plugin to you for $$$$ but we are too lazy to upgrade it when new versions come out" is not the kind of proposition that I would be interested in. Any system where I'm buying plugins that aren't even maintained to work with recent versions would send me running. Maybe in your ecosystem this is considered perfectly okay. I think it's on the wrong side of history, though.
This isn't about us only. And it isn't about the other companies that are building plugins. It is also about the customers. For us it is unacceptable that we force customers to worry about problems like these and we can't help them either as we cannot ask plugin developers for their source code either.
Also, for javadoc integration, see: https://www.lightbend.com/blog/genjavadoc-generate-true-javadoc-for-scala-pr
--
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
Yes, I understand reasons for this. I am not really blaming anyone. But this is not a new problem and there have been solutions made to problems like these, better or worse, without compromising source level functionality, only performance and/or binary size.
Java has maintained substantial/impressive levels of backward compatibility. One can still run very old Java bytecode in newest JVMs and make calls to these from the fresh new Java 8 code.
This is true, but it's much easier if you not only own the language but also the runtime. Then you can just add more workarounds to the runtime to support existing code.
Seamless scala/java interop is difficult. It is very easy to develop a nice scala api that can't be implemented or used from java.
Re plugging, if you want to have things work across version boundaries, you need to sandbox your classloaders. Run each plugin within a classloader environment with the version of scala it expects. Then have the plugin container manage bridging this back into your core application.
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate+unsubscribe@googlegroups.com.
I've been using Scala since 2.8, and personally find it makes me more productive.
And the approach of creating a Java api within a Scala api (Play, Akka) doesn't work very well either. There's always the poor-relation syndrome to deal with.
A big opportunity was lost by de-emphasising Java interop and long-term stability/compatibility.
I don't disagree that Scala starting on top of Java8 would be radically different than the Scala we have that was started on Java5/6.
But, these days, assembling a monolith is not in favour. So associated binary versioning issues are reduced by going with a micro-services architecture -- a way to realise more isolated contexts.
So I don't think I'm saying "just use Java"?
As far as "lost opportunity": My recollection is that that the broader Java/Spring commercial dev community was not averse to Scala in the beginning. But that community did learn to avoid Scala after running into the issues that started off this thread.
I can't help but wonder how the commercial Java development world would look today if (then) Typesafe had fully embraced Spring and made Scala-support a priority in that eco-system.
My 2c. Thanks for reading.
Slightly off-topic: I think the approach of re-writing the (java) world in scala terms makes no sense commercially.
And the approach of creating a Java api within a Scala api (Play, Akka) doesn't work very well either. There's always the poor-relation syndrome to deal with.
From a distance I'd say that trying to create a "scala-only" ecosystem hasn't worked out the way anyone had hoped.
A big opportunity was lost by de-emphasising Java interop and long-term stability/compatibility.
Is there any other choice but for Java to be a poor-relation, if Scala is good at making you more productive?
We can argue the stability point, but do you have any measures in mind that would substantially improve Java interop without giving up on a substantial part of "makes me more productive"? What was the opportunity that was missed?
Also, Java 8 adds features that are like those that Scala has had for years, but which were not implemented using Scala's battle-tested approach. What is the opportunity here to get both interop and compatibility?
Microservices place a greater burden on the deployment environment in exchange for simplifications gained from a smaller isolated context. Similar to the way that the JEE app server provides a complicated deployment environment on which to build your value-add. Microservices are a practical expression of the fact that small teams work better. But a small dysfunctional team will not necessarily produce a working microservice. But the failure should be smaller :)
Kind of off topic, but is there any major hurdle to using remote Akka actors with different deployables using different Scala versions (with the messages as simple case classes in a module that's cross-compiled)? So you have a pure Scala app (could you call it microservices?) in multiple Scala versions, with the interop implemented as actor messages.
Microservices place a greater burden on the deployment environment in exchange for simplifications gained from a smaller isolated context. Similar to the way that the JEE app server provides a complicated deployment environment on which to build your value-add. Microservices are a practical expression of the fact that small teams work better. But a small dysfunctional team will not necessarily produce a working microservice. But the failure should be smaller :)Yes, but that is the easy bit. I wasn't talking about that. The problem is in the glue between them. And "glue" is another word and/or a way for "interop" and "compatibility"...
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
- Match as many Java concepts as possible so that we can use Scala to define and implement APIs and contracts for Java users. Things like vararg methods, enums, relaxed generics, ...
Re: anything to do with Spring...That is a separate topic. I tend to stay as far way as possible from that atrociousness. It is one big antipattern with a huge following. Scala actually reduces the little glimmer of need for things like Spring.
I've been using Scala since 2.8, and personally find it makes me more productive.At one time I tried to use "scala everywhere" but found, the hard way, that it complicates life too much.
I can't move to 2.12 either as it isn't out yet and see no light at the end of that tunnel
Have thought of this myself. The implementation has to be carefully thought through. For example, the case class messages might themselves contain code as functions or methods.
This code would need to execute on the target Actor's vm. If security is a concern, some means of validating or sandboxing the code might be needed.
If some Actor-based services are implemented in another language (say Java) some standard means of translating types
and packing/unpacking case classes
might be needed. Personally, I would love to see some sort of simple, standard API like this
that everyone could write to. "Spring without the atrociousness."
Could Tyrpesafe get behind something like this?
On Sunday, September 4, 2016 at 10:41:35 PM UTC-7, nafg wrote:Kind of off topic, but is there any major hurdle to using remote Akka actors with different deployables using different Scala versions (with the messages as simple case classes in a module that's cross-compiled)? So you have a pure Scala app (could you call it microservices?) in multiple Scala versions, with the interop implemented as actor messages.
--