Skip to content

Instantly share code, notes, and snippets.

@nfunato
nfunato / alisp-clisp.md
Last active July 8, 2026 00:44
GNU alisp and clisp -- conversation with Gemini (July 5, 2026)

GNU alisp -- conversation with Gemini (July 5, 2026)

alispについて聞いていたら、思いがけずclispにまで話が及んだので、記録として貼り付けておきます。 基本的に眉唾で読むべきでしょうが、検索のとっかかりにはなるのかも。

最近(ここ半年から数ヶ月の間くらい)、GeminiはかってのChatGPTのようにおべっかを使う傾向が高まった気がします。一方、ChatGPTはおべっかを抑えるようになりましたが、対話者の人格を特定したがるようになってきている気がします。私はおべっかも人格特定も除外してクールにやって欲しい方ですが。

Q01

alisp (https://github.com/GitMirroring/alisp) は、少し特異なファイル編成(ソースコードのファイルがほぼ3つしかない)ですが、vibe coding の恩恵をどの程度受けているのでしょうか?GPLだそうですが、copyrightは2022以降ということになっています。

@nfunato
nfunato / robots.forth
Last active April 13, 2024 18:35
Robot game in FORTH
anew =============================robots=============================
\ refactored the following a bit
\ https://gist.github.com/nfunato/39490e1e5d41a9a2d8b0f614a46feeea#file-02a_robots-fs
\ -------------------------------------------------------------------
\ General utils
: not ( v -- f ) 0= ;
: 3dup ( a b c -- a b c a b c ) dup 2over rot ;
;; based on https://marui.hatenablog.com/entry/2022/12/13/222030
(defun mapfn-into (arr fn &rest args)
(loop for i below (array-total-size arr)
do (setf (row-major-aref arr i) (apply fn args))
finally (return arr)))
(defun box-muller-random-sampling ()
"Return a pair of independent, standard, normally distributed
(zero expectation, unit variance) random number, using a random
  • 01_robots.lisp
    古典的Robot Game.
    本(Land of Lisp)にあるオリジナル(http://landoflisp.com/robots.lisp) は、
    わずか42行の圧縮気味のコードなのを、読みやすく refactorしたもの.

  • 02a_robots.fs, 02b_prelude.fs
    上記 01_robots.lisp を GForthに移植したもの.

  • 04_robots.go

;;; dunm.scm
;;; - cwd傘下のnode_modulesディレクトリのdisk usageを調べる
;;; - usageに基づいて、(確認後に)消せるようにする
;;; (report-stats [#f])
;;; (report-stats #t)
;;; 傘下のnode_modulesディレクトリのdisk usageをプリントする。
;;; arg1が#fのときは、1ヶ月以上アクセスしていないもののみを対象とする。
;;; 結果の情報は、変数 *result* に格納されている。
@nfunato
nfunato / fizzbuzz.fs
Last active July 2, 2022 10:59
お嬢FORTH on top of GFORTH
\ FizzBuzz in OJ-FORTH ( on top of GFORTH )
include oj-forth.fs
\ FORTHには、ほぼ文法が無い(ワードしかない)ということがよく分かると思う
\ なお以下の例で使っているワード 「を」 「まで」 「から」 は、純粋に飾り(NOP)である
わたくし で割り切れるの ( i n -- b )
mod 0=
と定義しましてよ
@nfunato
nfunato / ColorProvider.tsx
Last active June 14, 2022 00:28
about typing react18 context object in typescript
import React, { createContext, useState, FC } from "react";
import uuidv4 from "uuidv4";
import { getInitialColorDataList } from "./ColorDataList";
export type ColorDataTyp = {
id: string;
title: string;
color: string;
rating: number;
};

Revision History

このgist entryには、 ここ(zenn) にある記事の参照用コードが含まれています。

内容

\ a study of github.com/robertpfeiffer/forthsnake, although essentially the same
include random.fs \ the only line depending on GFORTH
: not ( b -- b ) 0= ; \ changed since the def. in the original means INVERT
: myrand ( fr to -- r ) swap dup >r - 1+ random r> + ; \ random at [fr,to]
200 constant snake-size
50 constant xdim
20 constant ydim
create snake snake-size cells 2* allot does> swap snake-size mod cells 2* + ;
------------------------------------------------------------------
以下の翻訳文は、Felix Winkelmann の Thoughts on Forth Programming
(http://call-with-current-continuation.org/articles/forth.txt) の
翻訳であり、原著者の許可を得て公開するものです。
2021-09-01 Nobuhiko FUNATO (nfunato @ acm . org)
更新履歴:
2021-09-02(rev10): Shiro Kawaiさんにご指摘いただいた誤訳訂正/改善を反映
2021-09-02(rev09): 公開初版
------------------------------------------------------------------