1. Re: QBasic/BASIC programmers learning Euphoria

>mind you, no language can match optimized machine code
>(assembler/linker output) for speed and to some extent, program size. C++

    Only about 1% of the ASM programmers can make a simple program faster in
ASM than optimized C. Only in really small stuff (like a mask routine) an
ASM programmer makes faster code than a C or C++ compiler.
    The reason these days C(++) seems to be slower and slower is the
moveover to 100% OO code, and the fact that the optimizing OO is a lot more
complicated than optimizing function code, that is why C++ is unable to
optimize their code as much as they can do with pure C.

>adds ease of programming and security to it. The step from C++ to Euphoria
>is like moving from a manual "stick-shift" car to one with an automatic
>trasmission and tons of neat accessories.

Which accessories ?
It is simply the difference between a high- and low- level language.
Low- you tell the chip what *he* has to do step by step.
High- you tell the chip what *you* what should be accomplished.

The most extreme high language would be a 4th generation language.. maybe
Modula2. (althrough I still think, that placing something within a context
as it actually does, makes it no different from a 3rd generation language)

The most extreme low language would be pure machine code.
Add a human-readable vocabulary and premitive preproccesing to it and you
have ASM.
Add extensive preproccesing and macro's and you have C.

C without any head or macro is very very low level.
All high-level elements were placed in with macro's
Example: a for statement in C:

    for (a, b , c) d

translates to:

    a;
    while (b);
    {
    c;
    d;
    }

Even the whole OO stuff consists of macro's.
A simple C compiler in Euphoria would not be more than two or three pages of
code.

This made C the ultimate hack language. You could do stuff high, and if it
didn't work 100% right, you needed had to revise your algoritm or somehting!
You could just place a hack in. Pointers are the best example of this.

And like all ultimate hack stuff, it became very popular. (yes, like all
ultimate hack stuff, compare the succes of the Commondore 64 with the
Spectrum ZX for example), or consider basic. Oh.. i'll just jump away..
basic programs work ya.. because you can fix them with a hack!

Euphoria is the oposite of a hack-language, that is was makes it so great.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu