Message Board


Message Board > Fenix / Bennu / Gemix / DIV > If you could re-write fenix...

May 3, 2006, 00:17
PEader
お前はもう死んでいる
1486 posts

Quoting Rincewind:
Quoting PEader:
I think the other thing you want Rincewind is closures.

Wow, there's a name for it, you know your shit Peter. :thumbs:

Nah, you just caught me at the right time. I've been reading up on aspects of programming languages recently. I've rediscovered my intrest. So you just caught me at the right time.
____________
I see 57,005 people.
#
May 3, 2006, 00:30
Woody
HEAD BLACK MAN
722 posts

Oh oh oh change passing variables to processes to be optional. Like you'd call something like moose(life=50, boredome='woar', innit=5); or something like moose(); that would just use some default variables.
____________
boredome is the bitter fruit of too much routine
#
May 3, 2006, 02:44
Fiona
games are terrible
-9616558 posts

Yeah I always wanted default function parameters, you can fake it by just doing something like.

lol(-1);

function lol(stuff)
if(stuff == -1)
stuff = 50;
end

Or whatever. Not quite the same though, eh?
____________
laffo
#
May 3, 2006, 02:53
PEader
お前はもう死んでいる
1486 posts

I want:
Code:
make_game( "MMORPG" );
return earn_money();

____________
I see 57,005 people.
#
May 3, 2006, 03:00
Sandman
F3n!x0r
1194 posts

One could do
Code:
#define PARAM_DEFAULT -1

which would look a lot nicer.
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#
May 3, 2006, 10:29
yonni
None
420 posts
I'd like the compiler to compile to an .exe file, so you don't have to supply the compiler with every game you make.
____________
#
May 3, 2006, 10:49
Moogle
Enterprise Edition
239 posts

I'd rather have function overloading than parameter defaults.

And some proper OO. But then you might just as well switch to a proper language I guess.
____________
I am Moogle and I approve this message.

Quoting (. )( .) in the Bugs topic:
Everytime I login the threads with new posts are by Dennis.
#
May 3, 2006, 11:46
Rincewind
programmer
1545 posts

Quoting yonni:
I'd like the compiler to compile to an .exe file, so you don't have to supply the compiler with every game you make.


You don't have to supply the compiler with every game you make. The Fenix compiler is FXC.exe. The interpreter in FXI.exe.

But anyway if I understand right you still did not succeed renaming the FXI to the name of your dcb file? :P
____________
Personal website: http://www.loijson.com
#
May 4, 2006, 14:10
Rhovanion
Exterminated
666 posts
Quoting Woody:
Oh oh oh change passing variables to processes to be optional. Like you'd call something like moose(life=50, boredome='woar', innit=5); or something like moose(); that would just use some default variables.
overloading processes/functions would be useful indeed.

Exception handling would be nice. Something like.

if (errmessage=game_crashes())
close_opened_files();
write("pneois");
do_some_other_necessary_stuff_before_shutting_down();
exit("you have encountered the following handicap in fenix: '" + errmessage + "'", 0);
end
____________
#
May 4, 2006, 14:31
PEader
お前はもう死んでいる
1486 posts

Dunno about excpetion handling. Some sort of error state management would be better.
____________
I see 57,005 people.
#
May 4, 2006, 15:35
yonni
None
420 posts
exception hadling like PHP's "or die" would be good.
____________
#
May 4, 2006, 15:43
PEader
お前はもう死んでいる
1486 posts

Quoting yonni:
exception hadling like PHP's "or die" would be good.

You can do that with exit(). Besides PHP's or die() is fcuking horrible and is not exception handling.

[Edited on May 4, 2006 by PEader]
____________
I see 57,005 people.
#
May 4, 2006, 16:05
OScoder
None
1338 posts
Quote:
exception hadling

I was imagining if processes could look something like this:

Code:
object process proc1;
proc1.begin(x,y,graph);
proc1.error(int errnum);

OBJECT proc1
 PRIVATE
  variable1;
 PUBLIC
  variable2;

 BEGIN
  crash();
 END

 EROR
  write();
 END
END


[Edited on May 4, 2006 by OScoder]
____________
om
#
May 4, 2006, 16:27
PEader
お前はもう死んでいる
1486 posts

Quoting OScoder:
Quote:
exception hadling
I was imagining if processes could look something like this:

[code]
object process proc1;
proc1.begin(x,y,graph);
proc1.error(int errnum);

OBJECT proc1
PRIVATE
variable1;
PUBLIC
variable2;
BEGIN
crash();
END
EROR
write();
END
END

The pascal object definition is something like that if I recall correctly.
____________
I see 57,005 people.
#
May 4, 2006, 16:50
DTM
Earthling!
821 posts

it looks complicated :-(

as long as it would not be a necessity so newbies could ignore it.

you might as well just turn fenix into a c++ library.

or write a c++ compiler.

in my exquisite opinion.
____________
:o
#
May 4, 2006, 17:34
Rhovanion
Exterminated
666 posts
Fenix should be Object Oriented... Not like Java at all but still Object oriented. The objects being the processes and the code of the process being the class. It would solve some issues I don't like in Fenix. A possible solution for this without sacrificing the original system and make it still look "fenixish" would be something like this:

Code:
 
program This_Game;
include <libraries>;

declare
  public
  private
    what_the_mood;

begin
  some_thing = new Thing();
  what_the_mood = some_thing.get_mood());
  writeln("mood of some_thing: " + what_the_mood);
  loop
    frame;
  end
end

process Thing()
private 
  float comma = 3.9;
  string mood = "lol";
  int count = 20;
  boolean is_this_true = false;

Begin
   this.add(5);
   writeln("5 x 5 = " + count);
End

functions
  public string get_mood()
  begin
    return this.mood;
  end
    
  private void add(int nr)
  begin
    this.count += nr;
  end
end


I'm not saying this is how I would like it, though, it's just that I don't like structured code anymore :P

[Edited on May 4, 2006 by Rhovanion]
____________
#
May 4, 2006, 17:52
PEader
お前はもう死んでいる
1486 posts

Quoting DTM:
it looks complicated :-(

as long as it would not be a necessity so newbies could ignore it.

you might as well just turn fenix into a c++ library.

or write a c++ compiler.

in my exquisite opinion.

Why bother writing a c++ compiler just use gcc and directx.
Why would you write fenix as a C++ library? What would be the benefits? You're talking shit.


Also rhodavion fenix is currently object orientated you mean you just want more control and object methods.

[Edited on May 4, 2006 by PEader]
____________
I see 57,005 people.
#
May 4, 2006, 18:28
OScoder
None
1338 posts
Ok, I was meaning to write more - didn't quite get time as I was at school and had to finish quickly. This was what, on thinking about it, I meant to put:

Code:
program main; //prgram would be replaced with 'module', but that would be more confusing!
public
 var1;
private
 var2;
start
 var2=proc1(1,2);
 proc2[var2].die;
finish
 write("Thanks for playing!");
end

object proc1(int x, int y, int graph=10) 
//note that constructor is included in the 
definition to increase backward compatiblity, 
and make it easier for n00bs.
private
 var1;
 var2;
 die();
public
 var3;
 error(int errnum);
start
 //put constructor code here (what would come normally after begin)
finish
 //put destructor code here
end

proc1.die()
start
 //code goes here
end

proc1.error(errnum)
start
 //code goes here
end


the main differences between this and fenix are:
- objects instead of processes. objects can have types (not included on demo - default is process)
- objects can have methods
- objects can be reffered to directly by their PID
- public and private variables in objects
- exceptions
- 'begin' statements replaced by 'start' and 'finish' (fit better together) as constructors and de-structors. note that 'finish' is not mandatory

what other things I would include but may need more thought:
- inheritance and polymorphism
- ability to link module together
- ability to refference to external libraries
- closures
- 3D programming support directly integrated into processes

The idea of this was to change the language a bit to make it a bit less n00b-proof, but MUCH more powerful!

Any other sexy language features (not that are functions, etc) that you guys could think of adding?

Quote:
The pascal object definition is something like that if I recall correctly

original DIV was pretty similar to pascal. I did check out their object system the other day, so i may have been influenced by that!

btw, how an I stop code separating into lines like this?

[Edited on May 5, 2006 by Woody]
____________
om
#
May 4, 2006, 18:59
PEader
お前はもう死んでいる
1486 posts

Hmm. The D Progamming Language has a thing called contracts. I dnno there is loads of crap you can add. I think if you want to improve Fenix or the language you need to add things which make the language easier to use rather then more complex.
____________
I see 57,005 people.
#
May 4, 2006, 19:33
DTM
Earthling!
821 posts

Quoting PEader:
Quoting DTM:
it looks complicated :-(

as long as it would not be a necessity so newbies could ignore it.

you might as well just turn fenix into a c++ library.

or write a c++ compiler.

in my exquisite opinion.
Why bother writing a c++ compiler just use gcc and directx.
Why would you write fenix as a C++ library? What would be the benefits? You're talking shit.


There would be no benefits. The whole craziness of the idea is my point. in my opinion fenix does not need objects and methods and whatnot, you have c++ and java for that. Fenix is nice and simple. :annoyed:

adding all those features would essentially be writing a new language not rewriting fenix. It could be a great langauge though... :yay:

[Edited on May 4, 2006 by DTM]
____________
:o
#
May 4, 2006, 20:04
PEader
お前はもう死んでいる
1486 posts

ok.
____________
I see 57,005 people.
#
May 4, 2006, 20:33
OScoder
None
1338 posts
Quote:
There would be no benefits. The whole craziness of the idea is my point. in my opinion fenix does not need objects and methods and whatnot, you have c++ and java for that. Fenix is nice and simple.

adding all those features would essentially be writing a new language not rewriting fenix. It could be a great langauge though...


I see what you mean. In truth the REAL reason for re-writing fenix would be the bugginess, but it could be good to change some things along the way. My other perception was that there are alot of annoiances in the language that could be picked up on, like the want to pass custom signals to a process, default values, etc. It would also rock to have a bit more power while keeping the same ease of use, though I do not claim to be able to acomplish something like that.

Was what made DIV originally so popular the fact that it was so simple?
____________
om
#
May 5, 2006, 05:51
Woody
HEAD BLACK MAN
722 posts

Quoting OScoder:
Was what made DIV originally so popular the fact that it was so simple?

I sure wouldn't have bothered with it if it wasn't so simple. I think a language should always have the bare minimum of necessary structure to do stuff, like PHP. When a language forces me to write the same bloated crap for every program I stop bothering to learn it.
____________
boredome is the bitter fruit of too much routine
#
May 5, 2006, 11:09
Moogle
Enterprise Edition
239 posts

I am very much in favor of adding more powerfull OO features, but as people said, you need to keep it simple. Let the extra features be optional in a way where it stays backwards compatible with the current Fenix. Like say:

Normal version:
Quoting Fenix:
process Car()
private
int speed;
begin
//initialize
loop
//update a global with our speed:
global_speed = speed;

//Control the car
//Adjust angle and speed
//Update scroll
frame;
end
//exit code
end

New version:
Quoting Fenix:
process Car()
private
int speed;
begin
//Stop doing it every frame but make it requestbased
routine int getSpeed()
begin
return speed;
end

//Update
routine void updateList(int list)
begin
list.update(x,y);
end

//Destructor
routine void onKill()
begin
//exit code
end

//Extra functionality currently not possible
routine void onSleep()
begin
//Might be funny?
end

//What to do if a routine is called that doesn't exist? So you can anticipate.
routine void onRoutineError(String msg)
begin
say("Subroutine '" + msg + "' not found");
exit(0,"");
end

//The normal code, still normally ran.
//initialize
loop
//Control the car
//Adjust angle and speed
frame;
end
end


Give it routines, maybe even context sensitive optional ones like above. But the trick is, keep it backwards compatible, keep it easy.

[Edited on May 5, 2006 by Moogle]
____________
I am Moogle and I approve this message.

Quoting (. )( .) in the Bugs topic:
Everytime I login the threads with new posts are by Dennis.
#
May 5, 2006, 19:42
Frimkron
Frustrated Megalomaniac
703 posts

I agree that the beauty of the Div language was its relative simplictiy - that it didn't have lots of extra tagged-on features to the language. Meaning that when you read someone else's code, you knew what it meant straight away.

[Edited on May 5, 2006 by Frimkron]
____________
#

Page 1 , 2 , 3


Message Board > Fenix / Bennu / Gemix / DIV > If you could re-write fenix...

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!