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.
The official blog about the TBS(To Be Simple) programming language. Provides information and downloads.
Showing posts with label TBS. Show all posts
Showing posts with label TBS. Show all posts
12/16/2011
11/25/2011
Booleans and boolean expressions
Written by
TBS
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.
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;".
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);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.
#func() {
?blnTest =: 1 == 1 && 1 <> 2 && :<>false;
_if(:false || 1>0 && :?blnTest) {
!out(~"New, working expressions! Finally!\n");
}
: : :true;
};
!func();
_die();
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
Written by
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
Written by
TBS
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.
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
Written by
TBS
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:
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.
using(Stdio);"Stdio" is the package that contains the standard I/O facilities. All package names will start with a capital.
!out(~"Hello, world!\n");
_die();
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.
11/02/2011
alpha-2.9: release
Written by
TBS
To Be Simple alpha-2.9 has been released!
First, I would like to point out some things that will be improved/added in alpha-3(next release):
Too see what everything contains and were everything is, see my previous post.
First, I would like to point out some things that will be improved/added in alpha-3(next release):
- I will be completely changing the way system subroutines are called, allowing me to add more and more system subroutines. This will also increase the languages speed a lot. These subroutines will replace the current STDL, which will still exist but with other, more advanced features. All the subroutine names will remain the same, because of backward compatibility.
- There are too possibilities, or I will drop windows and I will add multi threading and sockets, or I will leave TBS as it is now and compile a windows binary(this will be voted).
- I will attempt to improve performance a lot.
- Go to /usr/bin/ as root(sudo nautilus for ubuntu).
- Move the files tbs-STDL and tbs there.
Too see what everything contains and were everything is, see my previous post.
alpha-2.9: ready for release
Written by
TBS
As you can see on the image above, the alpha-2.9 packages are ready for release. They contain:
In other news...
You may have noticed I have stopped posting quotes at the beginning of topics, this is because it's getting hard to find them.
- An updated(and more readable) language summary.
- A fixed version of the TBS STDL(which broke due to lack of backward compatibility).
- The TBS interpreter(version alpa-2.9).
- stdl.tbs is a program which does a number of operations using the STDL(in fact, all currently possible things).
- subj_sub.tbs demonstrates "wildcard" subroutines.
- person.tbs is a pseudo-OOP example.
- substitution.tbs shows you how code aliases work.
- encrypt.tbs uses a character shift for "encrypting" text.
- decrypt.tbs uses a character shift for "decrypting" text "encrypted" by encrypt.tbs.
- words.tbs generates a random word "of the day" based upon the words in "words".
In other news...
You may have noticed I have stopped posting quotes at the beginning of topics, this is because it's getting hard to find them.
10/29/2011
Words in TBS
Written by
TBS
![]() | ||
| An image of the words used in the entire TBS source code. |
Just for fun, I generated this image of the TBS source code with Wordle today. I find it quit interesting that I use the word "value" the most. The Tokent.kind is something that I actually never use, I believe it should be 2 words: "Token" and "t.kind".
After that I decided to create another one, but this time of my blog posts:
![]() |
| An image of the words used in the posts of this blog. |
As I expected, the most used word was TBS.
10/28/2011
Variable access changes
Written by
TBS
To improve is to change; to be perfect is to change often.Winston Churchill
For example, the following:
?greeting =~ "Hello!";!out(~greeting, ~"\n");
Will now be written as:
?greeting =~ "Hello!";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.
!out(~?greeting, ~"\n");
10/17/2011
alpha-2.9
Written by
TBS
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
Written by
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
Written by
TBS
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 = ";Output:
number = 3,141592654;
!out(~number, ~!str(number));
PI = 3,141592654In 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 = ";Will thus produce:
number = 3,141592654;
!out(~number, ~!str(number, 10));
PI = 3,1415926540
9/19/2011
The current state on alpha-3
Written by
TBS
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
Written by
TBS
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
Written by
TBS
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/09/2011
Tutorial 1: Hello, world!
Written by
TBS
Everything should be as simple as it is, but not simpler.Albert Einstein
In this first tutorial I will be showing you how to write a simple Hello, world! program. You probably won't find this hard, certainly if you already now another programming language.
9/07/2011
alpha-2: release + tutorials
Written by
TBS
A person who never made a mistake never tried anything new.
-Albert Einstein
Two things this time: the alpha-2 release and a new page!
9/05/2011
Graphical possibilities?
Written by
TBS
"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.
9/03/2011
Adding system commands
Written by
TBS
Change brings opportunity.-Nido Qubein
Yesterday, I received an interesting question from rambler on this blog. He asked if TBS supports system calls. I had to answer no, because I forgot to add them...
9/02/2011
Problems with alpha-1
Written by
TBS
"Errare humanum est."-Some Roman
It seems that there is a problem for some people with the Debian package that should install TBS. For those people, I would propose the following(very simple) alternative solution:
First of all, download this file.
Then go to /usr/bin/ as root(sudo nautilus for ubuntu).
And finally, simply move the files tbs-STDL and tbs to there.
You should be able to use tbs normally now.
Subscribe to:
Posts (Atom)


