This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; source https://github.com/woodrush/sectorlisp-examples/blob/main/lisp/basic.lisp | |
; Common Lisp translation: [email protected], 2022 | |
; https://gist.github.com/lispm/a2f56a1a6dc5599a039eb7134d99cd4a | |
(defun basic-example () | |
(BASICINTERPRETER | |
(QUOTE ( | |
(10 REM FIND AND PRINT PRIME NUMBERS BELOW N_MAX. ) | |
(20 LET N_MAX = (1 1 1 1 1 1 1 1 1 1 1 1 1 1 1) ) | |
(30 LET I = (1 1) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS=-std=c99 -pedantic -Wall -Werror | |
.PHONY: run forth | |
run: forth | |
./forth test.fs | |
forth: forth.c | |
$(CC) $(CFLAGS) -o forth forth.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <assert.h> | |
FILE *in; long M[1<<24]={0}, *D, *R, H=0x130000, IP=0, T; | |
long getu() { long t, h = getc(in); if (h < 0xC0) return h; | |
t = ((h&0x1F) << 6) | (getc(in) & 0x3F); if (h < 0xE0) return t; | |
t = ( t << 6) | (getc(in) & 0x3F); if (h < 0xF0) return t; | |
t = ( t << 6) | (getc(in) & 0x3F); return t & 0x1FFFFF; } | |
void putu(long c) { if (c < 0x80) { putchar(c); return; } | |
if (c < 0x7FF) { putchar(0xC0|(c>>6)); } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tiny FORTH by T. NAKAGAWA 2004/07/04-10,7/29,8/5-6 | |
/* | |
Tiny FORTH | |
Experimental Forth for Arduino | |
T. Nakagawa | |
2004/07/10 | |
*/ | |
#include <stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SIMPL | |
// A Serial Interpreted Minimal Programming Language | |
// Inspired by Txtzyme - by Ward Cunningham | |
// Ken Boak 2013 - 2016 | |
// Filename simpl_2015_32bit_list8 | |
// Requires UART routines - compiles on Arduino 1.04 | |
// This is the slim version of simpl that removes all of the Arduino specific routines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Tiny FORTH | |
; T. NAKAGAWA | |
; 2004/08/02-05 | |
; Additional comments by Ken Boak Jan 2016 | |
; Register | |
; r0: temporary | |
; r1-15: input buffer (terminated by 0x00, separated by 0x20) | |
; r16: temporary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Very Tiny Language T. Nakagawa 2004/05/23 2004/06/26 | |
#include <uart.h> | |
#include <avr/io.h> | |
#define F_CPU 16000000UL // define the clock frequency as 16MHz | |
#define BAUD 115200*2 | |
#include <util/setbaud.h> // Set up the Uart baud rate generator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ded | |
"Structural Data EDitor for Clojure with zippers. Inspired by Interlisp: http://larry.masinter.net/interlisp-ieee.pdf" | |
(:require [clojure.zip :as z]) | |
(:use [clojure.pprint :only (with-pprint-dispatch code-dispatch pprint)] | |
[clojure.repl :only (source-fn)])) | |
(defn print-hr | |
"Prints 30 dashes and a newline." | |
[c] | |
(println (apply str (repeat 30 c)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns com.manigfeald.http2.cont) | |
(defn bind% [m f] | |
(fn [kont bundle] | |
(m (fn [value] ((f value) kont bundle)) bundle))) | |
(defmacro return% [value] | |
`(fn [kont# bundle#] | |
((try | |
(let [v# ~value] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* | |
* A minimal Forth compiler in C | |
* By Leif Bruder <[email protected]> http://defineanswer42.wordpress.com | |
* Release 2014-04-04 | |
* | |
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
* | |
* PUBLIC DOMAIN | |
* |