Classic “Hello, World”
Main.tlang:
use io.Terminal
helper {
func main() {
Terminal.println("Hello, World !")
}
}
manifest.yaml
|
|
Generate “Hello, World” in Scala
Main.tlang:
use io.Terminal
use gen.Generator
helper {
func main() {
Terminal.println(Generator.generate(helloWorld()))
}
}
lang[scala] helloWorld() {
pkg hello_world
impl HelloWorld {
func main(args: String[]) {
println("Hello, World!")
}
}
}
manifest.yaml
|
|
To run this example, in your favourite terminal, go to the folder where you saved these files and then run:
|
|