Jump to content
  • entries
    38
  • comments
    119
  • views
    87,701

Easy language


Canardia

3,713 views

 Share

I introduced my new language earlier in Roland's Wizard thread, so I thought I could explain it a bit more.

Of course a new language is always seen a bit sceptically by people, and they wonder why is it needed, or what benefits does it bring.

 

At its first version, Easy is still very simple, and based on Variadic Macros (macros which can take a dynamic amount of parameters), and I hope I can keep it that way, and not need a seperate preprocessor, since it would break some features, like direct compiling in Visual Studio and other compilers, and in other languages too.

 

Although Easy is not always less to code than C++, BASIC or Pascal, it should be still faster to code with, as you don't have to type characters like "{", "}", "=", "<", ">", ":" and ";", but you always use only "(" and ")". So it's less thinking while coding (or looking up help files and examples), and it should get quite intuitive after writing your first few programs.

 

Let's compare C++, BlitzMax and Easy code:

 

C++:

#include "stdio.h"

int main()
{
printf( "Hello World!\n" );
for( int i=1; i<=10; i++ )
{
	printf( "%d\n", i );
}
return 0;
}

 

BlitzMax:

SuperStrict
Print "Hello World!"
For Local i:Int = 1 To 10
Print i
Next

 

Easy:

#include "easy.h"
Begin
Print( "Hello World!" LineFeed )
For( Int, i, 1, 10 )
	PrintIntLine( i )
End
Return( 0 )
End

 

As you can see, Easy has the least amount of special characters used, and everything is kept simple using a few characters: "(", "," and ")". It's also more readable (round brackets are reader friendly also in mathematics, as they do the thinking for you, when combining multiplication, division, powerization and addition in formulas), especially for persons who don't know the language in question (C++ or BlitzMax).

 

The line feed handling is still something I'm thinking about, it could end up as: PrintIntLine( i ), or PrintInt( i, LineFeed )

 

The official Easy web page can be found here:

http://www.siipi.com/easy

 Share

8 Comments


Recommended Comments

Either this is a joke and then its funny,

or (horrible thought) it is serious. In that case

its a waist of time and effort. Macro languages

has never and will never be any success. The only

thing they do is to make it harder to follow what

really happens.

Link to comment

That may be well true if the macro language is not implemented in a strict and clean way. I'm trying to keep things clean, and rather project the C++ language than to redefine it. A simple projection can do no harm, as it's just a shorter way to write the same thing.

 

It will of course make the proposed high end language not as simple as it could be, but that cost is well covered by the fact that the underlying C++ language is not broken, but only shortened.

 

Easy is not harder to follow than C++ in error situations, since it's very clear what each command does. There are no complex preconditions, invariants and postconditions, but each command is directly projected from C++. That's what makes debugging just as easy as in C++.

Link to comment

Thanks ;)

Anyway when a lot of programmers don't agree, it may mean that I'm on the right path, since it's hard to convince them to change their habits. When additionally then non-programmers agree, then I know it for sure.

Link to comment

For( Int, i, 1, 10 )

 

The comma between the 'int' and the 'i' would start to annoy me after a while. Perhaps because I'm not used to it. But I think even a non-programmer would eventually start to think "I wish I didn't have to put that comma in all the time"

Link to comment

Yeah, I've been thinking about that also, because if you want to use a loop variable which has been defined earlier, it looks even more ugly: For( , i, 1, 10 ).

 

I think the strict usage of the Define() command could be applied here, so it would then be like:

For( Define( Int, i ), 1, 10 )

and when i was defined earlier:

For( i, 1, 10 )

Link to comment
Guest Red Ocktober

Posted

don't ya think that the whole idea of the FOR/NEXT construct lies in opposition to what an 'easy' language is supposed to be all about.... i mean... in essence, it seems like all you're going to wind up doing is remaking c... or BlitzMAX... not so much easier, just different...

 

in order to make it easy... you'd have to abandon all these constructs that traditional programming syntaxes employ...

 

 

 

maybe something like this

 

loop, 10, ( printline)

 

or

 

do 10 times (printline)

 

 

ahhh... just i'm just thinking out loud here... ;)

i really wouldn't have the faintest idea where to start on such a project...

 

 

the hardest thing to do is to make something that could involve so much potentially complex logic appear easy on its face...

 

you've got a tough job ahead of you... good luck...

 

--Mike

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...