If you created your own programming language ..

Discussion in 'Chit Chat' started by Jim Brown, May 14, 2015.

  1. Jim Brown

    Jim Brown Active Member Licensed User

    .. what would its key features/syntax be?

    Perhaps I'm getting older and finding programming languages more alien-looking than ever but it got me thinking, If I could create my own programming language what would its key features and syntax look like.

    First things first, I hate typing. So the language would require absolute minimalistic coding.
    I would incorporate as many short-cut programming methods as possible.
    Next, I'd take a heavy pinch of Pythons tabbed spacing which defines code blocks.
    Finally, reduce the need as much as possible of having to type shifted characters like " {} &

    Putting it all together then, instead of having to type something very ugly and messy (C++ example):
    for (i=0,i<5,i++){
    "hello world");
    My minimalistic code would shrink the above down to:
    5 times
    'hello world'
    In cases where you need to know the loop count ..
    for (i=0,i<5,i++){
    "hello world" + i);
    5 times i
    'hello world'+i     ' ? is shortcut for print (C64 days!)
    My philosophy is, less is more.
  2. KMatle

    KMatle Expert Licensed User

    I really "hate" that C/C++ thing, the notation with "{" in the same line as the condition and ";" to terminate. We had a thread about that earlier.

    My opinion: As every language it should be easy to learn/use (like English, not German). One word more or less doesn't really count.


    Loop 5 Times
    1 to I
       Print I
    Loop End
    inakigarm and wonder like this.
  3. Jim Brown

    Jim Brown Active Member Licensed User

    There is certainly a fine between making something 'understandable' and too wordy.
    I have seen languages which put too much emphasis on using English language. The problem then is you end up not knowing what order to write the keywords.
    Or, forgetting what the keywords are? Was it 'units' or 'pixels'. All of a sudden you are writing an essay rather than coding.
    make red ball
    move ball 
    10 units right
    Oh, and taking your code example above I would make it even simpler. Again, for me, less is more:
    5 times
       Print I
  4. Troberg

    Troberg Well-Known Member Licensed User

    I think you should take a look at the loop construct in Rexx, I think you'll like it.

    Infinite loop
    Do forever

    Five iterations
    Do 5

    Until something happens. Also works with While.
    Do Until Condition

    With counter variable, no break criteria
    Do x = 5

    Ordinary for
    Do x = 5 to 10

    With step size
    Do x = 5 by 2

    Combine it all, anyway you want
    Do x= 2 to 10 by 2 Until Done

    Rexx also combines arrays and structures in what's called compound variables. Example:


    Note that, as Rexx is not a declarative language, this structure does not have to be pre-declared. This is both good and bad.

    It also have the best syntax rule ever: If the first line of a program is not a comment, it's considered a syntax error and it won't run.

    I really love the cleanness of Rexx, and would love a modern, object oriented Rexx as the base for a modern RAD IDE.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice