Live data from Hacker News

Scala isn't fun anymore

alexn.org

251–260 of 394 posts

Re: Scala isn't fun anymore

#251

This guy loves sbt. For me it's one of the main reasons to use TypeScript instead of Scala.js. npm is so much better. I have been writing a lot of code in Scala.js and Scala about a decade ago, but thinking now of it, I feel only dread. Scala the language is nice enough, but the whole ecosystem around it is so stuffy.

Give Mill a try. You need to realize the Scala ecosystem is not monolithic. Things are mostly fine if you stay within a corner, but can get complicated when you start mixing dependencies from multiple domains. I think that is true for many languages. The JVM ecosystem is rich, and that comes at a price.

Seconded. Mill is a very versatile build tool. It mainly focuses around modeling builds as DAGs of tasks, and thus allows you to only rerun what is necessary after changes. Other tools like Bazel are built around this model too, but IMO Mill has "taste" in the way it is configured. It also gets out of your way, you can seamlessly integrate it into various shell scripts, and you don't need to make your project revolve around your build tool.

Re: Scala isn't fun anymore

#252
post #209

Earlier quoted context omitted.

That's a matter of opinion. Many, me included, very much like the current, very explicit, approach. I understand why people who like monadic constructs don't like it though.

I don’t know — I don’t claim that algebraic datatypes are the only proper way to handle errors, I’m okay with exceptions as well (even checked ones). But what go has is only very slightly better than C’s attempt, so I’m not sure it is that subjective.

I think the presence of multiple return values and the ability to easily use complex types for errors make a huge difference (adding wrapping messages, context, etc.).

I agree algebraic data types could improve this. I don't think monadic result types or exceptions would be an improvement.

Re: Scala isn't fun anymore

#253

Earlier quoted context omitted.

constant drama. Travis Brown (a very sociopathic and toxic, straight up unstable person) tried to cancel John A De Goes, total shitshow ensued. FYI, Travis has created scripts to auto-dox people on Twitter if he doesn't like them. Travis also left Scala ecosystem after lashing out at literally everybody including Martin Odersky Reason: De Goes invited a speaker to his LambdaConf conference, without knowing that speak…

Keep on posting. Me waiting for season 2.

You're joking but this stuff has been going on for longer than most Netflix shows :D

Re: Scala isn't fun anymore

#254
post #201

I enjoyed Scala, but I enjoy F# much more. .NET Core is a healthy cross-plat ecosystem, many of the VSCode/F# tooling issues have been eliminated over the past few years (IntelliJ was really one of the core reasons I preferred Scala), plus Akka.NET has F# bindings. Come on in, the water's warm: https://fsharp.org/learn/ https://getakka.net/

How long does it take for someone with about a decade's experience in C# to a point where they can write idiomatic F#?

I didn't have c# exp and it took me a month to feel "productive comfort", and less than 2 months until i felt "native comfort". I've been using it for about 2 years now.

That said I:

• had zero C# experience and it was the C# interop that caused me the most pain. Its easy now but I didn't grok how to properly pass arguments to overloaded C# methods (i kept messing up parenthesis, commas, and didn't pass argument names to tell f# the right function signature)

• have been coding for 8 years

• have functional lang experience with elixir and elm.

Now f# is my primary backend language.

Re: Scala isn't fun anymore

#255
post #36

Earlier quoted context omitted.

I couldn't tell you exactly why (though I have some ideas), but Lisps seem to settle into amazingly stable languages. Even Clojure, with all its initial trendiness, has been remarkably resistant to bloat and churn. Such things as it's added have largely been either standardisations of things that people were doing anyway, or very natural extensions of ideas that were already there, and it still generally passes the "…

Clojure has massive amounts of ecosystem and toolchain pain, even though it is a cool language. Most common dev environment for it is a complex emacs tool chain. If you are seeking the simple joys of programming, Clojure is unlikely to be what you want.

I don't believe this assessment comes from a professional Clojurist. Emacs is common but not necessary -- you can easily reach for Calva in Visual Studio Code. Leiningen provides a tested and very accessible build environment. But I prefer the Cognitect tools deps toolchain instead, which does have a larger learning curve. Again, the developer can choose. The author and many in the comments decry JSON parsing pain in Scala. JSON is handled elegantly in Clojure -- while Jackson (neatly wrapped by Cheshire) has its occasional CVEs to wrangle, you can instead employ clojure.data.json which is performant and free of Java transitive dependency bloat and CVE surface. The transitive dependency hell mentioned in the article seems to be exacerbated by Scala tooling, though Java inter-dependencies can be complex and difficult to manage in any JVM language. I have found Clojure's tools deps toolchain to give the most elegant dependency management experience I have experienced on the JVM.

Re: Scala isn't fun anymore

#256
I can't help but notice that the majority of the libraries he mentions are Java-first.

I don't have an extremely strong argument that this is the root of many of his problem with version mismatches, but I do have a strong hunch that it is.

