Introduction

This is the fourth in a series of articles exploring the Gleam programming language. The first article explored some of the most basic features of Gleam; just enough to say hello. The second discussed looping constructs, namely that gleam doesn’t have them. The third was supposed to be about parallel programming and OTP, but it ended up being more about looping and recursion.

So this one is about parallel programming and OTP. Every other programming text I’ve written leaves concurrency until quite late because most programming languages make concurrency hard to get right (My will-never-be-published book on Rust took very serious issue with their “fearless concurrency” claims).

Continue reading

Introduction

This is the third in a series of articles exploring the Gleam programming language. The first article explored some of the most basic features of Gleam; just enough to say hello. The second discussed looping constructs, namely that gleam doesn’t have them.

This one was supposed to investigate how Gleam integrates with Erlang’s famous OTP library for concurrency and fault tolerance. But I got sidetracked and ended up doing a second article on recursion and tail recursion instead.

Continue reading

(Original published September 30, 2021. Updated May 7, 2022)

Introduction

Most of my Rescript series so far has been about combining Rescript with React using create-react-app. Now that I understand Rescript better, I’m not so sure create-react-app is a good fit for it.

Mostly because it’s slow. Rescript compiles JSX natively, so we shouldn’t need slow and hard-to-configure webpack. Most of create-react-app is about hiding the configuration of webpack from the end-user. I appreciate that. I’ve wasted more hours on webpack configuration than I care to count. But not having webpack is even better than hiding it!

Continue reading

Introduction

This is the second in a series of articles exploring the Gleam programming language. The first article explored some of the most basic features of Gleam; just enough to say hello.

Hello is basically the first thing we learn in any language (whether human or programming). This article explores looping in Gleam. More specifically, it explores the fact that Gleam doesn’t have any looping constructs.

That’s right: none.

Patreon

If you find my content valuable, please do consider sponsoring me on Patreon account. I write about what interests me, and I usually target tutorial style articles for intermediate to advanced developers in a variety of languages.

Continue reading

Introduction

Gleam is a newish programming language that I recently stumbled upon. It is so little-known that there aren’t really any tutorials available on it (even on the official documentation), so I decided to write my own.

Gleam transpiles to Javascript and Erlang. I’ll be focusing my attention on the Erlang side of things, as it is more mature. And to be honest, I don’t feel any reason to replace Rescript, my go-to transpiles-to-Javascript language.

Continue reading

Introduction

I was basically flat with an illness (yes, that one) on my back for two weeks in March. I could do little more than read articles on my tablet, and for reasons I cannot explain, I began chainsmoking the documentation for as many little-known languages as I could find.

I honestly don’t know why. In the fog of illness, it just seemled a fun thing to do. I’m weird.

Continue reading

Introduction

I’ve been writing plenty about Rescript this year, although I’ve taken a bit of a hiatus to focus on developing a couple (Rescript) open source libraries. I wanted to get back into blogging to answer one of the most confusing questions in the Rescript community: What is ReasonML and how does it relate to Rescript?

However, it has grown into something quite a bit bigger. Instead, we’ll be talking about the relationships between a collection of several interrelated languages, and I’ll give my opinion on which you should use.

Continue reading

As hinted in some of my recent articles on Rescript, I’ve been working on bindings to the wonderful Dexie interface to IndexedDB. It’s finally ready to announce to the world (in a fairly beta format)!

rescript-dexie depends on a recent version of Rescript and the rescript-promise library.

It’s still fairly beta and I haven’t covered all the features Dexie packs in yet, but the basics are working well. It feels intuitive and gives the right mix of sound type safety and easy call sites. Let me know what you think!

Continue reading

Introduction

(Note: There is a more recent version of this article)

Most of my Rescript series so far has been about combining Rescript with React using create-react-app. Now that I understand Rescript better, I’m not so sure create-react-app is a good fit for it.

Mostly because it’s slow. Rescript compiles JSX natively, so we shouldn’t need slow and hard-to-configure webpack. Most of create-react-app is about hiding the configuration of webpack from the end-user. I appreciate that. I’ve wasted more hours on webpack configuration than I care to count. But not having webpack is even better than hiding it!

Continue reading

Introduction

For basic syntax, functional programming does not feel that different from other paradigms. Sure, data and behaviour are separate, so you don’t have classes or objects or inheritance, but it feels relatively the same. This is especially true in Rescript, with the pipe-first syntax almost looking like a method lookup (comparable to the self object in Python).

But if you go deeply into a study of functional languages, you start encountering bizarre words such as “monad” and “functor”. Again, this is less true in Rescript, which emphasizes pragmatism over purity. Indeed, if you search the rescript documentation for “monad”, it will come up blank, and if you search for “Functor” you get a fairly short section that almost feels like an afterthought.

Continue reading

Author's picture

Dusty Phillips

Canadian author and software developer.

Author and software developer

New Brunswick, Canada