Getting Started with L

 


 

 

 


How to Get Started

So you're ready to get your feet wet and try L for a spin. Luckily for you, it's easy to begin.

Step 1: Download and install

You'll need a PC running Windows to try it out (Mac and Linux ports are coming soon). In addition, the development pack has special integration features if you have Microsoft Visual C++ 6.0/6.1.

Note: if you have Visual C++ 5.x, know how to use RegEdit, and would be interested in helping us get the Dev Pack running on VC 5, please email us.

Download the L Development Pack here.

Step 2: Learn about L

You can:

Step 3: Your first L program

The "Hello World" equivalent in L is this:

go write( "Hello World!\n" );

If you have Visual C++ 6.0/6.1, simply go to File / New, select the Projects tab, and select L Console Application. The wizard will create a project with a single L file and a go function that you can fill in. The wizard sets up the project so it will compile and build automatically.

If you're using a compiler other than Visual C++, you're more on your own. Write your L program and put it in a file called "HelloWorld.L" or the like. Then run it through the L Compiler (click here for more info). Take the resulting file and run it through your C++ compiler, then link with the L runtime libraries.

Step 4: Go wild!

If you haven't already, now is a good time to read the Tutorial, or maybe skim the Reference Manual. Or take a look at the example programs. These may give you some ideas for exploring the language on your own.

If you know how to program in C or C++, then you can take a piecemeal approach to learning L. Since you can embed C/C++ code directly in an L program, there's no reason you can't have a perfectly valid L program that is mostly C++. For instance:

go {
    C++: {
        char buf[256];
        printf( "Enter your name: " );
        fflush( stdout );
        gets( buf );
        printf( "Hi there, %s! How are you?\n", buf );


    }
}

Then you can add in L features as you discover them.