Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LispCraft

Name: Anonymous 2011-04-09 5:21

Hi, all. I finally completed Warcraft 2 implementation in LISP.
http://img859.imageshack.us/i/52320836.png/

Took me a few months, though, but mostly because I was too lazy and my DSL is still pretty buggy, has poor debugging support and long compilation times (takes about 30 seconds to reload source file). Anyway, this proves, that writing a game in Lisp is relatively easy, even for a single person.

Name: Anonymous 2011-04-09 5:25

>>1
So the ``meaningless'' code you kept posting was this?
I'm impressed. (I remember you said you would code Warcraft 2 ``in Lisp'')

Name: Anonymous 2011-04-09 5:28

Saging because I'm an evil Jewish mathematician with the infinity fetish.

Name: Anonymous 2011-04-09 5:29

>>2
Yes.

Name: Anonymous 2011-04-09 5:44

Okay, I'm impressed.

Name: Anonymous 2011-04-09 6:00

>>1, could you somehow share your DSL with us?

Name: Anonymous 2011-04-09 6:15

>>6
It isn't ready. I did this game project just to see DSL in action, so now I'll redo a few things, like replacing "|>" with "|", making && and || work like in BASH and considering "::" operator instead of `if`, because I had tons of bash-like pipes all over the code, so optimizing them looks like a nice goal.

Name: Anonymous 2011-04-09 6:17

considering "::" operator instead of `if`

minF f a b -> a<b | f a b :: f b a

instead of

minF f a b -> if a<b (f a b) (f b a)

Name: Anonymous 2011-04-09 6:27

>>8
Yes, add more punctuation marks it would improve readability even further.

Name: Anonymous 2011-04-09 7:06

Good job. Is the game fully functional? How many lines of code is it?

You should still post the DSL implementation if you actually want people to be able to read your code. It's not like any of us want it for our own personal use, it's mostly to be able to read your posts.

Name: Anonymous 2011-04-09 7:21

>>10
How many lines of code is it?
1600 lines of code.

Good job. Is the game fully functional?
It loads maps from commercial game. Units, spells, buildings, transports - everything works. No player AI. No GUI.

Name: Anonymous 2011-04-09 7:28

>>11
I'm calling bullshit on this, yet a part of me really wants to believe. Wait, how long (in lines) is the DSL implementation?

Name: Anonymous 2011-04-09 7:45

>>10
Yes, just post the implementation -- unfinished or not, if you can write Warcraft 2 in it, it's probably done enough. Maybe start a github. Is there any documentation?

Name: Anonymous 2011-04-09 8:36

i miss the autism threads

Name: Anonymous 2011-04-09 9:17

>>12
I used a pretty general data structure, which allowed me to reuse most of the code for everything. For example, units, buildings, projectiles, actions, spells, icons and upgrades could be all processed by the same code.

This is how I define area bombardment spell "Blizzard"

