Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Lisping in the mountains.

Minori Yamashita ympbyc

💭
Lisping in the mountains.
View GitHub Profile
@ympbyc
ympbyc / cl-sdl2-render-image.lisp
Last active January 27, 2023 04:50
Load and draw image with CL-SDL2
View cl-sdl2-render-image.lisp
;; Example use of CL-SDL2
;; Loads Sequentially named PNG image files in "(project-folder)/resources/images" and lay them out
(in-package #:mini-example)
(require :sdl2)
(defun collect-textures (renderer directory)
(loop for i from 10 downto 1
collect
View R1-on-S2-in-R3.txt
The steel needle cuts through the hills sawing together the cool night.
The needle propells along the curve around the hill.
Sudden light the color of cream shines hard on the silver steel.
Rising moon with bright smokey ring hang low above montains.
The steel maintains momentum and sings in visible frequency.
The sky cassies the disk away in exchange for the light-emitting vertices.
2-sphere has a 3-sky. Does the 3-space have a 4-sky?
@ympbyc
ympbyc / replacer.lisp
Last active May 5, 2020 17:21
html/xml batch structural replacer
View replacer.lisp
(defpackage :replacer
(:use :cl :plump :clss))
(in-package :replacer)
(defun slurp (path)
(with-open-file (stream path)
(let ((data (make-string (file-length stream))))
(read-sequence data stream)
data)))
@ympbyc
ympbyc / emacs-biwa.el
Last active May 18, 2020 01:55 — forked from BilalQadri/emacs-biwa.el
Biwascheme from Emacs (with repl)
View emacs-biwa.el
;; Initialize Biwascheme interpreter on frontend(browser) then send and receive expressions with websocket client
;; INSTALL websocket.el, LOAD this file and RUN interactive function `load-ws` from Emacs
;; ws-close to close server
;; send expression (e.g functions) to browser with `C-c C-s` ... Tip# cursor should be on function name
(require 'websocket)
(require 'scheme)
(defun biwa-start ()
(interactive)
;(load-file "~/.emacs.d/websocket.el")
@ympbyc
ympbyc / forth.ny
Last active November 29, 2019 05:31
linear programming language
View forth.ny
;;;;;;;;; Forth a la Let over Lambda ;;;;;;;;
(defvar forth-registers
'(pstack rstack pc dict compiling dtable))
(defun sym (&rest strs)
(intern (string-upcase (apply #'strcat (mapcar #'string strs)))))
(defmacro defstruct (name &rest slots)
(let ((n -1))
@ympbyc
ympbyc / universal-lisp-transpiler.lisp
Last active September 14, 2019 06:38
[sketch] tools to write transpilers from sexpr to Blub languages. For when you are in the direst situation.
View universal-lisp-transpiler.lisp
;;[sketch] tools to write transpilers from sexpr to Blub languages.
;;For when you are in the direst situation.
;; copyleft Minori Yamashita
(defpackage :ult
(:use :cl))
(in-package :ult)
(defpackage :ult-symspace)
@ympbyc
ympbyc / pieces-biwa.scm
Last active June 30, 2021 12:46
BiwaScheme glue functions
View pieces-biwa.scm
;;;;;;;;;;;;;;;;;;;;;
;;; generic utils ;;;
;;;;;;;;;;;;;;;;;;;;;
(print "loading generic utils")
;;convenient shorthand for lambda (^ (x) x)
(define-macro (^ params . expr)
`(lambda ,params ,@expr))
;;normalize parameter list e.g. (x), xs, (x . xs) into (x), (xs), (x xs)
@ympbyc
ympbyc / tech-memo.txt
Last active August 12, 2019 21:24
Memo on making a minimally viable workstation
View tech-memo.txt
Tech Memo on Minimaly viable work environment
=============================================
Essentials
----------
+ w3m
+ fb-messenger-cli (use with M-x term then M-x mozc-mode)
+ emacs-mozc-bin -- japanese input
@ympbyc
ympbyc / slime-external-timeout.el
Last active March 13, 2019 18:03
Every n seconds check if slime repl is actively updated. if not, interrupt and call a restart that gives up on current operation that's causing the hangup e.g. sockets
View slime-external-timeout.el
;; every 60 seconds check if slime repl buffer has been updated
;; if not intterupt and call restart-1
;; which should abort whatever is causing the hungup and continues
(defvar *slime-repl-last-output* "")
(defvar *slime-repl-watchdog-timer* nil)
(defun handle-sldb-restart ()
(sldb-invoke-restart-1) ;; change here
(message "Invoked restart-1 upon detecting a hungup."))
@ympbyc
ympbyc / .TalkingLisps.md
Last active February 19, 2019 18:12
Talking REPL. Experimental interaction of different Lisp implementations. In this case CL, elisp and Scheme.
View .TalkingLisps.md

Talking Lisps

My lisp terminal

This is a sketch illustrating dynamic interactions between three different implementations of Lisp.
Common Lisp, Emacs Lisp, and an very old Scheme are engaged in a conversation and producing a very crude talking REPL.

It's by no means complete nor useful at this point but it's a good starting point.