Principles of developing applications in Scala | by Adam Warski | SoftwareMill Tech Blog
SoftwareMill » Functional Programming
by Adam Warski
11M ago
Scala, a statically-typed functional programming language, has been on the market for almost 20 years. During that time, a couple of mainstream approaches have evolved when it comes to writing Scala code. These include using effect systems, techniques of asynchronous code execution, and leveraging various libraries and frameworks. While these approaches are quite diverse, there’s a set of principles that are shared among all of them. In other words, when writing applications in Scala, whatever your favorite stack, there are certain things you often do, and certain things you never do. Th ..read more
Visit website
Two types of futures | Adam Warski | SoftwareMill Tech Blog
SoftwareMill » Functional Programming
by Adam Warski
1y ago
Futures and promises have made their way into most of the mainstream languages. We intuitively know what a future represents, but what’s the precise definition? Are the concepts and mechanics behind futures/promises always the same, or are there some differences? Let’s reach out to Wikipedia for a start; Wikipedia articles on Computer Science vary in quality, but this one is pretty good. Here’s how a Future is described: In computer science, future, promise, delay, and deferred refer to constructs used for synchronizing program execution in some concurrent programming languages. They describe ..read more
Visit website
Trying out Unison, part 4: from the edge to the cloud | by Adam Warski
SoftwareMill » Functional Programming
by Adam Warski
1y ago
In the previous installments of the “Trying out Unison” series, we’ve first explored its core feature, content-addressed code, thanks to which a function’s identity is determined by what it does, not by its name (names are just labels). Then, we’ve examined how this impacts how you might organize your code and manage dependencies with the help of namespaces. Finally, we’ve looked at Unison’s abilities, an algebraic effect system that provides features such as error handling or dependency injection. These traits alone make Unison a language that improves on the status quo of mainstream program ..read more
Visit website
Trying out Unison, part 3: effects through abilities | Adam Warski | SoftwareMill Blog
SoftwareMill » Functional Programming
by Adam Warski
1y ago
Trying out Unison, part 3: effects through abilities | SoftwareMill In the previous articles on Unison, we’ve introduced Unison’s “big idea”: content-addressed code and explored how this impacts code organisation and dependency management. But that’s not everything that Unison has to offer. Its effect system is equally interesting and worth exploring in detail. Effect systems aim to add some structure to the way side-effects are represented in code. This includes any I/O operations (both local and over the network), interactions with the system clock, generating random numbers, or spawni ..read more
Visit website
Trying out Unison, part 2: organising code | by Adam Warski | Medium
SoftwareMill » Functional Programming
by Adam Warski
1y ago
Dependency hell, package managers, publishing, supply chain attacks-these are just a few of the problems that might be solved by Unison! Let’s see how. In the first part of the series surrounding Unison, we’ve covered the “big idea” behind it: content-address code. We’ve looked at how Unison stores code in a database, where each function is keyed and referenced by the hash of its abstract syntax tree. Luckily, when coding, we don’t have to use the hashes directly. Instead, we can assign names to hashes; a single hash can have many names. Names can be reassigned, implementing “instan ..read more
Visit website
Trying out Unison, part 1: code as hashes | by Adam Warski | Medium
SoftwareMill » Functional Programming
by Adam Warski
1y ago
Unison is an upcoming language & distributed runtime. It’s functional, statically typed, and introduces some really interesting ideas, which make Unison different from “mainstream” languages. If you’re into Scala, you might have heard of Paul Chiusano and Rúnar Bjarnason, the co-founders of Unison Computing (a public benefit organisation). They’re the authors of Functional Programming in Scala, which is one of the best introductions to modern FP. The leading idea of Unison is that code is content-addressed. But what does it mean? Content-addressed code In all mainstream language ..read more
Visit website
The future of effects in Scala | Adam Warski | SoftwareMill Tech Blog
SoftwareMill » Functional Programming
by Adam Warski
1y ago
Recently Jack Viers and Raul Raja from 47 Degrees posted a pre-SIP proposal to add Kotlin-like suspend functions to Scala. The proposal itself is an interesting read, but it is also followed by a long and insightful discussion, reaching in scope far beyond the initial SIP (for full disclosure, in part I’m responsible for some branching of the topic). It might seem that the thread quickly went off-topic, but I would say that on the contrary, it shifted to try to define the core problem. Adding suspended functions and continuations to Scala 3 is a solution to a problem. But as it turns out ..read more
Visit website
Functional programming for kids? I Adam Warski | SoftwareMill Tech Blog
SoftwareMill » Functional Programming
by Adam Warski
1y ago
A long, long time ago, in the pre-pandemic era, just after ScalaDays in Lausanne, we made a short trip to the Alps. Together with Jacek Kunicki and Michał Mital, we briefly talked on whether it would be possible to teach functional programming to kids. Learning-oriented programming environments are usually imperative. For example, in the most popular one — Scratch — you place blocks representing actions that should be run in a sequence. Later, kids or young adults are introduced to “normal” programming languages such as Python or JavaScript, which are imperative as well. Given that ..read more
Visit website
Structuring ZIO 2 applications | Adam Warski | SoftwareMill Tech Blog
SoftwareMill » Functional Programming
by Adam Warski
1y ago
I’ve been interested in various approaches to dependency injection for a long time; first as a user of annotation & reflection-based approaches, then as its critic, finally exploring simpler alternatives, such as “just using constructors and parameters”, optionally compile-time automated with libraries such as macwire. As ZIO-a library that aims to enable writing large-scale business applications, with large teams, using functional programming and Scala — offers its own unique approach, I’ve been following its development closely. In ZIO 1, the “best practice” for managing and passin ..read more
Visit website
Tapir 1.0 released
SoftwareMill » Functional Programming
by Adam Warski
2y ago
apir 1.0 released We’re happy to announce the release of tapir 1.0! After almost 4 years of development and multiple 0.x releases, the declarative, type-safe web endpoints library has reached the important milestone of a stable release. libraryDependencies += "com.softwaremill.sttp.tapir" %% "tapir-core" % "1.0.0" import sttp.tapir._ The goal of tapir is to provide a programmer-friendly, reasonably type-safe API to expose, consume, and document HTTP endpoints. How do we achieve that? Read on! :) If you’re not yet familiar with tapir, now is a great time to get start ..read more
Visit website

Follow SoftwareMill » Functional Programming on FeedSpot

Continue with Google
Continue with Apple
OR