RSSAmplifier

Blog

Functional[Justin]

Principal Software Engineer. Streaming data at scale. Generative AI. Functional Programming. Neovim. Emacs.

justinhj.github.ioRSS feed ↗10 posts

Latest posts

Refreshing your Neovim config for 0.12.0

Introduction Neovim version 0.12.1 was just released and you can check the release news here: Neovim v0.12.1 release news This is a massive release bringing a number of core capabilities that used to require external plugins into Neovim as built-in features. I took this opportunity to do a full refresh of my config. This was required as over the last few years I have pulled in many plugins only to…

Visualizing K-Way Merge&#58 An Interactive Guide to Database Sorting

Photo by Aleksandr Galichkin on Unsplash In this post, inspired by a video by Tigerbeetle engineers Tobias Ziegler (@toziegler) and Alex Kladov (@matklad), I'll walk through four algorithms for merging multiple sorted runs of data; a problem that shows up in modern database internals. You will be able to use an interactive web application to explore and understand each one. The title image isn't…

Optimizing training a GPT style Tokenizer with C++

Introduction In February 2024, renowned AI researcher and educator Andrej Karpathy, published the following video. https://www.youtube.com/watch?v=zduSFxRajkE An excellent introduction to the fascinating topic of tokenization, something he considers a necessary evil right now. Maybe the need for it will go away but for now it must be well understood by AI engineers in order to get good results…

The Magic of Lazy Lists

Photo by Dollar Gill on Unsplash Introduction As the Scala 3 - book points out, Scala has a rich set of collection classes. As well as List , of course, it also has a solid implementation of LazyList . If you're not sure what that is, or what is used for, read on and find out, plus even better I will walk through a full implementation of LazyList that can do some magical things. Scala List can…

Monad Transformers - the prelude to ZPure

Readers and Writers and Transformers BTW you can check out the video here instead: Functional Justin - Another Angle on Monad Transformers There are twenty pages here or over an hour of videos, so let me help you decide if it's worth your time. Who are you? You are a Scala programmer or interested in Scala and may have some Haskell or interest in pure functional programming. What do I cover?…

Monads in Scala 3 for the Genius

Introduction This is a companion blog the seventh Functional Justin YouTube video which you can find here: https://www.youtube.com/watch?v=B1FSxbmZpCE The source code shown in the video and in the fragments below can be found here: https://github.com/justinhj/evalexample/blob/video-7-r3/src/main/scala/livevideos/Video7.scala The goal here is to make 10-15 minute videos that each cover an isolated…

Functional Error Handling with Applicative in Scala 3

Introduction This is a companion blog my sixth Functional Justin YouTube video which you can find here: https://youtu.be/3GPXEzO14ZE In the video I talked about the Functor Laws and continued working on the example program that evaluates arithmetic expressions. I use Monad, then Applicative, to show how we can make a Numeric instance for Either, so we can handle errors in a nice functional way.…

Handling Errors functionally with Scala 3

Introduction This is a companion blog my fifth Functional Justin YouTube video which you can find here: https://youtu.be/wNVQ75KM8-4 If you're new to the series I'm exploring Scala 3 and functional programming using a simple expression evaluator, and adding features to it every week. Most of the videos are coffee break sized (10-15 minutes) but this one took a bit longer as I needed more time to…

Type classes with Scala 2

Photo by Crissy Jarvis on Unsplash Make your own Numeric type class This is the companion blog for a Functional Justin video which you can find here https://youtu.be/pJFfXhZlR5o . This is a series of coffee-break sized videos that each explore a topic in the world of Scala Functional Programming. In this video I talk about Type classes and here is the blog version for those that would rather read.…

Scala 3 Context Functions

Some Scala 3 Things: Context functions, Enums and significant whitespace Updated: for Scala 3.0.0-M3 `as` keyword was removed This is the companion blog for my first Functional Justin video which you can find here https://youtu.be/J01u_Dmrx5U . I spend around 15 minutes adding some Scala 3 (formerly Dotty) features to an Scala 2 program. The program itself builds a simple Algebraic Data Type (ADT)…