Programming Bookmarks

These bookmarks are about the act of programming, programming languages, and the profession of programming, unlike software bookmarks.

software bookmarks

​#Bookmarks ​#Programming

Editable software:

@akkartik writes:

@akkartik

Prefer software: with thousands rather than millions of users, that seldom requires updates, that spawns lots of forks, that is easy to modify, that *you* can modify. – Using computers more freely and safely

Using computers more freely and safely

Graphics:

raylib does not provide the typical API documentation or a big set of tutorials. The library is designed to be minimalistic and be learned just from a cheatsheet with all required functionality and a big collection of examples to see how to use that functionality. – raylib

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. – About SDL

raylib

About SDL

Books:

Teach Yourself Computer Science, book recommendations by Patchlore

The Algorithm Design Manual, Notes by Patchlore

Social Architecture

Pieter Hintjens

Stuff by Justine Tunney:

SectorLISP consists of 223 lines of assembly. It provides a LISP system that’s powerful enough to let you write your own LISP interpreter in just 40 lines of LISP. It’s compatible with all PC models dating back to 1981 which have at least 64kb of RAM. – LISP with GC in 436 bytes

In the above one-liner, we’ve basically reconfigured the stock compiler on Linux so it outputs binaries that’ll run on MacOS, Windows, FreeBSD, OpenBSD, and NetBSD too. They also boot from the BIOS. Please note this is intended for people who don’t care about desktop GUIs, and just want stdio and sockets without devops toil. – actually portable executable

redbean makes it possible to share web applications that run offline as a single-file “actually portable executable” zip archive which contains your assets. All you need to do is download the redbean.com program below, change the filename to .zip, add your content in a zip editing tool, and then change the extension back to .com. – redbean

LISP with GC in 436 bytes

actually portable executable

redbean

AI:

In this project, we implement a neural network that runs on SectorLISP. Since there are no features of built-in numbers, we have to reinvent the notion of numbers from scratch only by using symbolic manipulation. We first start off by constructing a fixed-point number calculation system based solely on list manipulations, and finally, implement matrix multiplication and activation functions using this fixed-point number system. – Building a Neural Network in Pure Lisp Without Built-In Numbers Using Only Atoms and Lists

Building a Neural Network in Pure Lisp Without Built-In Numbers Using Only Atoms and Lists

Regular expressions:

the Thompson NFA implementation is a million times faster than Perl when running on a miniscule 29-character string – Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)

Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...)

Games:

In the academic literature, the task of controlling a robotic arm is known as inverse kinematics. “Kinematics” stands for movements, and “inverse” refers to the fact that we don’t usually control the arm itself. What we control are the motors that rotate each individual joint. Inverse kinematics is the task of deciding how to drive these motors to move the arm to a certain point of position. – Inverse Kinematics in 2D

Texts about generative art, work, and experiments. – Generative art project by Anders Hoff

I make interactive visual explanations of math and algorithms, using motivating examples from computer games. – Red Blob Games

In many ways… what a game is, what it means to be in a virtual space, what it means to actualize all these concepts… starts with the tool. Tools inform these ideas too. When you explore the tool space, you come away with a whole new appreciation for games. – “RPG In A Box” is a cool tool! (an alternative game development curation)

Inverse Kinematics in 2D

Generative art project by Anders Hoff

Red Blob Games

“RPG In A Box” is a cool tool! (an alternative game development curation)

Plan 9.

Plan 9 is full of UTF-8 aware programs, which makes sense, given that Plan 9 was the system UTF-8 was designed on/for. – Writing UTF-8 Programs in Plan 9

Writing UTF-8 Programs in Plan 9

Lots of stuff.

Bartosz Ciechanowski

Lisp operating system.

The 3L project is building an computing system from the ground up to be secure, private, safe, and extensible. – The 3L Project

The 3L Project

Christine Lemmer-Webber said about the 3L project:

Holy shit an ocap OS written in prescheme! Oh my god look at the whitepapers and references page, it’s *all the right things* – References and Whitepapers

References and Whitepapers

Forth, uxn:

Notes on forth

UF

uxn

uxntal

Forth

Retro Forth

Gforth

@neauoire@merveilles.town recommended the following to learn Forth:

Retro Forth

A Problem-Oriented Language

Starting Forth

Forth: The programming language that writes itself: The Web Page

Stack Computers: the new wave

useful links

Array languages like KAP, APL, J:

At its core, KAP is a programming language based on APL. – KAP Tutorial

KAP Tutorial

Uiua is a general purpose array-oriented programming language where formatting translates English keywords into the weird little symbols.

Uiua

BASIC

In this interactive article, we will build a breakout game using Commodore 64 BASIC in the browser. This is a fun programming hack, but it has quite profound theoretical background. – The Lost Ways of Programming: Commodore 64 BASIC

The Lost Ways of Programming: Commodore 64 BASIC

Forth processor simulator:

Green Arrays Forth chip F18A simulator – F18

F18

@ratfactor@mastodon.art has a concatenative, inlining, stack-based programming language:

A Forth-like language that is conCATenative in two ways: 1. Concatenative data flow (traditional) 2. Concatenated machine code (weird)“ – Meow5

Meow5

And another post by Dave:

This page is my personal journey to discover Forth and put it in the context of computing history. It is adapted from my slides for a short talk. – Forth: The programming language that writes itself

Forth: The programming language that writes itself

Types of programming languages:

First, every programmer needs to know a language in the ALGOL family well. Second, learn a language in the Prolog family: SQL. … Then, once you’ve got these two, it’s worth branching out. Learning a new language that traces to an unfamiliar ur-language each year will pay dividends. The languages I would suggest today in each of these families, and maybe in this order, are: Lisp: PLT Racket, ML: Haskell, Self: Self, Prolog: Prolog, Forth: gForth, APL: K … ­­– The seven programming ur-languages

The seven programming ur-languages

Visual programming:

Despite the GUI going mainstream in the 80s, the programming community has largely opted to remain in the era of the terminal. Yet there have always been magnificent visual programming projects at the periphery. This repo exists to shine a light on these alternatives, see what costs and benefits they offer, and reflect on the work of people pushing for a future where programming leverages more of our senses and modalities.– Visual Programming Codex

Visual Programming Codex

@marioguzman@mastodon.social decided to take the old Macintosh Human Interface Guidelines and merge them into one large collection of topics while modernizing them in the process.

The following sections are general guidelines that describe fundamental Mac layout principles of center equalization, text and control alignment, appropriate use of white space, and visual balance. – [Layout Guidelines]

Write an editor in C:

It’s about 1000 lines of C in a single file with no dependencies, and it implements all the basic features you expect in a minimal editor, as well as syntax highlighting and a search feature. – Build Your Own Text Editor

Build Your Own Text Editor

A Canon Cat like editor with a LEAP key, by @m15o@merveilles.town:

Bitters is written in ANSI C, and depends on SDL2. It should run on any unix-based system. – Bitters

Bitters

Javascript:

QuickJS is a small and embeddable Javascript engine. It supports the ES2023 specification including modules, asynchronous generators, proxies and BigInt. – QuickJS

QuickJS

Go cross-compiling works until there's C code involved. @dctrud@mastodon.me.uk recommends:

Docker container to turn CGO cross-compilation pain into a pleasure. – goreleaser-cross

goreleaser-cross

UTF-8 is best.

Our goal is to promote usage and support of the UTF-8 encoding and to convince that it should be the default choice of encoding for storing text strings in memory or on disk, for communication and all other uses. We believe that our approach improves performance, reduces complexity of software and helps prevent many Unicode-related bugs. We suggest that other encodings of Unicode (or text, in general) belong to rare edge-cases of optimization and should be avoided by mainstream users. – UTF-8 Everywhere

UTF-8 Everywhere

Pascal:

Modern Object Pascal Introduction for Programmers

Castle Engine

Free Pascal

Lazarus

Awesome Pascal

Hare:

The Hare programming language

Hare documentation

Hare Playground

Tree layout:

I assumed that there would be a classic, easy algorithm for drawing neat trees. What I found instead was much more interesting: not only is tree layout an NP-complete problem, but there is a long and interesting history behind tree-drawing algorithms. I will use the history of tree drawing algorithms to introduce central concepts one at a time, using each of them to build up to a complete O(n) algorithm for drawing attractive diagrams of trees. – Drawing Presentable Trees, by Bill Mill

Drawing Presentable Trees

Think about consent before programming. The following is written for the fediverse but it applies to all data.

So there's a difference in opinion in the fediverse on whether it's important to get consent to use somebody's public posts for a purpose they didn't originally intend it for: adding them to a search engine, using them as part of algorithmic recommendation systems, "bridging" them to another social networks, using it to train artificial intelligence systems, and so on. Some think this is just fine, or that it's enough to assume consent and give people the ability to "opt out" and withdraw consent. Others think that these uses should require informed, affirmative, "opt in" consent. – Eight tips about consent for fediverse developers, for @nexusofprivacy@mastodon.social, by @jdp23@blahaj.zone

Eight tips about consent for fediverse developers

@jack@berlin.social has this:

A curated collection of HCI demo videos produced during the golden age from 1983-2002. – Classic HCI Demos

Classic HCI Demos

Learning to program:

Develop fluency in 70 programming languages with our unique blend of learning, practice and mentoring. Exercism is fun, effective and 100% free, forever. … Exercism is an independent, community funded, not-for-profit organisation. – Exercism

Exercism

And now for something completely different: compensation.

TechPays in Europe

levels.fyi

@baldur@toot.cafe writes:

Any executive that has led their company to a situation where they have to lay off 10–20% of their workforce is *by definition* incompetent. – Writing when tech has broken the web’s social contract

Writing when tech has broken the web’s social contract

Programming ARM 32-bit:

This book will teach you enough compiler theory and assembly programming to get going. It uses a subset of TypeScript that reads like pseudocode and targets ARM 32-bit instruction set. – Compiling to Assembly from Scratch

Compiling to Assembly from Scratch

Doom:

I think it might be useful to make available a simple and minimalistic port. One which modifies the original code as little as possible, uses as few dependencies as possible (no large external frameworks) and which can be built without a complex build system. – My easy-to-build DOOM port

My easy-to-build DOOM port

Retro-game development:

The `#retrogamedev` IRC channel at Libera is a friendly place to: ask questions about game development for retro systems; share your projects (including WIP); get inspired in all game development for classic systems! – ​#retrogamedev

​#retrogamedev

History:

There are no computation history classes in school. You can't expect people to always do the work of digging the ancestral past to learn how we got where we are now, but failing to do so creates myths. A lot of people think that ideas that died went away because they were bad, but it's almost never the case. When you start looking into these systems, it's always a social dynamic, or politics that made it so people forgot. – An Approach To Computing And Sustainability Inspired From Permaculture, by @neauoire@merveilles.town

An Approach To Computing And Sustainability Inspired From Permaculture

Go problems:

This fake "simplicity" runs deep in the Go ecosystem. Rust has the opposite problem - things look scary at first, but it's for a good reason. The problems tackled have inherent complexity, and it takes some effort to model them appropriately.

At this point in time, I deeply regret investing in Go.

Go is a Bell Labs fantasy, and not a very good one at that.

Go lets you whip something up quickly, but making the result "production-ready" is left as an exercise to the writer. Big companies that have adopted it have developed tons of tooling around it, use all available linters, do code generation, check the disassembly, and regularly pay the engineering cost of just using Go at all. – I want off Mr. Golang's Wild Ride, by @fasterthanlime@hachyderm.io (2020)

I want off Mr. Golang's Wild Ride

More by the same author

Because there is a lot to like in Go at first, because it's so easy to pick up, but so hard to move away from, and because the cost of choosing it in the first place reveals itself slowly over time, and compounds, only becoming unbearable when it's much too late, this is not a discussion we can afford to ignore as an industry. – Lies we tell ourselves to keep using Golang, by @fasterthanlime@hachyderm.io (2022)

Lies we tell ourselves to keep using Golang

Long term:

In contrast, there is also still a huge world where people don’t appreciate such continuous changes combined with only a pretty good likelihood of things working. Software that controls (nuclear) power plants, elections, pacemakers, airplanes, bridges, heavy machinery. In general, stuff that can kill you if it does the wrong thing, or perhaps simply by not working. -- On long term software development: caring (enough) about the future, by @bert_hubert@fosstodon.org

On long term software development: caring (enough) about the future

Lean:

