Skip to content

Instantly share code, notes, and snippets.

@Kroc
Kroc / 1-pling.md
Last active August 7, 2023 21:19
Pling!

Pling!

A nice looking functional, concatenative programming language for minimal systems.
By Kroc Camen.

  • Simple left-to-right push-down parser. No look-ahead!
    Intended for assembling & execution on very constrained systems
  • Easy to tokenise: anything separated by spaces is a "function"

Comments:

@Kroc
Kroc / web0.md
Last active August 25, 2023 23:29
A web-page specification for computers that predate the World Wide Web

Web0; A Specification -- DRAFT

Web0 ("web zero") is a World Wide Web for computers that pre-date Web 1.0.

Web0 is intended for 8-bit computers; newer machines can participate, but the spec is designed around a baseline of 8-bit hardware. This is because, whilst most 16-bit computers already have web-browsers that can be fed basic HTML through a proxy service such as http://frogfind.com, few 8-bit systems have browsers and struggle with even simple HTML due to assumptions in the design of HTML itself.

INCOMPLETE, DRAFT DOCUMENT

File all suggestions / complaints to kroc@camendesign.com

@Kroc
Kroc / gist:5f2ae65e3938259c9c1945100ae00d98
Created June 21, 2021 10:38
A shortlist of Inform6/PunyInform actions you can use in your games and what strings invoke them
! Answer: "answer"/"say"/"speak" X "to" Y
! "shout"/"scream"/"yell" X "to" Y
! Ask: "ask" Y "about" X
! AskFor: "ask" Y "for" X
! AskTo: "ask" Y "to" X
! "ask" "that" Y, X
! "tell" Y "to" X
! Attack: "attack"/"break"/"crack"/"destroy"/"fight"/"hit"/
! "kill"/"murder"/"punch"/"smash"/"thump"/
! "torture"/"wreck" X ("with" Y)
@Kroc
Kroc / opcodes_z80.c
Created February 5, 2019 15:32
WLA-DX Z80 opcodes with shadow registers (AF', BC', DE', HL')
/* the Z80 has a set of shadow registers A', F' (technically AF'),
BC', DE' & HL'. the `ex` instruction swaps A & F with A' & F',
whereas the `exx` instruction swaps BC, DE & HL with BC', DE', HL'
therefore, note that A & A' can be used independenly of
BC, DE, HL & BC', DE', HL', but BC, DE, HL cannot be mixed
with BC',DE',HL'
*/
struct optcode opt_table[] = {
{ "ADC A',A'", 0x8f, 0, 0, 0 },
@Kroc
Kroc / petspec.md
Last active September 11, 2018 20:50
A proposed image format specification for 8-bit Commodore computers.

Introduction

Version 1.0; 10-SEP-2018.

With the introduction of new tools for the development of Commodore 64 art on modern systems, there has arisen a need for a universal standard image format for the storing and transferring of Commodore image formats between programs, including original hardware.

This specification proposes just such a format that is simple to understand, simple to parse -- even on original hardware -- and simple to implement.

What Exactly is Commodore "art"?

@Kroc
Kroc / .editorconfig
Created May 5, 2016 13:02
My <editorconfig.org> file
# ".editorconfig" is the best attempt at a standard we've had so far for
# specifying portable settings in text-editors; some editors support this out
# of the box, many have plugins -- see the website for details:
# <editorconfig.org>
#===============================================================================
# LICENSE: I assert no copyright on this file at all,
# it should be considered within the Public Domain
@Kroc
Kroc / assembler.txt
Last active December 31, 2015 05:29
A proposal spec for a new assembler script language / syntax.
A specification for a new assembly script language [v0.05] -- Work in Progress
=======================================================================================
This document copyright Kroc Camen 2013
Licenced under Creative Commons Attribution 3.0
i. Goals:
=======================================================================================
:: Accessible
The primary goal is to educate others and preserve code for the future.
The purpose of this new assembler language is to be readable, obvious, more
@Kroc
Kroc / gist:3551351
Created August 31, 2012 10:41
Kroc's Transliteration Method
//safeTransliterate v3, copyright (cc-by 3.0) Kroc Camen <camendesign.com>
//generate a safe (a-z0-9_) string, for use as filenames or URLs, from an arbitrary string
function safeTransliterate ($text) {
//if available, this function uses PHP5.4's transliterate, which is capable of converting arabic, hebrew, greek,
//chinese, japanese and more into ASCII! however, we use our manual (and crude) fallback *first* instead because
//we will take the liberty of transliterating some things into more readable ASCII-friendly forms,
//e.g. "100℃" > "100degc" instead of "100oc"
/* manual transliteration list:
-------------------------------------------------------------------------------------------------------------- */
@Kroc
Kroc / domtemplate.php
Created January 4, 2012 14:55
DOM Template Class
<?php
//DOM Templating classes v7 © copyright (cc-by) Kroc Camen 2012
//you may do whatever you want with this code as long as you give credit
//documentation at http://camendesign.com/dom_templating
class DOMTemplate extends DOMTemplateNode {
private $DOMDocument;
private $keep_prolog = false;