Skip to content
chatur edited this page Jan 27, 2012 · 20 revisions

Buit-In Types

  • How are strings implemented? Does Clay support UTF8?

    Currently Clay strings are just mutable byte vectors stored on the heap. In the future, Strings will be immutable with better support for UTF8.

  • How do I get the largest value for a built-in integer?

    Use Greatest(Int), Greatest(Int64), etc.

Variants

  • How much space (in bytes) does a variant occupy?

    Variants are implemented as tag + value. Since all values of the variant have the same size, the size of the variant is machine word size (for the tag) + size of largest variant member.

Performance

  • Benchmarks are slower than equivalent C or C++ code

    Clay's library includes bounds check and integer overflow assertions by default, which adds about 10% overhead in typical code. Make sure you test with -Dclay.DisableAssertions to disable all assertions, or -Dclay.DisableAssertions.boundsChecks -Dclay.DisableAssertions.overflowChecks to disable only bounds and overflow check assertions, to get a fair comparison.

Building Clay

  • How do I build a debug or release version of Clay?

    When running cmake, set the CMAKE_BUILD_TYPE attribute to Debug or Release as needed. For e.g.: cmake -DCMAKE_BUILD_TYPE=Debug ..

  • Clay complains about parser errors on /* tokens

    Older versions of GCC have a compiler bug that breaks Clay's parser. Try updating your GCC, or using Clang.

  • Clay won't compile because it says it requires LLVM 3.0, even though I have LLVM 3.x

    LLVM minor revisions and developer versions are not source compatible. Only LLVM 3.0 (not 3.0svn) release is currently supported.

Clone this wiki locally