My ever-growing rescript article series

A new article is available. It’s a direct sequel to the previous article, and continues the journey of modelling RxDB collections in Rescript: https://dusty.phillips.codes/2021/04/02/modeling-rxdb-in-rescript-part-2/

3 Likes

Here’s part 3 of the RxDB miniseries:

I’ve got some really exciting stuff lined up syncing this thing with a graphql server. Gave a talk on Rescript at my new company this week. I’m expressly not pushing for adoption internally, but hopefully we’ll see one or two of my colleagues poking around here for their personal projects. :slight_smile:

6 Likes

The latest article is a messy unification of all the previous articles. I don’t know if it will be very easy to follow unless you’ve worked through the earlier ones, but it was necessary to get everything in the state I needed it to be for my later PWA work:

5 Likes

Keep it going =)
Haven’t read most of them but it’s good to know the pulse of the community

3 Likes

Latest article is about setting up a graphql server in Rescript!

My writing time has slowed down a bit, but I’ve got a holiday coming up in a few weeks so I’ll be able to fill my buffer again. :slight_smile:

8 Likes

Keep it up @dusty-phillips . I constantly check your blog and code when and if I get stuck, as well as what others like @ryyppy have created. Helps a lot. Makes things a bit less overwhelming.

3 Likes

New article is more of a demo than instructional. I had a bunch of refactoring to do and decided to document the steps to illustrate how quick and painless it is when you have a high-speed compiler of a functional language.

7 Likes

Latest article is a continuation of the RxDB series. This one gets serious about setting up graphql queries.

5 Likes

Sequel to the last article sets up graphql mutations. It’s a bit of a lightweight.

I’m on vacation this week, so I’ll be fleshing out my backlog (available for preview on Patreon) a bit and trying to dig into some “bigger” topics.

4 Likes

Latest is up!

1 Like

Sorry for the recent radio silence! I’ve been awfully busy with some other projects and had to let this slide. This article was written well over a month ago, but I didn’t even have time to just edit and publish it!

But here’s the latest; a direct follow-up to the previous one.

This is the last article in the RxDB series with the Recipe Book app, and I’m going in new directions now. I have a couple articles on unit testing in the queue, and one on parsing JSON. I had started an article on using Rescript with Gatsby, but it was really boring (step 1: use Gatsby. step 2: use Rescript) so I gave up. :smiley:

I’m planning to do some more technical discussions of rescript concepts instead of following the “project-based” model I’ve been using so far. Projects are more fun, but I was finding I’m writing more about the underlying than about Rescript itself.

My time continues to be limited, so the delay in my publication schedule will probably become the new normal (god I am getting sick of that phrase. Thanks COVID).

I haven’t seen as much Patreon activity as I’d hoped, so I’m backing off on my plans to write a book on Rescript. Hopefully Rescript will gain more momentum, and I may revisit the book idea in the future.

4 Likes

very useful articles

1 Like

Finally sharing my latest article. This has been available on my Patreon for well over a month, but I haven’t had time to do final edits and push it live. Ironically, I made a bunch of changes to rescript-zora in the mean time so the final edits were closer o a rewrite!

https://dusty.phillips.codes/2021/08/02/quickly-testing-rescript-with-zora/

3 Likes

My latest! The title is misleading and the article is full of ranting.

2 Likes

Here we go again! This one’s kinda soft because it just regurgitates the JZON documentation. But I got some harder stuff in the pipeline!

6 Likes

Oh, Jzon is featured in the novel :heart_eyes:

One newer project is jzon. It specifically targets Rescript syntax and has ultra-low boilerplate. My only concern with the library is that it is quite new and there’s no indication as to whether it will be supported in the long run (It’s already been six months since it’s last release).

Ouch! Six months passed already… I’m collecting thoughts on a breaking update. I think I’ll eventually swap data/codec ordering and make Jzon data-first and convert errors to lower-bound polyvar-type to assist the railway-oriented programming. What’s for minor changes I found (personally) nothing to do, because it solves the current problems in two production projects.

Thanks for your articles! I wish you make a complete book out of them.

4 Likes

Jzon looks nice!

I’ve actually have built something similar I’ve been using in a few hobby projects - I want to tidy-up, release and write up soon but not finding the time: A simplistic JSON parser for ReScript · GitHub

The decoders end up looking like this (emitted from a JSONSchema-like parser-emitter I’m working on):

module Test = {
  open Json.Decode
  open Json.ResultHelpers
  type schema2 = {address: option<string>, name: string}
  type testObject = {aString: option<string>, anObject: option<schema2>}
  let decodeSchema2 = v__ => {
    let o__ = d_object(v__)
    let address = o__->d_field("address")->d_optional(d_string)
    let name = o__->d_field("name")->d_string
    applyTo((address, name) => {address: address, name: name})->feed(address)->feed(name)
  }
  let decodeTestObject = v__ => {
    let o__ = d_object(v__)
    let aString = o__->d_field("aString")->d_optional(d_string)
    let anObject = o__->d_field("anObject")->d_optional(decodeSchema2)
    applyTo((aString, anObject) => {aString: aString, anObject: anObject})
    ->feed(aString)
    ->feed(anObject)
  }

The applyTo is weirdly polymorphic (it will adapt to functions of different arities I think) but a bit cleaner in its output. Operator overloading would reduce the boilerplate here a bit.

Trying to dig a little deeper into the language now:

6 Likes

Another deeper one. I really enjoyed writing this one!

7 Likes

Thanks for writing all these :clap: