RSSAmplifier

Blog

Noteflakes

A website by Sharon Rosner

noteflakes.comRSS feed ↗35 posts

Latest posts

Extralite 3.0.0 Released

I m pleased to announce the release of Extralite 3.0.0. This release marks the addition of object graph transforms, the transition to modern defaults for opening SQLite databases, and a minor security enhancement. Extralite is a fast and innovative SQLite wrapper for Ruby with a rich set of features. It provides multiple ways of retrieving data from SQLite databases, makes it possible to use…

Rethinking modularity in Ruby applications

I wrote recently about Syntropy , a new Ruby web framework I m working on (it runs this site ). Syntropy s design is based around the idea of file-based routing, which means that the source files for route handlers (i.e. controllers) that make up the app are organized and named according to the app s URL namespace. I also discussed the way Syntropy loads the different source files (referred to as…

Software as Craft: a First Look at Syntropy

I ve always been interested in coding as a craft - a thing to do with your hands, your eyes and your mind. In many ways, I feel that a lot of the satisfaction and accomplishment I get from making software comes from the process itself, the doing of it, and not necessarily the end result. To quote one of my favorite musicians : Most vagabonds I knowed don t ever want to find the culprit That…

Exploring automatic Buffer Management with io_uring

In the last year or so I ve been working on UringMachine , a Ruby gem for doing I/O with io_uring, and I ve been reporting on my progress on my website, as part of my grant work for the Ruby Association . A Quick Recap Here s a quick recap of what UringMachine does: UringMachine provides a low-level API for performing I/O operations using io_uring, which is an interface for performing I/O…

Threads vs Fibers - Can't We Be Friends?

In the last few weeks I ve been writing here about my work on UringMachine , a Ruby gem for doing I/O with io_uring. Before I talk about my work this week, I d like to address something that is important to me. Maybe, We ll See I usually share my blog posts in a few different places on the internet, and sometime people write their reactions. Last week, on Reddit, someone didn t like the title (of…

OSS Friday Update - Fibers are the Future of Ruby

In the last few days I ve managed to finalize work on the UringMachine fiber scheduler. Beyond making sure the fiber scheduler is feature complete, that is, it implements all the different Fiber Scheduler hooks and their expected behaviour. To make sure of this, I also spent a couple of days writing test cases, not only of the fiber scheduler, but also of UM s low-level API. Beyond the tests, I…

OSS Friday Update - The Shape of Ruby I/O to Come

I m currently doing grant work for the Japanese Ruby Association on UringMachine , a new Ruby gem that provides a low-level API for working with io_uring . As part of my work I ll be providing weekly updates on this website. Here s what I did this week: Last week I wrote about the work I did under the guidance of Samuel Williams to improve the behavior of fiber schedulers when forking. After some…

OSS Friday Update - The Fiber Scheduler is Taking Shape

This week I made substantial progress on the UringMachine fiber scheduler implementation, and also learned quite a bit about the inner workings of the Ruby I/O layer. Following is my weekly report: I added some benchmarks measuring how the UringMachine mutex performs against the stock Ruby Mutex class. It turns out the UM#synchronize was much slower than core Ruby Mutex#synchronize . This was…

OSS Friday Update

Note: while my schedule is quite hectic these last few weeks, I ve taken the decision to dedicate at least one day per week for developing open-source tools, and henceforth I plan to post an update on my progress in this regard every Friday evening. Here s the first update: UringMachine Grant Work As I wrote here previously, a few weeks ago I learned I ve been selected as one of the recipients of…

You Win Some, You Lose Some: on Papercraft and more

In the last few weeks I ve been busy with a few different projects, and I guess I m not the only freelancer who has trouble finding their work-life balance. That is, in the last few weeks life has been hitting me in the face, and it was a bit overwhelming. But I still did manage to make some progress on my work, and thought I might share it here. Papercraft Update Since releasing Papercraft 3.0 ,…

Papercraft 3.0 Released

I have just released Papercraft version 3.0. This release includes a new API for rendering templates, improved XML support and an improved API for the Papercraft::Template wrapper class. Below is a discussion of the changes in this version, as well as what s coming in the near future. A New Rendering API Papercraft 2.0 was all about embracing lambdas as the basic building block for HTML templates.…

Papercraft update: IRB Support, Bug Fixes, More Speed

This week I was away on a little trip to Paris to attend a Paris.rb meetup and meet some friends, so I was less productive, but still got some stuff done, and still managed to do some work on Papercraft . Here s what s changed: Using Papercraft in IRB Up until now, perhaps the biggest limitation of Papercraft was that you couldn t use it in an IRB session. That was because Papercraft always…

Hanami on Papercraft

Lately I ve been really excited about Papercraft and the possibilities it brings to developing web apps with Ruby. Frankly, the more I use it, the more I see how simple and joyful it can be to write beautiful HTML templates in plain Ruby. Now that the Papercraft website is up, I d like to concentrate on making it easier for everyone to use Papercraft in their apps, whatever their web framework. So…

Papercraft Update: New Version, New Website

I ve been working quite a bit on Papercraft these last few weeks. Yesterday I released Papercraft version 2.16, and here are some of the notable changes introduced since the last update: Emit DOCTYPE for html tag by default. Before this change, you needed to use the html5 tag to include the DOCTYPE at the top of the generated markup. Now you can just use html . This is important since this way you…

Words Can Hurt: A Plea to the Ruby Community

I ve been watching the recent drama within the Ruby community slowly devolve in the last few days into name-calling and virtue-signalling, and frankly just plain silliness. I won t repeat here the details of the disagreement, and I won t link to any posts written about what s happened. It is clear to me that some of this has to do with business interests of the different parties involved, some of…

My Thoughts on Euruko

I ve just got back home from Euruko last night. The conference ended on Friday, but I decided to stay two more nights in Portugal and visit Porto. In between walking all over the city, eating great food and enjoying the dancing and music making in the street, I ve also had time to think about all the wonderful people I met at the conference (and even some I ve met and talked to by chance on the…

P2 is the New Papercraft

In the last few months I ve been busy working on a few different open-source projects. Some of those projects are still at a preliminary stage, and I m taking my time in continuing to develop them, use them ( on this website for example), but one project I ve devoting a lot of attention to is P2, a Ruby gem for writing HTML templates in plain Ruby, which I ve been writing about lately . P2 has…

How I Made Ruby Faster than Ruby

Note : P2 is now folded back into Papercraft . The P2 repository will eventually be archived. If you re a Ruby programmer, you most probably will be familiar ERB templates and the distinctive syntax where you mix normal HTML with snippets of Ruby for embedding dynamic values in HTML. I wrote recently about P2 , a new HTML templating library for Ruby, where HTML is expressed using plain Ruby. Now…

P2 - a Functional HTML Templating Engine for Ruby

Note : P2 is now folded back into Papercraft . The P2 repository will eventually be archived. I ve just released P2 , a new HTML templating engine for Ruby. P2 builds on the work I did in Papercraft , but takes things quite a bit farther: templates are expressed as plain procs and are automatically compiled in order to make it fast. How fast? Here are the results of benchmarking Papercraft against…

Introducing UringMachine

UringMachine is a new Ruby gem for performing concurrent I/O using io_uring and Ruby fibers. In UringMachine I ve implemented all the lessons I ve learned from my previous attempts at bringing io_uring to Ruby: Polyphony , a comprehensive gem providing io_uring functionality, structured concurrency, and monkey-patching for the Ruby standard library; and IOU , a low level async API for using…

Exploring unix pipes with Ruby and Polyphony

Most of you are probably familiar with the concept of pipes on Unix-like OSes. We mostly encounter pipes on the command line, where we can use them to use one command s output as another s input. But pipes can also be used programmtically. On Linux specifically, pipes let us move data between two arbitrary file descriptors, without the data ever being seen by our user-space program, and in some…

My Open Source Ruby Gems - February 2022 Report

I m an independent software developer working mostly on Ruby apps. In the line of my work, I ve developing various open-source projects spanning the gamut from low-level concurrency constructs to database and frontend concerns. If you care about my work, please consider becoming a sponsor on Github . Here s a summary of my open-source work in February: Polyphony - fiber-based concurrency for Ruby…

Papercraft - Composable Templating for Ruby

Papercraft is a new Ruby gem I ve been working on, that provides a new way to render HTML, XML and JSON using plain Ruby. Here s what it looks like: require 'papercraft' template = Papercraft . html { html5 { head { title 'Some title' } body { emit_yield } } } template . render ( 'Page title' ) { h1 'Hello, world!' } #=> "<html><head><title>Some title</title></head><body><h1>Hello,…

Extralite - a new Ruby gem for working with SQLite databases

In the last year I ve been working a lot with SQLite databases. I started by using the popular sqlite3-ruby Ruby gem, but quickly noticed that for my usage there were a few things missing in the gem s API . Being a tinkerer, and having had some experience writing C-extensions , I had a look at the SQLite C API and decided to try to write my own Ruby bindings for SQLite. Thus Extralite was born.…

Qeweney - a feature-rich HTTP request/response API for Ruby

As you may know, in the last few months I ve been working on Tipi , a new web server for Ruby, with innovative features such as support for HTTP/2, automatic SSL certificates, and streaming request and response bodies. As part of the development process, I also had to deal with how to represent HTTP requests and responses internally. Tipi being a modern web server, with emphasis on concurrency,…

Signal handling in concurrent apps with Ruby and Polyphony

In the last few weeks I ve been writing about different aspects of Polyphony , a library for writing fiber-based concurrent apps in Ruby. Polyphony makes it easy for developers to use stock Ruby core and stdlib classes and APIs in a highly-concurrent environment in order to create scalable, high-performance apps. In order for provide a solid developer experience, Polyphony reimplements different…

Real-world Concurrency with Ruby and Polyphony: a Telnet Chat App

Recently there has been a lot of renewed interest in fibers as the building blocks for writing concurrent Ruby apps. Most of the articles written lately (my own included) have tried to explain what are fibers, how they can be used for writing concurrent apps, and how fiber scheduling works. While this obviously is great, I feel there s also a need for developers to get a feel for how a real-world…

About that monkey-patching business...

A few days ago, a comment was made on the internet about Polyphony , an open source project of mine, mentioning the fact that Polyphony patches some core Ruby APIs. The context was the difference between Polyphony and Async (another fiber-based concurrency gem for Ruby): Last time I checked, polyphony monkey patched Ruby core methods to do its work :-/. This has deterred from learning more about…

Explaining Ruby Fibers

Fibers have long been a neglected corner of the Ruby core API. Introduced in Ruby version 1.9 as a coroutine abstraction, fibers have never really seemed to realize their promise of lightweight concurrency, and remain relatively little explored. In spite of attempts to employ them for achieving concurrency, most notably em-synchrony , fibers have not caught on. Hopefully, with the advent of the…

Embracing Infinite Loops with Ruby and Polyphony

In this article I ll discuss the use of infinite loops as a major construct when writing concurrent apps in Ruby using Polyphony. I ll show how infinite loops differ from normal, finite ones; how they can be used to express long-running tasks in a concurrent environment; and how they can be stopped. Polyphony is a library for writing highly concurrent Ruby apps. Polyphony harnesses Ruby fibers and…

A Compositional Approach to Optimizing the Performance of Ruby Apps

Ruby has long been derided as a slow programming language. While this accusation has some element of truth to it, successive Ruby versions, released yearly, have made great strides in improving Ruby s performance characteristics. In addition to all the iterative performance improvements - Ruby 2.6 and 2.7 were especially impressive in terms of performance gains - recent versions have introduced…

How I Write Code: Pen & Paper

I am a self taught programmer. I first started programming as a kid, and have never bothered to formally study this discipline. To me, programming is first of all a pleasant creative pursuit. It s a bit like putting together and taking apart all kinds of machines, except these machines happen to be virtual constructions, and you get to keep your hands clean (well, mostly ) Incidentally, this…

What&#39;s new in Polyphony and Tipi - August 2021 edition

The summer is drawing to an end, and with it I bring another edition of Polyphony (and Tipi) news, this time on my own website, where I ll be publishing periodically from now on. Polyphony is a library for writing highly concurrent Ruby apps. Polyphony harnesses Ruby fibers and a powerful io_uring -based I/O runtime to provide a solid foundation for building high-performance concurrent Ruby apps.…

What&#39;s new in Polyphony - July 2021 edition

Following last month s update , here s an update on the latest changes to Polyphony: Redesigned tracing system New methods for changing fiber ownership Support for appending to buffers when reading Improved backend statistics Improved control over reading with #read and #readpartial Redesigned tracing system In previous versions, Polyphony included extensions to the core Ruby TracePoint API, so…

What&#39;s new in Polyphony - June 2021 edition

Polyphony 0.58 has just been released. Here s a summary and discussion of the latest changes and improvements: Improved functionality for OpenSSL sockets and servers. Fixes to the Mutex class. A redesigned event anti-starvation algorithm. A new API for splicing to/from pipes. A new API for chaining multiple I/O operations. New APIs for performing GC and other arbitrary work when the process is…