How to get your UID with PLT Scheme under UNIX

Via Eli on comp.lang.scheme:

#lang scheme
;; using the /proc filesystem
(call-with-input-file "/proc/self/loginuid" read)
;; running `id'
(require scheme/system)
(let ([o (open-output-string)])
  (parameterize ([current-output-port o]) (system "id -u"))
  (read (open-input-string (get-output-string o))))
;; calling getuid()
(require scheme/foreign)
(unsafe!)
((get-ffi-obj 'getuid #f (_fun -> _int)))

Scheme Space Invaders

This re-make of the classic arcade game “space invaders” is based on the version available on the well known arcade emulator called mame. It is made to look as close as possible to the original arcade game.
This game was made for fun, but also in the context of my master’s thesis at the university of Montreal under the supervision of Marc Feeley. The aim behind writing video games in scheme is to try to demonstrate not only that it is possible to write games in scheme, but that such games would have smaller developpement time, better code, less bugs, etc…
Thus space invaders is only the first step into my thesis and more games will be comming up later! I would like also to note that the version 1.0 is only a draft. Much ugly things can be found in the code and I will still continue the developpement of this game further by ameliorating the way the code is structured and modify parts of it’s basic architecture to experiment different design ideas. This is what’s beautifull about scheme, isn’t it? I tried to comment the code so that it should be understandable by interested schemers.
I hope you can enjoy this game as well as I enjoyed developping it!
David St-Hilaire
sthilaid@iro.umontreal.ca

(via stevebook)

Tachy Scheme

Tachy is a Scheme-like (R5RS is the template, but not the goal) language that is being developed in C# for the .NET framework and is made available as Open Source (BSD License). The current implementation is an interpreter, and a compiler is planned. The primary focus for Tachy is for programming language learning & experimentation, and an attempt has been made to keep the code as small(currently under 1000 lines) and straightforward as possible.

(via StackOverflow)

Box2D Lite: A Scheme Physics Engine

(via ikarus)

Box2D is a physics engine written in C++ by Erin Catto:

http://www.box2d.org/

Box2D Lite is a simplified version that he posted to his blog once upon a time.

I’ve ported Box2D Lite to Ikarus. Here it is running the pyramid demo:

http://imgur.com/aXAY4

That’s a screenshot of the very first successful run. 🙂

Of course, I’ll be happy to release the code once the performance is cranked a bit.

Ed

More Scheme projects I would like to work on

Here are some more fun and/or interesting Scheme projects that I would like to work on (eventually, and in addition to these):

  • DrScheme: Add line numbers to the editor window
  • DrScheme: Execute code in editor in another Scheme system
  • Port SchemeUnit to R6RS Scheme
  • Scribble the SRFI docs
  • Write a debt-elimination application
  • A Scheme API for generating Graphviz diagrams
  • A Scheme API for managing complex SVN projects
  • Make Scheme screencasts
  • Brush up on the PLT Scheme GUI API
  • Research currency and produce a SRFI for it

Would you find value in a Scribbled version of the SRFI docs?

The Scheme SRFIs are a collection of useful and portable Scheme code meant to provide commonly used functionality not included in the specification. The standard documentation format is HTML. For example, here is SRFI 1. While this format works fine, I am wondering if a Scribbled version would be a useful addition. Scribble is the tool used to document PLT Scheme. Here is an example of how their documentation looks.

Doing so would be pretty easy by implementing it as a PLaneT package; the documentation itself could be distributed via PLaneT or a simple file download for anyone interested.

What do you think?

Paralell Programming with PLT Scheme

Via plt-dev:

I’m pleased to announce the initial release of parallel futures, a construct for fine-grained parallelism in PLT. Roughly speaking, a programmer passes a thunk to ‘future’ and it gets run in parallel. That “roughly” holds a few gotchas, partly because we’re just getting started and partly due to the technique we’re using. See the documentation for more details:
http://pre.plt-scheme.org/docs/html/futures/