What Scala Can't Do

What Scala Can't Do

Today, Scala is a programming language that can use any Javascript library, any Java library, and any C/C++ library through its multiple target system. You can create library bindings for Javascript libraries via ScalaJS, and you can even do so automatically is a library supports typescript with Scalably Typed. You can also use C libraries with Scala Native, or with the JNI.

Naturally, you might wonder if Scala can build JVM apps, work in the browser and on Node.js, and also do system level programming, what can't we do with Scala? It seems to address all major targets. We can built browser apps and do native programming; what more do we need?

Before we address that, let's talk about what you shouldn't do with Scala.

The Should Nots:

Android & iOS Development:

To start, people have tried this and succeeded. Years ago there was Scala tooling to develop Android apps, but it's long outdated and no longer maintained. There are also a few proof-of-concepts, but in general Android development with Scala isn't recommended for anything more than that. You won't be able to find any Scala first libraries that are still maintained, and in general you won't have much information to go off.

To contrast, iOS development. There are libraries for iOS development on the JVM like RoboVM. You also might be able to get Scala Native running on iOS, but it tends to be Linux centric. ScalaJS is a candidate with technologies like React Native, but again, I wouldn't recommend it. ScalaJS and React Native don't fit together tremendously well.

Desktop Apps:

The verdict is in, Java desktop apps are dead. You can build a desktop app through every target of Scala, but you probably shouldn't.

Scala Native can use gtk and other native libaries, but Scala Native isn't yet production ready.

Scala on the JVM can use JavaFX or Swing, but it's generally not a great approach to build desktop apps on the JVM anyway. There are far better alternatives at this point.

ScalaJS can use cross platform app tooling for Javascript, but again, I wouldn't recommend it.

The Can Nots:

Smart Contract Development:

You CAN built smart contracts for the EVM with Stainless. In fact, if I needed to write a smart contract, this is how I'd do it. But, for other targets, there just isn't the tooling necessary to develop smart contracts.

Various Low Level Systems:

Last year I experimented with the configurable robotics system Lego Mindstorm. I didn't like the official drag-and-drop programming model so I started programming the robot with its unique assembly language. Systems like these cannot be targeted by Scala.

Conclusion:

Scala is an extremely flexible programming language. I've never wanted to do something and been unable to use Scala. You can even do quantum computing with the Java Strange API. In general, you can do almost anything with Scala. The question you should be asking is whether or not you should be using Scala. There are competitive alternatives everywhere.

In short, use the right tool for the job.

要查看或添加评论,请登录

Bradly Ovitt的更多文章

  • Concerns of Domain Driven Design

    Concerns of Domain Driven Design

    Let's talk about what problems domain driven design solves. Domain driven design is a methodology to model several…

  • The Actor Model & Reactive Systems

    The Actor Model & Reactive Systems

    Let's talk about the actor model and building reactive systems. The actor model is a programming paradigm for building…

    1 条评论
  • Concerns of Reactive Systems

    Concerns of Reactive Systems

    Let's talk about why we build reactive systems, as software engineers/developers. As professionals, we have to balance…

    1 条评论
  • Software Transactional Memory

    Software Transactional Memory

    Software transactional memory (STM) is a programming paradigm that allows multiple threads to share access to shared…

  • Understanding the Elm Architecture

    Understanding the Elm Architecture

    Elm is a functional programming language that is well-known for its robust architecture and its ability to build highly…

  • Binding Propagation in Prolog

    Binding Propagation in Prolog

    Prolog is a programming language that is well known for its ability to perform logical reasoning and search through…

  • Effect Rotation in ZIO

    Effect Rotation in ZIO

    ZIO is a popular functional programming library in Scala that has gained a lot of traction in recent years. One of the…

  • An Introduction to Shardcake

    An Introduction to Shardcake

    I recently found myself developing backend microservices with Scala and ZIO. I'm using ZIO-gRPC to implement the…

  • Transparency in Distributed Systems

    Transparency in Distributed Systems

    One of the most important theoretical goals of distributed systems is hiding the fact that resources and processes are…

  • The Secret to a Perfect Steak: The Nature of Abstraction

    The Secret to a Perfect Steak: The Nature of Abstraction

    I promise this is about more than cooking. I've been known to save MOST of my money and usually spend on a very tight…

    1 条评论

社区洞察

其他会员也浏览了