Rumoh Mongtuh
Rumoh Mongtuh: May 2008

Father and Son

Lyrics : Cat Stevens (Yusuf Islam)

Father
Its not time to make a change,
Just relax, take it easy.
Youre still young, thats your fault,
Theres so much you have to know.
Find a girl, settle down,
If you want you can marry.
Look at me, I am old, but Im happy.

I was once like you are now, and I know that its not easy,
To be calm when youve found something going on.
But take your time, think a lot,
Why, think of everything youve got.
For you will still be here tomorrow, but your dreams may not.

Son
How can I try to explain, when I do he turns away again.
Its always been the same, same old story.
From the moment I could talk I was ordered to listen.
Now theres a way and I know that I have to go away.
I know I have to go.

Father
Its not time to make a change,
Just sit down, take it slowly.
Youre still young, thats your fault,
Theres so much you have to go through.
Find a girl, settle down,
If you want you can marry.
Look at me, I am old, but Im happy.
(son-- away away away, I know I have to
Make this decision alone - no)
Son
All the times that I cried, keeping all the things I knew inside,
Its hard, but its harder to ignore it.
If they were right, Id agree, but its them you know not me.
Now theres a way and I know that I have to go away.
I know I have to go.
(father-- stay stay stay, why must you go and
Make this decision alone? )

__________________________________________________________
Rumoh MONGTUH - IT Solution | Said Syahputra | www.mongtuh.com

Superiority of Nusa

How Nusa is superior compared to C, C#, C++, Java, BASIC, and Delphi (Pascal)

1. Introduction
In the time where there are abundance of programming-languages, creating new programming-language is often met with criticism as ‘yet another programming-language’. On the other hand, we’ve seen big companies were often successful in enforcing their programming-language into the market with their big amount of money, or by community.

C#, C++, Java, and Visual BASIC are programming-languages that successful mainly through the support of big amount of money from companies. C# and Visual BASIC were backed up by Microsoft. C++ was backed up by AT&T. Java was backed up by Sun Microsystem. PERL and PHP are examples of programming-languages that were successful through the support of community.
1.1 Raison d'ĂȘtre: modular-programming, good encapsulation
Back to the creation of new programming-language, should anyone create new programming-language given the abundance of programming-languages? Yes, because all well known general-purpose programming-language badly implements the encapsulation and modular-programming. No well known general-purpose programming-language eases the understanding of modular programming.

1.2 Focus of this book
This book focuses on the superiority of Nusa, not on how to start programming with Nusa for beginner. For the latter purpose, please read the book ‘Programming in Nusa for beginners’.

Let us start with the explanation on how Nusa is superior compared to C.

1.3 Nusa compared to C
Major deficiency: modular-programming
Here are two questions
What is a module (conceptually)?
What is a module (actually in C)?

You can search the Web for the first and second question. We bet you’ll find too many incoherent answers from the Web. The incoherence of many answers proves these:

The world of programming is a chaotic world, full of poorly defined terms.
In many circumstances there is no such thing as concept.

Specifically

The concept of module does not (appropriately) exist.
C does not implement good modular programming.

Let’s get started with C. Here is an example showing two modules, with one module being the main module (main-module is often mistaken as ‘main program’)

// module01.h
int f1();
void p2();
If I did not put the name of module01 as (part of) the filename, would anyone understand I’m creating a module? Most likely not, and that’s what happens.

C is a very bad programming-language when it comes to (explain) the modular-programming.

And what .h stands for? Header-file? Does the term 'header file' self-explain the meaning/semantic? No. ‘Header-file’ is not a self describing term.

1.3.1 Module’s interface in C
Let us tell you, what the C author (perhaps unconsciously) implied with the term ‘header file’ was 'module’s interface'. Yes, this code is the module’s interface.

// module01.h
int f1();
void p2();

