Skip to content

Instantly share code, notes, and snippets.

View conartist6's full-sized avatar

Conrad Buck conartist6

  • Boulder, CO
View GitHub Profile
@conartist6
conartist6 / 1.log
Last active April 14, 2025 11:22
BABLR `/[--]/` parse log
>>> init('https://bablr.org/languages/core/en/bablr-regex-pattern')
>>> startFrame('eat', m`< />`, {})
>>> advance(t`<!0:cstml { bablrLanguage: 'https://bablr.org/languages/core/en/bablr-regex-pattern' }>`)
>>> advance(t`<$_>`)
--> `@bablr/fragment`
>>> eat(m`<$'https://bablr.org/languages/core/en/bablr-regex-pattern':Pattern />`)
>>> advance(t`.:`)
>>> startFrame('eat', m`.: <$'https://bablr.org/languages/core/en/bablr-regex-pattern':Pattern />`, { bind: false, allowEmpty: false })
>>> advance(t`<$'https://bablr.org/languages/core/en/bablr-regex-pattern':Pattern>`)
--> Pattern
@conartist6
conartist6 / index.js
Last active March 18, 2025 18:36
Text-only sumtree
import { buildModule, defaultNodeSize } from '@bablr/btree/enhanceable';
const { isArray } = Array;
const { freeze } = Object;
const LiteralTag = Symbol.for('LiteralTag');
export { defaultNodeSize };
export const {
@conartist6
conartist6 / post.md
Last active January 20, 2025 13:30
Dear Steve Yegge

Dear Steve Yegge,

In a recent blog post you wrote about your certainty that anyone not using LLMs to do their heavy lifting will be left behind.

I would like to make a counterproposal. It is you who will be left behind, and in fact you already have been. For one thing it seems like you no longer know how to write. Your post was a ramble. To people who have made insightful and incisive commentary you have responded with blather. Instead of optimism you now preach cynicism, and I can't help but think you don't even believe it yourself judging by the half-heartedness of your rhetoric. Your worthless blog post didn't even bother to address its own central question: how could a business possibly survive when it ceases to invest in its human element?

Instead of empowering people with literacy and expression you now believe in making them drones who are helpless without a machine to think for them. Instead of valuing the deeply intertwined relationship between creativity and hard work you now believe that the per

@conartist6
conartist6 / index.md
Last active September 7, 2024 20:19
Semver-0 proposal

0-based Semantic Versioning 0.0.0

Summary

0-based semver is a valid subset of Semver 2.0.0 where version numbers look like (for example) 0.24.1. 0-based semver also uses this specification to govern its own versions.

Given a triplet version number in the format X.Y.Z:

  1. X must always be 0
  2. The first initial development version of a package should be 0.0.1
@conartist6
conartist6 / index.js
Created August 22, 2024 15:53
Grammar no-compile example
import { i, re } from '@bablr/boot';
import { buildNumber } from '@bablr/agast-vm-helpers';
import * as Space from '@bablr/language-en-blank-space';
export const dependencies = { Space };
export function* eatMatchTrivia() {
if (yield i`match(/[ \t\r\n]/)`) {
return yield i`eat(<#*Space:Space>)`;
@conartist6
conartist6 / index.js
Last active August 13, 2024 20:54
JSON grammar with hoisting
import { readFileSync } from 'node:fs';
import { streamParse, Context, AgastContext } from 'bablr/enhanceable';
import { evaluateReturnAsync } from '@bablr/agast-helpers/tree';
import * as language from './z_2.json.grammar.fast.js';
import { buildFullyQualifiedSpamMatcher } from '@bablr/agast-vm-helpers';
const input = readFileSync(`${import.meta.dirname}/z_3_fixture.json`, 'utf-8');
const matcher = buildFullyQualifiedSpamMatcher({}, language.canonicalURL, 'Expression');
const ctx = Context.from(AgastContext.create(), language);
@conartist6
conartist6 / index.cstml
Last active August 5, 2024 15:48
CSTML JSON example: [1, true, "3"]
<!0:cstml bablr-language='https://github.com/bablr-lang/language-json'>
<>
<Array>
openToken:
<~*Punctuator '[' balanced=']' />
elements[]:
<Number span='Number'>
wholePart:
<Integer>
digits[]:
@conartist6
conartist6 / index.js
Last active July 23, 2024 03:02
BABLR for globbing mockup (public domain)
import { test as nonbacktrackingTest } from '@bablr/regex-vm';
import * as bablrLanguage from '@bablr/language-regex-vm-pattern';
import { buildTag } from 'bablr';
import { printCSTML } from '@bablr/agast-helpers/tree';
const re = buildTag(bablrLanguage, 'Pattern');
const weakMemo = (fn) => {
const cache = new WeakMap();
return (arg) => {
@conartist6
conartist6 / index.cstml
Last active November 22, 2024 13:10
Lithuanian CSTML for [1, 2, 3] courtesy of auris
<!0:cstml bablr-language='https://github.com/bablr-lang/language-json'>
<>
<Masyvas>
atidarymoŽymė: <*SkiriamasisŽenklas '[' atitinkantis=']' />
#: <*Tarpas:Tarpas '\n ' />
elementai[]: []
elementai[]:
<Skaičius apimtis='Skaičius'>
sveikojiDalis:
<Sveikas>
@conartist6
conartist6 / 01.index.js
Last active May 20, 2024 02:51
Concurrent buffering
// Utils
const buildDeferred = () => {
const d = {};
d.promise = new Promise((resolve, reject) => {
d.resolve = resolve;
d.reject = reject;
});
return d;
}