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.

@alexelcu
Indeed so, I chose #Scala3 for SWIM :
https://swim.benmatthews.eu
as I can write a complex society-climate #model, complex web GUI, and handle many historical datasets, all in one language - and I'm amazed how robustly #scalajs works for this. This is - so far - a one-man project. However individuals can keep coding longer than fashions in tech, or even mega corporations. Scala needs a broader influx, such examples of science code can help show python is not the only option.
Scalable World Interactive Model

@benjhm @jasmith Your project looks great and quite an inspiration! I have an open-source educational computing project that I have been thinking about for years and I finally want to get started. #scala 3 + #scalajs would be an excellent fit.

Scala 2 was my primary server-side language from 2009-2018. Two moderately large systems are still in production. I am learning what is new in Scala 3.

Can you recommend a SPA framework and a back-end service framework licensed for open-source release?

@jasmith @benjhm For SPA you can't go wrong with https://laminar.dev
For backend http4s and the typelevel ecosystem is one choice, otherwise Play Framework is still great and is being ported to Scala 3 (not sure if it was already released or not).
Laminar · Simple, expressive, and safe UI library for Scala.js

Simple, expressive, and safe UI library for Scala.js

@lolgab @benjhm I am a bit nervous about Play because of it is based on the now proprietary Akka (I am hoping to release under Apache 2, and yes, I did see that the Play folks are working in this.) I will take a look at the other options.

Laminar looks great!

@jasmith @benjhm Akka license has a special exception for the Play Framework so you can use it without problems!
Check https://www.lightbend.com/akka/license-faq
Akka License FAQ | @lightbend

Frequently asked questions about the Akka BSL License.

Lightbend
@lolgab @benjhm Thanks! Yes, I saw that. Still it leaves me with some uncertainty. If I use Play with Akka but call Akka APIs directly to implement async services, is that still covered by Play’s exception? Will they tighten Akka’s licensing in the future so that developers won’t use Play as a free Akka distribution? At lest for now I plan to look for alternatives.

@lolgab @benjhm I am really interested in Typelevel but do not have any experience with it. It is something I want to learn more about.

I got interested in Scala in 2009 mainly because I very much liked Odersky’s approach to mixing functional and object-oriented paradigms and also Scala’s early integration of Actors. I had done functional programming since graduate school in the 1990s, pre-Haskell, but I am definitely not a purist.

@jasmith
Hi Jonathon,
Thanks for encouraging words.
Currently, SWIM uses no frameworks (my own scala code makes svg plots), and no back-end - the web version you see just calculates in the browser (try disconnecting after it loaded, you can still change params and see plots adjust). This enables quick interactivity. However use of scala offers the potential for some science-modules to shift relatively easily to server side if they evolved to become more data-intensive.

@benjhm

I am hoping to build in some social features for small groups. Multiple people interacting with shared systems and spatial models. The model would run in the client but a server would receive and re-broadcast events representing user actions. Models + views in each person’s browser but synchronized.

A single language for server and client would make it easy for the server to maintain a live copy of the state. New users could “tune in” by downloading that copy and pulling missed events

@jasmith @benjhm Another possible choice for an Easy Stack is to use https://com-lihaoyi.github.io/cask with https://com-lihaoyi.github.io/scalatags and https://htmx.org/ in a server-side rendered application. It's completely at the other side of the spectrum, but it's a no-brainer to get started. You can probably swap Cask with Play and fastparse with Twirl if you want something more production-proof.
Cask: a Scala HTTP micro-framework

@lolgab @benjhm Thanks much! I really like Li Haoyi’s libraries. The code is clean and pragmatic. In this case I was not sure if Cask supports Scala 3 and the framework does not seem to be oriented towards async programming. I plan to put most of the logic and UI in the client (Scala JS) and use the back-end for data communications and synchronization. So mainly for services.

I also wanted to also look at Vert.x .. it’s not especially a Scala project, but it seems usable from Scala.