• Stars
    star
    402
  • Rank 107,380 (Top 3 %)
  • Language
    C++
  • License
    Other
  • Created about 14 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Clay programming language

Clay 0.2-WIP

Clay is a programming language designed for Generic Programming.

Visit http://claylabs.com/clay for more information.

This is a work-in-progress branch. Documentation may be out of date, and source code compatibility may break at any time. The latest release branch is v0.1; for normal use you will want to switch to that branch:

git checkout v0.1

Pre-requisites

Clay requires CMake version 2.6 or later, and LLVM and Clang 3.2. Note that LLVM versions are not backward-compatible so developer versions of LLVM and/or later releases are not compatible with this version of Clay.

CMake Configuration

Clay uses CMake to configure and control its build system. The build can be customized by passing cmake arguments of the form "-D=" to set CMake variables. In addition to standard CMake variables such as CMAKE_INSTALL_PREFIX and CMAKE_BUILD_TYPE, Clay's build system uses the following variables:

  • LLVM_DIR can be set to the install prefix of an LLVM 3.2 installation. If not set, CMake will look for an 'llvm-config' script on the PATH.
  • PYTHON_EXECUTABLE can be set to the path of a Python 2.x interpreter. Clay uses a Python 2 script to drive its test suite. Some platforms (notably Arch Linux) use Python 3 as their 'python' executable, and this will confuse CMake. Pointing PYTHON_EXECUTABLE at 'python2' may be necessary on these platforms.

Build Clay on Unix-like Systems

To build Clay, first run cmake to generate the Makefiles and then run make. CMake can also build project files for IDEs such as Xcode. Look at CMake documentation for how to build those. It is recommended that Clay be built in a separate build directory.

mkdir build
cd build
cmake -G "Unix Makefiles" ../
make

The default installation directory for Clay is /usr/local. To change the installation path, pass -DCMAKE_INSTALL_PREFIX=/my/path to cmake.

To install Clay run

make install

To run the test suite

make test

To compile a clay source file run

clay ../examples/hello.clay

The generated binary

./hello

Build Clay on Windows with Visual C++

I use Visual C++ Express 2010 to build LLVM and Clay for Windows. From a Visual Studio command prompt, build LLVM and Clang using cmake and the MSVC compiler. There are some issues with Debug builds and LLVM, so both LLVM and Clay will need to be built as Release. The default LLVM install directory needs Administrator permissions, so you may want to set a CMAKE_INSTALL_PREFIX as well. to change it. Place the Clang repository in llvm-3.2/tools/clang so that LLVM builds it automatically and compile LLVM with the following commands:

mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=c:\llvm31-install -DCMAKE_BUILD_TYPE=Release ..
nmake install

Then to build Clay, run CMake and generate nmake makefiles:

mkdir build
cd build
cmake -G "NMake Makefiles" -DLLVM_DIR=c:\llvm31-install -DCMAKE_BUILD_TYPE=Release ..
nmake

Building under Cygwin or Mingw, or with Visual C++ using cmake's Visual Studio Solution generator, may also work, but I haven't tried it.

More Repositories

1

hello-gl

"Hello World" in OpenGL 2.0
C
114
star
2

selfaware

Self-aware struct-like types in C++11
C++
45
star
3

tbb

Intel Threading Building Blocks with local modifications
C++
29
star
4

ch4-flag

Demo program for Modern OpenGL intro ch4
C
21
star
5

hello-gl-ch3

"Hello World" in OpenGL 2.0, with matrix transformations
C
20
star
6

Vinyl

Mac OS X music player + iTunes-like interface – iTunes-like crap
C
13
star
7

dgen-sdl

Ancient Sega Genesis/MegaDrive emulator
C
8
star
8

macosx-fatx

Mac OS X FATX filesystem kernel driver
C
7
star
9

durians

C++11 helper libraries
C++
6
star
10

ch5-flag

Flag demo for Modern OpenGL intro ch5
C
6
star
11

Sokoban.html

HTML Sokoban game
JavaScript
5
star
12

papier

sprites and stuff
Factor
5
star
13

newclay

Newclay programming language
Python
4
star
14

Megacanvas

(wip) infinite-size image editor/viewer
C++
4
star
15

BattleMints

action game for iPhone
C++
4
star
16

Footsie

twister, but with your fingers and on the iPhone
Objective-C
4
star
17

swift-generics-experiments

Assembly
4
star
18

Trixel

lo-res voxel renderer/modeler
Objective-C
4
star
19

rowsdower

static blog generator in Factor
4
star
20

CalTalk

Bonjour-based mini WebDAV server for sharing iCal calendars
Objective-C
3
star
21

ocaml-objc

OCaml-to-Objective-C bridge
Objective-C
3
star
22

jckarter.github.io

HTML
2
star
23

zissou

Zissou Factor Talk
Factor
2
star
24

cat-psychiatrist

HTML5 feline therapist simulator
JavaScript
2
star
25

graphs.js

Unobtrusive Javascript graph connections
JavaScript
2
star
26

clay-lua

Lua bindings for the Clay programming language
C
1
star
27

clay-sqlite

SQLite bindings for the Clay programming language
C
1
star
28

shinobi

Hacked-up Shinobi CUDA path tracer
C++
1
star
29

WinDock

NeXT-ish drag-and-drop application launcher dock for Windows
C
1
star