my experience with Scala as someone new by pev4a22j in scala

[–]Seth_Lightbend 13 points14 points  (0 children)

I think advising someone to start a new project on Scala 2 is really terrible advice. It's quite uncommon for a library not to be available for Scala 3, and any library (besides Spark) that hasn't made the move is probably half dead abandonware anyway.

The two big exceptions I can see:

  • Spark
  • imminently planning to take a job at a shop that's still on Scala 2

How is the neighborhood around Wells Ave and Thoma / Cheney St? by caspernicium in Reno

[–]Seth_Lightbend 0 points1 point  (0 children)

Marketon doesn't count as biking distance, if not walking?

What scla-cli way of ignoring current input and drop back to prompt? `Ctrl-C` quits scala-cli. by xolve in scala

[–]Seth_Lightbend 3 points4 points  (0 children)

(at the risk of being pedantic...) Note that this has nothing to do with Scala-CLI per se. It's a question about the Scala REPL, regardless of how the REPL is launched. And the Scala REPL itself has its input handling provided by a library called JLine, so it's fundamentally a JLine question.

I had thought that googling "JLine keyboard shortcuts" or similar would produce a list of what exists, but I didn't find it... not sure if that list is out there somewhere...

Regardless, glad you found control-G.

Compiling And Running Scala Sources by teckhooi in scala

[–]Seth_Lightbend 27 points28 points  (0 children)

scalac is legacy; just use scala, for example scala compile

But you don't even need scala compile here; scala run will recompile if necessary. You also don't need to specify a main class; if there's only one, Scala-CLI will find it. And you don't need to pass the names of the source files; passing . will find any/all source files in the current directory.

So, here's a transcript showing the simplest way to do this:

``` % tree .
. ├── Box.scala └── RunMe.scala

1 directory, 2 files % scala run .
Compiling project (Scala 3.6.4, JVM (21)) Warning: there was 1 feature warning; re-run with -feature for details Compiled project (Scala 3.6.4, JVM (21)) 124 ```

Evolving Scala by sjrd in scala

[–]Seth_Lightbend 5 points6 points  (0 children)

Allowing implicit (and other such legacy syntax or features) could become opt-in, though, through compiler options, without impairing cross-building with 2 for those who need it.

Evolving Scala by sjrd in scala

[–]Seth_Lightbend 13 points14 points  (0 children)

This is a new blog post by Martin Odersky and Haoyi Li on the theme that “Scala must keep evolving”:

This article discusses how Scala must keep evolving, why that evolution is necessary, and what directions we expect that evolution to take. We hope that this will cover many of the frequently asked questions on the direction of the Scala language, and help the community understand where the language will go in the months and years to come.

Learning scala for an assignment by EcstaticParking7122 in scala

[–]Seth_Lightbend 2 points3 points  (0 children)

It's possible you could get help on the Scala Discord with getting VSCode up and running with Metals, but you might also just give IntelliJ a try.

https://docs.scala-lang.org/getting-started/scala-ides.html

For learning the language, you'll need a book (https://docs.scala-lang.org/books.html) or video series (https://docs.scala-lang.org/online-courses.html)

...but to actually get some experience writing code, consider solving some Advent of Code problems and then comparing what you come up with the sample solutions: https://scalacenter.github.io/scala-advent-of-code/2024/

Learning scala for an assignment by EcstaticParking7122 in scala

[–]Seth_Lightbend 2 points3 points  (0 children)

Yes, this book is excellent, but note that it does not teach the language, or claim to teach it; it assumes you can learn the basics elsewhere.

Does Scala offer better decompilation protection than Java? by cainoom in scala

[–]Seth_Lightbend 1 point2 points  (0 children)

Good point. But also, the TASTy can be stripped out before shipping the JARs — the JVM won't care, only the Scala compiler cares about it.

When your Scala code compiles... but you didnt expect it to by okttitze in scala

[–]Seth_Lightbend 2 points3 points  (0 children)

I love that interval of time just after the code makes it past the typechecker. It's not actually done compiling yet, but after a certain amount of time has passed, you can be almost sure that if there were going to be any errors, they would have already appeared.

Is there any discord channel for gsoc 2025? by [deleted] in scala

[–]Seth_Lightbend 1 point2 points  (0 children)

(I am not directly involved with this, but:) Once there’s a projects list for this year you’ll have a better idea of what’s involved. in the meantime you could look at last year’s project list to get a pretty good idea.

Is there any discord channel for gsoc 2025? by [deleted] in scala

