7 ms·
There are still people explaining to me why you need a 'system programming language' like C or Rust for certain tasks. Meanwhile, I'm playing a game of Quake o
by heisig 7y ago
There are still people explaining to me why you need a 'system programming language' like C or Rust for certain tasks. Meanwhile, I'm playing a game of Quake on Mezzano, where everything from drivers to the actual videogame is written in pure Common Lisp.
In case you wonder how froggey managed to obtain a Common Lisp version of Quake, have a look at https://github.com/froggey/Iota https://github.com/froggey/Iota.
- noobermin 7y agoCurious, is this your main machine or a hobby machine? Regardless, I remember reading about this years ago (linked elsewhere for previous discussions on HN). Has it advanced to being more usable since? Interested to try it.
- ska80 7y agofrom https://github.com/froggey/Mezzano/releases https://github.com/froggey/Mezzano/releases : "Running on real hardware: The hybrid image can be burned to a CD or dd'd onto a USB drive, and booted directly. It requires a 64-bit x86 machine, 2GB of RAM, and a PS/2 keyboard and mouse."
- 314 7y agoAs a datapoint Quake is quite old. When it was released it used software rendering on a Pentium2. While is nice that everything from the ground up is written in lisp it sounds as if you are only achieving the performance of a P2 on modern hardware. What is the performance gap between Mezzano and an OS/application written in C/C++?
- NovaEcosophy 7y agoI think you forget just how old Quake is. I remember playing it on a 486DX 66Mhz, a P2 would have been total over kill for that game.
- skocznymroczny 7y agoP2 sounds about right for Quake2
- 6thaccount2 7y agoAre you thinking Quake III Rocket Arena?
- LambdaComplex 7y ago*Quake III Arena Rocket Arena is/was a mod
- Crinus 7y agoBoth Quake 1 and Quake 2 ran fine on my Pentium MMX (and i guess regular Pentium since they didn't use the MMX stuff) using the software rasterizer and Quake 3 also ran fine on my Pentium 2 with a GeForce 2.
- everdrive 7y agoI sadly tried to run Quake on my 486DX 33, and it was not up to the task =(
- kazinator 7y agoI built it (circa 1996) on HP PA-RISC workstations, like HP-715's. There was no assembly code for those, just portable C. The frame rate wasn't great, but it played.
- PuercoPop 7y agoThe reason it is slow is not because it is written is Lisp but because of how it is implemented, primarily because it is a hobby project. Graphics are rendered on the CPU for example. https://github.com/froggey/Mezzano/blob/master/gui/blit-x86-64-simd.lisp https://github.com/froggey/Mezzano/blob/master/gui/blit-x86-...
- reikonomusha 7y agoFolks are missing the point with performance. The Mezzano compiler + translating LLVM into Lisp wont be very efficient. That’s not the point. It’s crazy that a game like that runs on a non-Windows non-UNIX machine that is written from the ground up in Common Lisp, by way of compiling an application into a bunch of Lisp source code first.
- kthartic 7y agoQuake? That's your reference point? That game came out in the 90s. My Samsung washing machine could probably run that.
- reikonomusha 7y agoYour Samsung washing machine probably runs Linux though. Can you run it on a non-UNIXy OS? It’s amazing that this OS also has its own compiler and runtime capable of running Quake translated into Lisp.
- chapium 7y agoI don't know about you, but I rewrite all of my appliance firmware in chicken scheme.
- z3phyr 7y agoThat's basically C though ;)
- theamk 7y agoI don't think it runs Linux, there is tons of embedded OS's. It could be Nuclus, RIOS OS, or most likely, some sort of proprietary OS which was shipped with specific MCU they are using. OS writing is pretty simple, as long as you do not need a ton of device drivers and networking. There are over two dozen of them listed there: https://en.wikibooks.org/wiki/Embedded_Systems/Common_RTOS https://en.wikibooks.org/wiki/Embedded_Systems/Common_RTOS and that is not a complete list.
- luxuryballs 7y agoBetter virus check that thing.
- kjs3 7y agoMy Samsung washing machine runs on (I believe) an mc6800 variant (not mc68000). It's admittedly not a surf-the-net/watch-tv-while-you-watch version, so no Quake, but on the upside, no viruses.
- pixel_fcker 7y agoUnless you're playing it on a 75MHz Pentium, I think those people are right.
- deleted 7y ago[deleted]
- opencl 7y agoThat version of Quake is written in C and ran through a C->LLVM->CL transpiler. This is "written in pure Common Lisp" in the same sense that Emscripten applications are "written in pure Javascript".
- ksaj 7y agoExactly. The output is indeed pure Lisp, but it isn't very human readable when transpiling anything more gumptious than Hello World.
- stcredzero 7y agoIt demonstrates that Quake could well be written in Lisp.
- mruts 7y agoI mean, sure why not? CL can be about as fast as C if all you care about is performance. Also macros might get you faster than C, for the same reason that C++ can be faster than C (compile time metaprogramming).
- ksaj 7y agoThat depends on your definition of "written in." The transpiled Lisp code isn't at all what a human would or probably even could write. Don't forget about all those optimizations that get directly translated. Its not unlike the 90's disasms. They compile. They work. But no human writes that kind of code that results when disassembling an optimized high level language's output.
- stcredzero 7y agoThat depends on your definition of "written in." The point being, that someone could code up a similar game and expect similar or better performance.
- 7y ago
- SomeOldThrow 7y agoI’d imagine it’s more for driver support than anything.
- segmondy 7y agoI wonder if they can use this approach to convert and generate tons of tools for this OS. Build a POSIX layer, convert tons of useful unix tools using LLVM.
- deleted 7y ago[deleted]