Paperless Adulting on Linux with Evernote and NoteSlurp

Adulting is hard. Bills come and go, taxes have to be prepared, escrows have shortages, kids have activites, FSAs need proof of medical expenses, cars need to be registered.

The list of things an adult has to do seems to only grow larger over time, and one of the fundamental things that all adults seem to have to do is to track and file paperwork. I’ve gone “paperless” in my personal life (which I seem to have interpreted it to mean: “keep digital copies of everything, even if it was paper originally”).

When it comes to adulting, barriers to doing the right thing (like actually getting stuff filed paperlessly) are bad, as you won’t do them. So, recently I decided to make that just a little bit easier on myself with a new tool. Let me walk through the research I’ve done, what my process for paperless filing is, and where I’ve historically had problems, and how this new tool has helped me out.

[Read More]

Unsigned Integers with Java and Kotlin 1.3

Something that has always been a bit of a limitation in the Java numeric type system is the lack of support for unsigned integers. It is not particularly common to have to work with unsigned types, but when it does happen, it’s usually unpleasant in some way. Libraries like Guava have provided utilities to make it cleaner, and recent updates to Java 8 also included some unsigned helper methods.

Kotlin 1.3 has an experimental feature to make unsigned types a full citizen of the type system, while still having all of the performance of primitive integer types. Let’s take a look!

[Read More]

A Semi-Deep Dive into Kotlin Inline Classes

With Kotlin 1.3, a new experimental feature called “Inline Classes” is now available. This post is a somewhat deep dive into the nature of the implementation, how it works, where the edges are, and what limitations currently exist. Let’s take a look!

[Read More]

Contracts in Kotlin 1.3

Kotlin 1.3 is bringing a new experimental feature to the compiler to help with improving program correctness via the type-system: contracts.

Contracts are a tool that allow library code (both standard library and your libraries) hint to the compiler about the constraints that are ensured on types based on the use of functions in your program. Let’s see how this can be used in practice.

[Read More]

De-Structuring in Kotlin

Recently I wrote an article about de-structuring in TypeScript, and hinted that Kotlin has a similar feature, but in more of a “strongly typed” language style. Today I want to discuss that feature. To re-cap from the previous article, de-structuring is, at the core, a syntactic sugar to easily “lift” parameters out of an object or array and declare local all in one shot. With ECMAScript and TypeScript, this comes in two forms: positional (for arrays and iterables) and by name (for objects).[Read More]

What's the Deal with @JvmDefault?

Kotlin has an annotation called @JvmDefault which, like most of the “Jvm” prefixed annotations, exists to help massage the Kotlin compiler output to match Java classes in a certain way. This annotation was added in 1.2.40, and has now seen some experimental enhancements in 1.2.50, so it seems worth exploring what this is all about.

[Read More]

Tail Recursion in Kotlin

Tail recursion can be a very elegant way to solve problems that involve a significant number of iterations but are better organized using recursion, without paying the cost you normally pay for recursion. Kotlin can enable the use of tail recursion. To understand the benefits of this, a quick recap would be of value.

[Read More]

Kotlin: Reified Type Function Parameters

As most Java programmers know, Java generics are erased at compile-time. This has trade-offs, but the two main reasons for this are:

  • Compatibility - Java 1.4 and earlier dealt exclusively in raw types at the VM level. Generics were able to compile without introducing significant new typing to the bytecode and classfile format spec, and having to deal with older classes generated without that typing.
  • Simplicity - By erasing to raw types, the JVM doesn’t have to understand specialization; something that has its own complexities and downsides. For example, specialized types are much more challenging to optimize with a just-in-time compiler.

However, knowing the type parameters used at runtime can have real value, and it’s something Java simply doesn’t offer. Kotlin would like to help in this area, but there are many challenges in doing so.

[Read More]

Kotlin Logging Without the Fuss

One of Kotlin’s strengths is that generally speaking, the code you might write in Java is generally more compact in Kotlin without losing any of the readability, functionality, or performance.

An odd case where that doesn’t prove to be true is declaring loggers as Java developers.

[Read More]

Kotlin Libraries: Concurrency

Today’s Kotlin library article is about the kotlin.concurrent package, and everything that adds to the platform.

Java’s concurrency package is already quite sophisticated, and rather than re-invent so many extremely delicate abstractions, the Kotlin authors focused on making the libraries better suited to the language by decorating and shortening various features.

[Read More]