Jonathan Magen

/yonkeltron

Jonathan Magen

Computers and Stuff

User Avatar

Jonathan Magen

4y ago

I am going to show you examples of modern examples of Lisp which can help you with DevOps tasks. No, I'm not joking. No, I'm not drunk.

In no uncertain terms, the power of Lisp is ideally suited for automation. This is not just because of how expressive it is. It's also because of how straightforward Lisp is for solving real-world problems.

Now, let's dive in.

#1: Racket's new Zuo

Zuo is a huge step forward for both process automation as well as using Lisp for general scripting!

Since Zuo is basically just a tiny Racket wrapped around an automation-friendly core, it's ideal for scripting build systems! Zuo is new in Racket 8.6 but it's already making a splash amongst language aficionados who also need to get stuff done.

https://docs.racket-lang.org/zuo/index.html

#2: High-level automation with Bass

From building container images to automating builds, Bass has you covered!

Bass lang is a bespoke Lisp which runs on top of Docker's buildkit. Unlike Zuo, it's a Lisp dialect designed and written exclusively for the purposes of making common project tasks cacheable. It does this through the enduring magic of thunks, or unevaluated functions. Make sure to check out it's growing standard library.

https://bass-lang.org

#3: Configure your server fleet with Adams

Sure existing options are cool, but have you tried not using YAML?

While Adams might seem little more than a stylistic choice in favor of S-Expressions, this library packs a punch. Come for the efficient code-reuse, stay for the declarative nature of configs. As a bonus feature, it's written in Common Lisp and therefore has a ton of extension potential.

https://github.com/cl-adams/adams

Now go forth and be awesome!

Wishing you the best of luck as you Lisp!

User Avatar

Jonathan Magen

4y ago

In order to achieve CI/CD which meets your needs and doesn't inspire intense self hatred, you're going to need to play around with what works for you, your team, and your product.

As a computer scientist working for a large US corporation, I am constantly on the lookout for tools which will make folks lives better. I put together this grab bag list of stuff I hope I get to try out more ASAP. Hopefully others can benefit from what I've already been having some light success with in different environments. I haven't vetted all of these in as much detail as I wish I could, but maybe some will be a help or an inspiration for you!

Bors.Tech: Strict mode for your CI/CD

https://bors.tech/

The times when I've been most frustrated (and the most confused) with my CI/CD pipelines have been when I got unexpected results. While I've written elsewhere about why Git has caused issues for me in the past, tools like Bors.Tech can help. Drop it into your workflows and it'll help improve merge and test predictability.

Earthly: Make your CI/CD workflow portable

https://earthly.dev/

I've been following Earthly for a long time but their recent strides in both maturity and adoption of a proper FOSS license are what make it a viable option today.

Earthly lets you define your pipeline with an Earthfile which is half way between a Makefile and a Dockerfile. Then you can run it wherever you have Docker. This makes it very well suited to testing on your local machine and then running it, reliably and repeatably, on a shared CI server.

This makes the inner loop of the developer workflow much shorter, tighter, and more testable. Who doesn't love fewer surprises?

SLSA: keep your supply chain safe and transparent

https://slsa.dev/

SLSA stands for Supply chain Levels for Software Artifacts and it's a multi-tiered framework to guide projects in establishing desirable security properties. For CI/CD, the tools available have gotten just that good. Honestly the incredible strides made by the efforts adjacent to supply chain security are nothing short of awe-inspiring. Advocates on Twitter (like Dan Lorenc) have done just as a fantastic job of educating folks about supply chain security as they have evangelizing work like the Sigstore project.

https://www.sigstore.dev/

Using Sigstore tools (like Cosign for signing container images) can not only give your users and consumers confidence, but will help establish internal oversight. For highly-regulated entities, the ability to show chain of custody might be the difference between passing or failing an audit!

User Avatar

Jonathan Magen

4y ago

My secret shame as a computer scientist is that I can't make curly braces on a chalk/whiteboard. Also, I'm bad at proofs.

From the moment I opened my first discrete math textbook in 10th grade (a thoughtful gift from a high-school math teacher), I was confused by proofs. Logic and sets make plenty of sense, but I continued to struggle even in college. While I understood their importance and could follow the mechanics of others' proofs, I could never get my own attempts off the ground. This made me feel absolutely horrible and contributed tremendously to impostor syndrome which plagues me even today.

I wish I could tell you that sticking with it allowed me to break through the wall of understanding by sheer force of will. Nope. Instead I needed to change my approach.

There is more than one way to learn something.

If the textbook and lecture approach doesn't work for you, much like it didn't work for me, read on to see how I used some unexpected tools to help me get over the hump.

In truth I have a learning disability slash superpower where I can't understand something until I can program it. On the other hand, once I can program something I have a pretty good handle on the concept. In this case, that meant that being able to program proofs was the way for me to understand proof theory in general. But maybe not in the way you think!

Thanks to software known as proof assistants, here's how it all came together.

#1. The sequent calculus was my gateway drug.

The first proof assistant I had encountered was an interactive tutorial for the Sequent Calculus published by MIT.

http://logitext.mit.edu/main

Discovering (and understanding) that alternative proof systems even existed may have been enough. Then, the proof assistant itself helped me to experiment and play around whole growing my understanding of the goals. It was here that I figured out that proving a theorem is little more than showing it's a tautology!

#2. I struggled so much with Coq, but found more success with alternatives.

If you Google around for proof assistant software you'll undoubtedly make your way to Coq. Despite several attempts to wrap my head around Coq, it wasn't clicking. That's when I discovered various alternatives such as Lean, Cicada, Agda, and others.

#3. Formal methods became the light at the end of the tunnel.

After looking into proof assistants I was able to make it real in large part due to formal methods tools like Alloy and TLA+. My ability to understand and use such tools is in large part due to the work of my friend Hillel Wayne. If you don't know his stuff, check it out.

https://hillelwayne.com/

User Avatar

Jonathan Magen

4y ago

Want To Get Better at Tackling Problems? Try These Tactics to Help Jump Start Your Creativity and Understanding!
Jonathan Magen

I have been in the world of technology for most of my life. Considering that I wrote my first program in first grade, that's not an understatement.

During that time, I have written a ton of software for companies and myself. I have also been co-writing a book on the Actor model for practicing developers. In fact, I have invested so many hours into trying to master my craft that I gained a true appreciation for the way computer science let's us look at problems.

But do you want to know a secret?

At some point I realized how I actually start out with the same few tactics every time.

Tactic #1: Always be a beginner

The mindfulness community refers to this as "Beginner's Mind" whole Zen Buddhist nomenclature terms it "Shoshin".

Here’s how it works:

  • Approach a subject with a clear head and without preconceived biases.

  • Don't be afraid to ask "stupid questions".

  • Use your fresh perspective to learn new things!

This one really helps you to think out of the box.

Tactic #2: Worst idea first

This one gets talked about in the form of brainstorming and interaction design.

Here’s how it works:

  • Think about the problem and come up with the worst idea you can possibly conceive of which still solves it.

  • Make a list of all the reasons why that idea is terrible.

  • By addressing all the flaws, you incrementally gain a better idea of what a suitable solution could look like.

Quick note: Don't try to generate the perfect idea too quickly. That's a mistake. These steps work better because you get broader perspective.

Tactic #3: Doodle-Driven Problem Solving

There's been a lot of research that shows how getting your creative juices flowing in one area can benefit critical thinking in other areas. Don't worry if you're like me and have zero artistic ability. Grab a pen and give it a shot!

  • Avoid doodling anything related to the problem you're working on.

  • Do some random or otherwise abstract doodling instead.

  • If you avoid topicality and doodle without "artistic" direction, you'll unlock a whole new creative outcome.

Easy, right?

Tactic #4: Sleep on It

If you haven't yet read the fantastic book, Why we Sleep, by Dr. Matthew Walker, you should. In addition to fantastic overviews of what sleep is and why it's important, this accessible text also touches on the link between sleep, dreams, and creativity.

Here’s how it works:

  • Think about a problem.

  • Get a good night's sleep.

  • Wait for your sleeping mind to make new connections.

Do these 3 things, and you'll be wildly successful, in addition to being well-rested.

I hope that some of these tactics help you out!

If you try any of these, please reach out to me and report successes and failures so I can work on improving my toolbox.

Also consider checking out the collection of mental models at https://untools.co

User Avatar

Jonathan Magen

4y ago

I love distributed systems and all they allow us to do. Unfortunately, this topic is still incredibly difficult for folks to approach and even harder to really get steeped in.

And since I love helping others to get involved in distributed systems, I want to share a handful of projects I have been following for some time. They have captured my imagination on account of their tremendous possibility. I recommend them to anyone and everyone interested in the field.

Here are my 3 favorite projects currently under development:

  1. P: Modular and safe programming of distributed systems. https://p-org.github.io/P

  2. Hypercore Protocol: Peer-to-peer data sharing and the successor to the Dat initiative. https://hypercore-protocol.org

  3. Spritely Institute: "Centralization broke community on the web. We're here to fix it." https://spritely.institute

Each of these projects has absolutely wonderful characteristics and a ton of potential to make the field better. Perhaps you'll be able to see why I keep checking back in with them over and over again. Keep your eye out as these initiatives makes progress. If you end up looking into any of these, let me know what you think of them.