Hacker News new | comments | ask | show | jobs | submit login
Making Games in Lisp with Hypergiant and Chicken Scheme (alex-charlton.com)
155 points by bananicorn 68 days ago | hide | past | web | favorite | 22 comments



I love Chicken Scheme, so this is great to see. Note that this article is from 2015.

Chicken Scheme recently received a version 5 release, so please be aware that this article focuses on Chicken 4, as I do not believe Hypergiant has been ported to Chicken 5 yet.

As an aside, it's a shame the footnotes render over the text for me in Firefox.


I checked out hypergiant / chicken scheme a year or so ago - and was unable to get certain examples compiling / running on macOS.

While I'd love to play more with / learn more scheme - it's too niche of a language these days even for me (someone that writes a lot of Nim).

The scheme community seems to be very small to begin with, and then you factor in all the implementations - it's worse than the Common Lisp scene.

I do love the simplicity of the language and how elegant scheme code can look - and chicken / guile seem to be very well suited for game development.

I feel like I'd be trading a larger community for a smaller one at this point - and that's saying something, coming from a Nim user.


A nice thing about Lisp (that is harder to achieve in other languages) is that you can make the text of your program look like it is written in a declarative rather than in an imperative (or a functional) language. (I think that's what is meant when they say that Lisp is perfect for creating DSLs.)


Harder in other languages except Forth. While creating DSLs is easy enough in Lisp, Forth is more of a DSL construction kit than a programming language. Which is why there are roughly as many dialects as implementations.


Forth... so alluring, yet so scary. I am afraid doing it will make me do great things no one else can understand and maintain. :)


I've been working on one of my own that attempts to bridge some of the gaps between Forth and the rest of the world, feel free to take her out for a spin:

https://gitlab.com/sifoo/snigl


I presume you would know of factor, curious what you think of it.


Sure, I've played around with it; still too complex and too static due to being natively compiled.

I've mostly given up on the idea of driving applications from a higher level language, I much prefer having C as a foundation and then embedding a more dynamic language that I have full control over. I like to call it reverse FFI :)


So Guile, Lush, Lua, Tcl would be the other likely candidates. I do use Python but more as a remote control over C.


Yep, more or less. Though if you flip through Snigl's README, there's already plenty in there that these languages will never be able to do.

I used to do that in Common Lisp, which has the only FFI I've come across that's even nicer than Python's. But it's backwards; once you're in a high level language, it's inconvenient and expensive to reach down.

It makes a lot more sense to me to drive the whole process from C; not only do you have direct access to C; you also get to control the embedded world from the outside, which is about as meta as it gets.


If you want a FFI that's arguably even nicer, look at PicoLisps:

http://rosettacode.org/wiki/Call_a_function_in_a_shared_libr...

(setq Display (native "/usr/lib/libX11.so.6" "XOpenDisplay" 'N ":0.0"))


Just in case my comment came out as "why are you working on Snigl ?" ... I was thinking aloud on what are some of the other languages that you might like. Snigl sounds pretty cool and fun.


No harm done; I'm doing this with or without, because it has to be done.



This was posted today, illustrating the power of Common Lisp read macros (not to be confused with regular macros):

https://github.com/y2q-actionman/with-c-syntax


Gambit Scheme has SIX (Scheme Infix eXtension) for C style imperative code.

http://www.iro.umontreal.ca/~gambit/doc/gambit.html#Scheme-i...


I wish Chicken Scheme could be ported to Windows without the Posix dependencies. I run it on my Linux box, but unfortunately, work is all Windows. I have had years of frustration with Cygwin and MinGW or MSYS to run such things. I use Red [1] now, which is homoiconic like Lisp, has a great parser, and runs on all platforms with an executable under 1 MB.

[1] https://www.red-lang.org/


You use Red? Not just play with it? Could you share some details?

As for posix subsystems on windows, they're indeed painful. But the new Linux emulation layer is quite good - in some cases it might be a viable option.


Use for me is writing small utilities for work. I am not a programmer, but I work in entertainment engineering, and Red has proven useful for making all sorts of utilities to get my job done. I am currently trying to use Red to create the GUI and glue some other utilities I use together. I hope to get better at it to create full applications. Amazing for its size, and I've always loved Lisp and Forth.


Wait, does the Red gui work under linux now? According to their Roadmap it doesn't yet - but maybe it just hasn't been updated for the last half year...


I've been using Chicken Scheme a lot and I find it to be awesome. I wish Hypergiant was supported in version 5.


Surprise to see a Go board displayed. But given Alpha Go, is Lisp is still relevant or is there a way for chicken to call say leela zero?




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: