Live data from Hacker News

What's Next for Scala

lihaoyi.com

141–150 of 203 posts

Re: What's Next for Scala

#141
post #127
post #76

I’ve been using Scala as my main programming language for over 5 years. I’ve found my “plateau of enlightenment” by sticking to a subset of the features: case classes, for comprehensions, futures, immutability, pattern matching. By avoiding things like implicit, overly complex types, defining/overloading operators, and being dogmatic about FP/OOP I find the language stays out of your way and lets you write code that…

I've done the same by being lazy, mainly treating it as a better Java and only learning new stuff when necessary or obviously beneficial. I want to write good programs, not fancy code. My advice: - Options, immutability, pattern matching, and list comprehensions are all awesome and better than the default Javaesque way - Scala concurrency abstractions all better than Java, but concurrency is still hard. Proceed with…

OK, here's my question then. You're embracing Option type and yet presumably avoiding monads, applicatives, and functors (avoiding "FP-crusader stuff"), right?

So what happens when you are dealing with multiple option types, like you two optional ints you need to add together? Or you have an optional field in an optional object? This happens all the time in code that heavily uses Option types.

So do you match on every one, and nest match expressions inside match expressions inside match expressions? That can get very, very messy and even confusing.

Re: What's Next for Scala

#142

The Scala team pulled out all the stops with Dotty. It's a real tour de force, on a par with the sea change of C++11. Even with the plaudits he's earned, Martin Odersky is for me in the top three language designers of our time. (I'm sure I'm being unfair to other members of his team with this comment, though.) Dotty's union types are a thing of beauty, its implicits are really second to none, and _so_ damn useful. Th…

> Martin Odersky is for me in the top three language designers of our time

I don't know about that.

To me, the criteria he uses to allow incorporation of features in both Scala 2 and Scala 3 is "Will this feature allow me and my students to apply papers for conferences and fund my PhD students?".

Language design seems to have very little to do with that. As long as you can derive multiple papers to multiple conferences from a proposed feature, it's in.

Re: What's Next for Scala

#143
post #104

Earlier quoted context omitted.

Interesting you refer to C++. Both languages, IMHO, became too big to be practical. You need to, as a team, choose a subset of C++ (or Scala) and a style for it to become manageable. I dont think this looks good on a language, I prefer a language that comes with a small, concise set of features that are broadly understood and applied. But different folks different strokes.

I would disagree here. Scala's language spec is smaller than javas, it's problems are akin to Lisps. Too many dsls, extensions and so on. It really opened the doors for FP concepts to go mainstream. Unfortunately, some people went way too far with it.

Brainfuck's spec fits in one page. As does Whitespace's spec.

These two languages are impossible to write code in because of their complexity.

It's completely mystifying to me that even today, Martin still uses the "spec size" argument in his keynotes to attempt to demonstrate that Scala is a simple language, and it demonstrates a complete ignorance of what language design actually is, or a troubling disingenuity meant to deceive.

Re: What's Next for Scala

#144
post #136

One of the most off-putting experiences when starting with Scala is the lack of a dedicated Scala repository such as Clojars for Clojure. Floundering around in Maven Central trying to get an idea of what's available for Scala is an exercise in futility and enough to make you want to give-up before you've even started.

https://index.scala-lang.org/

Re: What's Next for Scala

#145

Scala is a beautiful and elegant language. I really thought that it would be one of my favourite languages when I first started working with it. However, after some time I got disenchanted. First, Scala is hard. Projects written by one person quickly become a deep functional labyrinth and custom architectural patterns because Scala is so expressive and you can do all kind of twists. Second, the entrance level remains…

Exactly my experience too.

It's hard not to fall in love with Scala in the first months you start using it but downright impossible to like the language after that.

Kotlin has won my heart. So far, anyway.

Re: What's Next for Scala

#146
post #122
post #115

Earlier quoted context omitted.

Dunno about Scala, but Clojure - another JVM language, has a GraalVM native executable for Hello WOrld about 8MB. Not that slim.

How does that compare to similar languages? (Go, Nim, D, etc).

For reference:

    $ \cat hellogo.go
    package main
    
    import "fmt"
    
    func main() {
      fmt.Println("hello")
    }
    $ go build hellogo.go
    $ \cat hellonim.nim
    echo "hello"
    $ nim c hellonim.nim
    ...
    $ ll
    total 2.2M
    -rwxr-xr-x 1 kbd staff 2.1M Apr 11 20:55 hellogo*
    -rw-r--r-- 1 kbd staff   66 Apr 11 20:42 hellogo.go
    -rwxr-xr-x 1 kbd staff  87K Apr 11 20:55 hellonim*
    -rw-r--r-- 1 kbd staff   13 Apr 11 20:29 hellonim.nim
Keep in mind these are the default compilation settings.

Re: What's Next for Scala

#148

The Scala team pulled out all the stops with Dotty. It's a real tour de force, on a par with the sea change of C++11. Even with the plaudits he's earned, Martin Odersky is for me in the top three language designers of our time. (I'm sure I'm being unfair to other members of his team with this comment, though.) Dotty's union types are a thing of beauty, its implicits are really second to none, and _so_ damn useful. Th…

A word of caution on Scala 3: Scala 3 still in beta, lacks clear roadmap, allows choosing between two syntaxes (python-style vs braces). Dotty Community Build lacking Lightbend frameworks (no Akka, no Play, no sbt) With the recent layoffs at Lightbend of Scala 2.x core contributors, a full endorsement of Scala 3 would certainly help.

As an outside observer (and professional Akka user), comments like this really help put the changes in perspective. Thanks.

Re: What's Next for Scala

#149
post #76

I’ve been using Scala as my main programming language for over 5 years. I’ve found my “plateau of enlightenment” by sticking to a subset of the features: case classes, for comprehensions, futures, immutability, pattern matching. By avoiding things like implicit, overly complex types, defining/overloading operators, and being dogmatic about FP/OOP I find the language stays out of your way and lets you write code that…

> By avoiding things like implicit ...

Implicit parameters are nothing more than a terminal argument list which the compiler attempts to provide from "the implicit scope." If you would rather it not, then simply provide them yourself at the point of invocation.

To wit:

  object HitchhikersGuide
  {
    implicit val answer : Int = 42;
    implicit val question : String = "the universe";

    def foo ()
      (implicit a : Int, q : String)
      : Unit =
      System.out.println (s"${q} = ${a}");

    // This
    foo ();

    // Is the same as this
    foo () (42, "the universe");
  }
It is left as an exercise for the reader to verify (hint: javap[0] is your friend).

HTH

0 - https://docs.oracle.com/javase/7/docs/technotes/tools/window...

Re: What's Next for Scala

#150
post #136

One of the most off-putting experiences when starting with Scala is the lack of a dedicated Scala repository such as Clojars for Clojure. Floundering around in Maven Central trying to get an idea of what's available for Scala is an exercise in futility and enough to make you want to give-up before you've even started.

https://index.scala-lang.org/

Great. I stand corrected. How long has that been up? Last time I started with Scala it didn't exist.
Post reply on HN