med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

312
active users

#scheme

10 posts9 participants0 posts today

I joined a game jam. Why do i do this to myself?

Yes, a deadline helps push you, but do I really need more stress? 😂 And it's for LISP ???!

I'm using Scheme. The clever people at Spritely Institute have developed a system for running Scheme in a web browser, which, is amazing. But I've had to create my own animation libraries for it, which is even more punishment.
We'll see how it goes. 6 days left.

itch.io/jam/autumn-lisp-game-j
spritely.institute/
bonthron.itch.io/

itch.ioAutumn Lisp Game Jam 2025A game jam from 2025-10-31 to 2025-11-17 hosted by David Thompson & technomancy. Lisp Game Jam is a recurring game jam taking place for a full 10 days. After the jam has finished, 7 days are given to everyone to try out the game su...
Continued thread

Hard stuff is easy. Easy stuff like reading/writing data files is hard.

My usual functions for this are R6RS, which has nice handling of exceptions and text encodings.

Kawa has R7RS-like shitty I/O, Scheme `guard` is given no information, so I have to use Kawa's `try-catch` Java hack. read/write/write-string work as expected. No get-string-all, instead this bullshit:

For the Autumn #Lisp #GameJam I am tempted to implement a game of Minesweeper in Virtuoso Schematic Editor.

Now, what I really need is plausible-sounding reasons for (1) spending R&D time on this and (2) uploading it to our support site as an app note...

Often I feel quite stupid, but occasionally I manage to do something mildly clever and then I feel a little better about myself.

Today, I figured out that extending the R6RS body expansion algorithm to allow definitions and expressions in any order was much easier if I:

1. Look for definitions from left to right.
2. Assemble the resulting letrec* from right to left.

Continued thread

Thanks to great hints from @mnemenaut and @adamhume, I managed to write what appears to be a usable macro expander for #Scheme function bodies!

This is literally the furthest I've got with writing an improved SKILL++ expander, despite a few attempts in recent years.

I'm not quite at the point where the expander can successfully expand itself, but it's within sight, which is quite exciting.

I need to implement define-syntax, then the next big challenge is going to be hygienic expansion.

It occurs to me that the coolest retrocomputing project possible would be a Scheme interpreter for my TRS-80 Model III. It appears no one has done it.

This would involve:

* Finally learning to love Z-80 Assembly Language
* Digging up my copy of "Structure and Interpretation of Computer Programs"
* A year of free time

... That last one is tricky #scheme #programming #trs80 #retrocomputing

Fellow #guile #scheme + #guix hackers. Recently I've been busy with #wayland bindings library for guile scheme. I've adopted it after original author disappeared (removed or renamed the account from codeberg, was unreachable via git email)

It was guix-unpacked, had few small guile bugs and was not able to handle "new_id" events (when event callback returns new protocol of type).

It's all fixed now. Enjoy & report if I've missed something

codeberg.org/shegeley/wayland-

Summary card of repository shegeley/wayland-scm, described as: a r7rs scheme library implementing the wayland protocol
Codeberg.orgwayland-scma r7rs scheme library implementing the wayland protocol
Continued thread

I am having difficulty getting my head around the correct algorithm for compiling a #Scheme body.

You have to look ahead to find all the definitions, in order to establish the lexical environment for expanding the init forms of those same definitions.

Also, some definitions may be created by macro transformers, and some init forms may contain definitions:

(define x (begin (define y 69) 420))
(list x y)
--> (420 69)

It feels like a chicken-and-egg problem.

I just discovered that SKILL++ compiles body definitions like `let*` instead of like `letrec*`.

No way! 🤯 That explains several weirdnesses I came across in recent testing.

Also, yet another non-conformance with RnRS for me to worry about…

I implemented #Scheme SRFI-16 case-lambda for SKILL & SKILL++. Thoughts:

- In a Scheme where each function is checked against its arguments when invoked, case-lambda really benefits from being a fundamental function type
- It's hard to produce helpful errors when no clause matches the argument list, especially when keyword parameters are supported
- “First match” is definitely the most comprehensible and explicable semantic, even in an implementation with self-evaluating keywords.