Improve devops workflows and self-host Docker, Grafana, GitLab, OpenFaaS and more on the simplest cloud platform. Spin up preconfigured cloud servers with the growing library of 1-Click Apps on DigitalOcean Marketplace.

Get started with a new user credit for Morning Cup of Coding readers.

Articles

(Jun 04) #swift

Declarative programming is all the rage these days. React, Vue, and a ton of others on the web front-end, XAML, QML and others on the desktop UIs. And at WWDC this year we got SwiftUI, a UI building framework that generates declarative Swift code as oppose to a garbled mess of XML. But it doesn't use the Swift you may be familiar with. To bring this to life, Apple had to add some features in its compiler and in this article Bruno Rocha takes a closer look at them.

(Jun 03) #rust

Andrea Lattuada and James Munns designed and implemented a high-performance lock-free ring-buffer for use in cross-thread communications in Rust. A ring buffer, specifically the BipBuffer in this case, allows one to allocate a block of memory and treat it as an infinite stream. The writer writes data on the buffer and circles back when it reaches the end while at the same time a reader reads that data in a similar fashion. A key property of this design is that both the reader and the writer treat the buffer memory as continuous (as opposed to jumping at different points to read and write like when using a Heap). A problem arises though when the writer needs to write data that is bigger than the remaining space in the buffer. This post explains how the two authors solved this issue efficiently.

(Jun 04) #cryptography #python

Let's say you are working on a cryptographic library and all you have is a pseudo random bit generator. While this is far from ideal because of how easily it can be attacked, there is a way to use two of these weak generators to produce a stronger random bit stream. John D. Cook summarizes the paper by Coppersmith et al that shows us how this works.

-- * --

Programming language of the day: Monkey. "Monkey is a programming language that you can build yourself by reading through Writing An Interpreter In Go and Writing A Compiler In Go.

There is no official implementation of Monkey — it lives in these books and it’s up to you, the reader, to implement it. "

-- * --

And that''s it for today! Discuss this issue at our subreddit r/morningcupofcoding.

Did you like what you read? Let us know by clicking one of the links below.

Liked - Disliked

I hope you enjoyed reading the latest issue of Morning Cup of Coding. If you did, consider supporting us by becoming a patron (Patreon) for perks like ad-free issues, or via a one-time donation via PayPal.

Cheers,

Pek