.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #34  
Old October 18th, 2004, 11:51 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE4 Templatizer Ready for Download!

Hmmm... looks like the scripting language might have to wait... I just remembered that the on-the-fly code compilation that I was going to use uses something called "reflection", which is VERY slow, and is what was slowing down my program so much in the first place!

I don't suppose throwing together my own interpreter would run code any faster than Microsoft's reflection, would it? Even though I'd be limiting the instruction set, hopefully speeding up the parsing, I don't think I'm that good that I could compete with the likes of them

On the other hand......

The compilation feature of .NET also has the ability to actually compile code into a DLL *on disk*, so maybe what I could do is provide a very basic language that is easy to use, write a compiler for it, which of course would run as quickly as anything I hardcode...

So, what features would you like to be in such a language? Basic math and logical operations are obvious, as are conditional and looping statements (though loops can be created by conditionals and gotos, should I choose to include gotos ) Variable declarations might also help...

Now since we're only going to be defining functions and no fancy data structures in this language, I suppose it might make sense to cut down on the typing and use something similar to Erlang's function definition style, which looks a LOT like the formal mathematical style (forgive my poor syntax; I've never actually written anything in Erlang before )

Recursive algorithm for finding factorials:
Code:

fact(0) -> 1.
fact(1) -> 1.
fact(n) -> if n < 0 error() else n * fact(n - 1).



How does that look? Readable? Maybe I'll get the hang of Erlang after all... then maybe I can even work on writing PLUGINS and stuff for Wings! (Nah, I won't have the time, and besides, I've barely scratched the surface of the language )

(Wow, I never thought I'd be developing my own .NET language, but really, I might be!)

Or maybe I SHOULD start over in Python... I'm already pretty much starting over as it is
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:55 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.