I've spent a little bit of time with Scala, a little bit with Clojure, and a lot with Kotlin. My biggest conclusion from all these years of working with non-Java JVM languages is that Java interop is actually a language mistake. Or, rather, Java interop ends up being "design debt". It's great to bootstrap your new JVM language into popularity because people can try to gradually switch from Java or use mature Java libraries when your $NEW_LANG ecosystem is still nascent. But, the problem is that Java libraries are written in Java style and are written within the constraints of Java and Java's type system.

The most obvious (albeit likely the least problematic) example is null in Kotlin and Scala. Both languages have superior ways to handle the "bottom type" to Java, but a Java library obviously doesn't get to use those.

The other problems come from how much information can be expressed at compile time. The biggest design flaw in Java as a language is that it combines type-erased generics and runtime type reflection/inspection. Either one of those is fine, but they are quite literally incompatible concepts. You can't apply type-based logic on a type that doesn't exist.

Yet, because of how unexpressive Java's type system is, any sufficiently complex Java library/framework will make ubiquitous use of type reflection. Usually while leveraging annotations.

I can't tell you how many type bugs I've found in the JacksonXML Kotlin compatibility module and in Vert.x with Kotlin. Nulls sneaking in where they aren't supposed to, value classes randomly causing issues because something boxes up a Function object and then uses reflection somewhere surprising, things not serializing correctly because JacksonXML or Gson doesn't understand some perfectly valid type I've defined, etc.

But something like JacksonXML should never exist in Scala. Scala has type-classes, so you can define your serialization and deserialization logic on the type itself. Then it can be checked at compile time. For Java, defining and passing around a separate serialization object for each type would be too cumbersome, so all of the serialization libraries use reflection and just hope they can figure out the deserialization at runtime. When you find out that it can't because your app crashed, then you can backtrack and "teach" Jackson/Gson how to deserialize your troublesome type with a custom deserializer class and an annotation.

And it's not just the type systems being incompatible. It's also the style and idioms. Java frameworks really like to be "magical" and hands-off, because it's so verbose to define and pass around separate classes for everything.

I believe this is also manifested in the OP's issues with libraries depending on other libraries and causing version conflicts. If Java libraries were less "plug and play", they would ask the user to provide logic, instead of saying "Don't worry, I'll do everything for you under the hood."

Is this just a cliché Java flame comment? Maybe it is. But it's based on my many years of dealing with Java and every popular JVM language (excepting Groovy; I don't have any experience with it outside of gradle).

I now have a policy that if I'm working on a Clojure, Kotlin, or Scala project, Java dependencies are nearly forbidden. It's a very high bar to include a Java library dependency, and if it uses generics or reflection, it's basically an instant "no".

Re: Scala isn't fun anymore

#257
post #107

I actually think Scala is in the best position it's ever been. There is a commitment to making the language simpler, easier and cleaner. On the backend, ZIO ( https://zio.dev ) is the best concurrency library on any platform. On the frontend you have really interesting Scala.js projects like Laminar ( https://laminar.dev ). The biggest issue really is the tooling. SBT is simply awful.

> The biggest issue really is the tooling. SBT is simply awful. It's like they sat down and said "Maven has a bunch of problems. Let's fix none of them and introduce a few new ones."

I recommend to have a look at Mill. It's versatile, built on simple foundations, and implements many concepts from general-purpose build tools such as Bazel (but of course it was designed for Scala). It's easy to call it from various scripts too, and doesn't require you to design your project around your build tool.

At work we've used mill to first replace sbt and then also gradle in another project, and haven't looked back. It worked out-of-the-box for our JVM projects, and we trivially wrote custom "rules" for integrating cmake-based C++ projects into the build.

Re: Scala isn't fun anymore

#258
I don't understand why do we have to listen to this boring crap. Most of the article are complaints about dependency convergence. Convergence is completely irrelated to Scala. It happens with any JVM projects and may happen with almost any project for any platform. There are multiple ways to address it.

Regarding Akka - let it rest in peace, it was one step ahead and ten steps back. Actors have too many fundamental problems to be a good general-purpose model.

Re: Scala isn't fun anymore

#259

I don't understand why do we have to listen to this boring crap. Most of the article are complaints about dependency convergence. Convergence is completely irrelated to Scala. It happens with any JVM projects and may happen with almost any project for any platform. There are multiple ways to address it. Regarding Akka - let it rest in peace, it was one step ahead and ten steps back. Actors have too many fundamental p…

> I don't understand why do we have to listen to this boring crap.

You don't? You chose to read the article yourself of your own free will. At least, I hope you did.

Re: Scala isn't fun anymore

#260

I don't understand why do we have to listen to this boring crap. Most of the article are complaints about dependency convergence. Convergence is completely irrelated to Scala. It happens with any JVM projects and may happen with almost any project for any platform. There are multiple ways to address it. Regarding Akka - let it rest in peace, it was one step ahead and ten steps back. Actors have too many fundamental p…

> I don't understand why do we have to listen to this boring crap. You don't? You chose to read the article yourself of your own free will. At least, I hope you did.

This link had been heavily spammed across all the Scala communities over last week. I'm pretty tired of this "useful" discussion.
Post reply on HN