layer=5 air=ye dirs=1 show="attack" ucost=["mana"=25]
range=12 effect=["wound" [0 10]] area=[2 2] shards=10 offset=[~4 ~4] splash=1
nonRMB=ye do=ye?
anims=["move"='((1 2 11) (1 2 10) (1 2 11))
       "death"='((2 6) (3 6))]

It's cost checked by the same code, that checks resources for new buildings and unit training. Pathfinding, animations, drawing - all reused.

Name: Anonymous 2011-04-09 9:38

Holly shit . . . someone did something useful and cool with Lisp?

Name: Anonymous 2011-04-09 9:43

>>16
Not exactly Lisp, but a DSL written in Lisp, who the author keeps calling Lisp.

As for useful stuff in Lisp, I've written quite a few tools in CL for personal and not-so-personal usage, and I've been content with them. Any language can be used to make useful stuff, especially powerful high-level languages.

Name: Anonymous 2011-04-09 9:54

>>17
It's not even a ``DSL", it's a general purpose language implemented in Lisp. Calling it Lisp is the same as calling Python C just because one of its implementations is happen to be written in C.

Also it's seriously shitty.

Name: Anonymous 2011-04-09 10:43

>>18
I disagree, but that's subjective anyway.

Name: Anonymous 2011-04-09 11:58

>>18
Apparently he can still call CL from his implementation, but then you can use an FFI in any modern high-level language to call code written in other languages, except in this case, his code expands to CL code... However, there is a Python implementation written in CL, and if you wanted, you could write inline CL in that Python implementation, just like you can write inline assembly in some C implementations... Your point still stands about it being a separate language.

Name: Anonymous 2011-04-09 12:08

Has anyone made a game with The Land Of Lisp?

Name: Anonymous 2011-04-09 14:43

Minsky clicked the same unit several times.

To which the Sussman queried ``Why do you click the same unit several times?'',

``So he will say \"Stop clicking me!\"'' Minsky replied.

At that moment the Sussman was enlightened.

Name: VIPPER 2011-04-09 15:50

JEWS

Name: VIPPER 2011-04-09 15:52

JEWS

Name: VIPPER 2011-04-09 15:54

JEWS

Name: VIPPER 2011-04-09 15:56

JEWS

Name: VIPPER 2011-04-09 15:58

JEWS

Name: Anonymous 2011-04-09 17:53

Name: Anonymous 2011-04-09 18:53

>>20
I can call CL using DSLs syntax. Though, it's problematic to reference non-uppercase symbols

Here is a C-style for-loop macro, one of cases of which expands into CL code

// for (i:0; i<6; !i+1) say i
e:m:for #($@v; $@c; $@i) @body ->
          do $@v (cl progn (while (and $@(map ['`!` ?] c))
                             !$body $@(map ['`!` ?] i)))
       ; x 'in xs @body -> fe {$x->$@body} $xs

Name: Anonymous 2011-04-09 18:56

>>29
Also, DSL uses CPS, and CL uses usual stack, so invoking continuation will break this `for` macro and lead to nasty glitches.

Name: Anonymous 2011-04-09 19:50

>>30
Also, DSL uses CPS
I perfectly remember that you were against full TCO, and CPS to work properly (read: no Segmentation fault) relies on TCO.

Name: Anonymous 2011-04-09 19:57

1. Post a Warcraft 2 screenshot
2. Claim you reimplemented the game in Lisp
3. Watch /prog/ go crazy
4. ???
5. PROFIT!

Name: Anonymous 2011-04-09 23:10

>>31
No. I always hated stack. But some people believe, that C++-like RAII and unwind-protect are so important, that you can sacrifice continuations for them. It's just stupid, when you have garbage collection. If you want insure resource release, just set a watch-dog timer, that'll release resource after some time of disuse.

Name: Anonymous 2011-04-09 23:13

>>33
btw, watchdogs are a very powerful way to avoid deadlocks.

Name: Anonymous 2011-04-09 23:14

>>34
one can even allow for race conditions to exist, when he sure, that watchdog'll resolve them.

Name: Anonymous 2011-04-09 23:59

>>33
Global garbage collected heap environments like Java or .NET are literally garbage. Global heaps do not scale well for highly parallel systems. Fortunately, it's not like retards who can't manage their own memory are also good at concurrency.

Stick to your garbage collected toy languages.

Name: Anonymous 2011-04-10 0:53

>>36
stick to your over 9000 lines of code, that segfaults every few minutes.

Name: NIGGERFUCK 2011-04-10 1:04

#include <stdio.h>
#define NIGGERFUCK "niggerfuck"

int main() {
  printf("Hi %s", NIGGERFUCK);
  return 0;}

Name: Anonymous 2011-04-10 1:29

>>37
I use unit and regression testing coupled with sound idiomatic programming to limit critical failures in my software to a near zero probability. In fact, I would argue that most of my C/C++ software has far less bugs than most of the crap I see churned out by Java/C#/FIOC/Haskell/etc. developers.

Name: Anonymous 2011-04-10 2:09

I can hear the sound of me getting trolled by >>39.

>>39
C/C++
Sepples has an optional garbage collector.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List