Getting Started

The repository moved

This only matters if you cloned the repository from Google Code and now want to update.
Since Google code is shutting down the repository was moved to Bitbucket.  It's still Mercurial, thus the only thing that changes is the location: https://bitbucket.org/zimbu/zimbu.
Edit your .hg/hgrc or ~/.hgrc and change "https://zimbu.googlecode.com/hg/" to "https://bitbucket.org/zimbu/zimbu".
Then "make update" and "hg update -C" if you get the error message (warning: local changes are discarded).


Prerequisite: You need Mercurial

On most systems you can use your favorite package manager to install Mercurial.
On Ubuntu it's simply called "mercurial".

For MS-Windows you can download mercurial from this web page. If you have no
preference try "TortoiseHG" for your Windows version.

Prerequisite: You need a compiler and development environment

Depending on your system it may already be there or you need to install.
For Ubuntu you would need packages clang (It's faster than gcc), tcmalloc_minimal and
 libc6-dev.

For MS-Windows you should install MinGW, see this web page.  You can use
another compiler, but you probably need to tweak the Makefile then.
  1. Download and run mingw-get-inst (using the .exe is the easiest)
  2. During installation check the MSYS Basic System checkbox.  This provides
    the "cp" and "diff" tools that you need for "make test".
  3. Add the C:\MinGW\bin and C:\MinGW\msys\1.0\bin directories to $PATH.
For threading support (including the HTTP server), you need a pthreads library.
MinGW includes it, for other compilers you can download one from here.
If you get an error for "struct timespec" redefined, comment it out in pthread.h.
 

At some point the Zimbu Hg repository was so big it made the code.google.com servers stumble.  Sorry!
(image by Robert Konigsberg)

Build for the first time

Use this command to fetch the Zimbu files:
hg clone https://bitbucket.org/zimbu/zimbu zimbu
cd zimbu
If you get "transaction abort!" errors, just try again.

On Unix building is done with "make bootstrap".  You can verify it works with "make test":
make bootstrap
make test
If you don't have clang edit MakeSettingsUnix.mak and change "clang" to "gcc" or whatever your compiler is called.

On MS-Windows the above should work if you installed MinGW with MSYS.  Otherwise use these commands:
make -f makeming.mak bootstrap
make -f makeming.mak test

On the Mac follow the instructions for Unix.

Updating to the latest version

On Unix:
make update

On MS-Windows, if the Unix command doesn't work, use:
make -f makeming.mak update

This will use Mercurial to fetch the latest files ("hg pull"), update the working directory ("hg update -C") and build from the C files ("make bootstrap").

Try out your code

A fun way to try out Zimbu code is by a live edit-build-run demo.  Do this:

cd livedemo
make
./livedemo

Now point your browser to http://localhost:8889/index.html
You will be able to type Zimbu code and immediately see the result.
Either error messages from the compiler or, when compilation succeeded, the output of the program.

This is what it looks like:

And when you make an error:

The live demo was written in Zimbu, using the ZWT library (Zimbu Web Toolkit).

Subpages (1): Hello world
Comments