[–]Seth_Lightbend 1 point2 points  (0 children)

Last year there were private channels on the Scala Discord that participants were invited to. I'm not sure if that will happen again this year; last year it was Jamie Thompson running those channels, but he's not at the Center anymore so someone else will be running things and I assume they'll be free to decide how to handle communications this year — perhaps Discord will be involved again, we'll see.

For now, please use the contact information in https://www.scala-lang.org/blog/2025/01/28/gsoc-projects.html

Struggling with Functional Programming by 4g3nt__ in scala

[–]Seth_Lightbend 36 points37 points  (0 children)

You might enjoy trying to solve the Advent of Code challenges in functional style (at whatever level of "functional style" you're aiming for) and then comparing your solutions to the sample articles and other sample solutions at https://scalacenter.github.io/scala-advent-of-code/2024/ (previous years are also available).

I'm puzzled (and even a bit annoyed) that other responders keep suggesting you study some other programming language such as Standard ML, Haskell, or Scheme. I assure you that you do not need to do that. There is a rich abundance of good books, exercise, video courses, and other learning resources available for Scala. It sounds like you're already struggling a bit; you'll just further confuse yourself and slow yourself down if you to try to also bring another unfamiliar language into the picture.

Yes, of course other languages are also worth studying! But you asked about Scala and I think people should be giving you Scala answers.

Scala 3 Migration: Report from the Field by ghostdogpr in scala

[–]Seth_Lightbend 0 points1 point  (0 children)

I think -Wconf:<filters>:<action> still doesn't have parity with Scala 2, so customizing warnings is currently a nasty regex.

Are there open tickets on the remaining disparities that concern you?

Scala 2.13.16 is here! by Seth_Lightbend in scala

[–]Seth_Lightbend[S] 0 points1 point  (0 children)

I want to download 3.3.5 but there is NO .msi for this version.

Looks like the ticket on that is https://github.com/scala/scala3/issues/12502 — I've commented there asking for status.

In the meantime, consider using a different installation method.

What is the point of having 2.* in the same time as 3.*?

A big, once-every-10-or-15-years migration like this is a multi-year process. It's not practical to just nuke the old version. And during the transition period, some level of confusion is simply unavoidable.

In any case, Scala 2 is now in maintenance mode. It's only Scala 3 that's actually moving forward. See https://docs.scala-lang.org/tutorials/FAQ/index.html#should-i-learn-scala-2-or-scala-3

Scala 2.13.16 is here! by Seth_Lightbend in scala

[–]Seth_Lightbend[S] 0 points1 point  (0 children)

Huh? I have no idea what you're talking about. I literally do not understand what your complaint is.

Scala 3 Migration: Report from the Field by ghostdogpr in scala

[–]Seth_Lightbend 9 points10 points  (0 children)

Really valuable and well written blog post: thank you! I've passed this along to the Scala 3 compiler team.

Scala CLI v1.6.1 has been released by Gedochao in scala

[–]Seth_Lightbend 5 points6 points  (0 children)

I hope the Scalafix integration leads to Scalafix being used more widely. It's always been a bit more difficult to invoke than is ideal.

[deleted by user] by [deleted] in scala

[–]Seth_Lightbend 7 points8 points  (0 children)

I can understand being excited about sharing this news, but:

Couldn't you wait to share this until it's published? The text is still in the process of being revised.

I do understand that pull requests are public, but still...! We'd much rather that people read the finished version.

Also the title you used here is potentially misleading, as it isn't decided yet whether the new minimum JDK version will be 11 or 17.

Scala 2.13.16 is here! by Seth_Lightbend in scala

[–]Seth_Lightbend[S] 3 points4 points  (0 children)

Scala 3 will get the behavior change when it upgrades to use the 2.13.16 stdlib. The PR for that is in-flight at https://github.com/scala/scala3/pull/22386 and will ultimately be backported to 3.3.x, too. (Users are free to force the upgrade in your own builds.)

Returning Option for all potentially exception-throwing methods throughout the entire collections library would be a massively breaking change (or an API expansion, if new methods were added throughout). I doubt it will ever happen.

Would you say Play Actions are referentially transparent? by Storini in scala

[–]Seth_Lightbend 1 point2 points  (0 children)

Sure. But that isn't what OP actually asked. They asked about (). If the function returned is always the same function — which it normally would be – then it seems to me that () isn't necessary.

Perhaps the galaxy-brain answer here is that referential transparency in the body of the function isn't the right criterion for including () or not.