This is the code with macros. It compares the time taken to calculate the sum of squares, using `function`s and macros.
square = (x) -> x * x
total = 0
console.time "no macro"
for i in [0...100000]
total += square i
console.timeEnd "no macro"
console.log "Total #{total}"
total = 0
console.time "macro"
for i in [0...100000]
total += SQUARE(i)
console.timeEnd "macro"
console.log "Total #{total}"
# 1 "macro.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "macro.c"
square = (x) -> x * x
total = 0
console.time "no macro"
for i in [0...100000]
total += square i
console.timeEnd "no macro"
console.log "Total #{total}"
total = 0
console.time "macro"
for i in [0...100000]
total += (i * i)
console.timeEnd "macro"
console.log "Total #{total}"
no macro: 2ms
Total 333328333350000
macro: 1ms
Total 333328333350000