Masthash

#scala

Sören Brunk
6 hours ago

Storch progress update:

Thanks to a fantastic contribution by @davoclavo, we now have implementations for many more math ops in Storch.

He's also added improvements to help derive correct op types through property-based testing, and more.

I'm really happy to see that people are interested in the project and even better, are contributing.

https://github.com/sbrunk/storch/pull/23

#Scala #PyTorch

Scaladoc showing pointwise tensor ops in Storch
Seth Tisue
10 hours ago

made a #scala-days channel on the Scala Discord https://discord.com/invite/scala

Eugene Yokota
12 hours ago

#ScalaDays tips, based on @rmondello's:
- 💧 Drink water
- 🗣️ Talk to people! Ask them what they're excited about; do not assume someone isn't "technical"
- 👩🏻‍💻 This is a work context for most people; don't flirt or otherwise make people uncomfortable
- 😷 Don't give anyone shit about wearing a mask (Consider wearing one yourself!) #Scala

Alex Nedelcu ☕️
13 hours ago

#Scala's type classes are first-class, in a very literal sense.

Ironically, Scala's type classes are more first-class than #Haskell's.
Not only because Scala 3 now has good syntax for extension methods, or for deriving instances, but also because …

‣ Type classes are just types;
‣ Type class instances are simply values passed as params.

The issue in Scala is that “coherence” relies on a weaker non-ambiguous check, instead of “canonicity”, but this plays better w/ OOP or dynamic linking.

Alex Nedelcu ☕️
20 hours ago

@deanwampler I'd love to see some good enhancements for "direct style", but in this space #Scala is not competing with existing async/await solutions, but rather with Kotlin's coroutines or with Project Loom.

The latter is bringing blocking I/O back with a vengeance, which is better than async/await simply because it reduces accidents:

https://alexn.org/blog/2022/10/13/the-case-against-effect-systems-io-data-type/

See also this, for a good introduction to Kotlin's “structured concurrency” concepts, also adopted by Java:

https://www.youtube.com/watch?v=Mj5P47F6nJg

1 day ago

Great news on the #ocaml side and the compilation to #javascript.

For the #scala folks following this is basically their alternative to the scala.js I think.

https://discuss.ocaml.org/t/ann-melange-1-0-compile-ocaml-reasonml-to-javascript/12305

1 day ago

Some people are trying so hard to make #scala be #python, when here is python wanting to be scala 😅😅🫣🫣😱

PEP 695 – Type Parameter Syntax | Lobsters
https://lobste.rs/s/ptdnnm/pep_695_type_parameter_syntax

Eugene Yokota
2 days ago

