‹ back to the petition

pacman, apostate

Somewhere in the thread that produced this petition, a second demand arrived: rewrite pacman in Ruby on Rails. Not just Ruby — Rails, specifically, on the record, twice. So here is the least pureblooded software imaginable, scaffolded on purpose, running right next to the manifesto it insults.

the confession

pacman is roughly 20,000 lines of C. It links against libalpm, talks to a flat file database, and does its job in milliseconds without asking Puma's permission. It is, by the petition's own logic two paragraphs up, about as pureblooded as software gets.

Ruby on Rails is a full MVC framework with an ORM, an asset pipeline, a convention-over-configuration philosophy, and — as of this scaffold — a PackagesController standing between you and a single filesystem write. Reimplementing pacman in it is not an optimization. It is the opposite of everything above. That was, as far as we can tell, the entire point of the ask.

What follows is not a real Rails app (Cloudflare Workers do not run a Ruby runtime, and this repo doesn't add servers for jokes) — it's a faithful simulation of one: real routes.rb, a real-looking rails server boot log, and a console that logs every install exactly the way ActiveRecord would, slowly, in your browser, backed by localStorage instead of SQLite.

rails new pacman_rails

terminal

$ bundle exec rails new pacman_rails --minimal --database=sqlite3
      create  Gemfile
      create  app/models/package.rb
      create  app/controllers/packages_controller.rb
      create  config/routes.rb
         run  bundle install
Bundle complete! 47 Gemfile dependencies, 47 gems now installed.
$ bin/rails db:migrate
== 20260903000001 CreatePackages: migrating ==================================
-- create_table(:packages)
   -> 0.0041s
== 20260903000001 CreatePackages: migrated (0.0042s) =========================
$ bin/rails server
=> Booting Puma
=> Rails 7.4.2 application starting in development
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 6.6.0 ("Sunflower")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 1994
* Listening on http://127.0.0.1:3000
Use Ctrl-C to stop

the scaffold

config/routes.rb

Rails.application.routes.draw do
  resources :packages, only: [:index, :show, :create, :destroy] do
    collection do
      get  :search   # pacman -Ss
      post :sync      # pacman -Syu
    end
  end
  root "packages#index"
end

app/models/package.rb

class Package < ApplicationRecord
  validates :name, presence: true, uniqueness: true
  validate  :must_be_pureblooded

  scope :installed, -> { where(installed: true) }

  # see: the manifesto, section "the case"
  CORRUPTED = %w[systemd wayland gdm networkmanager pulseaudio polkit].freeze

  private

  def must_be_pureblooded
    errors.add(:name, "is not pureblooded") if CORRUPTED.include?(name)
  end
end

app/controllers/packages_controller.rb

class PackagesController < ApplicationController
  def create
    @package = Package.find_or_initialize_by(name: params[:name])
    @package.installed = true
    if @package.save
      redirect_to packages_path, notice: "installed"
    else
      redirect_to packages_path, alert: @package.errors.full_messages.to_sentence
    end
  end
end

the console

A real pacman command line, logged the way Rails would log it. State persists in this browser only — nobody's Gemfile is actually involved.

pacman-rails$

try -S <pkg> · -R <pkg> · -Ss <query> · -Syu · -Q · help

share the heresy