r/lisp

▲ 206 r/lisp

Made a spell crafting IDE that uses Lisp as the syntax.

Finally posting after lurking here for a long time. Friends don't care too much about this sort of thing.

This is written in Odin, with my own small Lisp interpreter from over 5 years ago. Lisp was the easy choice, primarily because paren's are easier to parse into pretty circles, but also it is much lighter than including Lua.

Using Raylib for the rendering.

There are tons of things I want to implement, but I finally got it into a state that I'm happy sharing something about it. Like one thing I want to change is that spells shouldn't define the cost, but functions like `move-toward` should consume MP as they are called.

There are other spell effects not demoed: shield, heal, buff, debuff, damage, status, teleport, etc.

As for the window decor, a Windows 7 skin for KDE Plasma.

u/spyingwind — 11 days ago
▲ 55 r/lisp+1 crossposts

BLEG: A Facelift for common-lisp.net

Common-lisp.net was rewritten a couple days ago. Please let us know what you like and don't like, what's extra, what's missing, and so on.

common-lisp.net
u/dcooper8 — 13 days ago
▲ 33 r/lisp

Tell me about an interesting program you wrote or maintained

Hi all,

Younger dev here I’ve been reading the SICP book and also blog posts about Common Lisp and Emacs Lisp and I’m fascinated by the culture during its heyday (e.g. Symbolics era). But I didn't find more anecdotes besides the one here about how in the 1990s a piece of Germany’s air traffic control software ran on Emacs.

I’d love to hear about the programs you used to deal with and overall what tasks you think Lisp excelled in.

Thank you!

reddit.com
u/codegems — 11 days ago
▲ 32 r/lisp+1 crossposts

UPDATE 2: CL-OBJC is reborn!

Back in March 2023 I posted an update on reviving cl-objc, the CFFI-based Common Lisp ⇄ Objective-C bridge originally written by Geoff Cant and Luigi Panzeri. At that point I had Hello World and Converter running, and I was stuck waiting on CFFI. Here's where it is now.

Repo: https://github.com/theangelperalta/cl-objc

Examples

All five examples run on Apple Silicon (arm64). There are no nib files or Objective-C sources; every app is written in Lisp.

  • Hello World: an NSWindow with buttons wired to Lisp callbacks
  • Converter: the classic Cocoa currency-converter tutorial
  • Circle View: a custom NSView subclass that draws text along a circle, with mouse interaction and animation (ported from an old Apple SDK sample)
  • Video Player (new): an AVPlayerView streaming HLS, plus a KVO observer class defined in Lisp. make builds it into a standalone executable.
  • Todo (new): an NSTableView whose data source and delegate are Lisp classes. On macOS 26 the list scrolls under floating Liquid Glass controls (NSGlassEffectView); older versions get a translucent material instead.

https://preview.redd.it/ffb5lv3yjysh1.png?width=960&format=png&auto=webp&s=27fb94abc0109850ddcb87377946e7c0afcf093f

What changed under the hood

  • arm64 struct-by-value: you can pass and return structs by value, and the dispatch was rewritten for the arm64 ABI. x86-64 support has been dropped.
  • Lazy CLOS bindings: import-framework now loads only the static bindings. CLOS classes and generic functions get generated on demand (ensure-clos-bindings), and they're cached and regenerated when their inputs change. This makes startup much faster than scanning the whole runtime.
  • ObjC exceptions: with-objc-exception-handling turns NSException's into Lisp conditions, so they no longer crash the image.
  • with-autorelease-pool: macro
  • Many fixes around BOOL marshaling, automatic Lisp-string → NSString conversion in untyped calls, with-super, and method-cache collisions
  • The test suite moved from FiveAM to Rove.

The CFFI situation

define-objc-method methods that take a struct by value (for example drawRect: with a CGRect) need CFFI callbacks that accept structs by value. Released CFFI still doesn't support that. My PR is still open: https://github.com/cffi/cffi/pull/351 (open since December 2022). I decided to use Qlot to pin a patched version CFFI, to get this out in the world in the meantime.

For now, the repo includes a qlfile that pins my fork, so setup is:

    qlot install
    sbcl --dynamic-space-size 4096 --load .qlot/setup.lisp

Obviously this isn't ideal, if anyone here can review the CFFI PR or help get it merged, that's the biggest thing blocking cl-objc from loading with stock Quicklisp.

What's next

  • Getting struct-by-value callbacks into upstream CFFI
  • Fewer dependencies on CFFI internals
  • More examples and docs
  • Real applications (LEM frontend, LLM harness, Graphing tools, etc.)

Feedback, issues and PRs are welcome, especially from anyone who has tried building Cocoa apps from Lisp before.

A.I. Disclaimer

A.I. was used for some of the recent work, but the original CFFI patch was worked by hand. That being said, goal here is to unlock the potential of Lisp development for native macOS development again (I realize there are paid alternatives).

reddit.com
u/acort3255 — 13 days ago
▲ 26 r/lisp+4 crossposts

New release of racket-audio

New release of racket-audio

> [...] now also works with ffmpeg as backend and there's no special C-layer necessary anymore. The needed audio libraries are used directly.

https://racket.discourse.group/t/new-release-of-racket-audio/4209

> racket-audio is a small audio playback toolkit for Racket. It combines high-level asynchronous playback, optional metadata reading, file type sniffing, decoder backends, and libao based output

Available now from https://pkgs.racket-lang.org/package/racket-audio

(Thanks Hans!)

u/sdegabrielle — 13 days ago