Live data from Hacker News

The Road to Scala 3

scala-lang.org

171–180 of 196 posts

Re: The Road to Scala 3

#171
post #27
post #6

Earlier quoted context omitted.

I won’t even mention the anecdata from my own workplace. I’ll only say that within my extended network people are frantically rewriting Scala bits in other languages. Those who are stuck with it (because of, say, extensive prior investment into Spark) are scrambling to come up with alternate solutions. Put your ear to the ground, and you too will hear it.

There is an ongoing work on creating Spark alternative in Rust[1][2]. Hopefully, that could help. [1] https://github.com/rajasekarv/native_spark [2] https://medium.com/@rajasekar3eg/fastspark-a-new-fast-native...

Will take years to get there, if they even get there at all. This is a single-man side project now. Also benchmarking something that has 1/100 of the original functionality and is not production ready is very unfair. It is much easier to get a specialized use case faster than a general purpose system.

Re: The Road to Scala 3

#172
post #67

Earlier quoted context omitted.

I'll speak for myself. I just jumped ship from a Scala team and took a pay hit to get out because it was so horrible. No one on the team had a strong command of the language, which made it worse. The application was a ball of mud. The week I left, proposals to rewrite everything in Java were heard. I took a position on a Go team and am much happier.

I wouldn't jump ship to a Go project, but I am currently in the situation you fled from. Even the core team who started the project doesn't have command of the language. I have some experience with rust and Haskell (hobby) and JVM experience with Java and clojure so I can get by but it is not pleasant. I think the situation is similar to c++ where too many features have been added over time. While with c++ there is a…

This has nothing to do with languages. I saw the same happening in a company writing pure Java, JS or Python. Doing a project with people who don't have command of whatever stack they are using is asking for trouble.

On the flip side, Scala can be a very pleasant stack to work with if you have right people on the team.

> While with c++ there is a body of compiled recommendations on what not to use and how to write c++, for scala that doesn't really exist.

Principle of least power is what you need.

Re: The Road to Scala 3

#173
post #154

Earlier quoted context omitted.

>With all that said, the church of FP and the hascalator community is a problem for Scala. Overly dogmatic & academic functional programming styles don't have a place in production systems. Isn't Scala minus the problems you mentioned just Kotlin?

Does Kotlin have the maybe monad?

Not in the standard library. Kotlin went with specific language features to achieve null safety: https://kotlinlang.org/docs/reference/null-safety.html

Personally, being able to solve problems with the abstractions you can achieve within the language over adding very specific language features to solve them appeals to me more.

Having said that, Arrow has Option: https://arrow-kt.io/docs/apidocs/arrow-core-data/arrow.core/...

Re: The Road to Scala 3

#174
post #97

The problem of Scala is that it is outclassed by Rust and Kotlin at its two niches of, respectively, "best designed programming language" and "better Java on the JVM". Scala can't beat Rust because you can't have safe concurrency (and also single-threaded mutation control) without linear types, and you can't have linear types on the JVM; furthermore, a GC and VM-based language is inferior to a native non-GC one provi…

Scala and Rust are not competitors. They solve different problems and are designed for different kind of software. Rust will never be in the same league of productivity / abstraction as Scala is. There is a huge mental overhead of manual memory management that the language forces on you everywhere. Try to write a lockless or immutable Hashmap in Rust and then in Scala to see the difference. Or a graph-like structure. Or async code. Just compare method signatures. Scala is a piece of cake compared to Rust in this area.

On the flip side, Scala will never be as good system language as Rust is, even after adding more improvements to the JVM e.g. value types, or even with Scala native. In these use cases where I need a tight control of resources I'd take Rust over Scala every time.

As for Kotlin - meh, it is just Java with nicer syntax, not interesting to me at all.

Re: The Road to Scala 3

#175
post #162
post #161

Earlier quoted context omitted.

> Java 14 records, pattern matching and switch expressions are like a joke compared to Scala case class and pattern matching. What does Scala's pattern matching do that Java's (upcoming) doesn't? > For example, does Java 14 Stream have any method equivalent to `collect` in Scala, which is a combination of filter and map? Not that I'm aware, but then again, I don't see the large advantage compared to making two separa…

An example of Scala's pattern matching: case class Person(name: String, age: Int) // a collection of 3 people val c1 = Vector(Person("A", 5), Person("B", 6), Person("C", 4)) // now I want a collection of people who have age > 4 and then their ages are doubled val c2 = c1 collect { case Person(name, age) if age > 4 => Person(name, age*2) } How do you write it in Java 14? Want something lazy like Java streams? It's Laz…

