This project is specifically designed to work with Guile Scheme across different platforms (OSX, FreeBSD, and Linux).
- Guile Scheme 3.0+ (though most code should work with 2.2+)
- Built-in record types (compatible with SRFI-9 spec)
- No external dependencies needed
# Using Homebrew
brew install guile
# Check installation
guile --version# Using pkg
pkg install guile3
# or ports
cd /usr/ports/lang/guile3 && make install cleansudo apt-get install guile-3.0sudo dnf install guileFrom the repository root:
# Run the social media simulation example
make run-example
# Run just the core simulacra demo
make run-demoOr directly with Guile:
guile -l example.scm -c "(run-social-media-simulation)"# Start Guile REPL
guile
# Inside REPL
scheme@(guile-user)> (load "simulacra.scm")
scheme@(guile-user)> (demo-progression)This implementation uses SRFI-9 for record types and SRFI-95 for sorting functions, both of which are standard in modern Guile installations. The code avoids implementation-specific features to maintain compatibility across different Guile versions and platforms.
For larger extensions to this project, using Guile’s module system is recommended:
(define-module (simulacra core)
#:use-module (srfi srfi-9) ;; records
#:use-module (srfi srfi-95) ;; sorting
#:export (make-reality
reality?
reality-name
reality-essence
reality-existence))For testing, SRFI-64 is recommended:
(use-modules (srfi srfi-64))
(test-begin "simulacra-tests")
(test-assert "reality creation"
(reality? (make-reality "test" 'test 'test)))
(test-equal "first order simulacra"
"Reflection of Original"
(reality-name (first-order-simulacra
(make-reality "Original" 'authentic 'real))))
(test-end "simulacra-tests")- Use
(display)and(format)for output - Remember that
(write)shows the S-expression structure - Try
(gcrypt hash blake2 512)for debugging content equality - Enable backtraces for debugging with:
(use-modules (system vm trap-state))
(trap-enable 'wrong-type-arg)
(trap-enable 'out-of-range)