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

LISP and C

Name: Anonymous 2012-09-19 23:04

Ok, /prog/.

I want to make a game in C but the AI in LISP.

Is it possible?

Name: Anonymous 2012-09-19 23:15

>>1
You're gonna do a lot more than just AI in LISP, but yes.

Name: Anonymous 2012-09-19 23:17

>>2
For example?

Name: Anonymous 2012-09-19 23:19

Make the engine as a library in C

Use CFFI + Common Lisp to be able to access it

Finish in Common Lisp

Name: Anonymous 2012-09-19 23:21

>>4
I mean, can't I just make the AI with LISP?

Name: Anonymous 2012-09-19 23:26

urega

Name: Anonymous 2012-09-19 23:31

ageru

Name: Anonymous 2012-09-20 0:50

>>5

It depends a lot on what implementation you are using. You could use a lisp library to call lisp scripts from the c application. This would be sort of ok if you could compile the lisp scripts to byte code. Ideally, you could compile the lisp to native code and link it all together with the c code. It's all possible, it's just a matter of finding the lisp implementation that will do what you want.

Name: Anonymous 2012-09-20 1:02

>>8
So it's actually impossible with current tools? Damn, you're so helpful.

retard

Name: Anonymous 2012-09-20 1:23

>>9
Did he say it was impossible? No, you fucking moron. You may want to brush up on those reading comprehension skills. Please don't even attempt to make a game - I believe it may be beyond your skill level.

Name: Anonymous 2012-09-20 1:31

>>9
Yeah, it's impossible with your cranial tool.

Name: Anonymous 2012-09-20 2:26

>>9

I see that you are too intimidated by the nature of your problem to seek a solution.

If you were adequately prepared to think about this subject, your natural response would have been to browse through the various lisp implementations and look at their features. The ones that support what was described in >>8 should appear useful to you. If you are not satisfied with any of the implementations, you could consider being more flexible about the language choice. And go for, say, Lua, which is exactly what you want. But there are also plenty of general purpose scripting languages that can be used this way.

I remember ecl being neat. It's been a long time since I've used it though.

http://ecls.sourceforge.net/

Name: Anonymous 2012-09-20 3:31

Check out Abuse. It has its graphics and lisp engines written in C, and the rest of the game written in lisp.

Name: Anonymous 2012-09-20 6:05

>>1
http://en.wikipedia.org/wiki/Freecraft was written in C+Lisp, but they rewrote it to Lua

Name: Anonymous 2012-09-20 8:51

>>12
>>9
He's not me, the OP.

Name: Anonymous 2012-09-20 9:33

>>1
Yes. check out newLISP. simple interfacing to C.

Name: Anonymous 2012-09-20 9:53

>>16
newLISP
kent_pitman_puking.jpg

Name: Anonymous 2012-09-20 10:24

Name: Anonymous 2012-09-20 22:39

>>15

IWT

Name: Anonymous 2012-09-20 22:48


struct _cons_str {
   void *car;
   struct _cons_str *cdr;
};
typedef struct _cons_str cons;

Name: >>20 2012-09-20 22:52

>>20
typedef struct _cons_str {
 void * car;
 struct _cons_str * cdr;
} cons;

sorry about that guys, fixed

Name: Anonymous 2012-09-20 22:55

>>20
you have not yet achieved satori.

Name: Anonymous 2012-09-20 22:58

>>21
pleb

struct cons {
   void *car;
   struct cons *cdr;
};

pure C style

Name: Anonymous 2012-09-20 22:59

>>21
nope, still not there.

Name: Anonymous 2012-09-20 23:02

>>21
I don't like to mix the typedef and struct declarations, it looks less readable to me like that. I don't golf for golf's sake.

Name: Anonymous 2012-09-20 23:06

>>25
typedef'ing structs is bad news because it makes the composite type look like a scalar. I never do it unless the structure is supposed to be totally opaque.

Name: >>20 2012-09-20 23:06

Just use C, goddamnit. Unless you like underperforming games.

Name: >>26 2012-09-20 23:08

>>21
You also shouldn't prefix struct tags with an underscore. Identifiers with leading underscores are reserved for the implementation to use.

Name: Anonymous 2012-09-20 23:09

>>26
All structures should be opaque and have lots of functions/macros to operate on them. One should only have to mess with its innards in extraordinary situations.

Name: Anonymous 2012-09-20 23:12

>>28
If he is typedefing the struct, it's pretty clear he doesn't want anyone using the actual structs name, or he is trying to avoid name conflicts.

Name: Anonymous 2012-09-20 23:13

>>26,28
Fair enough.

Name: >>31 2012-09-20 23:14

I mena

>>29,30

Name: Anonymous 2013-08-31 17:26


 ☢☢☢☢COCKS COCKS COCKS☢☢☢☢

Name: Anonymous 2013-08-31 18:56


 I FUCKING LOVE BIRDS!

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