This was an incredibly enjoyable read. A lesson to take away is that many of the ideas of Lisp can be taken advantage of without reeling in the entirety of an existing stack. Writing a Lisp parser is easy. Walking Lisp code is easy. Serializing Lisp code is easy. Adding a new primitive is easy. Adding very basic syntax transforming macros is easy. All of these are virtually trivial if your host language is a Lisp, as…
Technical Breakdown of a new NES game written in Lisp
41–50 of 71 posts
Re: Technical Breakdown of a new NES game written in Lisp
#42Earlier quoted context omitted.
Hard reasons. Forth implementations on the 6502 uses a stack and require more RAM than Co2 which uses a compiled stack. I feel like Co2 would compile to faster code but of course I haven't benchmarked this. The reason I feel this is so is that I way I understand compiled forth is that the 'words' are still threaded so you don't escape the interpreter overhead. Soft reasons. Co2 takes away the chore of parsing, in For…
> Forth implementations on the 6502 uses a stack and require more RAM than Co2 which uses a compiled stack. I don't know what you mean when you say this. Could you elaborate? Any function call is going to require putting the arguments somewhere. > The reason I feel this is so is that I way I understand compiled forth is that the 'words' are still threaded so you don't escape the interpreter overhead. Indirect/direct…
There's a footnote in the article that might be helpful:
> this is thanks to a "compiled stack", a concept that's used in embedded programming, though I had a hard time finding much literature about it. In short, build the entire call graph of your project, sort from leaf nodes to roots, assign to each node memory equal to it's needs + the max(children)
Re: Technical Breakdown of a new NES game written in Lisp
#43Earlier quoted context omitted.
The other side of that coin is that on mobile the article is painful to read and the layout is horrible. For what it's worth I hate medium as well. But I would recommend ghost.org if you want to go with self hosting.
Seems ok reading in my mobile safari, not even using reader mode.
Re: Technical Breakdown of a new NES game written in Lisp
#44This was an incredibly enjoyable read. A lesson to take away is that many of the ideas of Lisp can be taken advantage of without reeling in the entirety of an existing stack. Writing a Lisp parser is easy. Walking Lisp code is easy. Serializing Lisp code is easy. Adding a new primitive is easy. Adding very basic syntax transforming macros is easy. All of these are virtually trivial if your host language is a Lisp, as…
They used Lisp to generate machine code. They didn't parse lisp at all. Imagine writing a library in your favorite language to do what they've done.
Parsing Lisp in Lisp is so easy because it’s free.
Re: Technical Breakdown of a new NES game written in Lisp
#45Does anyone know if there are any MUDs out there coded in lisp? I didn't find any good results in google aside from the MPI lisp-like language built on top of FurryMUCK.
Re: Technical Breakdown of a new NES game written in Lisp
#46One of the advantages of lisp is REPL-driven development. I imagine you can't just edit a fn, eval it and then see the changes immediately. What is the workflow like when creating a NES game using co2?
Re: Technical Breakdown of a new NES game written in Lisp
#47Earlier quoted context omitted.
They used Lisp to generate machine code. They didn't parse lisp at all. Imagine writing a library in your favorite language to do what they've done.
They did parse it, albeit indirectly, by Racket’s reader. Co2 is a language, not a bunch of function calls, so it’s not quite the same as building a library in your favorite language. The article even gives examples of new syntax they produced. Parsing Lisp in Lisp is so easy because it’s free.
Indeed, it's almost trivial.
Re: Technical Breakdown of a new NES game written in Lisp
#48This is impressive. I appreciate you documenting the development of it and giving an overview of what's going on inside. I wish there were more blog posts like this. Have you reached out to the Racket community about the game and co2? Also, would you say this Lisp is geared more toward people who already know 6502 assembly, and not toward people who just want to write a NES game in a Lisp?
With only looking through the article and being a 6502/NES programmer myself, you can't escape having to know 6502 and the NES hardware to write a NES game. This Lisp is cool and it will certainly smooth the process and is a good fit for an Adventure game and other parts of NES game development where you aren't counting cycles (like UI).
Re: Technical Breakdown of a new NES game written in Lisp
#49Looking at the code examples of the entity system in this article made me wonder what it'd be like to code a MUD in this language or in lisp generally. Does anyone know if there are any MUDs out there coded in lisp? I didn't find any good results in google aside from the MPI lisp-like language built on top of FurryMUCK.
You can find some information there:
https://archive.bleu255.com/nakedonpluto/about/
https://gitorious.org/naked-on-pluto/game-server (cert expired)
https://gitorious.org/naked-on-pluto/game-client (cert expired)
Re: Technical Breakdown of a new NES game written in Lisp
#50Earlier quoted context omitted.
Most Lispers and some Schemers are quite pragmatic in that regard. With the former favouring OOP and looping over recursion and the latter using imperative code when it matters. With developer mindshare flocking to the Haskell view of FP, for the Lisp family, only the Clojure users seem to still hold purity in high regard.
With the former favouring OOP and looping over recursion Not my experience at all, fwiw.
You cannot program in CL without using the CLOS. Most CL books go into great detail explaining it and the MOP, they are also full of looping constructs, even using GOTO. The only exceptions are Graham's books.
In open source, it is frowned upon to use recursion as TCO is not part of the standard. Some functions are even inlined for better performance.