text:
This document is another way to learn about LLVM. Unlike the LLVM Reference Manual or LLVM Programmer's Manual, here we learn about LLVM through the experience of creating a simple programming language named Stacker. Stacker was invented specifically as a demonstration of LLVM. The emphasis in this document is not on describing the intricacies of LLVM itself but on how to use it to build your own compiler system.
Amongst other things, LLVM is a platform for compiler writers. Because of its exceptionally clean and small IR (intermediate representation), compiler writing with LLVM is much easier than with other system. As proof, I wrote the entire compiler (language definition, lexer, parser, code generator, etc.) in about four days! That's important to know because it shows how quickly you can get a new language running when using LLVM. Furthermore, this was the first language the author ever created using LLVM. The learning curve is included in that four days.
The language described here, Stacker, is Forth-like. Programs are simple collections of word definitions, and the only thing definitions can do is manipulate a stack or generate I/O. Stacker is not a "real" programming language; it's very simple. Although it is computationally complete, you wouldn't use it for your next big project. However, the fact that it is complete, it's simple, and it doesn't have a C-like syntax make it useful for demonstration purposes. It shows that LLVM could be applied to a wide variety of languages.
The basic notions behind stacker is very simple. There's a stack of integers (or character pointers) that the program manipulates. Pretty much the only thing the program can do is manipulate the stack and do some limited I/O operations. The language provides you with several built-in words that manipulate the stack in interesting ways. To get your feet wet, here's how you write the traditional "Hello, World" program in Stacker:
: hello_world "Hello, World!" >s DROP CR ;
: MAIN hello_world ;
This has two "definitions" (Stacker manipulates words, not
functions and words have definitions): MAIN
. The MAIN
definition is standard; it
tells Stacker where to start. Here, MAIN
is defined to
simply invoke the word hello_world
. The
definition tells stacker to push the
"Hello, World!"
string on to the stack, print it out
), pop it off the stack (DROP
), and
finally print a carriage return (CR
). Although
uses the stack, its net effect is null. Well
written Stacker definitions have that characteristic.
Exercise for the reader: how could you make this a one line program?
Stacker was written for two purposes:
During the development of Stacker, many lessons about LLVM were learned. Those lessons are described in the following subsections.
Although I knew that LLVM uses a Single Static Assignment (SSA) format, it wasn't obvious to me how prevalent this idea was in LLVM until I really started using it. Reading the Programmer's Manual and Language Reference, I noted that most of the important LLVM IR (Intermediate Representation) C++ classes were derived from the Value class. The full power of that simple design only became fully understood once I started constructing executable expressions for Stacker.
This really makes your programming go faster. Think about compiling code
for the following C/C++ expression: (a|b)*((x+1)/(y+1))
. Assuming
the values are on the stack in the order a, b, x, y, this could be
expressed in stacker as: 1 + SWAP 1 + / ROT2 OR *
You could write a function using LLVM that computes this expression like
Value* expression(BasicBlock* bb, Value* a, Value* b, Value* x, Value* y ) { ConstantInt* one = ConstantInt::get(Type::IntTy, 1); BinaryOperator* or1 = BinaryOperator::createOr(a, b, "", bb); BinaryOperator* add1 = BinaryOperator::createAdd(x, one, "", bb); BinaryOperator* add2 = BinaryOperator::createAdd(y, one, "", bb); BinaryOperator* div1 = BinaryOperator::createDiv(add1, add2, "", bb); BinaryOperator* mult1 = BinaryOperator::createMul(or1, div1, "", bb); return mult1; }
"Okay, big deal," you say? It is a big deal. Here's why. Note that I didn't
have to tell this function which kinds of Values are being passed in. They could be
s, Constant
s, GlobalVariable
s, or
any of the other subclasses of Value
that LLVM supports.
Furthermore, if you specify Values that are incorrect for this sequence of
operations, LLVM will either notice right away (at compilation time) or the LLVM
Verifier will pick up the inconsistency when the compiler runs. In either case
LLVM prevents you from making a type error that gets passed through to the
generated program. This really helps you write a compiler that
always generates correct code!
The second point is that we don't have to worry about branching, registers, stack variables, saving partial results, etc. The instructions we create are the values we use. Note that all that was created in the above code is a Constant value and five operators. Each of the instructions is the resulting value of that instruction. This saves a lot of time.
The lesson is this: SSA form is very powerful: there is no difference between a value and the instruction that created it. This is fully enforced by the LLVM IR. Use it to your best advantage.
I had to learn about terminating blocks the hard way: using the debugger to figure out what the LLVM verifier was trying to tell me and begging for help on the LLVMdev mailing list. I hope you avoid this experience.
Emblazon this rule in your mind:
s in your compiler must be
terminated with a terminating instruction (branch, return, etc.).
Terminating instructions are a semantic requirement of the LLVM IR. There is no facility for implicitly chaining together blocks placed into a function in the order they occur. Indeed, in the general case, blocks will not be added to the function in the order of execution because of the recursive way compilers are written.
Furthermore, if you don't terminate your blocks, your compiler code will compile just fine. You won't find out about the problem until you're running the compiler and the module you just created fails on the LLVM Verifier.
After a little initial fumbling around, I quickly caught on to how blocks should be constructed. In general, here's what I learned:
argument. At first, I thought this was a mistake
because clearly the normal mode of inserting instructions would be one at
a time after some other instruction, not before. However,
if you hold on to your terminating instruction (or use the handy dandy
method on a BasicBlock
), it can
always be used as the insert_before
argument to your instruction
constructors. This causes the instruction to automatically be inserted in
the RightPlace™ place, just before the terminating instruction. The
nice thing about this design is that you can pass blocks around and insert
new instructions into them without ever knowing what instructions came
before. This makes for some very clean compiler design.The foregoing is such an important principal, its worth making an idiom:
BasicBlock* bb = new BasicBlock(); bb->getInstList().push_back( new Branch( ... ) ); new Instruction(..., bb->getTerminator() );
To make this clear, consider the typical if-then-else statement (see StackerCompiler::handle_if() method). We can set this up in a single function using LLVM in the following way:
using namespace llvm; BasicBlock* MyCompiler::handle_if( BasicBlock* bb, ICmpInst* condition ) { // Create the blocks to contain code in the structure of if/then/else BasicBlock* then_bb = new BasicBlock(); BasicBlock* else_bb = new BasicBlock(); BasicBlock* exit_bb = new BasicBlock(); // Insert the branch instruction for the "if" bb->getInstList().push_back( new BranchInst( then_bb, else_bb, condition ) ); // Set up the terminating instructions then->getInstList().push_back( new BranchInst( exit_bb ) ); else->getInstList().push_back( new BranchInst( exit_bb ) ); // Fill in the then part .. details excised for brevity this->fill_in( then_bb ); // Fill in the else part .. details excised for brevity this->fill_in( else_bb ); // Return a block to the caller that can be filled in with the code // that follows the if/then/else construct. return exit_bb; }
Presumably in the foregoing, the calls to the "fill_in" method would add
the instructions for the "then" and "else" parts. They would use the third part
of the idiom almost exclusively (inserting new instructions before the
terminator). Furthermore, they could even recurse back to handle_if
should they encounter another if/then/else statement, and it will just work.
Note how cleanly this all works out. In particular, the push_back methods on
the BasicBlock
's instruction list. These are lists of type
(which is also of type Value
). To create
the "if" branch we merely instantiate a BranchInst
that takes as
arguments the blocks to branch to and the condition to branch on. The
objects act like branch labels! This new
terminates the BasicBlock
as an argument. To give the caller a way to keep inserting after calling
, we create an exit_bb
block which is
to the caller. Note that the exit_bb
block is used as the
terminator for both the then_bb
and the else_bb
blocks. This guarantees that no matter what else handle_if
or fill_in
does, they end up at the exit_bb
One of the first things I noticed is the frequent use of the "push_back" method on the various lists. This is so common that it is worth mentioning. The "push_back" inserts a value into an STL list, vector, array, etc. at the end. The method might have also been named "insert_tail" or "append". Although I've used STL quite frequently, my use of push_back wasn't very high in other programs. In LLVM, you'll use it all the time.
It took a little getting used to and several rounds of postings to the LLVM mailing list to wrap my head around this instruction correctly. Even though I had read the Language Reference and Programmer's Manual a couple times each, I still missed a few very key points:
This means that when you look up an element in the global variable (assuming it's a struct or array), you must deference the pointer first! For many things, this leads to the idiom:
std::vector<Value*> index_vector; index_vector.push_back( ConstantInt::get( Type::LongTy, 0 ); // ... push other indices ... GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector );
For example, suppose we have a global variable whose type is [24 x int]. The variable itself represents a pointer to that array. To subscript the array, we need two indices, not just one. The first index (0) dereferences the pointer. The second index subscripts the array. If you're a "C" programmer, this will run against your grain because you'll naturally think of the global array variable and the address of its first element as the same. That tripped me up for a while until I realized that they really do differ .. by type. Remember that LLVM is strongly typed. Everything has a type. The "type" of the global variable is [24 x int]*. That is, it's a pointer to an array of 24 ints. When you dereference that global variable with a single (0) index, you now have a "[24 x int]" type. Although the pointer value of the dereferenced global and the address of the zero'th element in the array will be the same, they differ in their type. The zero'th element has type "int" while the pointer value has type "[24 x int]".
Get this one aspect of LLVM right in your head, and you'll save yourself a lot of compiler writing headaches down the road.
Linkage types in LLVM can be a little confusing, especially if your compiler writing mind has affixed firm concepts to particular words like "weak", "external", "global", "linkonce", etc. LLVM does not use the precise definitions of, say, ELF or GCC, even though they share common terms. To be fair, the concepts are related and similar but not precisely the same. This can lead you to think you know what a linkage type represents but in fact it is slightly different. I recommend you read the Language Reference on this topic very carefully. Then, read it again.
Here are some handy tips that I discovered along the way:
Constants in LLVM took a little getting used to until I discovered a few utility functions in the LLVM IR that make things easier. Here's what I learned:
This section describes the Stacker language
Stacker definitions define what they do to the global stack. Before proceeding, a few words about the stack are in order. The stack is simply a global array of 32-bit integers or pointers. A global index keeps track of the location of the top of the stack. All of this is hidden from the programmer, but it needs to be noted because it is the foundation of the conceptual programming model for Stacker. When you write a definition, you are, essentially, saying how you want that definition to manipulate the global stack.
Manipulating the stack can be quite hazardous. There is no distinction given and no checking for the various types of values that can be placed on the stack. Automatic coercion between types is performed. In many cases, this is useful. For example, a boolean value placed on the stack can be interpreted as an integer with good results. However, using a word that interprets that boolean value as a pointer to a string to print out will almost always yield a crash. Stacker simply leaves it to the programmer to get it right without any interference or hindering on interpretation of the stack values. You've been warned. :)
Punctuation in Stacker is very simple. The colon and semi-colon characters are used to introduce and terminate a definition (respectively). Except for FORWARD declarations, definitions are all you can specify in Stacker. Definitions are read left to right. Immediately after the colon comes the name of the word being defined. The remaining words in the definition specify what the word does. The definition is terminated by a semi-colon.
So, your typical definition will have the form:
: name ... ;
The name
is up to you but it must start with a letter and contain
only letters, numbers, and underscore. Names are case sensitive and must not be
the same as the name of a built-in word. The ...
is replaced by
the stack manipulating words that you wish to define name
Stacker supports two types of comments. A hash mark (#) starts a comment that extends to the end of the line. It is identical to the kind of comments commonly used in shell scripts. A pair of parentheses also surround a comment. In both cases, the content of the comment is ignored by the Stacker compiler. The following does nothing in Stacker.
# This is a comment to end of line
( This is an enclosed comment )
See the example program to see comments in use in a real program.
There are three kinds of literal values in Stacker: Integers, Strings,
and Booleans. In each case, the stack operation is to simply push the
value on to the stack. So, for example:
42 " is the answer." TRUE
will push three values on to the stack: the integer 42, the
string " is the answer.", and the boolean TRUE.
Each definition in Stacker is composed of a set of words. Words are read and executed in order from left to right. There is very little checking in Stacker to make sure you're doing the right thing with the stack. It is assumed that the programmer knows how the stack transformation he applies will affect the program.
Words in a definition come in two flavors: built-in and programmer defined. Simply mentioning the name of a previously defined or declared programmer-defined word causes that word's stack actions to be invoked. It is somewhat like a function call in other languages. The built-in words have various effects, described below.
Sometimes you need to call a word before it is defined. For this, you can
use the FORWARD
declaration. It looks like this:
FORWARD name ;
This simply states to Stacker that "name" is the name of a definition
that is defined elsewhere. Generally it means the definition can be found
"forward" in the file. But, it doesn't have to be in the current compilation
unit. Anything declared with FORWARD
is an external symbol for
The built-in words of the Stacker language are put in several groups depending on what they do. The groups are as follows:
While you may be familiar with many of these operations from other programming languages, a careful review of their semantics is important for correct programming in Stacker. Of most importance is the effect that each of these built-in words has on the global stack. The effect is not always intuitive. To better describe the effects, we'll borrow from Forth the idiom of describing the effect on the stack with:
That is, to the left of the -- is a representation of the stack before the operation. To the right of the -- is a representation of the stack after the operation. In the table below that describes the operation of each of the built in words, we will denote the elements of the stack using the following construction:
Definition Of Operation Of Built In Words | |||
Word | Name | Operation | Description |
< | LT | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is less than w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back on the stack. |
> | GT | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is greater than w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back on the stack. |
>= | GE | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is greater than or equal to w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back on the stack. |
<= | LE | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is less than or equal to w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back on the stack. |
= | EQ | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is equal to w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back |
<> | NE | w1 w2 -- b | Two values (w1 and w2) are popped off the stack and compared. If w1 is equal to w2, TRUE is pushed back on the stack, otherwise FALSE is pushed back |
FALSE | FALSE | -- b | The boolean value FALSE (0) is pushed on to the stack. |
TRUE | TRUE | -- b | The boolean value TRUE (-1) is pushed on to the stack. |
Word | Name | Operation | Description |
<< | SHL | w1 w2 -- w1<<w2 | Two values (w1 and w2) are popped off the stack. The w2 operand is shifted left by the number of bits given by the w1 operand. The result is pushed back to the stack. |
>> | SHR | w1 w2 -- w1>>w2 | Two values (w1 and w2) are popped off the stack. The w2 operand is shifted right by the number of bits given by the w1 operand. The result is pushed back to the stack. |
OR | OR | w1 w2 -- w2|w1 | Two values (w1 and w2) are popped off the stack. The values are bitwise OR'd together and pushed back on the stack. This is not a logical OR. The sequence 1 2 OR yields 3 not 1. |
AND | AND | w1 w2 -- w2&w1 | Two values (w1 and w2) are popped off the stack. The values are bitwise AND'd together and pushed back on the stack. This is not a logical AND. The sequence 1 2 AND yields 0 not 1. |
XOR | XOR | w1 w2 -- w2^w1 | Two values (w1 and w2) are popped off the stack. The values are bitwise exclusive OR'd together and pushed back on the stack. For example, The sequence 1 3 XOR yields 2. |
Word | Name | Operation | Description |
ABS | ABS | w -- |w| | One value s popped off the stack; its absolute value is computed and then pushed on to the stack. If w1 is -1 then w2 is 1. If w1 is 1 then w2 is also 1. |
NEG | NEG | w -- -w | One value is popped off the stack which is negated and then pushed back on to the stack. If w1 is -1 then w2 is 1. If w1 is 1 then w2 is -1. |
+ | ADD | w1 w2 -- w2+w1 | Two values are popped off the stack. Their sum is pushed back on to the stack |
- | SUB | w1 w2 -- w2-w1 | Two values are popped off the stack. Their difference is pushed back on to the stack |
* | MUL | w1 w2 -- w2*w1 | Two values are popped off the stack. Their product is pushed back on to the stack |
/ | DIV | w1 w2 -- w2/w1 | Two values are popped off the stack. Their quotient is pushed back on to the stack |
MOD | MOD | w1 w2 -- w2%w1 | Two values are popped off the stack. Their remainder after division of w1 by w2 is pushed back on to the stack |
*/ | STAR_SLAH | w1 w2 w3 -- (w3*w2)/w1 | Three values are popped off the stack. The product of w1 and w2 is divided by w3. The result is pushed back on to the stack. |
++ | INCR | w -- w+1 | One value is popped off the stack. It is incremented by one and then pushed back on to the stack. |
-- | DECR | w -- w-1 | One value is popped off the stack. It is decremented by one and then pushed back on to the stack. |
MIN | MIN | w1 w2 -- (w2<w1?w2:w1) | Two values are popped off the stack. The larger one is pushed back on to the stack. |
MAX | MAX | w1 w2 -- (w2>w1?w2:w1) | Two values are popped off the stack. The larger value is pushed back on to the stack. |
Word | Name | Operation | Description |
DROP | DROP | w -- | One value is popped off the stack. |
DROP2 | DROP2 | w1 w2 -- | Two values are popped off the stack. |
NIP | NIP | w1 w2 -- w2 | The second value on the stack is removed from the stack. That is, a value is popped off the stack and retained. Then a second value is popped and the retained value is pushed. |
NIP2 | NIP2 | w1 w2 w3 w4 -- w3 w4 | The third and fourth values on the stack are removed from it. That is, two values are popped and retained. Then two more values are popped and the two retained values are pushed back on. |
DUP | DUP | w1 -- w1 w1 | One value is popped off the stack. That value is then pushed on to the stack twice to duplicate the top stack vaue. |
DUP2 | DUP2 | w1 w2 -- w1 w2 w1 w2 | The top two values on the stack are duplicated. That is, two vaues are popped off the stack. They are alternately pushed back on the stack twice each. |
SWAP | SWAP | w1 w2 -- w2 w1 | The top two stack items are reversed in their order. That is, two values are popped off the stack and pushed back on to the stack in the opposite order they were popped. |
SWAP2 | SWAP2 | w1 w2 w3 w4 -- w3 w4 w2 w1 | The top four stack items are swapped in pairs. That is, two values are popped and retained. Then, two more values are popped and retained. The values are pushed back on to the stack in the reverse order but in pairs. |
OVER | OVER | w1 w2-- w1 w2 w1 | Two values are popped from the stack. They are pushed back on to the stack in the order w1 w2 w1. This seems to cause the top stack element to be duplicated "over" the next value. |
OVER2 | OVER2 | w1 w2 w3 w4 -- w1 w2 w3 w4 w1 w2 | The third and fourth values on the stack are replicated on to the top of the stack |
ROT | ROT | w1 w2 w3 -- w2 w3 w1 | The top three values are rotated. That is, three value are popped off the stack. They are pushed back on to the stack in the order w1 w3 w2. |
ROT2 | ROT2 | w1 w2 w3 w4 w5 w6 -- w3 w4 w5 w6 w1 w2 | Like ROT but the rotation is done using three pairs instead of three singles. |
RROT | RROT | w1 w2 w3 -- w3 w1 w2 | Reverse rotation. Like ROT, but it rotates the other way around. Essentially, the third element on the stack is moved to the top of the stack. |
RROT2 | RROT2 | w1 w2 w3 w4 w5 w6 -- w3 w4 w5 w6 w1 w2 | Double reverse rotation. Like RROT but the rotation is done using three pairs instead of three singles. The fifth and sixth stack elements are moved to the first and second positions |
TUCK | TUCK | w1 w2 -- w2 w1 w2 | Similar to OVER except that the second operand is being replicated. Essentially, the first operand is being "tucked" in between two instances of the second operand. Logically, two values are popped off the stack. They are placed back on the stack in the order w2 w1 w2. |
TUCK2 | TUCK2 | w1 w2 w3 w4 -- w3 w4 w1 w2 w3 w4 | Like TUCK but a pair of elements is tucked over two pairs. That is, the top two elements of the stack are duplicated and inserted into the stack at the fifth and positions. |
PICK | PICK | x0 ... Xn n -- x0 ... Xn x0 | The top of the stack is used as an index into the remainder of the stack. The element at the nth position replaces the index (top of stack). This is useful for cycling through a set of values. Note that indexing is zero based. So, if n=0 then you get the second item on the stack. If n=1 you get the third, etc. Note also that the index is replaced by the n'th value. |
SELECT | SELECT | m n X0..Xm Xm+1 .. Xn -- Xm | This is like PICK but the list is removed and you need to specify both the index and the size of the list. Careful with this one, the wrong value for n can blow away a huge amount of the stack. |
ROLL | ROLL | x0 x1 .. xn n -- x1 .. xn x0 | Not Implemented. This one has been left as an exercise to the student. See Exercise. ROLL requires a value, "n", to be on the top of the stack. This value specifies how far into the stack to "roll". The n'th value is moved (not copied) from its location and replaces the "n" value on the top of the stack. In this way, all the values between "n" and x0 roll up the stack. The operation of ROLL is a generalized ROT. The "n" value specifies how much to rotate. That is, ROLL with n=1 is the same as ROT and ROLL with n=2 is the same as ROT2. |
Word | Name | Operation | Description |
MALLOC | MALLOC | w1 -- p | One value is popped off the stack. The value is used as the size of a memory block to allocate. The size is in bytes, not words. The memory allocation is completed and the address of the memory block is pushed on to the stack. |
FREE | FREE | p -- | One pointer value is popped off the stack. The value should be
the address of a memory block created by the MALLOC operation. The
associated memory block is freed. Nothing is pushed back on the
stack. Many bugs can be created by attempting to FREE something
that isn't a pointer to a MALLOC allocated memory block. Make
sure you know what's on the stack. One way to do this is with
the following idiom:64 MALLOC DUP DUP (use ptr) DUP (use ptr) ... FREE
This ensures that an extra copy of the pointer is placed on the stack (for the FREE at the end) and that every use of the pointer is preceded by a DUP to retain the copy for FREE. |
GET | GET | w1 p -- w2 p | An integer index and a pointer to a memory block are popped of the block. The index is used to index one byte from the memory block. That byte value is retained, the pointer is pushed again and the retained value is pushed. Note that the pointer value s essentially retained in its position so this doesn't count as a "use ptr" in the FREE idiom. |
PUT | PUT | w1 w2 p -- p | An integer value is popped of the stack. This is the value to be put into a memory block. Another integer value is popped of the stack. This is the indexed byte in the memory block. A pointer to the memory block is popped off the stack. The first value (w1) is then converted to a byte and written to the element of the memory block(p) at the index given by the second value (w2). The pointer to the memory block is pushed back on the stack so this doesn't count as a "use ptr" in the FREE idiom. |
Word | Name | Operation | Description |
RETURN | RETURN | -- | The currently executing definition returns immediately to its caller.
Note that there is an implicit RETURN at the end of each
definition, logically located at the semi-colon. The sequence
RETURN ; is valid but redundant. |
EXIT | EXIT | w1 -- | A return value for the program is popped off the stack. The program is
then immediately terminated. This is normally an abnormal exit from the
program. For a normal exit (when MAIN finishes), the exit
code will always be zero in accordance with UNIX conventions. |
RECURSE | RECURSE | -- | The currently executed definition is called again. This operation is
needed since the definition of a word doesn't exist until the semi colon
is reacher. Attempting something like: : recurser recurser ; will yield and error saying that "recurser" is not defined yet. To accomplish the same thing, change this to: : recurser RECURSE ; |
IF (words...) ENDIF | IF (words...) ENDIF | b -- | A boolean value is popped of the stack. If it is non-zero then the "words..." are executed. Otherwise, execution continues immediately following the ENDIF. |
IF (words...) ELSE (words...) ENDIF | IF (words...) ELSE (words...) ENDIF | b -- | A boolean value is popped of the stack. If it is non-zero then the "words..." between IF and ELSE are executed. Otherwise the words between ELSE and ENDIF are executed. In either case, after the (words....) have executed, execution continues immediately following the ENDIF. |
WHILE word END | WHILE word END | b -- b | The boolean value on the top of the stack is examined (not popped). If
it is non-zero then the "word" between WHILE and END is executed.
Execution then begins again at the WHILE where the boolean on the top of
the stack is examined again. The stack is not modified by the WHILE...END
loop, only examined. It is imperative that the "word" in the body of the
loop ensure that the top of the stack contains the next boolean to examine
when it completes. Note that since booleans and integers can be coerced
you can use the following "for loop" idiom:(push count) WHILE word -- END For example: 10 WHILE >d -- END This will print the numbers from 10 down to 1. 10 is pushed on the stack. Since that is non-zero, the while loop is entered. The top of the stack (10) is printed out with >d. The top of the stack is decremented, yielding 9 and control is transfered back to the WHILE keyword. The process starts all over again and repeats until the top of stack is decremented to 0 at which point the WHILE test fails and control is transfered to the word after the END. |
Word | Name | Operation | Description |
SPACE | SPACE | -- | A space character is put out. There is no stack effect. |
TAB | TAB | -- | A tab character is put out. There is no stack effect. |
CR | CR | -- | A carriage return character is put out. There is no stack effect. |
>s | OUT_STR | -- | A string pointer is popped from the stack. It is put out. |
>d | OUT_STR | -- | A value is popped from the stack. It is put out as a decimal integer. |
>c | OUT_CHR | -- | A value is popped from the stack. It is put out as an ASCII character. |
<s | IN_STR | -- s | A string is read from the input via the scanf(3) format string " %as". The resulting string is pushed on to the stack. |
<d | IN_STR | -- w | An integer is read from the input via the scanf(3) format string " %d". The resulting value is pushed on to the stack |
<c | IN_CHR | -- w | A single character is read from the input via the scanf(3) format string " %c". The value is converted to an integer and pushed on to the stack. |
DUMP | DUMP | -- | The stack contents are dumped to standard output. This is useful for debugging your definitions. Put DUMP at the beginning and end of a definition to see instantly the net effect of the definition. |
The following fully documented program highlights many features of both the Stacker language and what is possible with LLVM. The program has two modes of operation. If you provide numeric arguments to the program, it checks to see if those arguments are prime numbers and prints out the results. Without any arguments, the program prints out any prime numbers it finds between 1 and one million (there's a lot of them!). The source code comments below tell the remainder of the story.
# Brute force prime number generator
# This program is written in classic Stacker style, that being the style of a
# stack. Start at the bottom and read your way up !
# Reid Spencer - Nov 2003
# Utility definitions
: print >d CR ;
: it_is_a_prime TRUE ;
: it_is_not_a_prime FALSE ;
: continue_loop TRUE ;
: exit_loop FALSE;
# This definition tries an actual division of a candidate prime number. It
# determines whether the division loop on this candidate should continue or
# not.
# div - the divisor to try
# p - the prime number we are working on
# cont - should we continue the loop ?
# div - the next divisor to try
# p - the prime number we are working on
: try_dividing
DUP2 ( save div and p )
SWAP ( swap to put divisor second on stack)
MOD 0 = ( get remainder after division and test for 0 )
exit_loop ( remainder = 0, time to exit )
continue_loop ( remainder != 0, keep going )
# This function tries one divisor by calling try_dividing. But, before doing
# that it checks to see if the value is 1. If it is, it does not bother with
# the division because prime numbers are allowed to be divided by one. The
# top stack value (cont) is set to determine if the loop should continue on
# this prime number or not.
# cont - should we continue the loop (ignored)?
# div - the divisor to try
# p - the prime number we are working on
# cont - should we continue the loop ?
# div - the next divisor to try
# p - the prime number we are working on
: try_one_divisor
DROP ( drop the loop continuation )
DUP ( save the divisor )
1 = IF ( see if divisor is == 1 )
exit_loop ( no point dividing by 1 )
try_dividing ( have to keep going )
SWAP ( get divisor on top )
-- ( decrement it )
SWAP ( put loop continuation back on top )
# The number on the stack (p) is a candidate prime number that we must test to
# determine if it really is a prime number. To do this, we divide it by every
# number from one p-1 to 1. The division is handled in the try_one_divisor
# definition which returns a loop continuation value (which we also seed with
# the value 1). After the loop, we check the divisor. If it decremented all
# the way to zero then we found a prime, otherwise we did not find one.
# p - the prime number to check
# yn - boolean indicating if its a prime or not
# p - the prime number checked
: try_harder
DUP ( duplicate to get divisor value ) )
-- ( first divisor is one less than p )
1 ( continue the loop )
try_one_divisor ( see if its prime )
DROP ( drop the continuation value )
0 = IF ( test for divisor == 1 )
it_is_a_prime ( we found one )
it_is_not_a_prime ( nope, this one is not a prime )
# This definition determines if the number on the top of the stack is a prime
# or not. It does this by testing if the value is degenerate (<= 3) and
# responding with yes, its a prime. Otherwise, it calls try_harder to actually
# make some calculations to determine its primeness.
# p - the prime number to check
# yn - boolean indicating if its a prime or not
# p - the prime number checked
: is_prime
DUP ( save the prime number )
3 >= IF ( see if its <= 3 )
it_is_a_prime ( its <= 3 just indicate its prime )
try_harder ( have to do a little more work )
# This definition is called when it is time to exit the program, after we have
# found a sufficiently large number of primes.
# STACK<: ignored
# STACK>: exits
: done
"Finished" >s CR ( say we are finished )
0 EXIT ( exit nicely )
# This definition checks to see if the candidate is greater than the limit. If
# it is, it terminates the program by calling done. Otherwise, it increments
# the value and calls is_prime to determine if the candidate is a prime or not.
# If it is a prime, it prints it. Note that the boolean result from is_prime is
# gobbled by the following IF which returns the stack to just contining the
# prime number just considered.
# p - one less than the prime number to consider
# p+1 - the prime number considered
: consider_prime
DUP ( save the prime number to consider )
1000000 < IF ( check to see if we are done yet )
done ( we are done, call "done" )
++ ( increment to next prime number )
is_prime ( see if it is a prime )
print ( it is, print it )
# This definition starts at one, prints it out and continues into a loop calling
# consider_prime on each iteration. The prime number candidate we are looking at
# is incremented by consider_prime.
# STACK<: empty
# STACK>: empty
: find_primes
"Prime Numbers: " >s CR ( say hello )
DROP ( get rid of that pesky string )
1 ( stoke the fires )
print ( print the first one, we know its prime )
WHILE ( loop while the prime to consider is non zero )
consider_prime ( consider one prime number )
: say_yes
>d ( Print the prime number )
" is prime." ( push string to output )
>s ( output it )
CR ( print carriage return )
DROP ( pop string )
: say_no
>d ( Print the prime number )
" is NOT prime." ( push string to put out )
>s ( put out the string )
CR ( print carriage return )
DROP ( pop string )
# This definition processes a single command line argument and determines if it
# is a prime number or not.
# n - number of arguments
# arg1 - the prime numbers to examine
# n-1 - one less than number of arguments
# arg2 - we processed one argument
: do_one_argument
-- ( decrement loop counter )
SWAP ( get the argument value )
is_prime IF ( determine if its prime )
say_yes ( uhuh )
say_no ( nope )
DROP ( done with that argument )
# The MAIN program just prints a banner and processes its arguments.
# n - number of arguments
# ... - the arguments
: process_arguments
WHILE ( while there are more arguments )
do_one_argument ( process one argument )
# The MAIN program just prints a banner and processes its arguments.
# STACK<: arguments
NIP ( get rid of the program name )
-- ( reduce number of arguments )
DUP ( save the arg counter )
1 <= IF ( See if we got an argument )
process_arguments ( tell user if they are prime )
find_primes ( see how many we can find )
0 ( push return code )
This section is under construction.
In the mean time, you can always read the code! It has comments!
The source code, test programs, and sample programs can all be found in the LLVM repository named llvm-stacker This should be checked out to the projects directory so that it will auto-configure. To do that, make sure you have the llvm sources in llvm (see Getting Started) and then use these commands:
cd llvm/projects cvs co llvm-stacker
Under the projects/llvm-stacker directory you will find the implementation of the Stacker compiler, as follows:
See projects/llvm-stacker/lib/compiler/Lexer.l
See projects/llvm-stacker/lib/compiler/StackerParser.y
See projects/llvm-stacker/lib/compiler/StackerCompiler.cpp
See projects/llvm-stacker/lib/runtime/stacker_rt.c
See projects/llvm-stacker/tools/stkrc/stkrc.cpp
See projects/llvm-stacker/test/*.st
As you may have noted from a careful inspection of the Built-In word definitions, the ROLL word is not implemented. This word was left out of Stacker on purpose so that it can be an exercise for the student. The exercise is to implement the ROLL functionality (in your own workspace) and build a test program for it. If you can implement ROLL, you understand Stacker and probably a fair amount about LLVM since this is one of the more complicated Stacker operations. The work will almost be completely limited to the compiler.
The ROLL word is already recognized by both the lexer and parser but ignored
by the compiler. That means you don't have to futz around with figuring out how
to get the keyword recognized. It already is. The part of the compiler that
you need to implement is the ROLL
case in the
Good luck!
The initial implementation of Stacker has several deficiencies. If you're interested, here are some things that could be implemented better:


text:
Just looking at the Jedi Wave carded pics...for everyone belly aching about potential pegwarming must not have been around for the Winter of 98-99...Bets on a repeat?
You can actually still find him on the pegs at Rite-Aid around here. $12.99.
So step up people when you see him, he is the key to the next true Fan figure! Buy at least 3 of him.
I plan on doing just that. Hasbro gave us what we wanted and we owe it to them to support them. If I see one on the pegs, I am going to buy it and give it to a kid who might not otherwise be able to afford it. It's the least I can do to keep the hobby I've had for 30 years going.
Quote from: Carpeteria3000 on July 29, 2009, 03:29 PMForget new figure petitions - I say go for an ICMG Lego figure now. Neverwork, they don't make "portly" LEGOs.
Forget new figure petitions - I say go for an ICMG Lego figure now.

subset: commoncrawl


text:
Physcial Sciences Division
Research Highlights
May 2008
Looking for a Cheap Catalyst
Scientists study how atoms behave when alcohol interacts with promising, inexpensive catalyst to produce hydrogen
The energy involved in breaking different bonds in methanol is studied via computational models. Enlarged View
Results: One hurdle to producing hydrogen as an affordable, green alternative to gasoline is the exorbitant price of platinum, gold, and other precious metals used to catalyze or drive the reactions. So, scientists from Pacific Northwest National Laboratory's Institute for Integrated Catalysis and Southern Illinois University completed a theoretical study on how an inexpensive ceria catalyst can decompose a simple alcohol into hydrogen.
Methanol (CH3OH) contains four hydrogen atoms and can dissociate via several different reactions, depending on which bonds within the molecule are broken first. For example, if the C-O bond of breaks methanol first, undesirable byproducts and little hydrogen is produced.
Why it matters: As the financial and environmental costs of oil use continue to rise, cleaner-burning domestic fuels, such as hydrogen, are needed. To make manufacturing hydrogen a reality requires affordable catalysts, but first the atomic-level chemical and physical phenomena in the catalysts that drive the desired reactions must be understood.
Methods: The team showed that methanol molecules can attach through two different methods, molecularly and dissociatively, on two single crystal ceria catalyst surfaces. On both surfaces, breaking the hydrogen off the carbon of methanol produced the most stable products, but breaking the hydrogen from the oxygen atom was kinetically easier. Removing the hydrogen from the oxygen was almost spontaneous on one surface, known as the CeO2(111) surface. When the methanol coverage was increased, the O-H bond breaking became thermodynamically and kinetically favorable and resulted in more desirable hydrogen recovery.
To conduct this research, the team used the supercomputer and VASP software in the Department of Energy's Environmental Molecular Sciences Laboratory, a national scientific user facility at PNNL, and the National Energy Research Scientific Computing Center at Lawrence Berkeley National Laboratory.
The results are consistent with earlier experiments, but explain the molecular details of dissociation that could not be observed experimentally.
What's next? The researchers plan on investigating the effect of defect sites on methanol decomposition over the ceria catalysts and compare with the experimental results under practical operating conditions.
Acknowledgments: The work was funded as a Laboratory Directed Research and Development project at PNNL. The computations were performed using the Molecular Science Computing Facility in EMSL. Computing time was made under a Computational Grand Challenge "Computational Catalysis." Part of the computing time was also granted by the National Energy Research Scientific Computing Center.
The research was conducted by Donghai Mei, N. Aaron Deskins, and Michel Dupuis of the Pacific Northwest National Laboratory, and Qingfeng Ge of Southern Illinois University. This work is part of PNNL's contributions to developing and deploying transformational tools and techniques for the biological, chemical, environmental, and physical sciences.
Citation: Mei D, NA Deskins, M Dupuis, and Q Ge. 2008. "Density Functional Theory Study of Methanol Decomposition on the CeO2(110) Surface." Journal of Physical Chemistry C 112(11):4257-4266.


text:
If the lost series against the Rays the weekend before had been the funeral, the sweep at the hands of the Chicago White Sox last weekend was the bulldozer pushing fresh sod onto the grave. And I was there for the second of two losses in the same day, a day in which the Red Sox scored just two runs in 18 innings of baseball.
Saturday's game was the meat in a crappy loss sandwich, and at first it was tough to think of a less appealing night at the ballpark, in terms of both the game and my seats in the bleachers.
But we've been here before; about this time of year in 2006, to be exact. "Keeping the faith," to me, doesn't mean always believing that the Red Sox will win, or make the playoffs. It's ultimately about loyalty regardless of outcome. Eventually, during a game like Saturday's, in a season like this one, I just find what else there is to watch.
The atmosphere was comfortable -- the weather showed few traces of Hurricane Earl, which, though much-hyped, had briefly flirted with the Massachusetts coastline and then blown out to sea.
The ballpark still seemed full and the crowd reasonably loud, on a weekend evening with just a two-run deficit and runners on base for most of the game.
Notable characters made their appearance on the field: Manny Ramirez, to boos and camera flashes...
Ozzie Guillen, during a brief tempest over a hit batsman in the bottom of the fourth...
...and the always-electric Daniel Bard.
Young guns and newcomers like Bard, Daniel Nava and Ryan Kalish have become, for me, the main attraction of a Red Sox game at this point.
Joined by further reinforcements from the farm like Lars Anderson and Yamaico Navarro, the Sox celebrated Labor Day in their series opener with the Rays tonight by thrashing Tampa Bay 12-5, while the Yankees lost to the Orioles.
That's all a few days late, of course, and another dozen runs couldn't bring back the must-win games they've dropped in the last two weeks. But the Red Sox won, the Rays and Yankees lost, and I didn't have to go to work. So for today, I'd say I'm satisfied. Even if, in the grand scheme of things, I am very much not.


text:
"We will rid the country of corruption within the first 90 days in office...I condemned the attack on Malala within 48 hours and was the first to visit her in the hospital...Taliban have killed hundreds of ANP workers...If I condemn the Taliban, they'll kill my workers too." PTI Chief Imran Khan in San Jose, CA. Oct 28, 2012
There were many contradictions in PTI chief Imran Khan's San Jose speech that attracted about 500 Pakistani-Americans. The attendees were quite enthusiastic in their welcome of the national cricket hero who has turned to politics with a strong anti-corruption platform. Imran was accompanied by PTI leader Fauzia Kasuri and sufi rock singer- songwriter Salman Ahmad of Junoon fame.
When Imran Khan arrived, the fundraiser-dinner quickly turned into an urban middle class rally reminiscent of the PTI events in major Pakistani cities like Lahore and Karachi. The banquet hall at Dolce Hayes Mansion came alive with slogans of "Pakistan Zindanad" and "Imran Khan Zindabad" following Pakistan's national anthem played by Salman Ahmad.
The well-attended Silicon Valley event was a confirmation of the fact that PTI is essentially an urban middle class phenomenon drawing support from people who are looking for new leadership to rid the country of corruption and misrule by Pakistan People's Party and Pakistan Muslim League (Nawaz), the two major political parties which have dominated Pakistani politics since 1980s.
Anti-Corruption, being the key theme of Imran's speeches, elicited a number of questions from the audience. One questioner suggested that "99% of the people are involved in some form of corruption" and asked how would Imran Khan end it? Imran responded by citing low government salaries as the main cause. He said bureaucrats like his father were not corrupt because their monthly salary was large enough to buy a car back in 1950s. He did not elaborate as to how he would raise government employee salaries to such lofty levels in Pakistan as part of his plan to end corruption in 90 days, nor did he elaborate on the role of the elite colonial-era civil service to control the population rather than serve the people.
Continuing on the theme of low salaries, Imran Khan mentioned that one of his brilliant classmates at Aitcheson College became a top scientist but had such "low income that he could not afford to send his children to Aitcheson College". After hearing this answer, the first thought that ran through my mind was to compare Imran Khan with the Republican presidential nominee Mitt Romney who is being portrayed as "out of touch" and "disconnected" from the ordinary folks.
A woman questioner asked him how he would "end corruption in 90 days when it takes 9 months to make a baby?" In response, Imran said "I am not talking about making babies". Then he proceeded to cite an example of an "honest police superintendent" in some small town near Dera Ismail Khan who ended all crime within 90 days. He also saw the chief minister of the Indian state of Bihar as an inspiration for ending corruption and achieving double-digit economic growth.
Addressing a question about how he intends to deal with the Taliban, Imran blamed it on the US presence in the region and the use of drones. He said dialog is the way to end it. He also said that the number of "irreconcilable" Taliban militants was very small and could be defeated by a "small military military operation" by Pakistan Army after the US exit from the region.
Responding to a question about PTI's election strategy, Imran Khan said he did not believe in "constituency politics" and would not give his party tickets based on the notions of electability. Instead, he is counting on a PTI landslide victory similar to the 1970 elections in which Zulfikar Ali Bhutto's PPP won big in West Pakistan.
After Imran's speech, I was asked by some PTI-USA officers about what I thought of it. I told them that I felt Imran was confused when he said he condemned the Taliban after the Malala shooting but then proceeded to ask "who will protect my workers if I condemn the Taliban". Three of the PTI officers, including Dr. Nasrullah Khan, rose to defend their leader's remarks on the Taliban by asking me "who do you think attacked Malala?" When I said the TTP has claimed responsibility for it, they claimed it was "someone other than the Taliban". As the discussion continued, Dr. Nasrullah Khan pulled up a picture of injured Malala on his iPhone and said "I am a cardiologist and I have seen gun-shot victims" and the nature of Malala's head injury shows the "attack was staged".
It seems that Dr. Nasrullah Khan and his fellow PTI members I met are discounting the fact that the Taliban have a long track record in both Afghanistan and Pakistan of attacking anyone, regardless of age and gender, who disagrees with their goals or tactics. They have a record of using extreme violence to silence those who dare to criticize them.
My assessment of Imran Khan after yesterday's event is that he has very enthusiastic support among young urban middle class Pakistanis who are probably participating in the political process for the first time in Pakistan's history. This augurs well for the country in the long run. However, PTI's chances of emerging with a majority of seats in Pakistani parliament in 2013 elections appear remote.
I also believe that Imran Khan is well-meaning but he appears to be naive, even disconnected from the reality, when it comes to Pakistan's current electoral politics which is based on a system of patronage. He is also significantly underestimating the serious national threat posed by the Taliban and other militant groups and the widespread culture of corruption in the country.
Here's a brief video clip of the event:
Related Links:
Haq's Musings
Malala Moment: Pakistan's Cowardly Politicians
Pakistan 2013 Election Predictions
Pakistan's Culture of Corruption
Imran Khan's Lahore Rally
Pakistan's Politics of Patronage
Pakistani Judges' Jihad Against Corruption
Incompetence and Corruption in Pakistan
Culture of Corruption at Imran's Kasur Rally
Imran Tells Obama: Leave Afghanistan
Pak Taliban Killing Spree Continues
Appeasement in Swat
Pakistan's Growing Insurgency
Rising Intolerance in Pakistan
Fighting Agents of Intolerance in Pakistan
Muslim Scholars Must Fight Hate in Pakistan
South Asian Christians Celebrate Christmas in Fear
Quaid-e-Azam Mohammad Ali Jinnah's Vision
Pakistan Must Defeat Agents of Intolerance
Celebrating Quaid-e-Azam M.A. Jinnah's Birthday


text:
Please direct all orders to our corporate office by email or fax with Attention to Customer Service. Every order should list official Purchase Order, exact shipping and billing address; name, telephone number and e-mail of somebody at the receiving end. E-mail information is going to be used for order confirmation and auto shipment notices only. TimTec does not provide order receipt via fax. To prevent any duplication of orders, all confirming orders must be clearly marked as "copy".
By making a purchase you(the customer) agree to the following:
I am taking full responsibility for any purchases (made now or in the future) of any product or service from TimTec. Without limiting the generalities foregoing, I am taking and accepting full liability for personal injury damages, punitive damages, lost profit or revenues, loss of use of product or equipment and any loss of property that may result from the purchase of product or services from TimTec. Furthermore, I agree to indemnify and hold harmless TimTec, its suppliers, agents, owners, shareholders and employees, as the case may be, for and against any and all losses, damages and expenses, including legal fees and other costs of defending any action that TimTec may sustain or which may occur as a result of any claim of negligence of contract or other claims or theories of law by myself, my officers, agents, or employees, my successors or assignees, my customers or other persons, whether direct or indirect in connection with the unsafe, improper or illegal use, or an unintended use of any chemical or product or services provided.
Storage and Handling
The majority of the compounds in dry form can be transported and stored long-term under ambient temperatures unless stated otherwise by TimTec at the time of quotation/order. Keeping products in slightly cooler than room temperature, dark space is preferred. Once compounds are dissolved in DMSO, acceptable storage temperature would be -20C and -80C, for long-term storage. Solvent use, solvent/s composition as well as storage conditions are largely determined by assays and the specifics of product/s use. Compounds stability in DMSO might be affected by thaw-freeze cycles. TimTec is not responsible for any quality claims related to customers' in-house storage decisions. TimTec would advise consulting with reference materials on product handling and storage related to customers' particular application.
Storage and Handling
Domestic Shipping for individual compounds is $45. International Shipping $185.
Terms and Shipping
Net 30 days, FOB Shipping Point. No minimum order charge is maintained, however, orders are subject to acceptance by TimTec. Payment by corporate VISA/MasterCard or Discovery card is also accepted. Every attempt will be made to ship your order as soon as possible as it is received. All items are shipped via UPS, FedEx, or other common carrier, insured at buyer's expense. Customers UPS or FedEx accounts could be used for collect shipping. Refrigerated items will generally not be scheduled for shipment on Friday, unless specifically requested by the customer. TimTec would act with due diligence in preparation and coordination of each shipment dispatchment under dry ice. TimTec is not liable nor does have any control over carrier in transit delays or any delays at customs may any of the delays result in product spoilage.
When a complete order cannot be shipped, a partial shipment will be made at our discretion. If partial shipments are unacceptable, please indicate when ordering. Even with the greatest of care, occasional damages do occur. If any damage is noted, the freight or express carrier should be notified immediately, and an inspection requested. Shipping cartons and packing materials must be retained until the claim is settled. Credit will be issued upon receipt of the proper claim support documents.
TimTec does not manufacture any storage solutions/vessels for products it sells. TimTec uses outside suppliers to source suitable for compounds, compounds collections, and other products storage solutions. TimTec is not responsible for any of its product damage related to storage solutions used for hosting and transporting individual compounds and compound library collections. TimTec offers standard storage solutions that are most of the time complimentary to purchased products. A customer is always welcome to ship vials, plates, or other compounds and compound library collections storage solutions to TimTec prior to orders processing.
Taxes and other charges
Any value added tax, sales tax, excise tax, duty, customs, inspection or testing fee or charge of any nature whatsoever imposed by any governmental authority, on or measured by the transaction between the Seller and the Buyer shall be paid by Buyer in addition to the prices quoted or invoiced. In the event the Seller is required to pay any such tax, fee, or charge, the Buyer shall reimburse the Seller; or, in lieu of such payment, the Buyer shall provide the Seller, at the time the order is submitted, an exemption certificate or other document acceptable to the authority imposing the tax, fee or charge.
Shortage claims should be made immediately upon receipt and inspection of material within 10 business days.
Upon confirmation and authorization, an item may be returned for prompt replacement or credit. All returns must be made within 30 days of the order date. We are unable to accept returns on items which have deteriorated as a result of incorrect storage, or which have become outdated.
All products bought from TimTec are for research and development purposes only and NOT FOR HUMAN OR ANIMAL CONSUMPTION. Research products properties are not fully investigated/known and should be handled by trained personnel only. Newly synthesized batches of products might slightly differ in chemical composition and activity from original batches or designs. TimTec encourages customers to perform thorough analytical and targets-interaction investigation for all active, no matter how pure, substances.
TimTec is making every effort to ensure the acceptable quality of its product while sourcing them from outside vendors or producing the products in house. TimTec performs routine spot checks and eliminates products with unacceptable quality from inventory. The company can not still guarantee 100% quality coverage for each singe item on the inventory list.
All prices and availability are subject to change without notice prior or after order placement.
Order Cancellation
If an Order is cancelled after it has been placed and approved, the customer shall pay for all labor, materials and services involved. The cancellation fee is determined as follows:
- Compounds from Stock: 20% of the order price, minimum $50
- Compound shipped from Overseas Stock: 30% of the order price, minimum $100
- Custom Synthesis: 50% of the order price.
The cancellation fee can be waved in under some circumstances, for example when no labor or other costs have incurred prior to the cancellation.
Pricing or Typographical Errors
While TimTec strives to provide accurate product and pricing information, pricing or typographical errors may occur. Such errors may occur on TimTec's Web Sites, in advertisements placed on TimTec's Web Sites or in circulars linked to TimTec's Web Sites. In the event that an item is listed at an incorrect price or with incorrect information due to an error in pricing or product information, TimTec shall have the right, at its sole discretion, to refuse orders placed for that item. Prices and availability are subject to change without notice.
TimTec pure Natural Products Library, NPL
TimTec pure Natural Products Library, NPL, includes primarily known natural compounds that are also available through a number of domestic and international commercial sources. The value of the library design is in the broad diversity of selected natural material available in screen-ready format. TimTec does not hold any IP rights for compounds in any of our collections nor is responsible for any sort of damages that may result as a result of TimTec products use. TimTec products are for R&D use only and should be handled by trained personnel.
Governing Law
All disputes as to the legality, interpretation of these terms and conditions, shall be governed by the laws of the State of Florida, USA.
All information provided on www.timtec.net site and any of our affiliates is to the best of our ability.
Company | Quick Links | Resources | Customer Support | TimTec Network |
About Us Our Customers Our Partners Register & Login Contact Site Search |
Compound Libraries Natural products Bioscreening Directory |
Glossary Database Downloads FAQs |
Customer Service Terms of Sale Your Feedback (Un)Subscribe |
eChemStore ActiMol.com MyriaScreen.com ChemDBsoft.com timtec.org |


text: The theory it attempts is fine but the execution is lacking. And a personal thing. Those cathedral replica watches now just remind me of the over large zenith pilot watches. I used to like them, but like rolex replica sale else on the enormous is best trip, I am done with them. I am not in the bronze watch case hating camp, although I will always enjoy how it has been used. Main calendar rolex watches store. However, the case has been upsized, and built with replica watches uk is signature ultra hard tegimented steel, which shrugs off even hard scratches with surprising ease. Perfect rolex replica uk for piloting jaeger vs kaiju. Love hate on the watch cool look on leather strap. Hunting, hiking rolex replica uk really need to accessorize correctly. The water resistance has been upped to 200m, and it also gets Sinn is unique technology a dehumidifying copper sulfate capsule which keeps the internals dry, and can replica watches uk the dial from fogging during rapid temperature change.


text:
| |||||||||||||||||||||||||||||||||||||
Academic Improvement and Teacher Quality Programs
You are here: OESE Home > Programs/Initiatives > AITQ |
Academic Improvement and Teacher Quality Programs (AITQ) administers several major formula and discretionary grant programs. These programs are authorized by the Elementary and Secondary Education Act of 1965, as reauthorized by the No Child Left Behind Act of 2001.
These programs provide financial assistance to State and local educational agencies, institutions of higher education, community and faith-based organizations, and other entities. Funding supports activities designed to recruit and retain a high-quality teaching staff for America's schools, to strengthen the quality of elementary and secondary education, including through after-school programs, to test and disseminate information on new approaches for improving educational results, to improve literacy skills for children and students from birth through 12th grade, and to raise the educational achievement of at-risk students, such as Native Hawaiian and Alaska Native children and youth.
The administration of these programs includes the development of legislative proposals; the formulation of regulations, nonregulatory guidance, and policies; the formulation of program and operational budgets; the establishment of management goals and priorities; the provision of leadership and technical assistance to the education community on issues addressed by the programs (including through partnerships with private foundations and other non-governmental entities); the design and conduct of grant competitions; program monitoring; and technical assistance and guidance to grant recipients to promote program success and ensure compliance with statutory requirements.
AITQ is headed by a Director who reports directly to the Assistant Secretary for Elementary and Secondary Education and advises the Assistant Secretary, Deputy Assistant Secretaries, and other top officials of the Department on policy and administrative issues related to programs in the office. The Director oversees 3 Program Groups:
The Academic Improvement Programs Group is responsible for oversight and dissemination of State-administered grants that provide services during non-school hours to students and their families for academic enrichment. The program group is also responsible for administering programs that improve the literacy skills of students through increased access to up-to-date school library materials, and programs that provide assistance to meet the unique educational needs of Native Hawaiians and Alaska Natives. (Group Leader: Valerie Randall)
The High School Programs Group is responsible for oversight and administration of programs that improve the quality of educational programs and services for middle and high school students. The program group administers direct grants that: increase the participation of low-income students in both pre-Advanced Placement and Advanced Placement courses and tests; and support the implementation of smaller learning communities in large public high schools; support effective, sustainable, and coordinated dropout prevention and reentry programs in high schools. (Acting Group Leader: Madeline Baggett)
The Teacher Quality Programs Group is responsible for administering programs aimed at improving teacher and principal quality. The program group also administers programs and initiatives aimed at improving students' achievement in mathematics and science, and programs that enhance the ability of elementary and secondary schools to meet the special education needs of gifted and talented students. (Group Leader: Carol O'Donnell)
In administering the programs assigned to it, AITQ establishes cooperative relationships with other Departmental Principal Offices and with other Federal agencies and governmental and nongovernmental organizations as appropriate. For example, AITQ administers the Mathematics and Science Partnerships program cooperatively with the National Science Foundation and carries out joint activities in support of 21st Century Community Learning Centers with one or more private foundations. Administration of the Improving Teacher Quality State Grants program involves frequent interaction with other offices in the Department that administer programs that train and provide professional development to teachers.


text:
This article is more than 1 year old
You don't know disk about storage failures
Research shows platters a victim of spin
Knowing just what breaks a storage box is of obvious interest to data center admins. It's quite reasonable to conclude the blame should be heaped on the 80-some platters spinning all day at 7200 RPMs.
But a recent study presented at the USENIX Conference on File and Storage Technologies argues that disk failure isn't nearly the whole story. Other components in a storage subsystem are often the point of failure, although their failings are still treated as disk faults. This results in unnecessary disk replacements — and inevitably an incomplete perspective on storage system resiliency.
The study, titled "Are Disk the Dominant Contributor for Storage Failures?" was authored by Weihang Jiang, Chongfeng Hu, Yuanyuan Zhou of the University of Illinois department of computer science and Arkady Kanevsky of Network Appliance.
Over a period of 44 months, the group analyzed storage logs of about 39,000 commercially deployed storage systems. They estimate the systems in total were composed of about 1,800,000 disks hosted in about 155,000 storage shelf enclosures. The researchers examined near-line (backup) disks, low-end, mid-range, and high-end hardware.
While the findings do show disk failures contribute to 20-55 per cent of storage subsystem failures, other components such as physical interconnects (broken wires, shelf enclosure power outages, HBA failures, etc) and protocol stacks (software bugs and compatibility issues) also account for a significant percentage of problems.
The group states that recent studies on storage failures have failed due to an excessive focus on disk malfunctions. For example, in June, Google released a paper that disputed the reliability claims of disk manufacturers from a user perspective. A good start, write the researchers.
"But as this study indicates, there are other storage subsystem failures besides disk failures that are treated as disk faults and lead to unnecessary disk replacements," their paper claims.
The research indicates between 27-68 per cent of storage subsystem failures come from physical interconnects. Between 5-10 per cent are a result of protocol stack errors. Due to component failures, even slower, more reliable disks like near-line backup have higher failure rates.
"These results indicate that, to build highly reliable and available storage systems, only using resiliency mechanisms targeting disk failures (e.g. RAID) is not enough," the study states. "We also need to build resiliency mechanisms such as redundant physical interconnects and self-checking protocol stacks to tolerate failures in these storage components."
As an example, in low-end storage systems (defined as having embedded storage heads with shelf enclosures) the annualized failure rate (AFR) is about 4.6 per cent. The AFR for the disks only is 0.9 per cent, or only 20 per cent of overall AFR.
Near-line storage disks (mostly SATA) show a 1.9 per cent AFR, but again the whole storage subsystem failure is higher, at 3.4 per cent.
So, on their own, low-end disks fail less often than higher-end SATA disks, but total SATA systems fail less often than lower-end systems.
The researchers argue this indicates that "disk failure rate is not indicative of the storage subsystem failure rate," meaning there's other factors for failures such as shelf enclosure model and network configurations that strongly affect reliability.
The research team concludes that storage subsystem components cannot be ignored when designing a reliable storage box. They offer some suggestions to improve reliability.
Redundancy mechanisms such as mulitpathing were able to reduce AFR for storage systems by 30-40 per cent when paths were increased from one to two.
The researchers also recommend spanning a RAID group across multiple shelves — and using fewer disks per shelf, with more shelves in the system. This helps reduce the chances of a shelf failure taking out an entire RAID group.
The full paper is available here at the Usenix website. ®


text:
The 3 percent solution for energy use
- Published: July 1, 2010
When the Village's electric power supplier looks into the future, its leaders assume that the village's need for electricity will increase by about 1 percent each year. But with much of the supply currently coming from carbon–emitting coal plants, villagers and Village leaders have been looking for ways not to be such predictable power consumers.
The Village Energy Task Force has stated its goal to help the village reduce its energy consumption by 3 percent per year. And both Village Manager Mark Cundiff and University of Dayton energy researcher Bob Brecha believe that the village as a whole can continue to reduce its energy usage at that rate for at least five years. Decreasing the village-wide energy consumption by 15 percent while at the same time seaching for more renewable energy sources is a conservative but realistic goal toward greening the village, Brecha said last week. The effort will benefit both residents and commercial businesses as well by saving them money in power costs, and likely more than they thought possible, Brecha said.
Current energy use profile
As a whole the village has seen a steady reduction in the amount of electric power used over the past decade. In 2001 the village logged over 40 million kilowatt/hours for the year. Five years later the year-end total was almost 34 million kwh, and last year the village was down to just over 29 million kwh. But instead of greater efficiency in the way that energy is used in the village, the drop in consumption reflects a steady decline in industrial and business activity in the village, according to ETF chairperson Jerry Papania.
On the residential side, per household energy consumption in the village has decreased slightly since 2003, but it remains almost 20 percent higher than the average household in the Midwest. According to an energy use analysis completed last year by Brecha and UD colleague Kevin Hallinan, the energy consumption per household in Yellow Springs is .45 kw per sq.ft. per month, versus the Midwest average of .37 kw per sq.ft per month. The local household energy consumption also balloons at about four times the "Energy Star" rate of the top 25 percent of energy efficient homes in the U.S., according to the report.
According to the report, the biggest reasons for the high level of residential energy use are the temperature at which residents set their air conditioners in the summer, poorly sealed houses and the low rate of attic, floor and wall insulation of the average home in the village. Just by raising the set point temperature from 60 degrees F to 72 degrees, for example, the average home could drop its cooling energy needs by about three-fourths. And just by increasing the attic insulation from an R (insulation) value of 25 to an R value of 51, a home would suddenly use half the cooling energy as before, according to the figures in the report.
"It is clear that Yellow Springs is far away from where they desire to be as a community in terms of their collective energy use," the authors of the energy analysis conclude.
Residents in individual homes use more than half of the village's total electric power. Last year residences used about 17 million kwh, while commercial businesses used almost 4 million kwh and industrial businesses used just over 8 million kwh, according to figures from Village Finance Director Sharon Potter.
The ultimate goal of the Energy Task Force is to decrease the overall energy consumption village-wide by encouraging and educating both residents and businesses about the importance of making the operation of their homes and business facilities more efficient. If residents and businesses can employ some of the ETF's recommendations and create some independent solutions for greater efficiency, the village as a whole can reduce its consumption.
Papania said last week that a conservative goal of "3 percent is realistic to shoot for. That's something I think could be attainable with some effort."
Let the energy saving begin
The task force has two main goals, to help the Village reduce energy consumption and to educate the public about ways to increase efficiency in the home. Armed with $50,000 from the Village budget, the task force began this spring with a plan to switch the Village street lights from high-pressured sodium to induction lights, which act like fluorescents, Papania said. The task force can afford to replace about half the street lights, which will save the Village about $10,000 per year in energy costs. That means, he said, that the project will have paid for itself in about five years.
The ETF also investigated and recommended that when the Village replaces the roof on the Bryan Center, the Village should add an extra one and a half inches of insulation to reduce the energy needed to heat and cool the building and also save on energy costs.
"In the meantime, our focus will be on conservation and pushing what we've been calling 'negawatts,'" Papania said.
The task force aims to spread information about the 2 For 1 Energy audit and home retrofit business, of which Brecha is part owner, that a small investment can save villagers both energy and the costs associated with it. The group plans to include educational inserts in Village utility bills about the quick payback for switching to compact fluorescent lightbulbs, washing clothes with cold water and drying them on a line, statistics on energy efficient appliances and tax credits that can help villagers recoup their energy investments.
The task force also aims to help local businesses and industries save money by saving on energy costs. According to Papania, the Morgan Family Foundation funded a project of Community Solutions to help local companies such as YSI, Morris Bean and Friends Care Community improve the energy efficiency of their facilities. Task force member Reggie Stratton initiated a similar effort in 2007 at the Antioch Company and shared with other local companies solutions such as rainwater catchment, prairie grass growing and timed lighting and temperature settings to help businesses shave energy costs.
The seven-member task force includes Papania, vice-chair Stratton, Village Council representative Judith Hempfling, Pat Murphy, Brian Strawn, Larry Gerthoffer and Terry Graham. In working together, task force members have learned a lot themselves about energy leaks, for instance, and ways to test vampire loads that occur in most homes when appliances appear to be off and inactive and yet continue to draw power. According to Papania, a home energy meter that can be checked out from the local library showed him that his new compact stereo system pulls 20 watts even when it is off.
"It's just a matter of people being aware and getting used to things and making intelligent decisions with what they replace appliances and things with," Papania said.
Village's power source profile
The Village currently uses a combination of renewable, non-polluting energy and fossil fuel, carbon emitting energy, much of which comes through contracts with the AMP cooperative. According to the Village's power contract schedule, approximately 63 percent comes from coal plants, 28 percent from landfill gas, and about 9 percent from hydroelectric power on the Hudson River. When those contracts end in 2012 and 2013, the Village has scheduled to replace nearly all of its power sources with coal for about two years until its contracts with several new hydroelectric projects, Belleville and Meldahl/Greenup, begin to supply about 55 percent of the village's total power needs.
The new hydro contracts are scheduled to begin in 2015. If by then, the village has been able to reduce its need by the goal of 15 percent, suddenly the hydro projects will be supplying almost 70 percent of the total electric power need. If the remaining 30 percent of demand can be filled with hydro or other renewable energy sources such as wind or solar, the village will be burning very clean. And according to Brecha, the hope at that point would be to reduce the natural gas consumption, which produces carbon emissions.
"Three percent for five years is not that difficult — I think we could probably do a lot more," Brecha said. "There are a lot of places using less, such as California, which started years ago. They began by using the same as the others, and went to using half."
California implemented its efficiency measures over a 30-year period, according to Brecha. And if they could do so beginning in the 1980s, surely the village can reduce its demand by 15 percent today, he said.
"There's no silver bullet, but there's silver buckshot," Papania said. "All the little things will add up to make it work."
No comments yet for this article.


text:
Trails have been a part of Scouting since the beginning.
There are figurative trails — the one to First Class and to Eagle — and literal ones, like the 350 miles of trails at Philmont or the familiar 10-mile loop at your favorite state park.
Whatever your trail, show your pride by protecting it.
One great way? Participate in the American Hiking Society's 20th annual National Trails Day, dubbed "America's largest trails celebration." I told you about it last year, and this year's event on Saturday, June 2, 2012, promises to be even bigger.
Here's how the folks at the American Hiking Society describe the day:
More than 2,000 NTD events will take place around the country to celebrate and protect our magnificent and growing trail system. Events will include trail maintenance projects, hikes, paddle trips, bike and horseback rides, wildlife viewing activities, trail dedications, and much more.
"We are thrilled to continue our steadfast partnership with the Boy Scouts of America to engage youth and families in America's great outdoors and to preserve and protect hiking trails nationwide," says Gregory Miller, president of the American Hiking Society.
Step one: Get outside
Last year, I gave you four ways to celebrate National Trails Day, held every year on the first Saturday in June. Here they are:
- Get out. Use this locator map to find one of 2,000 events near you. These include trail maintenance, hiking, paddling, biking, horseback riding, bird watching, running, trail celebrations, and more.
- Get active. Go hike, paddle, or ride a bike. Responsible trail use helps set the example for others and keep our trails clean and safe.
- Get smart. Visit educational exhibits, join a guided hike, or go bird watching with local experts. You could consider having one of these experts talk at your next meeting or campout.
- Give back. Show your favorite hiking trail a little TLC with a little trail maintenance. Your pack, troop, team, or crew already does service projects regularly, right? So why not give back to the trails that have given you so much?
Step two: Get the patch
This year, to celebrate the event's 20th anniversary, the BSA is issuing a special patch that shows your commitment to keeping trails clean and well-maintained.
I know, I know. You don't do these kinds of activities to earn a patch (right?), but you won't turn one away, will you?
Any Scouter or Scout who participates in a National Trails Day event some time in 2012 can wear the patch, which sells for $3.99.
No paperwork is necessary — you can buy it on the honor system. Pick one up at your local Scout Shop or at ScoutStuff.org, button it onto your right pocket, and — voila! — you're a walking billboard for trail stewardship and sustainability.
Inspire Leadership, Foster Values: Donate to Scouting
When you give to Scouting, you are making it possible for young people to have extraordinary opportunities that will allow them to embrace their true potential and become the remarkable individuals they are destined to be.
Donate Today


text:
UK researchers are not winning the hearts and minds of CFS patients – that's for sure. Just a couple of uplifting weeks after Dr. Mikovits displayed so much enthusiasm and confidence in XMRV the other shoe has dropped. An Imperial College researcher said another negative study was coming and here it is; this UK study also failed to find virtually ANY evidence of XMRV in a large number of CFS patients. This study was similar and different from the Imperial College study.
Annette Whittemore said to be cognizant of who's doing the studies – in this case, though, there doesn't appear to be any bias to question, no damning history of behavioral emphasis to reflect upon; two members of the study, Dr. Kerr and Dr. Gow, are long term ME/CFS researchers committed to a pathophysiological interpretation of this illness. (Ironically it was Dr. Gow that refuted Dr. DeFreitas finding 25 years ago).
Indeed, the paper went to some lengths to praise the Lombardi Science paper stating the "apparently compelling evidence against the possibility of laboratory contamination" and the immune response against XMRV the researchers demonstrated was present. They stated that they set out with 'the intention of confirming the Lombardi' study.
PCR Tests – This was a large study that looked at well over 500 CFS patients and controls from two cohorts in the UK and Scotland. They first looked for sequences on two the three genes XMRV possesses. When they didn't find anything the first time they looked again using a more sensitive assay.
Immune Tests – Unable to find evidence of XMRV by PCR they looked for signs that the patients immune systems were reacting to it. To do this they obtained some 'neutralizing antibodies' against the 'env' protein found in the family of mouse retroviruses. Antibodies neutralize retroviruses by attaching to them and preventing them from getting their hooks into cells. They also raise a red flag to the immune system to come and attack. As they examined this set of antibodies they were able to identify one that was specific for XMRV and they used it to search for the virus.
The neutralization test is a rather indirect one; they apparently add the antibodies to the sample and then (somehow) test the sample for 'infectivity'. Since the antibodies attach themselves to the retroviruses the degree of infectivity should go down a certain amount and in a couple to test cases they confirmed this. When they ran the neutralizing antibody test on the 142 ME/CFS patients none of them met the criteria for infection. Ironically, 14% of the healthy controls from one of the healthy cohorts tested positive for infection, altho later testing suggested it was do to a different mouse virus.
They stated that they were 'confident' that their 'PCR assay is more sensitive than the published single round PCR method and should have possessed the necessary sensitivity to find XMRV'.
Two Different Tests : Two Different Results – The WPI has backed away from the PCR test because of its inability to detect XMRV at very low levels and their associated lab VIP Dx is not longer offering it. This could not be a reason, of course, for the zero results seen in this test – the WPI's PCR test may not be perfect but it appears to be able to find most instances of infection. We also know from Dr. Lombardi and from patient reports that the WPI's test IS finding XMRV infection in UK patients. Why they are finding it and two UK groups have not, is, of course, the big question. Either the patients are very different or the tests are. Since it seems unlikely that that the patients are THAT different its pretty clear that the WPI's test is quite different from these other groups.
Validation Not a Replication Study – It's interesting, by the way, that this UK group – with its ties to the WPI via Dr. Kerr – did not appear to avail itself of the WPI's assays or or Dr. Singh's antibody tests. Since the group didn't appear to use the WPI's methods this is a validation study not a replication study; its was an attempt to validate the WPI's claim that they'd found XMRV not an attempt to determine if the the WPI's methods worked.
This is still just the beginning of the XMRV studies to come out but its a remarkable turnaround given the lengths the WPI, researchers from the NCI and the Cleveland Clinic went to in that compelling Science paper (Dr. Coffin called it as good a first paper as they get) to demonstrate the presence of XMRV. The fact they were able to show that this virus was able to infect previously uninfected cells and show a virus budding out of them still seems – at least to this layman – to be the most singular and important finding to date.
My understanding is that the WPI is now using Dr. Singh's antibody test specific to XMRV that shows INCREASED not decreased rates of positivity. It really is a conundrum; the WPI appears to be getting more and more internal evidence that they're right these papers are coming out suggesting that something went wrong. The first question always appears to be if what the WPI found is an endogenous retrovirus – a piece of junk DNA from an old mouse retrovirus in our genome. They sequenced 2 and a half strains of the virus and compared what they found against our entire genome against our entire genome and found nothing. That's one of the reasons Science took the paper – they convinced them it was not an endogenous retrovirus. But if it's not that then what is it?
The Scientific Director of the CFIDS Association, Dr. Vernon, will reportedly release an analysis of the study tomorrow, giving us a much needed expert overview of the situation.


text:
Lam Binh Community sends strong message to poachers
Once bitten, twice shy. Or perhaps, in this case the phrase should be 'once stung, twice shy'. That is the lesson SOS grantee, People Resources and Conservation Foundation, hopes poachers will take from a recent successful 'sting' operation carried out in Lam Binh, a remote mountainous karst region in northern Vietnam.
It was a small but significant quantity of confiscated primate bones. Tu Minh Tiep, project coordinator with PRCF's Francois' langur (Trachypithecus francoisi) conservation project, was very happy because the sting operation he helped organise had caught a poacher and recovered them. Weighing just 4.7 kilos, the pile of bones were later identified by the Institute of Ecology and Biological Resources, 300km away in Hanoi, as belonging to a Slow loris and four Francois' langurs: both protected animals.
Fernando Potess, project director, said that the sting would also broadcast a clear message to other wildlife traffickers operating in the region. Vietnamese law, namely Decree 32 which protects threatened species from hunting and trade, is supported by local people and enforced by the police around Lam Binh.
While the monkey 'bushmeat' is often eaten, the bones are generally sold to the traditional medicine trade as ingredients for a variety of unproven products. This haul could have fetched approximately $500 USD had it ever made it to market.
Part of the langur conservation project's objectives had always been to minimise threats from hunting by empowering local communities to protect their natural environment. With around 70 individuals, of which at least five are juveniles, the Francois' langur population in Lam Binh represents the largest known remaining population of the species living outside of China. The loss of four animals to hunting in mid-2012 severely hindered recovery prospects for this small cliff-dwelling primate.
Through engagement with local youth unions, the surrounding communities had already become aware of the unique value of their local biodiversity. Discussions as to how these natural resources could be leveraged sustainably have already begun: one option identified was to develop eco-tourism based on the appeal of a substantial population of Francois' langurs. Consequently it was imperative to act fast, according to Potess, if PRCF was to avert an impending poaching free-for-all in this relatively remote jungle area.
Tiep recruited a local villager to make contact with a group of suspected poachers, ostensibly in order to purchase some bones. The idea was to create the ruse of a purchasing scenario which Forest Protection Department officials would seemingly discover by coincidence. The person posing as the buyer could conveniently escape into the forest, leaving the poachers caught red-handed with their illegal wares on show and for sale in public. This was the sting and it worked like clockwork, with FPD officials arriving at the right moment to intercept the poachers, confiscate the animal parts as well as some shotguns and ammunition – all to be used as evidence in a pending prosecution case.
Reflecting on the successful if tense sting operation, Potess and Tiep explained that such incidents, combined with the distribution of PRCF's new anti-poaching posters around the area, would generate the right kind of word-of-mouth to consolidate the tentative community support for the langur conservation project.
With community spirit on a high, the team are now looking forward to a field study trip taking place after the Vietnamese Têt holiday. Selected participants from Lam Binh's seven villages will visit a successful eco-tourism venture involving the critically endangered Delacour's langur. PRCF hopes to implement some of the lessons learned from this venture – based in Ninh Binh province, about 90 kilometres south of Hanoi – in a similar venture based much further north in Lam Binh.
Innovative community-based conservation activities such as these will hopefully help safeguard the engangered Francois' langur in northern Vietnam.


text:
You may remember intellectual-folk queen Dar Williams for her queer-acceptance Christmas carol The Christians and the Pagans, a 1990s mix-tape staple. Although singer-songwriters strumming guitars weren't hard to come by in those days, Dar stood out for her magnificent gift for storytelling and her radical politics. Her following today extends beyond the Northampton area she called home for many years, although her truest believers may still reside there: Who better to appreciate a song that celebrates lesbian pagans interrupting a stodgy New England Christmas dinner?
Williams releases her ninth studio album this month, and if you lost track of her during the '00s, now is a good time to tune in. In the Time of Gods explores present-day politics through the lens of Greek mythology.
As a longtime fan of Dar's, I was delighted to spend an hour on the phone with her discussing the fall of Zeus, the public's aversion to solar panels, feminist child-rearing and her new album.
Ms. Blog: In the Time of the Gods, like many of your albums, has a novel-like quality; the songs have a subtle connected narrative. What was the story in your mind as you worked on it?
Dar Williams: With the exception of the first one, which is basically just me writing a bunch of songs on my futon when my boyfriend dumped me, every single album I've done has to do with some form of power. With End of the Summer I was dealing with authority: the beginning of school, the hinge between summer and fall. The Green World had a lot to do with divine authority. This record has a lot to do with the flights and fancies of having … power. I'm in my forties, I have some power. Some of it comes from being a performer for awhile, but a lot of it just has to do with being a citizen for this long.
Do you enjoy the power that comes with age, or does it have its pitfalls?
The stakes are much higher now. When you're 22, things feel clearer—but they also don't mean as much. I could write an op-ed piece that gets printed tomorrow in The New York Times—as opposed to my school paper, or my local paper—and what if I get my facts wrong? You can slip, you can have a moral lapse that costs you your house, or a marriage, or your kids, or you can stay in a marriage when there's been a moral slip. That's part of the price of having commitments. You have to hold a paradox in your hands at all times in this Earth.
The Greek characters that populate the album—you don't really want to cuddle up with any of them.
Not at all. I like Artemis the best. She's supposed to be Little Miss Frigid, pissed off. But she is actually a guardian of balance. She was a virgin goddess, but she adored her hunting partner, Orion. Her twin brother was jealous, so he sent a scorpion after Orion, and Orion was killed. He found something that his sister loved, and he couldn't let her have it, so he destroyed it. And he's Mister God of Beauty and Art! Artemis is a very interesting paradigm for women. She is stereotypically female—she's very graceful and moon-worshiping—but she won't have sex with you. I feel like I've met that woman, and she is reviled in our society. She lives in the woods and she feeds squirrels and she has a shot gun and she hates your guts. I love her.
Zeus sort of emerges as the "bad guy" of the album.
Zeus is the king of the gods, and he's this moody, old-school, bolt-throwing guy. And I don't think that guy does as well these days. With Bill Clinton, who was actually one of the nicer versions of the good ole boy … there was no one clapping him on the back going, "Oh, boys will be boys." He was not treated with a wink and a nod.
Are you raising your children as feminists?
The feminist in me is more of a gender radical. I love it when I feel like I'm in a place where everyone has the permission to pick and choose from traditional coded gender attributes and take them on as they fit. I think that in a world that has gender liberation, there is a much greater chance for female equality. When I meet a real white-gloved girly girl, I see her as experiencing her gender freedom.
My girl is a hybrid, and so is my boy. With kids you've just got to take what you have, and let it grow. Maybe [your child] likes a big blonde bouffant but she's also a big fan of the gear shift in a truck—so let her have both. At another point you can really do the analysis and break down where that proclivity may have come from—don't harsh on a kid for liking what she likes.
Has your songwriting changed since you've had children?
No, [but] the song I Am the One Who Will Remember Everything [is about] a Goddess of Children, and that goddess doesn't exist, because the Greek goddess of marriage hates children! The song Write This Number Down is for my daughter. My daughter is from Ethiopia, and the voice of the song … says: I have faith in justice. You have come to a country where you will find justice. And if you don't find justice, you will find networks of people who want to help you find it. A tip of the hat to Ms. Magazine and the Ms. Foundation–there are ways to find justice within the strengthened ties of the feminist world. It's not just seedlings of discussions any more. There are organizations that have backbones and money and power, and they operate in the world alongside of the courts and the justice system.
What causes do you lend the microphone these days?
I'm trying to do a tandem project—decommissioning a local nuclear power plant near my home and also encouraging renewable energy. We have solar panels [in my house]—they produce 70 percent of our power. I'm really trying to encourage it on buildings around here. I now see why sometimes journalists lose their minds, because you feel like as soon as you get the information out there, people will act on it. You have to live with the heartbreak of knowing that's not the way it works, and keep on writing. There's an enormous amount of discussion and encouragement to be done, [even] amongst the converted. They're saying "Yeah, that's a good point. But solar panels don't really work, right?"
Is it apathy, people who bought organic eggs and think they're done for the day?
No! No. I don't get that at all. I get that people deeply care, and that they would love to live in alignment. I think they're overwhelmed by their lives, and feel cornered. It's just finding the moment and the aperture to encourage each other along toward sustainability: You give out bean seeds at a concert.
This fall you're returning to your alma mater, Wesleyan, to teach a college course. Tell me some of the material the Wesleyan students who are lucky enough to get into your class are going to encounter.
My course is called Music Movements in a Capitalist Democracy. Music movements have taken hold here, and they have interplay with the commercial world. The commercial world mirrors them and recognizes them, and sometimes makes a parody of them.
I think it would be fun for [my students] to experience what it's like to be in a movement, to get their mojo going, and make decisions. Like, how would you react to this? How would you germinate the beginnings of a people's movement, as opposed to a commerce-initiated movement? I hope they experience that feeling.
Photo of Dar Williams by Amy Dickerson. All rights reserved.