In Kotlin

    data class Person (val name: String, val age: Int)
    val c1 = listOf(Person("A", 5), Person("B", 6), Person("C", 4))
    val c2 = c1.filter{ it.age > 4 }.map{ it.copy(age = it.age*2) }

Re: The Road to Scala 3

#176
post #27
post #6

Earlier quoted context omitted.

I won’t even mention the anecdata from my own workplace. I’ll only say that within my extended network people are frantically rewriting Scala bits in other languages. Those who are stuck with it (because of, say, extensive prior investment into Spark) are scrambling to come up with alternate solutions. Put your ear to the ground, and you too will hear it.

There is an ongoing work on creating Spark alternative in Rust[1][2]. Hopefully, that could help. [1] https://github.com/rajasekarv/native_spark [2] https://medium.com/@rajasekar3eg/fastspark-a-new-fast-native...

He is not the first, Andy Grove worked on a similar thing last years, but he worked mostly alone, and without community you cannot take off such ambitious project: https://andygrove.io/2018/11/datafusion-2019/

Re: The Road to Scala 3

#177
post #139

Earlier quoted context omitted.

FWIW, I'm in a FAANG and finding Scala devs is even a problem within my own org and team. We've resorted to teaching largely Java devs Scala on the job with mixed results. A former senior manager who made the decision supposedly viewed going all in on Scala as a mistake in large part due to the huge time loss in ramping people up & problems hiring. I like what I've used of the language at work, although I tend to wri…

Hiring Java devs is the problem. It's a lowest common denominator language. Try looking for Ruby or JS devs. It's a lot easier to teach someone from a dynamic background how to leverage a type system than it is to teach an imperative developer to write side effect free code. State is a crutch.

They just happen to be people who has done Java - we hire the best devs we can, regardless of language experience (my own team has interviewed/hired people who have done primarily Python, Ruby, JavaScript, Clojure, and/or Java). A couple turned out pretty well, but several turned out to be much more junior than we expected. I should add that I have no love for Java myself, I rather not be writing Java at all if I can help it.

If there is one thing this profession has taught me about hiring, it is that it is very difficult to predict who the top performers will be. Blanket assumptions will often prove to be not true when searching for the cream of the crop.

Re: The Road to Scala 3

#178
post #154

Earlier quoted context omitted.

Does Kotlin have the maybe monad?

Not in the standard library. Kotlin went with specific language features to achieve null safety: https://kotlinlang.org/docs/reference/null-safety.html Personally, being able to solve problems with the abstractions you can achieve within the language over adding very specific language features to solve them appeals to me more. Having said that, Arrow has Option: https://arrow-kt.io/docs/apidocs/arrow-core-data/arrow.…

Ok, looks similar to C#.

Honestly I prefer maybe monads to null coalescing

Re: The Road to Scala 3

#179
post #133

Earlier quoted context omitted.

Kotlin is not the future of anything. They got the Android boost and still, two years later, all they have to offer is a molasses-slow improvement pace and a shitty dev experience in their signature IDE (which also happens to be made by the same company). Last time I tried to create a Kotlin project in IDEA, it couldn't provide type information on hover. The Kotlin dialect of Gradle was barely supported enough to be…

We're writing new apps in Kotlin instead of Java, works fine for us. shrug Vert.x , Ktor apps, Kafka streaming apps. IDEA handles it absolutely fine these days, I suspect you last tried it sometime ago. Can't comment on the Gradle stuff though, I vastly prefer Maven.

Is vertx better than ktor for production?

Re: The Road to Scala 3

#180
post #162

Earlier quoted context omitted.

An example of Scala's pattern matching: case class Person(name: String, age: Int) // a collection of 3 people val c1 = Vector(Person("A", 5), Person("B", 6), Person("C", 4)) // now I want a collection of people who have age > 4 and then their ages are doubled val c2 = c1 collect { case Person(name, age) if age > 4 => Person(name, age*2) } How do you write it in Java 14? Want something lazy like Java streams? It's Laz…

In Kotlin data class Person (val name: String, val age: Int) val c1 = listOf(Person("A", 5), Person("B", 6), Person("C", 4)) val c2 = c1.filter{ it.age > 4 }.map{ it.copy(age = it.age*2) }

Kotlin and Java don't have a powerful pattern matching like Scala. Maybe that's why they don't have `collect` for filter + map. However I'm learning kotlin now because my employer doesn't allow me to use Scala
Post reply on HN