Skip to content

Instantly share code, notes, and snippets.

View crcx's full-sized avatar

Charles Childers crcx

View GitHub Profile
Image:
- metacompiler (no more dependency on toka)
- dropped unneccesary padding following conditionals
- smaller initial image
- added:
- "later" - defer execution until caller completes
- "pow" - power function
- "r" - get copy of TORS
- "eval" - interpret string
: :create ( $- )
push :: save string pointer
here last dup @ , ! :: start new header, pointing to here
['] .data , :: class of .data
here 0 , :: xt = 0 (patched later)
pop dup getLength here :: get length of string, setup for copy
swap dup allot :: but first, allocate space for the name
copy 0 , :: copy name to allocated space, terminate string properly
here swap ! ; :: go back and patch the xt to point to here
@crcx
crcx / commentary.retro
Created December 13, 2009 14:45
Refactoring of contrib_comnmentary.retro
Original by docl:
{{
variable tmp
: nf whitespace dup @ tmp ! off ;
: rf tmp @ whitespace ! ;
---reveal---
: ::: nf 10 accept rf ;
}}
@crcx
crcx / later.rst
Created December 13, 2009 14:56
On the use of later

One of the more interesting flow control words in Retro is later. This is a word that returns control to the caller, then regains control when the caller is finished.

A simple example:

: test ( - ) 1 . later 2 . ;
: b ( - ) test 3 . ;

Run b, and you should see:

@crcx
crcx / REM.rst
Created December 20, 2009 00:50
Notes on using REM

Retro Editor for Mortals

Author: Charles Childers
Version: 2009.12.20

REM User's Guide

@crcx
crcx / RetroLanguage.txt
Created December 20, 2009 01:17
A Guide to the Retro Language
The Retro Language
==================
:Author: Charles Childers
:Version: 10.3 (20091212)
===========================
Section 1: Welcome to Retro
===========================
@crcx
crcx / rem2.retro
Created December 20, 2009 15:54
start of new rem
This is the start of a re-implementation of REM, intended to eliminate the huge conditional block and make adding new commands easier. (The existing REM works well, but suffers from a lack of visibility since everything is literally enclosed in a single scoped block. This core should be easier to factor and makes adding new commands possible after REM is loaded.)
variable rem:l ( line )
variable rem:c ( column )
: $$i rem:l -- ; ( i = up )
: $$j rem:c -- ; ( j = left )
: $$k rem:l ++ ; ( k = down )
: $$l rem:c ++ ; ( l = right )

Block Conversion

Author: Charles Childers
Version: 2009.12.21

Blocker User's Guide

@crcx
crcx / code_style.rst
Created December 22, 2009 14:40
Code Style in Retro

Code Style in Retro

Author: Charles Childers
Version: 2009.12.22

Choosing Names

This is probably the most important. I'll just say:

Overview

RxWeb is an attempt to develop a framework for building small websites and applications using Retro.

Requirements

  • Linux, BSD, or MacOS X
  • Perl (to run the www-server)