Website | Source

Archived Feb 2024

# Execution starts at the entry point
@entry
def fizzBuzz {
  for i in 1..101 {
    var text = mod(i, 3, "Fizz") + mod(i, 5, "Buzz")
    document.write((text == "" ? i.toString : text) + "\n")
  }
}

# The compiler inlines this function in release mode
def mod(i int, n int, text string) string {
  return i % n == 0 ? text : ""
}

# Imported declarations are just for type checking
@import
namespace document {
  def write(text string)
}

Why use it?

The intent is to use this language for the platform-independent stuff in an application and to use the language native to the target platform for the platform-specific stuff. When done properly, the vast majority of the code is completely platform-independent and new platforms can be targeted easily with a small platform-specific shim.

Pros:

Cons:


Tags: language   archived  

Last modified 07 October 2024