urn-love2d-bindings - Write Löve2D games in Lisp!

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Posts: 1
Joined: Thu Jan 25, 2018 11:22 pm

urn-love2d-bindings - Write Löve2D games in Lisp!

Post by Lignum » Thu Jan 25, 2018 11:50 pm

These are bindings for Löve2D for the Urn programming language, which is a self-hosting Lisp that compiles to Lua. It outputs single, mostly readable, dead code-eliminated, fully self-contained Lua files, making it easy to use within any context.

You may find the bindings on GitLab.
If you're using Arch Linux, you can get this library, as well as Urn, from the AUR (not maintained by me).

To get started, simply follow these steps:
Run these commands:

Code: Select all

mkdir my-project
cd my-project
git clone https://gitlab.com/Lignum/urn-love2d-bindings.git love
Create a file game.lisp with these contents:

Code: Select all

(import love/love (defevent))
(import love/graphics)

(defevent :init ())
(defevent :draw ()
  (love/graphics/print "Hello World!" 64 64))
Now, assuming "urn" is the Urn compiler, run this:

Code: Select all

urn game.lisp -o main
The Urn compiler will now have created a self-contained main.lua file, which we can run with Löve2D as usual:

Code: Select all

love .
If everything worked correctly, you should be able to see a window with the text "Hello World!", as expected.

Further useful information:

To prove this library works in practice, I've written a basic Pong example with these bindings, which you can find and learn from here.

GitHub user paines has figured out how to use lovelive to live compile Löve2D games with Urn.

Posts: 4
Joined: Thu Mar 02, 2017 11:23 am

Re: urn-love2d-bindings - Write Löve2D games in Lisp!

Post by eitanbron » Mon Apr 09, 2018 9:29 pm

This is majorly cool. It is also the first time I managed to get anything game related to work in a Lisp language. If there is any way I could help in developing this project I would love to contribute. Thank you so much!!!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests