12/29/2011

An esoteric language

As I have posted earlier, I was planning to create a new programming language. Since then, I have written a simple interpreter. The idea is not to create a functional language, but just an esoteric language. A language to prove a point, not to solve a problem.
The following is an example of a program written in this language:

Create a variable named name. Display "Enter your name: " and a newline.
Vary the value of name by call the function "ask". Make another variable called age.
Display "Enter your age: " and a newline.
Set the value of age to call function "to number" with call another function "ask".
Display "The name is " and the name. Show "." plus a newline. Show "The age is ".
Display the age. Show "." and another newline.
If the name equals "World" then:
Display "Hello World!" and a newline.
Display another newline.
That's all. Else, then:
Display "Now this is no longer a 'Hello, world!' program..." and a newline. That's all.
If the age is larger than 100 or the age equals 100 then:
Display "You are very old." and a newline.
Display another newline. That's all.
Otherwise, then:
Display "You are less than 100 years old." and a newline. That's it. Show "Bye!" and a newline.
Stop the program.
As you can see, some statements(statements are sentences) or expressions may seem a little weird and not exactly like you would say or write it yourself. This is because it is simply too hard (for me at least) to write a parser that can understand the complete English language.
Vary the value of name by call the function "ask".
The above probably seems very weird. But in fact, "by" is declared as a synonym for "to"(which is required for changing the values of variables) and "call the function "ask"" is considered a part of an expression.
The following...
Set the value of age to call function "to number" with call another function "ask".
...is probably the weirdest statement of all. This is because it uses no temporary variables. It could be rewritten as following:
Declare a new variable named temp. Set the value of temp call function "get input". Change the value of age to execute procedure "to number" on temp.
I think the above is a more "natural", but it is also longer.
Also note that the last statement("Stop the program.") is actually only executed until "Stop" and no dot is actually required after it. "the program." will be tokenized by the parser to(displayed on a stack of tokens here):
-token::Article("the")
-token::VarName("program")
-token::Dot('.')
But these tokens will never reach the interpreter, and thus cannot cause errors(most likely "unexpected token" errors). This all means that we could also write:

Stop the current program and do something else.
So, what have I done so far and what are the parameters of the language?
I have added expressions, variables, "if" and "else" statements, an output language construct and function calls(no user defined functions, only system functions). I have also added a "newline" variable and 2 system functions("to number" and "ask"/"get input"). I am not yet sure when and if I will add features such as user-defined functions, but I will most likely add at least one type of loop(probably while).
Some specific things for this programming language are the huge amount of synonyms available for every word, the fact that if statements have no separate scope and the ability to "formulate" sentences in a different way(made possible by "optional" words such as "the value"). Because of these things, I hope it seems clear that this language has no intention of being functional in any way.

This interpreter will be available soon, although I cannot and will therefor not give you a date yet.

12/22/2011

Merry Christmas!

// Christmas, by Test(http://tbslanguage.blogspot.com/)
// Do not redistribute...
#include <iostream>
#define I std::cout
#define Jesus "Christ"
typedef std::string _;typedef int _____;typedef char& _O_O;
void                                                   oO(
char                         O                         ){//
I <<                        O;}                        void
oO(_                       O) {I                       <<O;}
class                     O {/**/                      /***/
/***/                    protected                     :char
o/**/                   ;public:///                    /////
virtual                char operator                   ()(){
return                '\n';}};struct o                 /**/:
public               O{o(char o){O::o=o                /***/
;}char              operator()(){ return               O::o;
}};                char __(_____ ___) {_               ____=
"moda"            "grippa@live.be";return              ____[
___];}           char _o_( _____ ___ ) { _             ____=
"You "          "will be assimilated. Resi"            "sta"
"nce "         "is futile.";return ____[___]           ;}///
/****/        template<class __> __ ___(__ o,          __ O)
/***/{       return o==O?(true?o:0):o+O;} void         OoO (
/****/      _O_O OoO,short O,bool _0=false){for        (////
short      o;o<O;++O){if(!_0)OoO++;else OoO--;}}       _____
_O_ (     _____ O);void oOo(){char _o=__(_O_(_O_(      ___(1+
true,    true+1)+(1+1 )*true ) ) + _O_ ( _O_ (___(     true +
true,   0)+1)));o _O(_o);char _0=_o;OoO(_0,(1+1) *(    1+1)*(
1+1+1) *(1+1));oO(_0);oO(_o);oO(_o+9+!false+_O_(1+1)); oO(_o+
_O_(                   ___(_O_(___                    (1+1 ,
_O_(                   1+1))),1+1+                    1)+1))
;oO(                   _o_(false)+                    2*(_O_
(_O_                   ('y'/(___ (                    _O_  (
_O_(                   _O_(1 ) )),                    _O_(-~
true)                  )+1)) ) )-~                    true );
oO  (                  _o_(-(~true                    -1))) ;
oO  (                  Jesus);oO (                    __(0));
oO(_o_((1+1)*(_O_(1)+_O_(true + 1))));oO(_o_(5*(1+1)+-(~true+~
true)));OoO(_0, _O_(_O_(_O_(_O_(_O_(1)))))+_O_(_O_(_O_(_O_(_O_
(1)))))+_O_(_O_(_O_(_O_(_O_(1)))))+_O_(_O_(_O_(_O_(_O_(1))))))
;oO(_0);oO('\n');}_____ _O_(_____ O){_____ o(O);if(o%2==0) o
   +=1;else o+=2;return o;}int main( ) {oOo() ; return 0 ;}
                /* Created by Test on 22/12/2012 */

12/17/2011

A new language

Since it is sometimes annoying to do just one thing at a time, I am currently searching for new and original ideas to implement in a simple (interpreted) programming language. So, if you have an idea then make sure to  email(modagrippa(at)live(dot)be) me.
Notice that this certainly does not mean that TBS will no longer be developed.

I will be posting more updates on this new language concept in the following days.

12/16/2011

SDL Support: delay

I'm currently having some problems(both technical and political) with SDL and I believe it is not likely that they will soon be fixed. Thus, the next release will most likely not yet contain support for SDL.

Currently, I'm still looking for another graphics library that might be integrated into TBS.