27 Dec 24
If I want to see my terminal I need to either make my browser or code window smaller. I could use cmd+tab or the mouse to switch to my terminal but these options are annoying. cmd+tab always seems to go to the wrong app, and mission control involves reaching for the mouse or track pad which is often a nuisance.
A lightweight macOS window and app manager scriptable with JavaScript. You can also easily use languages which compile to JavaScript such as TypeScript. Phoenix aims for efficiency and a very small footprint. If you like the idea of scripting your own window or app management toolkit with JavaScript, Phoenix is probably going to give you the things you want. With Phoenix you can bind keyboard shortcuts and system events, and use these to interact with macOS.
30 Nov 24
In practice, the only thing that makes web experiences good is caring about the user experience — specifically, the experience of folks at the margins. Technologies come and go, but what always makes the difference is giving a toss about the user.
27 Sep 24
A blog post about a few ways to optimize looping constructs in javascript. Includes an interesting conversation about reverse while loops, and using hash tables instead of arrays.
02 Sep 24
React dot JS, or simply “reaked”, is a not inconsiderable amount of JavaScript, written by some self-styled engineers, to help a website called Facebook undermine democracy, foment genocide, and do whatever else is needed to sell virtual advertising space…
React is useful for making complex interfaces like Facebook’s or for making otherwise simple interfaces, and their underlying codebases, complex like Facebook’s. Rendering the text “hello world” without React requires one text editor and exactly 11 bytes of code. Doing the same with React, via the popular “create-react-app” command line interface, requires over 200MB of Node modules. The continual maintenance and expert calibration needed to run a React application has created a thriving job market.
06 Aug 24
Now to be fair, I’ve dunked on shadow DOM a bit in the past myself… such as when it’s used as a container for piles of JavaScript-generated HTML that would be better off in the page from the start. But the more I’ve worked with web components, the more I’ve come to see that shadow DOM (and slots in particular) may still play an interesting role in the HTML Web Components story.
05 Aug 24
For years now, though, I’ve been using Tachometer for most browser-based benchmarks. It’s featured in this blog a few times, although I’ve never written specifically about it. Tachometer doesn’t make benchmarking totally foolproof, but it does automate a lot of the trickiest bits. What I like best is that it:
12 Jan 24
Minimalistic zero dependency Jest-like test library to run tests in browser, nodejs or deno
05 Sep 23
Juno is a self-hosted Lisp dialect that compiles to JavaScript. It combines fast execution and ease of use with features such as a macro facility modeled on Common Lisp and the ability to save and restore the running image. Juno provides a Lisp computing environment for JavaScript platforms: the browser, Deno or Node (ala V8), or similar, without requiring any dependencies except the JavaScript container itself.
14 Jul 23
Ohm is a parsing library for JavaScript, which was created at HARC to support our programming language research. We think of it as a language implementation toolkit that lets you quickly prototype new languages and experiment with extensions to existing languages. You can use Ohm to parse custom file formats or quickly build parsers, interpreters, and compilers for programming languages.
12 Jul 23
A pretty slick javascript implementation of Conway’s life:
The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead, or “populated” “unpopulated”. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent.
01 Jul 23
So you have a demo in JS. It’s pretty. It’s perfect. It’s 3k in a 1k competition. Well, damn.You start with the obvious and run it through a minifier and you shorten all your variable names to a single character, you get it to 2500 bytes. Great, that’s progress, but you’ve still got 1476 bytes to go. You merge some functions together, fold a couple loops into each other, and soon you’re at 2200 bytes. Long way to go.Rule
29 Mar 23
RetroV (pronounced “retro vee”) is a virtual DOM (VDOM) rendering library. It is “vanilla” JavaScript, browser-native, and has no dependencies or build system.
14 Mar 23
Our application will be a pixel drawing program, where you can modify a picture pixel by pixel by manipulating a zoomed-in view of it, shown as a grid of colored squares. You can use the program to open image files, scribble on them with your mouse or other pointer device, and save them.
I implemented this, here https://eli.li/_assets/bin/pixel/
13 Mar 23
The age of frontend JavaScript frameworks eating the web world didn’t happen simply because some well-meaning developers found great DX. It happened because we were fed a line.
08 Mar 23
Here is my preferred take on the “post to linkhut” bookmarklet. It snags the selected text as the post’s description, and prompts you to enter some tags.
Val Town is a delightful place to code online.
If you’re new here, the fastest way to learn what Val Town is about is watching the Demo video. You can also explore what others are making, join our Discord, and of course, sign up to make your own vals for free. We’re ridiculously friendly, so don’t be shy. See you around the town!
03 Mar 23
Dak is a Lisp like language that transpiles to JavaScript.
24 Feb 23
OS X Yosemite introduced JavaScript for Automation. This makes it possible to access native OS X frameworks with JavaScript. I’ve been digging in to this new world and putting together examples along the way. In this post I’ll explain the basics and step through building a small example app.