JVM articles

Existential types

Scala has a rich types ecosystem with sometimes almost philosophical categories. One of such categories is the one of existential types.

Continue Reading β†’

Types variance in Scala

Lower and upper bounds are not a single Scala feature related to the types. Another one is the variance.

Continue Reading β†’

Value classes

I am a class storing a single public and immutable value and at runtime I'm allocated on stack. What's my name ?

Continue Reading β†’

Underscore role in Scala

Scala has a lot of syntactic sugar. Despite the fact that most of times it pretty simply understandable, it occurs often that it increases the learning curve. One of symbols widely used in Scala and hard to understand at first contact is the underscore.

Continue Reading β†’

ScalaTest extra features

ScalaTest, as xUnit family testing frameworks, provides a lot of features. Even though several of them are not frequently used, it's always good to know them and the context of their use.

Continue Reading β†’

Partial functions in Scala

Recently in this series about Scala features I covered the partially applied functions. At first glance we could think they are the same as partial functions. But it's not really true and this post will explain why.

Continue Reading β†’

Partially applied functions in Scala

In the occasion of the post about currying I mentioned shortly the existence of similar concept called partially applied functions. This idea will be explained in this post.

Continue Reading β†’

Akka and Distributed Data module

Recently we discovered a lot of topics related to the eventual consistency (ACID 2.0, CRDT, CALM...). Some of these posts had the code examples using the Akka distributed data module that will be covered below.

Continue Reading β†’

Currying in Scala

Scala is a hybrid language implementing both functional and object-oriented features. One of them that merits to be analyzed is currying.

Continue Reading β†’

ScalaTest and testing styles

At first glance the wide choice of testing families in Scala can scary. After all in JUnit and other xUnit frameworks, the choice of tests declaration is limited. Hopefully after some digging ScalaTest's testing styles become more obvious to understand and to use.

Continue Reading β†’

Scala type bounds

Scala has a rich type system and one of interesting features are type bounds.

Continue Reading β†’

Scala context bound

This post begins the series of posts about Scala's features called "One Scala feature per week". Every week one particular Scala's functionality will be covered. This beginning post will explain context bound.

Continue Reading β†’

Use cases of Java ServiceLoader

During my analysis of Apache Spark and Apache Beam projects I've discovered the use of ServiceLoader - a Java's util class used to load other classes dynamically.

Continue Reading β†’

Java Flight Recorder

Java Mission Control (JMC) described in previous post comes with another tool helping to understand what happens in the JVM. This tool is the Java Flight Recorder (JFR).

Continue Reading β†’

Collections complexity in Scala - immutable collections

Using the right tool at the right time is important in every domain. It's particularly useful in the case of collections that can have different complexity for writing and reading. And very often this difference can dictate the use of one specific implementation.

Continue Reading β†’

Java Mission Control tool

Historically JVisualVM was one of Oracle references to monitor the state of the JVM. However the 7th version of Java brought an alternative called Java Mission Control.

Continue Reading β†’

On-heap vs off-heap storage

Java programmers are often limited in their thoughts to heap management and it's justified. JVM offers the possibility to code without taking care about manual objects allocation and deallocation. But, as JVM-based language programmer, at least for personal knowledge, it's good to know that on heap memory is not the single memory storage solution in JVM applications. The complement memory is off-heap.

Continue Reading β†’

Misleading concurrent keyword

Often we think that if something is from "concurrent" package, it's automatically thread-safe. By definition is true, but the definitions rarely make the applications and through this post we'll see why.

Continue Reading β†’

Manipulate bytecode with Javassist

Javassist is a very useful library to manipulate bytecode in Java. In intuitive way it allows to access class members and change their behaviour - as well in source-code level as in bytecode one.

Continue Reading β†’

LockSupport in Java

During reading Thread documentation I found a class that existence I've ignored until now - LockSupport. Some of its methods influence Thread states, so it was quite natural choice for the topic of next posts.

Continue Reading β†’