Website | Source | HN

Ante is a low-level functional language for exploring refinement types, lifetime inference, and other fun features. In general, ante is low-level (no GC, values aren't boxed by default) while also trying to be as readable as possible by encouraging high-level approaches that can be optimized with low-level details later on.


//The 'ante' keyword declares compile-time values
    labels = global mut empty Map

    goto lbl =
        label = lookup labels lbl ?
            None -> Ante.error "Cannot goto undefined label ${lbl}"

        Llvm.setInsertPoint (getCallSiteBlock ())
        Llvm.createBr label

    label name:Str =
        callingFn = getParentFn (getCallSiteBlock ())
        lbl = Llvm.BasicBlock(Ante.llvm_ctxt, callingFn)
        labels#name := lbl

//test it out
label "begin"
print "hello!"
goto "begin"

Tags: language   metaobject   llvm  

Last modified 22 May 2024