Curious (Clojure) Programmer Simplicity matters

Menu

  • Home
  • Archives
  • Tags
  • About
  • My Talks
  • Clojure Tip of the Day Screencast
  • (Open) Source
  • Weekly Bits & Pieces
  • RSS
May 9, 2022

Weekly Bits 10/2022 - Clojure, Cider 1.4, AWS architectures, Lisp in Small Pieces, and The Fieldstone Method

Table of Contents
  • Clojure
    • babashka/fs
    • Learn Pedestal - new course by Jack Schae
    • Cider 1.4 release ("Kyiv") - undef-all and friends
    • The Clouncil
    • When is Clojure "the right tool for the job"?
    • Flow-storm debugger
    • How to structure the codebase for data shape discoverability
  • Architecture
    • Cloudonaut - Unusual AWS Architectures
  • Security
    • Handling Sensitive Data: A Primer
  • AWS & Cloud
    • RDS backups & restores - point-in-time recovery
  • Reading (Books)
    • Lisp in Small pieces - the book club
    • Six Easy Pieces: Essentials of Physics Explained by Its Most Brilliant Teacher
  • Writing (Blog, Articles)
    • Weinberg on Writing: The fieldstone method
  • Links

Some of the interesting things I did, learned, or found in the past week.

Clojure

babashka/fs

babashka/fs is a file system utility library that helps you use java.nio package from Clojure. The standard clojure.java.io namespace and some other libraries like Raynes/fs use the old java.io package and thus suffer from several drawbacks. However, the nio package isn’t that nice to use from Clojure and this library should help with that.

I had problems with Rayne’s fs/rename when moving files between file system. Had I used babashka.fs then I could replace this code:

(Files/move (.toPath (io/file source))
               (.toPath (io/file target))
               (into-array (if replace-existing?
                             [StandardCopyOption/REPLACE_EXISTING]
                             [])))

with this call (and perhaps eliminate my custom function entirely)

(babashka.fs/move source target {:replace-existing replace-existing?})

Learn Pedestal - new course by Jack Schae

Jacek published a new course reviewed by experts such as Paul de Grandis. I wanted to have a look at pedestal for a long time and I hope this will be the right motivation to give it a try.

Cider 1.4 release ("Kyiv") - undef-all and friends

I was excited to see a few improvements in the latest Cider release, notably the support to undefine all the previous definitions inside a namespace before loading it - simply by prefixing the usual cider-load-file command with C-u (or SPC-u in spacemacs). Unfortunately, there are some problems with respect to Java imports so it’s not fully functional yet. Watch Unexpected cider-undef-all outcome wrt. java.lang classes #3194.

The Clouncil

The Clouncil is a fun and friendly live call-in show for Clojure beginners to ask experienced Clojurians questions and work out problems together.

I think it’s a great iniative and it’s run by Clojure (and teaching) experts like Arne Brasseur and Daniel Higginbotham.

When is Clojure "the right tool for the job"?

I re-discovered this essay by didibus via Clojurians slack.

My take is that in general, the right tool for the job actually doesn’t matter that much when it comes to programming language. …​ That’s why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.

— didibus

Flow-storm debugger

A new clojure trace "debugger" has been published. It reminds me the tracing functionality available in Cider, but maybe it can offer something valuable to specific audience.

If interested, watch the video here: https://www.youtube.com/watch?v=YnpQMrkj4v8

How to structure the codebase for data shape discoverability

Sean Corfield offered good advice:

In general, good function and argument names, and good docstrings, should tell the reader all they need to know – see Zach Tellman’s excellent book “Elements of Clojure”. But using Spec as an additional form of documentation for data structure can also help. Destructuring can also be a helpful tool. There’s no One True Way(™) here.

— optional attribution

Architecture

Cloudonaut - Unusual AWS Architectures

An older article from Cloudonaut discusses a few different architectures and their tradeoffs. They talk about:

  • Active-Standby (only one instance is actively serving the traffic but the other one can be used in case of failure)

  • multi-AZ RDS deployments with AZ preference to avoid costly cross-zone traffic

  • EBS replication between two AZs (via DRBD, Distributed Replicated Block Device),

  • and a very specific one: Oracle APEX on Fargate and RDS

Security

Handling Sensitive Data: A Primer

This is a good introduction to the topics of **data privacy and GDPR / regulations. Their "framework" contains three pillars:

  1. Learn - identify categories of information such as Personal Information

  2. Assess - compile a list of customer data that is already being handled and stored by your company and do technical and policy assessment

  3. Govern - determine regulations and policies that apply to your situation and design or find a technical solution to implement and reinforce those policies.

AWS & Cloud

RDS backups & restores - point-in-time recovery

With AWS RDS, it’s easy to setup a backup schedule and perform regular snapshots of the database, let’s say on a daily basis. But you have another option and that’s called point-in-time recovery. You can simply restore your DB instance to a specific point in time (with 5-minute granularity) within your backup retention period. To see the latest restorable time for each DB instance go to the Amazon RDS console and choose the Automated backups menu.

Reading (Books)

Lisp in Small pieces - the book club

Chris Houser have been looking for people joing his book club reading Lisp in Small Pieces I hesitated at first, but decided to give it a shot and started reading the book last week.

It’s quite dense right from the beginning but even if I don’t finish it I think I’ll get a lot of value from the process. And it will be fun doing it with other people.

Six Easy Pieces: Essentials of Physics Explained by Its Most Brilliant Teacher

I’ve just got this wonderful little book. It’s a distillation of The Feynman Lectures on Physics.

So far, I’ve read only the introduction by Paul Davies - and that was already great!

Writing (Blog, Articles)

I published a long summary for the whole April.

Weinberg on Writing: The fieldstone method

This book contains a lot of good advice and, even more importantly, writing exercises. I’ll be trying some of them - one that can be quite helpful is a re-writing/eliminating exercise (on p.92):

  1. Select a couple of paragraphs

  2. Eliminate 1/Nth of words in every sentence of those paragraphs

  3. Eliminate 1/Nth of sentences in every paragraph

  4. Add max 3 words for a paragraph if it lacks something.

Tip: For most writers, N=3 is a good value to start with.

Links

A quick recap of some of the links mentioned in this post:

  • babashka/fs

    • problems with Rayne’s `fs/rename`when moving files between file system.

  • Learn Pedestal

  • The Clouncil

  • When is Clojure "the right tool for the job"?

  • How to structure the codebase for data shape discoverability

  • AWS RDS - point-in-time recovery

  • Six Easy Pieces: Essentials of Physics Explained by Its Most Brilliant Teacher

    • The Feynman Lectures on Physics

  • Cider 1.4 release ("Kyiv") - undef-all and friends

    • Unexpected cider-undef-all outcome wrt. java.lang classes #3194

  • Lisp in Small pieces - the book club

  • Flow-storm debugger

  • Weinberg on Writing: The fieldstone method


Tags: architecture clojure physics writing weekly-bits

« Weekly Bits 11/2022 - Lisp in Small Pieces, Abstractions, Project Loom, and Fixing ring's redirects Bits & Pieces 09/2022 - April »

Copyright © 2025 Juraj Martinka

Powered by Cryogen | Free Website Template by Download Website Templates