Let’s digest a bit about the term 'Interface'. Have you ever heard about API? Yes, it’s an abbreviation. Whether it stands for Application-Program Interface or Application-Program Interface is perhaps a matter of belief (or taste?). As an aside, the abbreviation some say DNS stand for Domain Name System, some say for Domain Name Server, and some say Domain Name Service. The world is full with too many synonyms and confusions surrounding them.

Now, does a module contain the interface only? No, but before getting back to answer that question, let us see how to complete the code for module01 in C.

// module01.c

int f1()
{
return 5;
}

void p2()
{ }

1.3.2 Module’s implementation
Almost all (if not all) IT scholars, practitioners, and authors of C programming-language use various terms to refer to the module01.c above, and there is also lack of coherence. Some will say C file, some say implementation file, some say source file.

What does the module01.c really stand for? It stands for module’s implementation. Again, is C self-describing on the concept 'module’s implementation'? NO, not at all!

1.3.3 Module in Nusa
Modular-programming is very self-describing in Nusa. To create module with the same purpose as in C’s module we’ve just seen, in Nusa we do it this way.

Module Module01;
interface
integer f1();
void p2();

implementation
integer f1()
{
return (5);
}

void p2()
{ }

It’s very easy to learn modular-programming in Nusa. A program is collection of modules. The notion of module is easily described in Nusa. Any module (in its complete source-code) is self-describing, as can be seen at the word 'Module' in the beginning of any module.

Module’s interface can be easily understood. There is a word 'interface' somewhere in the module. Hence, the concept of 'Program Interface' (better notion than 'Application Program Interface', because not every program is an application program) can also be easily understood.

Module’s implementation can also be easily understood. What is a good implication? We can better specify the job of software designer. They created the interface. The implementer, on the other hand, will implement the code based on the interface(s). This simple understanding is lost in the midst of millions of books because too many people are confused.

1.3.4 Program in C
Let us create another module in C, the one that uses the previous module.

#include "module01.h"

void main()
{
int z = f1();
p2();
}

The notion of program is not evident in C. There is no word 'Program' in C.

1.3.5 Program in Nusa
In Nusa, we must create the program explicitly. This is how we create program in Nusa (with the same purpose as in the C 'program' shown before).

Program Module02;

Use (Module01);

void main()
{
integer z := f1();
p();
}

The Program Module02 consists of two modules: module01 and module02. Later, the specification of Nusa will enable (and perhaps enforce) the writing of such module to be like this.

Program Example01
Module Main;

Use (Module01);

void main()
{
integer z := f1();
p();
}

With that kind of writing, the above source-code of Nusa describes the Program Example01 as a program consisting of two modules: Module01 and Main. As the name inspires, the module with the name Main will serve as main-module. The main-module must have the main-operation, the operation named main.

1.4 Nusa compared to C: information hiding
C is often used as programming-language of choice to write large-scale software, software like Operating Systems. From another perspective, the authors of Software Engineering books often quote Software Engineering as engineering large-scale industrial-strength software. The authors usually also mention about what is expected from a programming-language, to engineer a software.

If we combine the three, it looks like the fact confirms these reasonings Since C was and is de facto used to create large-scale software, and The engineering of large-scale software expects certain features and supports from programming-language used
Then C has the required features and supports of software engineering

The reasoning is false, the conclusion is misleading. C lacks several qualities as a good programming-language to engineer (large-scale) software. At this moment we will not comment further on why too many programmers were and are blindly using C to create OS.

We will focus on what is missing in C to make it a good programming-language to engineer good quality source-code and software. It is: the encapsulation (information-hiding).

1.4.1 Hiding the information of operations
Suppose we want to create two operations: f2 and p1; and want neither to be accessible outside the declaring/defining module. How should we write it in C.

This will be the content of 'header-file'

// module01.h

int f1();
static int f2();

void p2();
static void p1();

and this will be the content of 'source-file'

// module01.c

int f1()
{ return 5; }

static int f2()
{ return 3; }

void p2()
{ }

static void p1()
{ }