The really short version: the way we build/ship software these days is mostly ridiculous, leading to 350MB packages that draw graphs, and simple products importing 1600 dependencies of unknown provenance. Software security is dire, which is a function both of the quality of the code and the sheer amount of it. --
A 2024 Plea for Lean Software (with running code), by @bert_hubert@fosstodon.org

A 2024 Plea for Lean Software (with running code)

A shell:

Although developing large software projects isn’t easy, many times the basic idea of that software is quite simple. Implementing it yourself is a fun way to show that you have what it takes to be a real programmer. So, this is a walkthrough on how I wrote my own simplistic Unix shell in C, in the hopes that it makes other people feel that way too. – Tutorial - Write a Shell in C, by Stephen Brennan

Tutorial - Write a Shell in C

Forth is about redefining the problem:

Forth the language captures nothing, it's a moving target. Chuck Moore constantly tweaks the language and largely dismisses the ANS standard as rooted in the past and bloated. Forth is the approach to engineering aiming to produce as small, simple and optimal system as possible, by shaving off as many requirements of every imaginable kind as you can. -- My history with Forth & stack machines, by Yossi Kreinin

My history with Forth & stack machines

Common LISP: The Language, 2nd edition (CLtL2):

The original CLtL2 in high quality typesetting. … The first edition of the book was already out of print, and I believe the second edition was never actually printed since the LaTeX source indicates it is still under revision. – CLtL2

CLtL2

Spell checking:

How do you fit a 250kB dictionary in 64kB of RAM and still perform fast lookups? For reference, even with modern compression techniques like gzip -9, you can't compress this file below 85kB. – How Unix Spell Ran in 64kB RAM, by Abhinav Upadhyay

How Unix Spell Ran in 64kB RAM

Ethics and morals in programming:

This was never about finding better WiFi. We were always finding phones. Phones carried by people. … I was building a tool for the military to find people based on where their phones where, and shoot them. – Don't Get Distracted, by Caleb Hearth

Don't Get Distracted

@ArneBab@rollenspiel.social wrote a 64-page Scheme Essentials book:

This article teaches the core of programming with Guile Scheme. The tutorial starts from scratch and teaches in examples with minimal explanation. It’s core is a map of the minimal functionality you need from Scheme to write meaningful programs. - Naming and Logic (Scheme)

Naming and Logic (Scheme)

Maybe using the smallest possible increments isn't always the answer.

Jeffries, however, does not believe in bigger pictures; his approach to software design is proudly myopic. He prevents himself from seeing the forest by pressing his face against the trees. -- the sudoku affair

the sudoku affair

@onepict@chaos.social writes:

Why would anyone who's not a privileged cis male programmer get involved with your project? Why would folks who have faced abuse in their past volunteer to help you out and take your abuse? -- Some more thoughts on FOSS Sustainability: The community pipeline problem

Some more thoughts on FOSS Sustainability: The community pipeline problem

Makefiles.

They seemed awash with hidden rules and esoteric symbols, and asking simple questions didn’t yield simple answers. To solve this, I sat down for several weekends and read everything I could about Makefiles. I've condensed the most critical knowledge into this guide. Each topic has a brief description and a self contained example that you can run yourself. -- Makefile Tutorial

Makefile Tutorial

The shell.

a foreign function interface for bash -- ctypes.sh

ctypes.sh

@FredBednarski@merveilles.town was "looking for a framework that will make it fun to write some retro inspired game."

Are you a video game enthusiast and want to rediscover the charm of programming the first home computers? With ugBASIC, an isomorphic language inspired by the classic BASIC of the 80s, you can create software for a wide range of 8-bit retrocomputers. – ugBASIC USER MANUAL

ugBASIC

ugBASIC USER MANUAL

A love letter to the CSV format.

A love letter to the CSV format

xan is a command line tool that can be used to process CSV files directly from the shell.

xan

meejah@mastodon.social wrote `git-withme` which allows peer-to-peer Git usage:

I have a Git repository and I want to collaborate with others. We do not have a public server, and do not wish to use existing hosting services. `git withme` provides a way for a single host to invite numerous peers with short, one-time secure codes. The peers connect directly via Dilated Magic Wormhole channels, allowing collaborators to `git clone git://localhost/<repo-name>`. -- Git With Me

