YAPL - Yet Another Programming Language

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Heathfield

    #16
    Re: YAPL - Yet Another Programming Language

    Roberto Waltman said:
    <adem24@adem24a dem24.org.inval idwrote:
    >
    >>... a new programming language is needed ...
    >>...
    >8) There are no reserved words.
    >>
    Wonderful! What the world needs is one more language that allows you
    to write:
    >
    "IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE IF;"
    >
    or something like that...
    Your wish is my command.

    Here is the source code for a compiler for the BETTIE (Begin/Else/Then/er,
    Then/If/End) language:

    /* BETTIE Compiler

    The BETTIE (Begin/Else/Then/er, Then/If/End) language
    has five keywords: BEGIN, ELSE, THEN, IF, and END.

    I'll let you figure out the semantics for yourself.

    Richard Heathfield, 1 July 2008
    */


    #include <stdio.h>
    #include <string.h>

    #define LW 16

    int t(unsigned long int n)
    {
    static unsigned long l = 0;
    char x[] = "Oh? Oh! Oh okay.";
    l==0 || putchar(' ');
    putchar(x[(n & 0xFF000000) >24]);
    putchar(x[(n & 0xFF0000) >16]);
    putchar(x[(n & 0xFF00) >8]);
    putchar(x[n & 0xFF]);
    ++l==LW && putchar('\n');
    l%=LW;
    return 1;
    }

    int main(void)
    {
    char i[256] = {0};
    int ms = 0;
    while(1 == scanf("%255s", i))
    {
    if(strcmp(i, "ELSE") == 0)
    {
    ms = !ms;
    }
    else
    {
    if(strcmp(i, "BEGIN") == 0)
    {
    (ms && t(0xB0C0F) && t(0xB0C06)) ||
    (t(0xB0C06) && t(0xB0C02));
    }
    else if(strcmp(i, "END") == 0)
    {
    (ms && t(0xB0C06) && t(0xB0C0F)) ||
    (t(0xB0C02) && t(0xB0C06));
    }
    else if(strcmp(i, "THEN") == 0)
    {
    (ms && t(0xB0C0F) && t(0xB0C02)) ||
    (t(0xB0C02) && t(0xB0C0F));
    }
    else if(strcmp(i, "IF") == 0)
    {
    (ms && t(0xB0C0F) && t(0xB0C0F)) ||
    (t(0xB0C06) && t(0xB0C06));
    }
    else
    {
    fprintf(stderr, "Syntax error: %s\n", i);
    }
    }
    }
    putchar('\n');
    return 0;
    }

    And here is a "hello world" program written in BETTIE:

    ELSE THEN IF IF IF IF IF IF IF IF IF ELSE BEGIN THEN ELSE IF
    IF IF IF IF IF IF IF THEN ELSE IF END THEN ELSE END THEN IF IF
    IF IF IF IF IF ELSE BEGIN THEN ELSE IF IF IF IF THEN ELSE IF
    END THEN ELSE IF END IF IF IF IF IF IF IF END END IF IF IF END
    THEN THEN THEN IF IF IF IF IF IF IF IF ELSE BEGIN THEN ELSE IF
    IF IF IF THEN ELSE IF END THEN ELSE END THEN THEN THEN IF IF
    IF IF IF IF IF IF IF IF ELSE BEGIN THEN ELSE IF IF IF IF IF IF
    IF IF IF THEN ELSE IF END THEN IF IF IF ELSE END ELSE THEN THEN
    THEN THEN ELSE END IF IF IF END ELSE IF IF IF IF IF IF ELSE END
    ELSE IF IF IF IF IF IF IF IF ELSE END THEN THEN IF END

    --
    Richard Heathfield <http://www.cpax.org.uk >
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999

    Comment

    • CBFalconer

      #17
      Re: YAPL - Yet Another Programming Language

      campyhapper@yah oo.com wrote:
      CBFalconer <cbfalco...@yah oo.comwrote:
      >
      > [mail]: Chuck F (cbfalconer at maineline dot net)
      > [page]: <http://cbfalconer.home .att.net>
      >
      This appears to have little to do with the C language, and is thus
      off-topic.
      You appear to be an idiot unable to recognize a sig. marker. Bye.

      --
      [mail]: Chuck F (cbfalconer at maineline dot net)
      [page]: <http://cbfalconer.home .att.net>
      Try the download section.


      Comment

      • rio

        #18
        Re: YAPL - Yet Another Programming Language


        "Adem24" <adem24@adem24a dem24.org.inval idha scritto nel messaggio
        news:g48gn4$6nd $1@aioe.org...
        The World Joint Programming Language Standardization Committe (WJPLSC)
        hereby proclaims to the people of the world that a new programming
        language
        is needed for the benefit of the whole mankind in the 21st millenium.
        This new language not only differs from existing ones by new features
        and paradigms but which also brings real advantage by rigourously
        preventing bad programmer habits by omitting features which are outdated.
        In the proposed new joint language for the world (codename YAPL)
        several concepts in use by currently used bad languages have been
        eliminated.
        All UN member countries and organizations are urged to adapt these
        recommendations which are for the benefit and safety of the planet and the
        mankind:
        >
        1) There is no goto statement.
        Hidden goto's like break- and continue-statements are also omitted.
        I would take "if() goto" and "goto" and would loose if(), while(), for(), do
        while(),
        etc

        For me the base language has to have these points
        1) No UB so people instead of speak of UB, they program
        2) So it should be easy to master and to program so that whatherver
        someone write something, there is not much of say about "grammar"
        3) If there is some error in writing something it stop to run
        4) it is easy to read and to write
        5) it should have only few instruction, no if-loop controls only
        conditionals jumps and gotos

        so it should be some subset of some cpu assembly
        2) There is no return statement.
        Instead a result variable can be declared to which the result of a
        function can be assigned.

        3) There are no automatic type conversions.
        When a subprogram should be used for different types it must be
        overloaded.
        >
        4) There are no variable length parameter lists.
        Instead it is possible to use arrays as parameters.
        >
        5) There are no default parameters.
        But it is easy to define two subprograms: One with and one without an
        additional parameter.
        >
        6) There is no special "parameter" called "self" or "this".
        In a procedure the receiving object is declared as formal parameter
        with a user-defined name.
        >
        7) There is no macro feature since this mechanism is too similar to the
        subprogram feature.
        Instead subprograms can be used in a more flexible way than in other
        languages.
        >
        8) There are no reserved words.
        >
        9) There is no conceptual distinction between functions, operators,
        procedures and statements.
        >
        10) The procedure calling mechanism is not based on a concept with an
        object-message pair
        (An object receives a message). Instead a match is done over a list of
        objects.
        This more general (and powerful) mechanism is called multimatch and it
        includes
        the simple object-message mechanism as special case.
        >
        >
        cu l8er
        Jesus DeCoder



        Comment

        • contestcen

          #19
          Re: YAPL - Yet Another Programming Language

          On Jun 29, 12:27�pm, "Adem24" <ade...@adem24a dem24.org.inval idwrote:
          The World Joint Programming Language Standardization Committe (WJPLSC)
          hereby proclaims to the people of the world that a new programming language
          is needed for the benefit of the whole mankind in the 21st millenium.
          This new language not only differs from existing ones by new features
          and paradigms but which also brings real advantage by rigourously
          preventing bad programmer habits by omitting features which are outdated.
          In the proposed new joint language for the world (codename YAPL)
          several concepts in use by currently used bad languages have been eliminated.
          All UN member countries and organizations are urged to adapt these
          recommendations which are for the benefit and safety of the planet and themankind:
          >
          �1) There is no goto statement.
          � � Hidden goto's like break- and continue-statements are also omitted.
          >
          �2) There is no return statement.
          � � Instead a result variable can be declared to which theresult of a function can be assigned.
          >
          �3) There are no automatic type conversions.
          � � When a subprogram should be used for different types it must be overloaded.
          >
          �4) There are no variable length parameter lists.
          � � Instead it is possible to use arrays as parameters.
          >
          �5) There are no default parameters.
          � � But it is easy to define two subprograms: One with andone without an additional parameter.
          >
          �6) There is no special "parameter" called "self" or "this".
          � � In a procedure the receiving object is declared as formal parameter with a user-defined name.
          >
          �7) There is no macro feature since this mechanism is too similar to the subprogram feature.
          � � Instead subprograms can be used in a more flexible waythan in other languages.
          >
          �8) There are no reserved words.
          >
          �9) There is no conceptual distinction between functions, operators, procedures and statements.
          >
          10) The procedure calling mechanism is not based on a concept with an object-message pair
          � � (An object receives a message). Instead a match is done over a list of objects.
          � � This more general (and powerful) mechanism is called multimatch and it includes
          � � the simple object-message mechanism as special case.
          >
          cu l8er
          Jesus DeCoder
          >
          .
          Item 1 states that hidden Goto's are omitted. To the list which is
          given (Continue and Break) the proposer should add For, While, Repeat,
          If-Then-Else as well as procedure and function calls.

          Comment

          • s0suk3@gmail.com

            #20
            Re: YAPL - Yet Another Programming Language

            On Jun 30, 11:46 pm, "rio" <a...@b.cwrot e:
            "Adem24" <ade...@adem24a dem24.org.inval idha scritto nel messaggionews:g 48gn4$6nd$1@aio e.org...
            >
            >
            >
            The World Joint Programming Language Standardization Committe (WJPLSC)
            hereby proclaims to the people of the world that a new programming
            language
            is needed for the benefit of the whole mankind in the 21st millenium.
            This new language not only differs from existing ones by new features
            and paradigms but which also brings real advantage by rigourously
            preventing bad programmer habits by omitting features which are outdated.
            In the proposed new joint language for the world (codename YAPL)
            several concepts in use by currently used bad languages have been
            eliminated.
            All UN member countries and organizations are urged to adapt these
            recommendations which are for the benefit and safety of the planet and the
            mankind:
            >
            1) There is no goto statement.
            Hidden goto's like break- and continue-statements are also omitted.
            >
            I would take "if() goto" and "goto" and would loose if(), while(), for(), do
            while(),
            etc
            >
            For me the base language has to have these points
            1) No UB so people instead of speak of UB, they program
            2) So it should be easy to master and to program so that whatherver
            someone write something, there is not much of say about "grammar"
            3) If there is some error in writing something it stop to run
            4) it is easy to read and to write
            5) it should have only few instruction, no if-loop controls only
            conditionals jumps and gotos
            >
            so it should be some subset of some cpu assembly
            >
            All those things are exactly what most modern programming languages
            try to omit/discourage (except point 4). I'm not surprised what you
            say in point 2 about not being there much to say about grammar, since
            4 of your 5 points have grammatical errors. :)
            2) There is no return statement.
            Instead a result variable can be declared to which the result of a
            function can be assigned.
            3) There are no automatic type conversions.
            When a subprogram should be used for different types it must be
            overloaded.
            >
            4) There are no variable length parameter lists.
            Instead it is possible to use arrays as parameters.
            >
            5) There are no default parameters.
            But it is easy to define two subprograms: One with and one without an
            additional parameter.
            >
            6) There is no special "parameter" called "self" or "this".
            In a procedure the receiving object is declared as formal parameter
            with a user-defined name.
            >
            7) There is no macro feature since this mechanism is too similar to the
            subprogram feature.
            Instead subprograms can be used in a more flexible way than in other
            languages.
            >
            8) There are no reserved words.
            >
            9) There is no conceptual distinction between functions, operators,
            procedures and statements.
            >
            10) The procedure calling mechanism is not based on a concept with an
            object-message pair
            (An object receives a message). Instead a match is done over a list of
            objects.
            This more general (and powerful) mechanism is called multimatch and it
            includes
            the simple object-message mechanism as special case.
            >
            cu l8er
            Jesus DeCoder

            Comment

            • thomas.mertes@gmx.at

              #21
              Re: YAPL - Yet Another Programming Language

              On 30 Jun., 12:04, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
              wrote:
              Adem24 wrote:
              1) There is no goto statement.
              Hidden goto's like break- and continue-statements are also
              omitted.
              >
              There are cases, they are scarce but they exist, where goto is
              nothing else but really usefull, ...
              Others have already answered to this. Just one point:
              In Java goto is a reserved word but does not presently serve any
              function.
              2) There is no return statement.
              Instead a result variable can be declared to which the
              result of a function can be assigned.
              >
              Helps you in how far? Makes lambda expressions a PITA.
              Why should that make any problems with lambda expressions?
              Seed7 (the list is an almost exact copy from the Seed7 manual) uses
              result variables which represent the function result when the
              function is left. The user can define the name of the result
              variable and it can be used like a normal variable. This is similar
              to Pascal where the function name is used as result variable. The
              difference is that in Pascal normal usages of the function name
              (which are not at the left side of an := ) are interpreted as
              recursive calls and not as usages of the result variable. In the
              following function definition a result variable is used:

              const func string: gets (inout string: stri,
              in integer: leng) is func
              result
              var string: result is "";
              begin
              result := stri[.. leng];
              stri := stri[succ(leng) ..];
              end func;

              As you can see the name of the result variable is 'result'. Although
              'result' is also used as keyword in the function declaration this
              does not imply that all keywords can be used as variable names. The
              keyword 'result' is used in the middle of a syntactic construct (it
              just follows the keyword 'func'). As such it does not introduce
              something. Therefore the keyword 'result' can be used as variable
              name. Most other keywords like 'if', 'while', 'for' , etc. introduce
              a statement (or some other construct) and therefore it cannot be
              used as variable name.
              3) There are no automatic type conversions.
              When a subprogram should be used for different types it
              must be overloaded.
              >
              If a type can be converted without possible loss of data, why not
              make it implicit. Compilers (should) raise a warning otherwise,
              anyway.
              The avoidance of implicit conversions gives us something:

              For every expression (and sub expression) you know its type at
              compile time without knowing where this expression is used.

              This principle improves the readability of code.
              I am discussing this also in the FAQ, see:

              4) There are no variable length parameter lists.
              Instead it is possible to use arrays as parameters.
              >
              See the D programming language. D even has a feature, that
              variable parameter lists are implicitly converted into an array.
              As I said already I am not a fan of implicit conversions.
              6) There is no special "parameter" called "self" or "this".
              In a procedure the receiving object is declared as formal
              parameter with a user-defined name.
              >
              In OOP aimed languages such parameters are implicitly created,
              but a fixed name is a must, otherwise code is hard to read.
              I see no reason why code is hard to read when a user supplied name
              can be used. Non-OO languages had user defined parameter names for
              ages. If you want you can use 'this' as user defined parameter name.
              BTW: How do you name your 'this' variables when you use multiple
              dispatch? Don't say 'this1', 'this2', ...

              What multiple dispatch is, is explained here:

              7) There is no macro feature since this mechanism is too
              similar to the subprogram feature.
              Instead subprograms can be used in a more flexible way than
              in other languages.
              >
              Sounds like templates and mixins in the D programming language
              Seed7 supports templates, but instead of special template constructs
              normal functions are used. Seed7 functions can use types as
              parameters and/or a type as function result. Such template functions
              are executed at compile time and may declare things like functions.
              In this function declarations the type parameters can be used.
              That way no special template syntax with angle brackets or similar
              constructs is necessary.
              8) There are no reserved words.
              >
              Err, how do you want to code then? Ther muse be a few reserved
              words the lexer can recognize. How do you want to reference
              preimitive typed then?
              There are keywords which are used at various places. Some keywords
              introduce statements or other constructs (such as declarations).
              E.g.: The keywords 'if', 'while', 'repeat', 'for', and some others
              introduce statements. Other keywords like 'do', 'range', 'result,
              etc. are used in the middle of statements (or other constructs).

              Seed7 uses syntax declarations to specify the syntax of statements.
              I use the word 'keyword' when a name is used somewhere in a syntax
              declaration. Syntax declarations reduce the possibilitys to use
              a keyword out of context. E.g: After the keyword 'if' the lexer
              expects always an expression. This makes 'if' unusable as variable
              name. This way you get error messages when you try to use 'if' as
              variable name. That behaviour is just the same as in other languages
              which have reserved words.
              9) There is no conceptual distinction between functions,
              operators, procedures and statements.
              >
              See the D programming language. Operators are actually calls to
              functions named op_add, op_mul, op_cmp and so on.
              Connecting operators and functions with a mapping like + --op_add
              is one possibility. In Seed7 new operators can be invented, but
              there is no user visible mapping to a function name.
              10) The procedure calling mechanism is not based on a concept
              with an object-message pair
              (An object receives a message). Instead a match is done
              over a list of objects. This more general (and powerful)
              mechanism is called multimatch and it includes the simple
              object-message mechanism as special case.
              >
              Bug prone and non deterministic. Can make hell break loose (think
              about circular calls...)
              I see no reason why this should be the case. The technic to connect
              a method to more than one type is called multiple dispatch. I wrote
              an explanation of multiple dispatch here:


              If there are questions, just ask.
              I am happy with every feedback.

              Greetings Thomas Mertes

              Seed7 Homepage: http://seed7.sourceforge.net
              Seed7 - The extensible programming language: User defined statements
              and operators, abstract data types, templates without special
              syntax, OO with interfaces and multiple dispatch, statically typed,
              interpreted or compiled, portable, runs under linux/unix/windows.

              Comment

              • thomas.mertes@gmx.at

                #22
                Re: YAPL - Yet Another Programming Language

                On 1 Jul., 00:17, Roberto Waltman <use...@rwaltma n.comwrote:
                <ade...@adem24a dem24.org.inval idwrote:
                ... a new programming language is needed ...
                ...
                8) There are no reserved words.
                >
                Wonderful! What the world needs is one more language that allows you
                to write:
                >
                "IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE IF;"
                >
                or something like that...
                Sorry, but Seed7 (the list is an almost exact copy from the Seed7
                manual) does not support this. The keyword 'if' is not reserved in
                the classic sense, but the syntax defined for 'if' requests that an
                expression follows it. Since variables are not written this way, it
                is not possible to define a variable named 'if'.

                It can be subsumed that Seed7 reaches the goal of avoiding the
                misuse of keywords in other ways and not by reserving them
                altogether.

                If you look at classic compilers (e.g. a Pascal compiler) there is a
                distinction between reserved words and identifiers. Pascal compilers
                and probably also Ada, C/C++, Java and C# compilers use an
                enumeration type to represent the reserved words.

                Since Seed7 allows user defined statements (which may introduce new
                keywords) it is not possible to hardcode reserved words in the
                compiler as it is done in Pascal, Ada, C/C++, Java and many other
                compilers.

                Greetings Thomas Mertes

                Seed7 Homepage: http://seed7.sourceforge.net
                Seed7 - The extensible programming language: User defined statements
                and operators, abstract data types, templates without special
                syntax, OO with interfaces and multiple dispatch, statically typed,
                interpreted or compiled, portable, runs under linux/unix/windows.

                Comment

                • Richard Heathfield

                  #23
                  Re: YAPL - Yet Another Programming Language

                  thomas.mertes@g mx.at said:
                  On 1 Jul., 00:17, Roberto Waltman <use...@rwaltma n.comwrote:
                  ><ade...@adem24 adem24.org.inva lidwrote:
                  >... a new programming language is needed ...
                  >...
                  8) There are no reserved words.
                  >>
                  >Wonderful! What the world needs is one more language that allows you
                  >to write:
                  >>
                  >"IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE IF;"
                  >>
                  >or something like that...
                  Sorry, but Seed7 (the list is an almost exact copy from the Seed7
                  manual) does not support this.
                  BETTIE does.

                  See elsethread (or http://www.cpax.org.uk/prg/portable/bettie/ if you
                  prefer) for details.

                  Since BETTIE does support it and Seed7 doesn't, we must conclude that
                  BETTIE is the more powerful language (bless her).

                  --
                  Richard Heathfield <http://www.cpax.org.uk >
                  Email: -http://www. +rjh@
                  Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                  "Usenet is a strange place" - dmr 29 July 1999

                  Comment

                  • thomas.mertes@gmx.at

                    #24
                    Re: YAPL - Yet Another Programming Language

                    On 1 Jul., 11:31, Richard Heathfield <r...@see.sig.i nvalidwrote:
                    thomas.mer...@g mx.at said:
                    >
                    On 1 Jul., 00:17, Roberto Waltman <use...@rwaltma n.comwrote:
                    <ade...@adem24a dem24.org.inval idwrote:
                    ... a new programming language is needed ...
                    ...
                    8) There are no reserved words.
                    >
                    Wonderful! What the world needs is one more language that allows you
                    to write:
                    >
                    "IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE IF;"
                    >
                    or something like that...
                    Sorry, but Seed7 (the list is an almost exact copy from the Seed7
                    manual) does not support this.
                    >
                    BETTIE does.
                    I am sure that the world needs another esotheric programming
                    language. :-)
                    Since BETTIE does support it and Seed7 doesn't, we must conclude that
                    BETTIE is the more powerful language (bless her).
                    You obviously don't understand the Force ...

                    Look at the Seed7 homepage, it will introduce you to the Force.

                    Greetings Thomas Mertes

                    Seed7 Homepage: http://seed7.sourceforge.net
                    Seed7 - The extensible programming language: User defined statements
                    and operators, abstract data types, templates without special
                    syntax, OO with interfaces and multiple dispatch, statically typed,
                    interpreted or compiled, portable, runs under linux/unix/windows.

                    Comment

                    • pete

                      #25
                      Re: YAPL - Yet Another Programming Language

                      thomas.mertes@g mx.at wrote:
                      On 30 Jun., 12:04, Wolfgang Draxinger <wdraxin...@dar kstargames.de>
                      wrote:
                      >Adem24 wrote:
                      >> 1) There is no goto statement.
                      >> Hidden goto's like break- and continue-statements are also
                      >> omitted.
                      >There are cases, they are scarce but they exist, where goto is
                      >nothing else but really usefull, ...
                      Others have already answered to this. Just one point:
                      In Java goto is a reserved word but does not presently serve any
                      function.
                      Before 1988,
                      "entry" was a keyword in C that served no purpose.
                      Now, it's not a keyword anymore.

                      --
                      pete

                      Comment

                      • Richard Heathfield

                        #26
                        Re: YAPL - Yet Another Programming Language

                        thomas.mertes@g mx.at said:
                        On 1 Jul., 11:31, Richard Heathfield <r...@see.sig.i nvalidwrote:
                        >thomas.mer...@ gmx.at said:
                        >>
                        On 1 Jul., 00:17, Roberto Waltman <use...@rwaltma n.comwrote:
                        ><ade...@adem24 adem24.org.inva lidwrote:
                        >... a new programming language is needed ...
                        >...
                        8) There are no reserved words.
                        >>
                        >Wonderful! What the world needs is one more language that allows you
                        >to write:
                        >>
                        >"IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE
                        >IF;"
                        >>
                        >or something like that...
                        Sorry, but Seed7 (the list is an almost exact copy from the Seed7
                        manual) does not support this.
                        >>
                        >BETTIE does.
                        >
                        I am sure that the world needs another esotheric programming
                        language. :-)
                        That's correct. In fact, you are now the second person to say so - and as
                        the Bellman nearly said, "What comp.lang.c tells you three times is true."
                        So all I need do is say:

                        The world is in desperate need of another Turing-complete but stupid
                        programming language!

                        Ladies and gentlemen, I give you - BETTIE!



                        --
                        Richard Heathfield <http://www.cpax.org.uk >
                        Email: -http://www. +rjh@
                        Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                        "Usenet is a strange place" - dmr 29 July 1999

                        Comment

                        • thomas.mertes@gmx.at

                          #27
                          Re: YAPL - Yet Another Programming Language

                          On 1 Jul., 13:38, Richard Heathfield <r...@see.sig.i nvalidwrote:
                          thomas.mer...@g mx.at said:
                          >
                          On 1 Jul., 11:31, Richard Heathfield <r...@see.sig.i nvalidwrote:
                          thomas.mer...@g mx.at said:
                          >
                          On 1 Jul., 00:17, Roberto Waltman <use...@rwaltma n.comwrote:
                          <ade...@adem24a dem24.org.inval idwrote:
                          ... a new programming language is needed ...
                          ...
                          8) There are no reserved words.
                          >
                          Wonderful! What the world needs is one more language that allows you
                          to write:
                          >
                          "IF IF THEN THEN ELSE IF ELSE THEN IF ELSE IF END THEN BEGIN ELSE
                          IF;"
                          >
                          or something like that...
                          Sorry, but Seed7 (the list is an almost exact copy from the Seed7
                          manual) does not support this.
                          >
                          BETTIE does.
                          >
                          I am sure that the world needs another esotheric programming
                          language. :-)
                          >
                          That's correct. In fact, you are now the second person to say so - and as
                          the Bellman nearly said, "What comp.lang.c tells you three times is true."
                          So all I need do is say:
                          >
                          The world is in desperate need of another Turing-complete but stupid
                          programming language!
                          There are never enough programming languages. :-) I got your irony,
                          but I would like to discuss the reserved word vs. keyword issue (and
                          other issues).

                          As I said already elsthread, the misuse of keywords is prohibited in
                          Seed7. Just because the compilers of most programming languages use
                          a table of hardcoded reserved words does not imply that this is the
                          only solution.

                          I know that new concepts start in a hostile world, but objective
                          professional feedback is the preferred reaction to them.

                          I hope that the new ways that I take in some areas do not discourage
                          you to think about them. I would be glad if you answer with a
                          professional view towards my ideas. Besids the points mentioned by
                          the OP the FAQ (see: http://seed7.sourceforge.net/faq.htm ) is a
                          good starting point for a professional response.

                          Greetings Thomas Mertes

                          Seed7 Homepage: http://seed7.sourceforge.net
                          Seed7 - The extensible programming language: User defined statements
                          and operators, abstract data types, templates without special
                          syntax, OO with interfaces and multiple dispatch, statically typed,
                          interpreted or compiled, portable, runs under linux/unix/windows.

                          Comment

                          • Richard Heathfield

                            #28
                            Re: YAPL - Yet Another Programming Language

                            thomas.mertes@g mx.at said:

                            <snip>
                            >
                            [...] Just because the compilers of most programming languages use
                            a table of hardcoded reserved words does not imply that this is the
                            only solution.
                            True enough. My own preferred solution is to divide the world into two
                            namespaces. User namespace begins with an alphabetic character, and *no*
                            language feature may interfere with that - i.e. no keywords or library
                            routines may begin with an alphabetic letter. Alas, some languages don't
                            even follow /their own/ namespace schemes, let alone mine. (For example, C
                            introduced the restrict keyword in C99. User space? Ha! Stomp stomp
                            stomp...)
                            I know that new concepts start in a hostile world, but objective
                            professional feedback is the preferred reaction to them.
                            Oh, I know. I just found it quite amusing that, within a hundred or so
                            minutes of its being requested, I was able not only to design a language
                            that met the specification, but also implement a (portable!) compiler for
                            it and provide a sample program written in that language. (Within those
                            hundred minutes I also devised a *de*compiler, which I didn't bother to
                            publish.) I'm not sure whether anyone has actually got the whole joke
                            yet...

                            Anyway, FWIW, creativity is what counts. Keep coming up with new ideas, and
                            eventually some of them *might* get through the thick skulls of the CS
                            community.

                            <snip>

                            --
                            Richard Heathfield <http://www.cpax.org.uk >
                            Email: -http://www. +rjh@
                            Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
                            "Usenet is a strange place" - dmr 29 July 1999

                            Comment

                            • Juha Nieminen

                              #29
                              Re: YAPL - Yet Another Programming Language

                              thomas.mertes@g mx.at wrote:
                              >Type1 foo(Type2 value)
                              >{
                              > for(size_t i = 0; i < data.size(); ++i)
                              > for(size_t j = 0; j < data[i].size(); ++j)
                              > for(size_t k = 0; k < data[i][j].size(); ++k)
                              > if(meetsRequire ments(data[i][j][k], value)
                              > return data[i][j][k];
                              >>
                              >}
                              Your function returns garbage when nothing meets the requirements.
                              Most compilers will issue a warning, though.
                              A stuctured solution to your example could use a boolean flag which
                              is changed when the data is found.
                              Exactly how is that different from 'break'? (Let's assume a 'break'
                              which can take as parameter how many nested loops it breaks from, like
                              some languages have. In other words, you could do a "break 3;" in the
                              example above, assuming it was supported.)

                              The only difference I can see is that the 'break' would be
                              compiler-supported (and thus easier for the compiler to optimize), while
                              the boolean solution is user-written, which is more work and clumsier.
                              Also, I don't believe the boolean solution would make the code any
                              easier to understand and follow than the 'break' solution.
                              // Find the first value in 'data' which meets the requirements
                              // imposed by the parameter:
                              Type1 foo (Type2 value)
                              {
                              int search = 1;
                              Type1 result = Type1default;
                              >
                              for (size_t i = 0; i < data.size() & search; ++i) {
                              for (size_t j = 0; j < data[i].size() & search; ++j) {
                              for (size_t k = 0; k < data[i][j].size() & search; ++k) {
                              if (meetsRequireme nts(data[i][j][k], value) {
                              result = data[i][j][k];
                              search = 0;
                              }
                              }
                              }
                              }
                              return result;
                              }
                              Another point: Assume that initializing the return value is a very
                              heavy operation. If a result is found, you are initializing the return
                              value twice, for no reason. (If the found value was returned from inside
                              the loop, and if the loops end without result, the default value is
                              returned, the return value would then always be initialized only once.)
                              In fact, it would be enough for the default value to be very heavy to
                              construct for this problem to happen.

                              Sure, you could add yet another boolean to take care of that... Is
                              this supposed to make the code easier to write and read, and/or less
                              error-prone?
                              As you can see, I prefer to use curly braces even when they are not
                              necessary.
                              That's mostly a matter of style and preference. I omitted them mostly
                              for brevity (ie. it doesn't mean I consistently avoid the braces in real
                              code whenever I can).

                              Btw, why do you use the braces in an inconsistent way?
                              In a language which has no C for loops like Seed7 the function
                              would look as follows:
                              >
                              const func Type1: foo (in Type2: aValue) is func
                              result
                              var Type1: result is Type1.value;
                              local
                              var integer: i is 1;
                              var integer: j is 1;
                              var integer: k is 1;
                              var boolean: search is TRUE;
                              begin
                              while i <= maxIdx(data) and search do
                              while j <= maxIdx(data[i]) and search do
                              while k < maxIdx(data[i][j]) and search do
                              if meetsRequiremen ts(data[i][j][k], aValue) then
                              result := data[i][j][k];
                              search := FALSE;
                              end if;
                              incr(k);
                              end while;
                              incr(j);
                              end while;
                              incr(i);
                              end while;
                              end func;
                              I'm sorry but I have to confess that doesn't look like very attractive
                              to me. The 9 lines of code in my original function (with the fix of
                              returning the default value at the end) vs. 23 lines in your example. I
                              honestly can't say your version is more readable either.

                              Let's make it clear that I'm all against compact obfuscated code.
                              However, there's a limit where code becomes *too* verbose to be comfortable.
                              I know that this solution is not as elegant.
                              Maybe I should introduce an advanced version of the 'for' statement
                              like:
                              >
                              for i range minIdx(data) range maxIdx(data) andWhile search do
                              >
                              What do you think?
                              A 'for' clause is always a handy shortcut for 'while', so why not.

                              I also think you should really consider 'break' (perhaps even the
                              version which takes a parameter, as I mentioned above).

                              Comment

                              • campyhapper@yahoo.com

                                #30
                                Re: YAPL - Yet Another Programming Language

                                On Jun 30, 10:38 pm, CBFalconer <cbfalco...@yah oo.comwrote:
                                campyhap...@yah oo.com wrote:
                                CBFalconer <cbfalco...@yah oo.comwrote:
                                >
                                 [mail]: Chuck F (cbfalconer at maineline dot net)
                                 [page]: <http://cbfalconer.home .att.net>
                                >
                                This appears to have little to do with the C language, and is thus
                                off-topic.
                                >
                                You appear to be an idiot unable to recognize a sig. marker.  Bye.
                                Your immaturity has little to do with the C language, and is thus
                                off-topic.

                                Comment

                                Working...