Author Topic: Would a "higher level" AGI compiler be useful?  (Read 26846 times)

0 Members and 1 Guest are viewing this topic.

eidolon

  • Guest
Re: Would a "higher level" AGI compiler be useful?
« Reply #60 on: March 24, 2002, 10:37:05 AM »
AGI is already very straightforward. Fancy stuff like Main(), timers, and event types would only confuse me. Please keep it simple and short.

I would be very happy if I could write like this:


room parlour:50
{
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

Offline Joel

Re: Would a "higher level" AGI compiler be useful?
« Reply #61 on: March 24, 2002, 11:19:33 AM »
I tend to agree with the keep it simple philosophy. Unless we really need these event things (and I don't think we do), it would probably add confusion, especially because events are typically nondeterministic, which is generally confusing enough, but making events that are entirely deterministic would probably be worse, because it goes against the norm.

Also, the more data types that are added, the more difficult it may be for a beginner to grasp the limited nature of AGI. They have to learn, "the sum total of all logics and rooms must not exceed 256" and "The sum total of all vars, pics, temporary variables, and timers must not exceed 256."

The main thing I'd say goes against the idea of event syntax is basically that if statements are practically identical (and in fact are identical if we just treat them as macros). If the preprocessor is good enough, anyone who wanted to do things like that could define a macro themselves:

#define OnNewRoom if (new_room)

or

#define OnTimer(val) if (vTimer == (val))

But I don't think it should necessarily be forced on beginners. It's important to make sure that, in defining this new syntax, that it is actually easier for beginners to understand than the (as eidolon said) already pretty straightforward syntax of AGI. The biggest failure of AGI syntax as it is right now I think is the awkwardness of certain structures such as if else if's

if ()
{
}
else
{
 if ()
{
}
}

and the lack of easier-to-write structures such as switches.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #62 on: August 07, 2002, 04:41:19 AM »
I know Mokalus has been working on ARVO amongst other things but I've decided to look into an actual compiler.

The plan is to make a backwards compatible compiler which means less frilly bits like complex expressions. The next step is to somehow incorporate it into agi studio.

...and then start on whatever crazy higher level compiler syntax we feel like. :)

I'm using lex to pick out the tokens, yacc to hopefully check it's syntax.  I'm thinking about using m4 (macro preprocessor) to remove comments, expand defintions and include files.  The good thing about this is that you can define proper macros hopefully.  The only bad thing is that I don't know if I can support the #message syntax.

Anyway.. that's what I'm doing..  

The plan is for this new compiler to also generate some sort of map file so nagi can trace through code with line numbers 'n everything.

any suggestions?  Right now I'm playing around with LEX and I can get it to detect most tokens..  hopefully YACC won't be too much trickier.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Randy

  • Guest
Re:Would a "higher level" AGI compiler be useful?
« Reply #63 on: August 07, 2002, 11:58:51 PM »
Call me crazy, but I'd like to see "if...else if"  loops! :)

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #64 on: August 08, 2002, 12:12:18 AM »
I'd like switch myself.. along with if's without brackets (i think logic doesn't have those)

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Blacki

Re:Would a "higher level" AGI compiler be useful?
« Reply #65 on: August 08, 2002, 12:47:31 AM »
I know you guys have been putting a lot of time and work into this, but does AGI really need improvement?  It's about 15 years old and is still being used, that say's something doesn't it?

I just thought if you wanted to improve somthing you could make a compiler/decomiler for SCIV if it isn't already being worked on?

Just an idea.

Offline Brian Provinciano

Re:Would a "higher level" AGI compiler be useful?
« Reply #66 on: August 08, 2002, 01:13:48 AM »
A good higher level AGI compiler would slow things down, so the games would probably not run on XTs and such (but who needs that). However, by targeting the compiler for games to run on faster computers, you could go all the way, and add compiler generated code that handles pushing and popping variables so to speak, kind of like how some compilers generate code for 16 bit number support on 8 bit machines, or emulated coprocessor stuff, etc.

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #67 on: August 08, 2002, 01:14:35 AM »
Yes, true.. but I think most people have to be pretty dedicated to work on AGI.  If there's SCI and AGS and everything else to compete with it, it will have to move with the times a bit.

Take C, that was developed years ago but they still release new versions of that (there's C99 which is the latest I think)

And why not?  If we don't have to spend as much time wrestling with the simple logic, it will actually a HIGH-LEVEL compiler instead of a glorified assembler.

I'm pretty sure SCIV already has a compiler in the guise of SCI Studio.. it's the other bits 'n pieces that need working on.  I'm more interested in AGI anyway.. I won't be moving onto sci development.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Brian Provinciano

Re:Would a "higher level" AGI compiler be useful?
« Reply #68 on: August 08, 2002, 01:24:38 AM »
I was thinking about this, and remembered that there are AGI commands which can jump and execute code in any script at any offset. With this feature, you could easily set up your compiler with a library script, which could handle everything you need, such as 16 bit integer emulation, etc.

Also, you could easily modify my SCI compiler to generate AGI code. The kernel calls would be command calls, for example. I know you said you're not interested in SCI, however, if this was the case, then we could easily write SCI procedures in the scripts to emulate AGI commands. If the compiler was modified to keep the syntax, but generate AGI code, and the regular SCI version was used with the AGI command emulation procs, then it would be possible to write AGI code which could be compiled for AGI and SCI.

It's a bit of a wacky idea, but it would work.

Offline Brian Provinciano

Re:Would a "higher level" AGI compiler be useful?
« Reply #69 on: August 08, 2002, 01:28:44 AM »
I didn't notice that post by Blacki. SCI Studio includes everything except a sound editor, including a compiler. SCIV is SCI0 (EGA). SCIDHUV is SCI1 (VGA). I have built the compiler to work on both (though the one with SCI Studio is only set up for SCI0).

Nick, stick with what you love, there's no need to move to SCI if you don't want. However, my suggested idea in the previous post is very AGI related, so give it a read.

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #70 on: August 08, 2002, 01:51:15 AM »
I think the SCI2AGI logic would be something that Mokalus of Borg would love to try. :)  It sounds good though.. I wonder how much of the syntax you could port over to agi.

A library would be cool (standard agi library.. heh)..  actually, when you think about it, the current games all have a standard library.. there's the debug library and the main logic library.. they're just easy to play around with.

there's that along with proper symbols for variables but the original syntax didn't really allow for this and expected the preprocessor to handle that.

Unfortunately, adding that sort of stuff will probably break a lot of code.. that's why I'm starting with a backwards compatible compiler.  Even expressions that would require an extra variable is a no no.. where would you get that variable from?  how do you know it wasn't used in another logic?

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #71 on: August 08, 2002, 02:25:28 AM »
Another thing is parsing strings.  AGI has variable names within strings.. which need to be parsed but I'm pretty sure they don't..  most preprocessors skip strings so I might need to handle that separately.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline df

Re:Would a "higher level" AGI compiler be useful?
« Reply #72 on: August 08, 2002, 02:34:46 AM »
i'd still like to on the fly convert logic bytecode to z80 :) hehehehe. wrap 'commands' as system calls..

Offline Nick Sonneveld

Re:Would a "higher level" AGI compiler be useful?
« Reply #73 on: August 08, 2002, 02:46:45 AM »
Has anybody ever looked into that funky new Amiga interpreter?  Apparently you can use as many registers as you want.. which makes sense since it's all interpreted anyway.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Mokalus of Borg

Re:Would a "higher level" AGI compiler be useful?
« Reply #74 on: August 09, 2002, 12:44:59 AM »
I believe that AGI, as an engine, has a lot to gain from an easier-to-learn and faster-to-use programming language. That's why I started this discussion in the first place. But I found that my skills and time were not too productive in this particular area.

Mokalus of Borg

PS - I'll be interested to see what you come up with, Nick.
PPS - Maybe, just maybe, after AGI2SCI is complete, I might think about SCI2AGI. But don't count on it. :P


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.114 seconds with 22 queries.