SMURF programming language

From Todd's Humour Archive


Overview

A mere six months after its creation at the University of Waterloo, Microsoft and Inprise have announced the release of IBM PC-based compilers for the popular SMURF programming language. From MicroSMURF (a division of Microsoft devoted to SMURF) we will see WinSMURF 2000 by July 2000. From Inprise we'll see Inprise SMURF++ by August '00. IBM expects to release Visual SMURF, Symantec has already announced the Symantec Múshroom development suite and claims it will be ready by fall '00 and most important - Sun microsystems have decided to drop all further development on their much successful Java and JavaBeans and focus all development on a new MicroSMURF++ CPU.



...Wait a Second... What the HECK is SMURF?



For those of you who haven't heard of SMURF, I'll enclose the following press release, dated April 9th, 1999:





Waterloo Announces the Release of SMURF

Prof. B. W. Becker of the University of Waterloo has officially released his unix based SMURF compiler to the world. Developed at UW to provide a powerful object-oriented programming language for second year CS students, SMURF is a powerful and yet simple language well suited to a teaching environment.

SMURF stands for Short Modular Un-Recursive Function. A brief introduction to SMURF follows.


SMURF is Short

SMURF programs are, by necessity, very short. An individual SMURF program can't contain more than four function-calls. For example, a SMURF module might contain one variable assignment, one function which acts on this variable, one call to another SMURF, and a return function which passes the modified variable to the previous SMURF. Each smurf module can access only one variable, called SMURF.


SMURF is Modular

SMURF programs may only contain four function calls, but you can have thousands of the little fuckers working together. Picture your CPU, swarming with SMURFs, each perform its own little job without giving a shit about what the other SMURFs are doing, how much CPU time its taking up, or who actually owns that file you told it to erase.


SMURF is un-recursive

As Bill Gates so eloquently said in his '91 interview in BYTE magazine "recursive programming sucks!". To combat this archaic programming style, a SMURF function can not call itself. Complex function-tree-structure analysis built into the SMURF compiler makes sure that sneaky programmers can't trick the SMURFs.


SMURF has (duh) functions

Function: If you don't know what these are, you must be very confused by now.


SMURF Modules

A programmer writing in SMURF must quickly learn the 100 or so different kinds of SMURF modules. Rather than have libraries which link different kinds of functions into a module, each library has its own kind of SMURF module which it automatically links to. The downside of this is that you can't use functions from two different libraries in the same module. When you're dealing with a maximum of four function calls per module, this usually isn't much of a problem. Several kinds of SMURF modules are described below.

PapaSMURF: This is the main module, the progenitor of all other SMURFs. It does nothing but execute other SMURF modules. In other words, it bosses the other SMURFs around. There can only be one PapaSMURF.

SMURFette: This module has no function libraries linked to it. It accepts no parameters. It returns no values. It is incapable of input or output. In other words, it performs no useful function in a SMURF program. It can, however, link to any other SMURF module.
SMURF project-chief Yohan claims "it keeps the other SMURFs happy, and hard working". There is only one SMURFette, and in large SMURF programs especially, she gets linked constantly. The SMURFette module must be linked to the PapaSMURF module, and in multitasking SMURF programs, PapaSMURF's call to SMURFette have priority over all other calls.

BrainySMURF: This module performs all the input and output functions available in SMURF. In other words, whenever you want user input, or wish to output information to the screen, you have to call BrainySMURF. The BrainySMURF library is one of the most criticized parts of SMURF. The input routines work fine, but the output routines are slow and tend to include extraneous information. You can have as many BrainySMURF modules as you want, but you'll wish you had less.

ClumsySMURF: Whenever you define your SMURF variable in a module, you'll use some memory. SMURF doesn't reclaim this memory when the module is exited, you have to destroy the variable using ClumsySMURF if you want that. If you ever have more than one ClumsySMURF module running simultaneously, chances are they'll get confused, and start randomly destroying memory.

HeftySMURF: This module moves information from one memory location to another. Whenever you want to assign a variable or copy a list, you've gotta call HeftySMURF.

There are hundreds more. Type "man SMURF" for more information.


Hello SMURF!

For those of you who are confused, I'll show you an example SMURF program. Note, each of these is a separate module-file, the name of which is given.

Papa.SMURF 
    SMURF! 
      { 
         Link Smurfette.SMURF; 
         Call Brainy.SMURF.Smurf-them-hello-Brainy; 
      } 
    ENDSMURF. 
 
Smurfette.SMURF 
    SMURF! 
      {} 
    ENDSMURF. 
 
Brainy.SMURF.Smurf-them-hello-Brainy 
    SMURF! 
      { 
         SMURF = Call Hefty.SMURF.What-is-their-name-Hefty; 
         OutSmurf("Hello "SMURF); 
         Call Clumsy.Destroy-this-name-for-us-Clumsy(SMURF); 
         ReSMURF(); 
    % Poor Brainy didn't get to SMURF with SMURFette 
      } 
    ENDSMURF. 
 
Hefty.SMURF.What-is-their-name-Hefty  
    SMURF! 
      { 
         CreateSmurfString(SMURF); 
         Call Brainy.SMURF.Ask-them-their-name-Brainy(SMURF); 
         Link Smurfette.SMURF; 
         ReSMURF(SMURF); 
      } 
    ENDSMURF. 
 
Brainy.SMURF.Ask-them-their-name-Brainy(SMURF); 
    SMURF! 
      { 
         SMURF = GetStringSMURF("What the smurf is your name?"); 
    % Ha, this time I will SMURF her good! 
         Link Smurfette.SMURF; 
         ReSMURF(SMURF); 
      } 
    ENDSMURF.
 
Clumsy.SMURF.Destroy-this-name-for-us-Clumsy(SMURF); 
    SMURF! 
      { 
         SmurfWithAHammer(SMURF); 
         Link Smurfette.SMURF; 
         ReSMURF(); 
      } 
    ENDSMURF. 

Of course, this is a very simple program, which is why so little code was needed. The 420 megabyte example source code for CalcuSMURF" (a non smurfentific...er...scientific calculator), which comes on CD-Rom with WinSMURF 2000, gives a much better demonstration of the power of SMURF.


"Have a smurfy day!" - Bill Gates SMURF project manager


The SWT (SMURF Window Toolkit)

The university of Waterloo has recently announced the release of the much expected SWT Development Kit (SWTDK) in late spring 2000, which will bring SMURF to the Internet, allowing SMURFlets to be run within your favorit browser. The newly introduced SVM (SMURF Virtual Mushroom) makes this possible. The SVM will make the SMURF a portable language suitable for international companies, where the SMURF structure will make the transition from heavy mainframe structures to a more distributed architecture easier, since the SMURF already supports individual and independent working sub-modules which has no idea about what other sectors of the system is doing. The SVM will likewise make it possible for large cooperations to run the same programs on all of their different computer systems, distributing data much more efficiently than before, making it a lot more difficult to maintain and extend the system.

One of the best things about the new SWTDK is the new set of modules free to use. Within the standard free package you will find 15 visual components and more than 2.100 different modules to support the 15 components. The cooperate version will be available directly from UW at an expected price of $304.- will include an additional 13 visual components and more than 10.000 modules, capable of creating even the most complex applications with a minimum of coding left to the programmer (assuming they can overlook the 5000p of documentation). A sample of a SWT SMURF program writing Hello on the screen is shown below:

Papa.SMURF 
    SMURF! 
      { 
         Link Smurfette.SMURF; 
         Call Brainy.SMURF.Smurf-them-hello-Brainy; 
      } 
    ENDSMURF. 
 
Smurfette.SMURF 
    SMURF! 
      {} 
    ENDSMURF. 
 
Brainy.SMURF.Smurf-them-hello-Brainy 
    SMURF! 
      { 
         SMURF = Call Hefty.SMURF.What-is-their-name-Hefty; 
         Call Painter.Draw-some-readable-text("Hello "SMURF); 
         Call Clumsy.Destroy-this-name-for-us-Clumsy(SMURF); 
         ReSMURF(); 
    % Poor Brainy didn't get to SMURF with SMURFette 
      } 
    ENDSMURF. 
 
Hefty.SMURF.What-is-their-name-Hefty  
    SMURF! 
      { 
         CreateSmurfString(SMURF); 
         Call Brainy.SMURF.Ask-them-their-name-Brainy(SMURF); 
         Link Smurfette.SMURF; 
         ReSMURF(SMURF); 
      } 
    ENDSMURF. 
 
Brainy.SMURF.Ask-them-their-name-Brainy(SMURF); 
    SMURF! 
      { 
         SMURF = GetStringSMURF("What the smurf is your name?"); 
    % Ha, this time I will SMURF her good! 
         Link Smurfette.SMURF; 
         ReSMURF(SMURF); 
      } 
    ENDSMURF.
 
Clumsy.SMURF.Destroy-this-name-for-us-Clumsy(SMURF); 
    SMURF! 
      { 
         SmurfWithAHammer(SMURF); 
         Link Smurfette.SMURF; 
         ReSMURF(); 
      } 
    ENDSMURF. 
    
Painter.SMURF.Draw-some-readable-text(SMURF);
	 SMURF!
	   {
	   	PickUpPencil();
	      Draw-text-on-screen-in-a-readable-fashion(SMURF);
	      Link Smurfette.SMURF;
	      ReSMURF();
	   }
	 ENDSMURF.
	 

The SWTDK offers an advanced event-based programming style, where the events between the Smurf and the user will result in actions performed by the smurfs.

Another feature introduced with the SWTDK is the new exception handling system. Since many of the students at UW have complained about the impossibility to trap errors occuring when Smurf modules misunderstand messages from other modules, a new DoctorSmurf module will be included. DoctorSmurf will take care of damaged Smurf-Modules and making sure that the ClumsySmurf module gets a chance to call SmurfWithAHammer() on the damaged smurf so that the allocated memory may be released.

The SVM will support the increasing demands of the SMURFlets for better graphics (with the new module PicassoSMURF), allowing even complex games to be written in SMURF.






Note: This text has been modified to comply with the new S++ standard pending for ANSIfication. The original document was copied from the Smurfy Pages about Smurfs.

Note: None of the companies or persons mentioned in this document has officially stated anything written here. The purpose of the text is solely for entertainment and no products, persons, universities or anything else here has actually agreed to the publication of this document. If any of the involved parties feels that the document contains undesirable material please contact me immediately and the document will be removed. The document is in no way associated with DTU (except for this sentence).

Back...





Last updated 2001-07-31 FlushedSector