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.

No comments:

Post a Comment