Dilated Magic Wormhole

Git With Me

Remember Turbo Pascal, Turbo C, and those Borland IDEs that they came with?

A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support. -- Turbo Vision

Turbo Vision

A use for GPUs:

Anton's observation was that you could drive it with two textures: one texture to determine the geometry of the scanlines and the other to determine their color. Any sources could be used for either texture, allowing the artist to mix and match and experiment. … My contribution … is the observation that texture sources driving the raster geometry and color could come from a live coded system, namely Hydra. My hunch was that this could give you the flexibility and liveness of Hydra with the "plasticity" of the Rutt-Etra on all on modern GPUs, running in the browser. -- Livecoding Scanlines on the GPU , talking about DiMattina

Livecoding Scanlines on the GPU

DiMattina

@smonff@rivals.space talks about writing an app for photo management:

The combination of Mojolicious::Lite, Yancy (the Django for Mojolicious) and Mojo::SQLite makes building that kind of thing so easy. It’s barely lines.

@ratfactor@mastodon.art writes about small programs and the small implementations of programming languages:

I know I’m not alone in seeing the appeal of tiny Forths, tiny languages, tiny programs, and just small stuff in general. What’s up with that, anyway? – Small Programs and Languages, Dave Gauer

Small Programs and Languages

@timbray@cosocial.ca writes:

Unicode:
1. RFC 9839, a guide to which Unicode characters you should never use;
2. a blog post with background and context, RFC 9839 and Bad Unicode;
3. a Go library that implements 9839’s exclusion subsets.

RFC 9839

RFC 9839 and Bad Unicode

a Go library

Most projects have just one maintainer.

A project exists called ecosyste.ms that catalogs a lot of open source. … They currently have 11.8 million open source projects in their data. … 7 million open source projects are one person. … About half of the 13,000 most downloaded NPM packages are ONE PERSON. -- Open Source is one person, by Josh Bressers, for Open Source Security

Open Source is one person

Don't be a partner in crime!

At that point, if he wanted to avoid being an accomplice to potentially illegal activity, his options were: 1. Talk to a lawyer on how to avoid assisting a crime. 2. Turn whistleblower. … 3. Quit the company, ensuring he did not further aid this activity. … If you take one lesson from this, it’s that you can always say no. -- Asked to do something illegal at work? Here’s what these software engineers did, by Gergely Orosz, for The Pragmatic Engineer

Asked to do something illegal at work? Here’s what these software engineers did

Workslop, as described by @gfxstrand@treehouse.systems:

If you submit the merge request, you're responsible for the code change as if you typed it yourself. You don't get to claim ignorance and "because the AI said so". It's your responsibility to do due diligence to make sure it's correct and to accurately describe the change in the commit message. -- Mesa is working to update our contributor guide. Can you guess why?, by Faith Ekstrand

Mesa is working to update our contributor guide. Can you guess why?

Something like Forth?

Factor is a concatenative, stack-based programming language with high-level features including dynamic types, extensible syntax, macros, and garbage collection. It has a full-featured library, supports many different platforms, is fully compiled for performance, while still supporting interactive development.

Factor

Scripting inside Go? That does sound enticing.

Written in Go, Rye doubles as a scripting companion for Go programs. Go's libraries integrate seamlessly, and Rye can be embedded as a scripting or config language for Go programs. As a high-level language, Rye explores bridging coding and user interfaces. Its interactive console features syntax highlighting, history, tab completion, and tools to explore the language and environment you’re crafting. -- Rye

Rye

Get rich?

And that’s when the problems that we were trying to solve switched from “what do people need” to “I’m not rich yet.” … But when I think back to myself at the start of my career, and the things that pulled me towards this industry, I don’t see myself making that same decision if I were making it now. This is not a place of honor. … Capitalism is not a system of honor … this industry is not a place of honor. These are not people of honor. -- How to grow strawberries, by Mike Monteiro

How to grow strawberries

I have never tried Ada.

What Ada demonstrates is not that it should be more widely used — though the argument for its use in any domain where software reliability matters is stronger than the industry credit it receives — but that the problems modern language design is solving are old problems, and that the solutions modern languages are discovering are old solutions. – The Quiet Colossus

The Quiet Colossus