Arman Bilge (https://twitter.com/armanbilge) implemented releaseNotesURL setting in sbt 1.9.0, which will add a new property in the published POM file (https://github.com/sbt/sbt/pull/7148)

this is based on the Scala Steward feature, added by https://mastodon.social/@fthomas to pick up the property to support non-GitHub release notes
https://contributors.scala-lang.org/t/add-release-notes-urls-to-your-poms/6059 #Scala

Eugene Yokota
2 days ago

at March Scala Tooling Summit in Lausanne this year, Chris Kipp (https://hachyderm.io/@ckipp) led the session on structured/actionable diagnostics (compiler warnings etc), which can apply to non-compiler tooling as well.

sbt 1.9.0 and its incremental compiler Zinc 1.9.0 takes a few concrete steps towards the roadmap (https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172).
- Chris added actions list to the Problem datatype, which carries warnings and errors (https://github.com/sbt/sbt/pull/7242)
- I've added the proposed wiring to BSP spec (https://github.com/build-server-protocol/build-server-protocol/pull/527), and implemented the forwarding in https://github.com/sbt/sbt/pull/7264

interestingly, in 2018 LSP rejected the idea of supporting `actions` but later compromised to add a catch-all `data` field, which we'd be using. I guess it means that individual editors like IntelliJ or Helix would have to watch for `dataKind` to see if it contains this extra payload? clangd apparently can already send it under `codeActions`. regardless, I'm excited about the standardization of code changes, and compiler being able to do more than spit out strings and binary #Scala

Eugene Yokota
2 days ago

sbt 1.9.0 was a collaborative effort of multiple organizations/individual contributors.

Adrien Piquerez (https://twitter.com/adrienpi2) from Scala Center (@scala_lang) contributed the headline feature, POM-consistent sbt plugin publishing, to make plugins reachable from corporate Maven repos. sbt has been publishing POM file of sbt plugins as sbt-something-1.2.3.pom (using sbt-something as artifact name) even though the artifact URL is suffixed as sbt-something_2.12_1.0. sbt 1.9.0 addresses this issue by double publishing both the JAR and POM files in the conventional way and POM-consistent style. William Narmontas and Wudong Liu's experimental sbt-vspp paved the way for this idea.

Coursier was also updated so it would look for the POM-consistent style first (https://github.com/coursier/coursier/pull/2633).
https://github.com/sbt/sbt/pull/7096
https://eed3si9n.com/sbt-1.9.0 #Scala

Ross A. Baker
4 days ago

Exciting development for the dozens of us Scala developers on Emacs: a new, tree-sitter mode!

https://github.com/KaranAhlawat/scala-ts-mode

#Scala #Emacs

Eugene Yokota
4 days ago

released sbt 1.9.0!

the headline features are:
- POM consistency of sbt plugin publishing
- sbt init, a text-based adventure
- deprecation of IntegrationTest configuration
- releaseNotesURL setting
https://eed3si9n.com/sbt-1.9.0 #Scala

Typelevel
4 days ago

Frameless 0.14.1 is out with Spark 3.4 and DBR 12.2 support. Bring more expressive types to your Spark jobs!

https://github.com/typelevel/frameless/releases/tag/v0.14.1

#Scala #Typelevel #Spark

Typelevel
4 days ago

New affiliate project, fs2-aes, does what it says in the name: provides AES encryption and decryption for FS2.

https://github.com/jwojnowski/fs2-aes

#Scala #Typelevel #FS2

Typelevel
4 days ago

Thrilled to welcome Laika as the latest Typelevel organization project. Laika generates static sites and e-books and can be trivially installed via SBT plugin. It already drives several Typelevel projects' docs.

https://typelevel.org/Laika/

#Scala #Typelevel #Laika

Alex Nedelcu ☕️
4 days ago

Unless you `import scala.language.strictEquality`, use of `CanEqual` isn't required.

However, once you implement a `CanEqual` for a type, its use is mandatory. See screenshots.

#Scala #Scala3
2/2

Snippet of code showing that universal equality still works like in Java when CanEqual isn't involved. Snippet:

case class Cat(name: String) 
case class Dog(name: String)
val d = Dog("Fido")
val c = Cat("Morris")

d == c
Scala-CLI session, showing that as soon as you `derive CanEqual` for a new type, then the equality for that type is protected. The following snippet throws a compile-time error:

case class Cat(name: String) derives CanEqual 
case class Dog(name: String)
val d = Dog("Fido")
val c = Cat("Morris")

d == c
Alex Nedelcu ☕️
4 days ago

In #Scala 3, Ints and Strings can no longer be compared with ==.

This is due to the introduced “multiversal equality” (the `CanEqual` type-class):
https://docs.scala-lang.org/scala3/reference/contextual/multiversal-equality.html

#Scala3
1/2

Screenshot of a Scala CLI session, showing that Int == String triggers an error:

"Values of types Int and String cannot be compared with == or !=
4 days ago

Strings can not longer be compared to Ints on normal #scala, fuck yeah 🥳

4 days ago

Man, I'm too dumb for this. I'm trying to change a small thing I have around from #scala 2 to #scala3 that is using cats and all it's magical imports and now I have no idea what imports to use 😅 . All I know is that it's complaining at compile time and I've already changed some places to use the import syntax.all._ .

Maybe the problem is fs2 since it says recursive Files[IO]. Dunno.

Why can't I find any docs on the cats page about scala3?? :thaenkin:

Yann
4 days ago

If someone wants to help an opensource project in #scala, I have an issue in macros when updating to scala 3.3.0: https://github.com/sangria-graphql/macro-visit/pull/175

Alex Nedelcu ☕️
6 days ago

A lot of the #Scala ecosystem is maintained by the community. It's a very community-driven language. This makes any single project we rely on vulnerable, but the ecosystem is stronger IMO.

Just look at this “ScalablyTyped” project. Someone went ahead and created a #TypeScript to #ScalaJS types converter, which works and is ahead of solutions from other ecosystems:

https://scalablytyped.org

Occasionally, I'm awed by the productivity I see in this community, a very humbling experience.

Alex Nedelcu ☕️
6 days ago

The problem that powerful languages have (e.g., #Scala, #Haskell, #OCaml, others) is that you can't necessarily look at a piece of code and realize why the language is powerful. As it's about the whole UX. In Scala, by just looking at a piece of code, you won't realize the big difference in the culture for compile-time safety & reflection.

UX is a doubly edged sword. Those invested may lose sight of the quirks, like how awful the build times are, quirks that are noticeable by adopters.

Alex Nedelcu ☕️
6 days ago

#Scala 3.3 is looking good.

The first release of Apache Pekko (the Akka fork) will go straight for Scala 3.3 support.

Now I'm waiting on a first release of Pekko to attempt a Scala 3 migration at $work. (Would work with Akka, but we need Akka HTTP too, blah, blah).

One of my favorite features of #scala is

???

such a simple thing yet so useful 🎉 :scala:

Nice read. Be interesting to do a similar integration that @mitchellh did here integrating #zig and #swiftui but instead integrating #scala #scalanative and #swiftui https://mitchellh.com/writing/zig-and-swiftui

@deech I am waiting on you to try it with #nimlang :)

Alex Nedelcu ☕️
1 week ago

I once worked on a platform for serving ads, integrating with real-time bidding exchanges, circa 2011.

I built it in #Scala/JVM. It was serving ~2000 real transactions per second. We were kicked off Heroku b/c we were using too few “dynos”. We ended up w/ EC2 + ELB w/ an “elastic” config that booted/killed instances based on demand, for a cost that would make anyone jealous.

I don't get the complaints about performance & “cloud-native”, as if some of us haven't been doing it for a long time.

Alex Nedelcu ☕️
1 week ago

#Scala CLI has experimental #Markdown support 🙀

Can be useful for validating documents with Scala snippets or for "literate" #programming.

https://scala-cli.virtuslab.org/docs/guides/markdown/

Alex Nedelcu ☕️
2 weeks ago

#ScalaCLI is objectively better than alternatives I've seen in other ecosystems, and it's becoming the official `scala` command.

#Scala is becoming my scripting language, increasingly replacing Bash, Ruby, and Python.

https://github.com/VirtusLab/scala-cli/releases/tag/v1.0.0

% scala-cli --version
Scala CLI version: 1.0.0
Scala version (default): 3.3.0

There is an upcoming online O’Reilly course: Build a Modern Web Service with Scala, Akka HTTP, and PostgreSQL 👇 https://www.oreilly.com/live-events/scala-web-services-in-4-hours/0636920092709/ #scala :Scala:

Alex Nedelcu ☕️
2 weeks ago

An interesting addition in #Scala 3.3.0 is that annotation macros have landed (since RC2).

https://github.com/lampepfl/dotty/releases/tag/3.3.0-RC2

This should make some Scala 2 macros possible again.

And, I'm almost tempted to build another JSON serialization library 😆

Alex Nedelcu ☕️
2 weeks ago

#Scala 3.3.0 was tagged and artifacts released 2 days ago.

https://github.com/lampepfl/dotty/releases/tag/3.3.0

Release notes are still pending.

Alex Nedelcu ☕️
2 weeks ago

I've migrated my #Jekyll-powered blog to use https://highlightjs.org for the syntax highlighter. Not ideal, since it's powered by JavaScript, but it supports #Scala 3 (new keywords / syntax). It's also used by Scala's documentation.

Previously, I was using Rouge, which is pretty standard for Jekyll blogs, but nobody fixed the Scala lexer yet. Maybe some kind soul will 🥹

https://github.com/rouge-ruby/rouge/issues/1885

bblfish
2 weeks ago

My #Solid client and server are now ready for efficient access control demos on #BigData. Let me know if you are interested in the comments below.

I can demo with a server publishing N resources (in this case #LinkedData Event Stream (#LDES) data.
The client could need to make no more than N+2 requests:
1. Request 1 on a resource R returning a "401 Unauthorised"
2. a max of 2 requests to get the access control rules
3. from there on, N signed requests using HttpSignatures (when those all fall in the same container space)

Solid clients are essentially like Search Engine crawlers fetching data on the web, so they need to jump around from website to website. Having approx 2 requests extra per website for auth is very interesting in that scenario. Note: those 2 requests can be cached, so those may be only needed once over a long period of time.

The connection efficiency is possible by combining the following pieces:

* using the IETF's HTTPSig (a version from the beginning of the year)
* using default rules (part of the spec)
* caching of ACLs on the client
* the use of a "defaultAccessContainer" link header to reduce the number of requests.

The client is implemented in #Scala using #http4s, and the server uses #Akka . The libraries can be compiled to JS for use on #nodeJS frameworks too. Native is not far off either.

Alex Nedelcu ☕️
2 weeks ago

"Smithy - the API definition language"

Smithy, a protocol-agnostic interface definition language made by AWS, now has integration with Scala (and #Http4s). Watch this video series.

Shared #link (#Programming, #Scala, #YouTube, #Video).

https://www.youtube.com/watch?v=nNUnSbyyxGI&list=PL1NS3pe5mmu25RK5lJnLxnllcMkxBqaI5

Alex Nedelcu ☕️
2 weeks ago

I decided to like #Scala 3 🤷‍♂️

There's no point in continuing to bicker about it, and either I move on, or I shut up and help in some way with the migration; at least at $work. For now, I'm doing the latter.

Scala 3 has some real improvements, and it has no replacement in its tier. Others are fine too, I also like #Kotlin & #Rust, but not for the kind of work I like doing (soft real-time, long-running servers, doing a lot of I/O, where both productivity & correctness matters).

Alex Nedelcu ☕️
2 weeks ago

" Cats Effect - Dispatcher, Supervisor, IOLocal"

Shared #link (#Programming, #Scala, #Typelevel, #Video, #YouTube).

https://www.youtube.com/watch?v=DTni0RHV_Ds

Alex Nedelcu ☕️
3 weeks ago

#Scala, #Kotlin, #Rust still strong 💪

Scala's community output is outstanding (libraries, tools), and it explains these results IMO.

https://redmonk.com/sogrady/2023/05/16/language-rankings-1-23/

Alex Nedelcu ☕️
3 weeks ago

#ActiveX, #Flash, #Silverlight are all dead b/c they were proprietary platforms that couldn't survive once some real competition from open standards and FOSS platforms happened.

People jumped on #JavaScript feet first, despite all its issues. Proprietary platforms on the web can't survive given a cross-platform environment.

The one sore thumb is #Perl. It lost a lot of popularity due to TIMTOWTDI complexity + the announced breakage in Perl 6. #Scala contributors should take notes.

Alex Nedelcu ☕️
3 weeks ago
Alex Nedelcu ☕️
3 weeks ago

On #Scala's side, in addition to allowing vars in their state, case classes are still non-final by default.

This is in Scala 3.2.2:

Scala code snippet follows:

case class Foo(hell: String)

class Bar1(var whatThe: String, hell: String) extends Foo(hell)

class Bar2(var whatThe: String, hell: String) extends Foo(hell):
  override def equals(that: Any): Boolean
Alex Nedelcu ☕️
3 weeks ago

One area where #Java preferred more purity than #Scala or #Kotlin is in defining “records”, vs case classes (Scala) or data classes (Kotlin).

Records in Java are immutable, can't have any vars. This was a design choice, to make them nominal tuples. In doing so, with a Java record, you have the guarantee that the state is fully described by its constructor.

Equivalent in Scala & Kotlin allows for mutability, being error-prone due to their structural equality or the JMM.

https://alexn.org/blog/2021/02/12/scala-list-secret/

Ross A. Baker
3 weeks ago

http4s-blaze-0.23.15 has fixes for the new cancellation semantics of cats-effect-3.5.0. Please report an issue in that repository if you run into any problems.

https://github.com/http4s/blaze/releases/tag/v0.23.15

#Scala #Typelevel #http4s

Ross A. Baker
3 weeks ago

Caution: cats-effect-3.5 broke both http4s-blaze and http4s-servlet backends. Working on it. http4s-ember-0.23.19 is fine.

#Scala #Typelevel #http4s

Alex Nedelcu ☕️
3 weeks ago

We have static #programming languages that are both adequate for the server-side and can target the client-side (Javascript, WASM, native, etc), such as #Scala, #Kotlin, #Rust, #FSharp, #Typescript.

The biggest advantage of using the same language is that you can share code, starting with the data models, alongside serialization, and parsing/validation rules. The API can thus be easily kept in sync, and a server-side test is also relevant on the client-side.

Channing Walton
1 month ago

There is quite a bit of talk about #Scala and it’s future it seems. There are thoughts about academia driving the language for its own noble goals but losing sight of the consequences for industrial size codebases in the wild and the ecosystem as a whole.

It’s a justifiable opinion. For example, the IDE support has been a long struggle and is pretty good for 2, but it has taken a big step backwards for 3. It’s become a tiring and unnecessary impediment to just getting things done for the average programmer who doesn't want to repeatedly quit the IDE, killall java, or reimport projects because "something weird has happened". We don't have time for that crap.

Now you might all say I don't know what I'm talking about, that with some clever solutions to X and Y and using a proper editor, everything will be great. Maybe, but having worked hard at trying a lot of these tools and IDEs, I've found little joy with Scala 3. I've also tried migrating systems to Scala 3 several times and gave up because it is a herculean task with considerable risk to the systems.

I’m not a type astronaut or contributor to libraries like the type level ecosystem – I’m not smart enough. But, I think I can say I’m not bad at building systems by leveraging the work of those geniuses. And, I am pretty happy working with Scala 2 and enjoying the improvements around the ecosystem that are happening all the time.

I'm enormously grateful to all those really smart people working very hard, for free, to make it possible for me to have an enjoyable career.

The success of the language depends critically on an ecosystem sustained by very smart people giving up their free time, and so it is imperative that changes to the language do not exhaust their good will and patience. I fear that Scala 3, whilst having many great features, was too much too fast for everyone.

Daniel Spiewak
1 month ago

Your #Scala fun fact of the day: a single fiber in Cats Effect imposes 72 *bytes* of memory overhead.

Alex Nedelcu ☕️
1 month ago

(Sub-toot)

#Scala is a great language. It's the only one running on top of the JVM in which you can actually practice (statically typed) FP, exposing a charming blend of Haskell abstractions & OOP. Due to its features, it's miles ahead of alternatives in terms of safety & expressiveness. And I quite like its tooling, actually.

But I agree that Scala 3 has shaken the trust in the language, unfortunately. Without a stronger commitment to the industry's concerns, it may be in jeopardy.

1/

Latest edition of #scalanews is out all! Enjoy! #scala :scala: 🎉📰https://www.scalanews.net 🗞️🚀 :scala:

cc @ross @typelevel @majkp @adamwarski @softwaremill @scala_lang @alexelcu

Ross A. Baker
1 month ago

A quick article on building your Scala vocabulary by understanding common affixes. "bi-" is intuitive, but what's "co-"? What are all those cryptic "-T", "-K", and underscore suffixes? Familiarity with these can help us find the function we're looking for, and name the ones we write so they can be found.

https://rossabaker.com/blog/scala-affixes/

#Scala

Typelevel
1 month ago

log4cats-2.6.0 is out with Scala.js, WriterT, derivation, and codecov (yours, not ours) improvements.

https://github.com/typelevel/log4cats/releases/tag/v2.6.0

#Scala #Typelevel #Logging

Typelevel
1 month ago

fs2-compress is a new Typelevel affiliate project. It's a companion to FS2 that supports gzip, zip, tar, bzip2, zstd, and brotli.

https://github.com/lhns/fs2-compress

#Scala #Typelevel #FS2 #Compression

Want to know which frameworks/languages you can use on @Kinsta hosting besides WordPress?

@palmiak made a nice overview here: https://kinsta-starters-s3edo.kinsta.app/

To list some: #Statamic, #Gatsby, #NodeJS, #Astro, #Docusaurus, #Go, #Scala, #Python, #Rails

Alex Nedelcu ☕️
2 months ago

Integrating #Akka and #CatsEffect 3 isn't without challenges, but the awesomeness of managing resources via Cats-Effect makes it all worth it, being #Scala's secret weapon.

I wrote a blog post describing some integration solutions we use for building payment processors. #FP #programming to the max 💪

Please share 🙏🥺

https://alexn.org/blog/2023/04/17/integrating-akka-with-cats-effect-3/

Wille
2 months ago

Tried to figure out with #ChatGPT 3.5 how to generate #Bazel build artifacts from an existing #scala #sbt project.

It came up with some plausible, but ultimately hallucinated instructions:
* The plugin does not seem to exist.
* The instructions were doomed to fail, even if the plugin had existed.

Juan
2 months ago

Hi, just moved to this instance so is time for a new #introduction!

I love open source and also do (retro) gamedev (ZX Spectrum, Amstrad CPC, MSX and Commodore 64; sometimes PC), and other types of "dev" in #Scala, #Python, #C, #Z80, and #Haskell.

My games are always free to download and play, go and check:

https://www.usebox.net/jjm/

(some of the retro ones have physical edition too)

Moved from mastodon.sdf.org.

Collector's edition of Kitsune's Curse (Amstrad CPC).
Collector's edition of Night Knight (MSX).
Collector's edition of Brick Rick (Amstrad CPC).
Vlæd Zá
2 months ago

Found a proper, ~functional~ functioning pizza place in Amersfoort #scala :cate:

A pizza place in Amersfoort, Netherlands, called "Pizzeria Ristotante La Scala"
Michael Pilquist
2 months ago

New #typelevel #scala library for building effects incrementally: https://github.com/typelevel/twiddles

Ross A. Baker
2 months ago

Magic tricks that trade referential transparency for "direct syntax" are well trod in Scala, but it has never worn well beyond slide decks and tutorials, and I don't anticipate it being different this time.

https://raw.githubusercontent.com/lampepfl/async/main/scalar-slides.pdf

#Scala

Eugene Yokota
2 months ago

Tooling Summit at Lausanne organized by Darja, @ckipp etc has already been useful, pushing me to gather thoughts on sbt 2, Bazel etc in prep, but also got interesting ideas from the sessions

here's the first concrete output 'RFC-2: sbt 2.0 RFC process'
https://eed3si9n.com/sbt-2.0-rfc-process #Scala

thinkberg
3 months ago

I am hiring at UBIRCH. #Scala #Junior or #MidLevel & #Senior #DevOps roles. Ideally in #Berlin#Germany#Europe, remote is fine. Ey all welcome!

https://join.com/companies/ubirch

gemelen
3 months ago

@Cerchie And if there would be anyone interested in how to tackle Server Side Events to streaming, there is a short snippet in #Scala
https://github.com/gemelen/wikistreamer/blob/master/core/src/main/scala/net/gemelen/wikistreamer/WikiStreamer.scala

Anupam Jain
3 months ago

Submissions for the first #FPWebConf are open, and we are looking for speakers!

If you have explored functional programming for web development and would like to share your experiences, we would like to hear from you! Please submit a talk at the conf page - https://hasgeek.com/jsfoo/fp-webconf/

Boosts appreciated!

#functionalprogramming #webdevelopment #conference #india #haskell #purescript #elm #typescript #rustlang #scala #kotlin #clojure #fsharp #ocaml #reason

dazfuller :rickwhoah:
3 months ago

@khalidabuhakmeh I’m paying for DotNet Ultimate and IntelliJ for myself. I do a lot of coding in #csharp, #scala, #python, and #GoLang and #Rust for me. Those two have me covered for all those languages with great features across them all.