Showing posts with label alpha-3. Show all posts
Showing posts with label alpha-3. Show all posts

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.

11/25/2011

Booleans and boolean expressions

It is highly likely that you have noticed that boolean expressions are horribly supported in TBS alpha-2.9 and older. Luckily, alpha-3 may come to the rescue!
The following(pointless but interesting) program and its explanation, should provide you with an idea of how alpha-3 will handle boolean expressions.
using(Stdio);
#func() {
    ?blnTest =: 1 == 1 && 1 <> 2 && :<>false;
    _if(:false || 1>0 && :?blnTest) {
        !out(~"New, working expressions! Finally!\n");
    }
    : : :true;
};
!func();
_die();
The first thing you should know is that the boolean operator was changed from '|' to ':', I know, neither are "logical", but it's really hard to find a more logical character that a normal keyboard has.

Besides that, you must also know that the previous "=/" operator has been changed to "<>", the "=<" operator to "<=", the "=>" operator to ">=" and the previous "/" to "<>". The "&" operator is now "&&", just like the "|" was changed to "||". Notice however that "|" still exists, as the exclusive or(XOR).
I truly believe this is a good change as this notation is more widely used.

The return statement(": : :true;") might seem a little weird, but it is only logical: the first ':' represents the return command, the second one indicates that we will be returning a boolean expression, and the last one that we read a boolean value in that expression. For example, if we wanted to return a string we would write ":~?string;", or if we wanted to return a boolean as the result of a string comparison we would write  ": : ~"string" == ?string;".

11/18/2011

Graphical TBS

Thanks to SDL(Simple DirectMedia Layer), TBS alpha-3 will support some basic, 2 dimensional, graphics. I will make sure to link with the shared library instead of including the headers directly, simply because otherwise it would be illegal to use this library. I have created a very simple TBS program, which demonstrates how it works, the result of this program can be seen in the following video:


11/11/2011

Bugs with nested loops: fixed in alpha-3

Unfortunately, because of a bug in alpha-2.9 and earlier versions, nested subroutines did not work. I am happy to tell you that this bug has been fixed in version alpha-3.
I discovered this bug during a graphical test, yes, you read it: a graphical test. Indeed, graphical features will be added to TBS using the SDL(Simple DirectMedia Layer) library.

11/07/2011

Changes to system subroutines

Alpha-3 will, similar to PHP, include a huge number of system subroutines. But let's be honest: PHP has way too many functions in the main scope. To prevent this from happening to TBS, I have decided to add a new statement: the using statement. It is not a language construct, just a keyword. For example, the classic "Hello, world!" program will now have to be written like this:
using(Stdio);
!out(~"Hello, world!\n");
_die();
"Stdio" is the package that contains the standard I/O facilities. All package names will start with a capital.
Notice that it will not be possible to define these package names yourself, they are just a way of ordering the build-in language facilities.
Also notice that I have decided not to maintain backward compatibility with the old subroutine system, because I assume that nobody uses an alpha release for real-world systems. Besides that, I have also decided to maintain compatibility with windows for now. Windows binaries will most likely be compiled for alpha-3/4.

10/28/2011

Variable access changes


To improve is to change; to be perfect is to change often.
Winston Churchill

Alpha-2.9 was supposed to be released this weak, however I have decided to change a little thing about the way you can access variables. Instead of only using '?' for declarations, the question mark will now be used in front of all variables, similar to the PHP syntax.
For example, the following:
?greeting =~ "Hello!";
!out(~greeting, ~"\n");

Will now be written as:
?greeting =~ "Hello!";
!out(~?greeting, ~"\n");
I am aware of the fact that this is a big change that will affect almost all TBS code, although there should be no problem with this as alpha versions do not guarantee backwards compatibility.

10/17/2011

alpha-2.9

O earth, what changes hast thou seen!
Alfred Lord Tennyso
Because of the huge amount of changes for alpha-3, I have decided to release another version between 2 and 3 which will have all language features but will however not include the new STDL.

I know that I have not been posting for a while but that does not mean I haven’t worked on TBS. I shall release this subversion in this or in the next week.

10/02/2011

Help testing TBS

You can have everything in life you want, if you will just help other people get what they want.
Zig Ziglar

You might be interesting in testing TBS alpha-3 or to help me finding bugs. If you are please send me an email. If you found one or more bugs you will be given credit for finding bugs when I release the next version(currently alpha-3). So please, do not hesitate and help testing!

9/27/2011

alpha-3: casting to string

But quality of work can be expected only through personal satisfaction, dedication and enjoyment. In our profession, precision and perfection are not a dispensible luxury, but a simple necessity.
-Niklaus Wirth
 
You may know that in alpha-1 and 2 you can use the str subroutine to cast from an integer to a string. For example:
?number =~ "PI = ";
number = 3,141592654;
!out(~number, ~!str(number));
Output:
PI = 3,141592654
In alpha-3 str also accepts a 3th, optional argument. Notice that the above example would produce the following output in alpha-3:
PI = 3

This 3th argument is the decimal precision, and it's default value is 0. The following:

?number =~ "PI = ";
number = 3,141592654;
!out(~number, ~!str(number, 10));
 Will thus produce:
PI = 3,1415926540

9/19/2011

The current state on alpha-3

And, you know, the fact is, if you believe in evolution, we all have a common ancestor, and we all have a common ancestry with the plant in the lobby. This is what evolution tells us. And, it's true. It's kind of unbelievable.
Jeff Hawkins

This is just a short update on alpha-3, to show that I'm still working on TBS(I didn't post much because of that, in fact).
The last days I have been reorganizing the structure of TBS. I have, and probably will still, encountered some bugs but luckily I succeeded in fixing all of them. This means that I can now continue with restructuring the code. I also added the ability to provide less arguments than needed(see last post) and I added the first feature of the environment subroutine: OS checking.

9/14/2011

alpha-3: new features

I do not fear computers. I fear the lack of them.
Isaac Asimov
  
Obviously, alpha-3 will offer some new and interesting features. The goal of this post is the list the features that I currently have implemented or am planning to implement.

9/10/2011

pseudo objects in alpha-3

Object-oriented programming is an exceptionally bad idea which could only have originated in California.
Edsger Dijkstra

Today, I realized that some of the new features that alpha-3 offers I would be able to create some sort of objects. Note that I did not intentionally add any support for OOP. I like to call this sort of objects pseudo objects and the classes that define them pseudo classes. Why? Because you can't really call them real objects.

9/05/2011

Graphical possibilities?

"The days when you needed amazing Silicon Graphics machines to run animation software are gone now."
-Dave Rowntree

 The aim of TBS is not to draw nice windows on your monitor, yet I might add graphics possibilities. I would start by adding the ability to show simple message and input boxes in alpha-3 and later I would start by adding the ability to draw more complex windows with menus buttons, shapes and possibly images. Please note that this isn't certain at all.
In other news: you can expect alpha-2 to be released this week.