This will be one way to test the declaring/defining module.

#include "module01.h"

void main()
{
int z = f1(), y = f2();
p1();
p2();
}

Compiling and linking the modules in Visual Studio 2008 gives us this error

1>d:\project\00000001\module02.cpp(9) :
error C2129: static function 'int f2(void)' declared but not defined
1> d:\project\00000001\module01.h(4) : see declaration of 'f2'
1>Generating Code...
1>Build log was saved at "file://d:\Project\00000001\Debug\BuildLog.htm"
1>00000001 - 1 error(s), 0 warning(s)

The confusion itself grown even among the top programmers, the ones that created the gigantic tool like Visual Studio 2008. The error message itself is an error. The function f2() is defined – see the 'source-file' Module01.cpp', but the tool reports otherwise.

As further proofs on the confusion from the C programming-language, search the web for exact phrase "static function in C". www.velocityreviews.com/forums/t315530-what-is-a-static-function-in-c-.html contains one sample answer.

Your friendly C textbook should have already explained this.
A static function has a name visible in that translation unit only. A normal function has a name visible across the entire program.
If you were to have two source files:
static int foo() {
return 0;
}
int bar() {
return 0;
}
(both files look the same)
you would get "function already defined" errors for bar, but foo would compile absolutely OK.

Is it good? No, it’s bad explanation. So, how should we explain it? By mastering Nusa.

1.4.1 Hiding the information of operations in Nusa
This is an example how we can encapsulate (hide information) in Nusa. We give simple example on how to encapsulate operations (functions and procedures).

Module Module01;

interface

integer f1();
void p2();

implementation

integer f2();
void p1();

integer f1()
{ return (5);}

void p2()
{ }

integer f2()
{ return 3; }

void p1()
{ }

So, how can we encapsulate (hide information about) something? By putting it inside the implementation section only. Read the module as if it is written like this.

Module Module01;

public

integer f1();
void p2();

private

integer f2();
void p1();

integer f1()
{ return (5);}

void p2()
{ }

integer f2()
{ return 3; }

void p1()
{ }

Any other module that uses module01 will only see the public portion. So why we choose the word 'interface' over 'public', and 'implementation' over 'private'? There are reasons whose explanation is beyond the scope of this book. Now, let’s see the main module in Nusa.

Program Example02;

Use (Module01);

void main()
{
integer z := f1(), y := f2();
p1();
p2();
}

If we translate the program, the Nusa translator reports this.

Error @Line 000007: not allowed to access private item 'f2'

The error message is easier to be specified and understood than the one in C. Nusa uses only module as the means of encapsulation (information hiding). Anything that is put on the interface section is public, while anything that is put ONLY on the implementation section is private.

Nusa makes it very easy to understand encapsulation and modular-programming. Thus, we have proved the superiority of Nusa over C in terms of encapsulation and modular-programming.

by Bernaridho Hutabarat | www.bernaridho.net

_____________________________________________________________
Rumoh MONGTUH - IT Solution | Said Syahputra | www.mongtuh.com

Introduction: About Nusa

Nusa is a general-purpose programming-language created by Bernaridho Hutabarat. Nusa is created to be the highly orthogonal programming-language, something that ALL well-known programming-languages (C, C#, C++, Java, BASIC, Delphi) fall short. As the consequence of lack of orthogonality, all those general-purpose programming-languages are very difficult to master, full of unnecessary complexity

Nusa is highly orthogonal, as can be seen from the syntax to declare object, type, and operation. It is a shame that there are many researchers of programming-languages around the world, yet too few research were and are not directed to aim for high orthogonality. It is safe to say that too many research are misled and fruitless. Enough for this introduction. Please read the document/writing in the right of this writing. In the near future, you can download the interpreter, library, and the manual.

by Bernaridho Hutabarat | www.bernaridho.net


_____________________________________________________________
Rumoh MONGTUH - IT Solution | Said Syahputra | www.mongtuh.com