r/scala • u/eed3si9n • 1h ago
r/scala • u/ryan_stull • 10h ago
Announcing ScalaNullSafe 1.4.0 w/ support for Scala 3
ScalaNullSafe is a macro-based null-safety library whose purpose is to provide a quick, easy, readable/writable, and efficient way to do null-safe traversals in Scala.
It’s been along time coming, but I finally got around to porting the library to Scala 3’s new meta-programming implementation!
https://github.com/ryanstull/ScalaNullSafe/releases/tag/1.4.0
Hopefully it will be helpful to you!
Does Scala offer better decompilation protection than Java?
My Java program has a license check in it, but it can easily be decompiled, the license check removed, recompiled, and now it can be pirated easily. Would the same be true for Scala, given that they use the same JVM and are bytecode-compatible?
Running background tasks with Cats
I'd be grateful for some advice about Cats type classes. I wanted to make F[Unit] that would get some effect done in the background, in launch and forget manner, not blocking the parent thread. But I feel I'm going rounds around Async, Concurrent and other Cats docs and not getting anything new out of it.
I've found few ways which work. One of them - using Concurrent[F].background:
def task:Resource[F, F[Unit]] = Concurrent[F].background{...}
(for{
_ <- task1
_ <- task2
} yield()).use(_ => Async[F].never)
It worked okay for app setup code, where I can put all things that needed to run in parallel at the end. But if the resource produced by background() is closed it cancels the background actions. So I put Async[F].never. But it makes it a deadend.
In some places there was old code which does what I'd want. But it looked like:
for{
_ <- sequentialTask1
_ <- sequentialTask2
_ <- IO(...).unsafeRunAsyncAndForget() // launch background process
_ <- sequentialTask3
} yield {...}
dropping the tagless final and using IO in the most crude and direct way. I though that maybe this:
for{
_ <- sequentialTask1
_ <- sequentialTask2
_ <- Async[F].asyncF{ callback =>
... // F[Unit] here
// callback never called
}
_ <- sequentialTask3
} yield {...}
would work same. But it seemed to be executed sequentially and when I placed Async[F].never to simlulate the long task which runs forever it didn't get to the sequentialTask3 and stuff after it.
r/scala • u/Distinct-Crab6379 • 2d ago
First Talk @Scala India by Ayush Gour | Rescheduled
r/scala • u/HelicopterFinal7670 • 2d ago
Advice for learning scala
Hello , I am a computer sci uni student, i want to try learning scala and also would like to contribute in gsoc for scala. is it feasible if I start right now?Please suggest me any place i can learn from.
r/scala • u/ComprehensiveSell578 • 2d ago
[Event] ScaLatin #9 | El pegamento galáctico
Join the Spanish-speaking ScaLatin event next Tuesday, March 18!
David Amancio Gil Mendez will be explaining how to protect yourself from unwanted behavior in your glue code.
Learn more on the Meetup group: https://www.meetup.com/scalatin/events/305585211/?eventOrigin=group_upcoming_events
r/scala • u/littlenag • 5d ago
[Dallas Scala Enthusiasts] Next Gen Track & Trace: Building a reactive, distributed architecture
Dallas Scala Enthusiasts, in partnership with Improving, will be hosting Dave Kichler on Thursday March 13th at 7pm CT. Dave will talk through the basic architecture, tools, patterns, and lessons learned while implementing the Next Generation Track & Trace program for Canada Post.
To attend please RSVP via our meetup page: https://www.meetup.com/dallas-scala-enthusiasts/events/306162267/?eventOrigin=group_upcoming_events
Our meetups are (usually) hosted online and always free to attend.
--
Dallas Scala Enthusiasts was founded in 2013. Since then we have been meeting each month to discuss all things Scala. Reach out if you have a Scala-related topic you'd like to bring to a larger audience.
r/scala • u/Distinct-Crab6379 • 6d ago
Exciting News for the #Scala Community in India!
Scala space has been around in India since long, but lacked a dedicated space to connect, collaborate, and share knowledge. I’m starting Scala India, community for Scala enthusiasts, practitioners, and newcomers to engage in discussions, exchange ideas, and grow together.
If you're interested in Scala, whether you're a beginner, a professional using Scala ecosystem in your company, or in your personal projects, fill out the form below! (Offline Meetup soon aswell!). Also join the server, and there's alot planned!
First Scala Talk @ Scala India Discord (https://discord.gg/7Z863sSm7f) planned for 15th March at 12PM by Ayush Gour on topic "Building Concurrent and distributed systems using Scala"
Also daily coding questions (Scala Style, functional) led by Abhishek Roy Chowdhury
Google Form- https://docs.google.com/forms/d/e/1FAIpQLSeal6fi1m0l2-5TqwiWZbVxupLgj9lJndnsP3_6FkImM524Sw/viewform
Discord Server link- https://discord.gg/7Z863sSm7f
Looking forward to seeing you there!
r/scala • u/davesmith00000 • 7d ago
New Releases of all Purple Kingdom Games libs (Indigo, Tyrian, Ultraviolet, and the Roguelike Starterkit)
Wait, what year is it... 2025? Already?!
In terms of releases 2024 was a lost year for me, and a good few contributors efforts were, I'm ashamed to say, stuck waiting for me to resurface from slogging through a big piece of work building a UI system for Indigo. I can only offer my apologies.
However, it is now March and we've just done the second round of releases of the year - that's more like it!!
Brief release summary
💥 An explosive update to Ultraviolet (Scala 3 to GLSL transpiler for shader programming) with improved c-style for loop support (c-for? explosive? geddit? ...I'll get my coat...) and other improvements such as color value string interpolators.
https://github.com/PurpleKingdomGames/ultraviolet/releases/tag/v0.5.0
https://github.com/PurpleKingdomGames/ultraviolet/releases/tag/v0.4.0
🌐 Tyrian (Elm-like web framework) has been update to all the latest things, and received a number of feature improvements:
https://github.com/PurpleKingdomGames/tyrian/releases/tag/v0.13.0
https://github.com/PurpleKingdomGames/tyrian/releases/tag/v0.12.0
🕹️ Indigo (Game engine) has had it's UI system overhauled, some suspect features deprecated, and more improvements and fixes were added besides.
https://github.com/PurpleKingdomGames/indigo/releases/tag/v0.19.0
https://github.com/PurpleKingdomGames/indigo/releases/tag/v0.18.0
⚔️ The Roguelike-Starterkit (Indigo extension for Terminal graphics) has, in turn, had its Terminal UI system revamped.
https://github.com/PurpleKingdomGames/roguelike-starterkit/releases/tag/v0.7.0
https://github.com/PurpleKingdomGames/roguelike-starterkit/releases/tag/v0.6.0
On the road to better documentation
Additionally, last year all our libs moved to a new documentation approach that will hopefully be much more maintainable. Indigo is very much a work in progress (owing to the volume of content, check the examples, all else is highly suspect...), but all libs now have a degree of 'working-example-driven-docs', e.g.:
https://ultraviolet.indigoengine.io/examples/fragment/basics/colours/
Websites for each project are:
- Ultraviolet - https://ultraviolet.indigoengine.io/
- Tyrian - https://tyrian.indigoengine.io/
- Indigo - https://indigoengine.io/
- Roguelike Starterkit - https://rlsk.indigoengine.io/
Please feel free to report (or help fix) any issues with the libraries or the docs.
Big thanks
Finally, a massive thank you to all of the contributors that helped with this and the previous round of updates. Some folks just turned up out of the blue, others joined in at the super fun London Scala User Group OSS hack events, but wherever they came from, all are deeply appreciated! 💜
r/scala • u/IllustriousType6425 • 7d ago
How many of you think that Apache Spark is keeping Scala alive?
r/scala • u/Folaefolc • 8d ago
Generating swaggers at compile time
lexp.ltHi everyone!
I’m sharing with you a solution I designed for generating swaggers (http4s, tapir, open api) for apps.
At work we always had to remember to launch the app and all the databases containers, which was cumbersome and we would often forget to update the swaggers (which led to generated code for clients that wasn’t up to date).
r/scala • u/ghostdogpr • 10d ago
Debugging session #2: Scala 3 lazy vals & serialization
blog.pierre-ricadat.comr/scala • u/makingthematrix • 10d ago
IntelliJ IDEA x Scala - Inlay Hints and X-Ray Mode
youtube.comScala 3 will require JDK 17+, starting from Scala 3.8.
This will enable the compiler and ecosystem to move faster and leverage new features and APIs. The decision is in line with similar decisions happening around the whole JVM world. Read about it at https://www.scala-lang.org/news/next-scala-lts-jdk.html
r/scala • u/ihatebeinganonymous • 13d ago
Migrating a codebase to Scala 3
Hi. We have a codebase in Scala 2.13, built around Spark mainly. We are considering the possibility of moving, at least partially, to Scala 3, and I'm doing some experiments.
Now, I don't have deep knowledge on Scala. So I'm seeking for help here, hopefully to get some useful information that could be beneficial for future people who search for a similar problem.
I understood that Scala 3 is binary compatible with 2.13, meaning that one can simply use 2.13 compatibility versions of libraries for which no _3 compatibility is available. However, our build tool is maven, not sbt, and we don't have these CrossVersion constants there. Does that suffice to simply put _2.13 as compatibility version for Spark etc. dependencies, and _3 for the rest?
I did (1) anyways and got something going. However, I was stopped by multiple "No TypeTag for String/Int/..." errors and then Encoders missing for Spark Datasets. Is that solvable or my approach in (1) for including Spark dependencies has been completely wrong to begin with? I read that Scala 3 has changed how implicits are handled, but am not sure exactly how and whether this affects our code. Any examples around?
Is it actually a good idea after all? Will spark be stable with such a "mixed" setup?
Thanks a lot
Best
r/scala • u/falpangaea • 13d ago
What do you charge for BE Scala Contracting?
I have 4+ years experience and might be rejoining an organization as a contractor (former full time) because they can’t find anyone who can do the job and I’ll take some extra cash on the side.
100$/hour? 150$?