Saturday, June 19, 2010

OO Hello World - Boo



Hello world in Boo is here as well.
"Boo is a new object oriented statically typed programming language for the Common Language Infrastructure with a python inspired syntax and a special focus on language and compiler extensibility." Taken from: (http://boo.codehaus.org/)


By the way, you can see my previous post here: http://carlosqt.blogspot.com/2010/06/oo-hello-world.html
where I give some details on WHY these "OO Hello World series" samples.


Version 1 (Minimal):
The minimum you need to type to get your program compiled and running.
class Greet: 
 name as string
 def constructor(name as string):
  self.name = name[0].ToString().ToUpper() + name.Substring(1, name.Length - 1)
 def Salute():
  print "Hello, ${name}!"

// Greet the world!
g = Greet("world")
g.Salute()
Version 2 (Verbose):
Explicitly adding instructions and keywords that are optional to the compiler.
namespace GreetProgram
import System

private class Greet: 
 private name as string
 public def constructor(name as string):
  self.name = name[0].ToString().ToUpper() + name.Substring(1, name.Length - 1)
 public def Salute():
  print "Hello, ${self.name}!"

// Greet the world!
public def Main(argv as (string)):
 g = Greet("world")
 g.Salute()


The Program Output:
  








Boo Info:
Boo is an object oriented, statically typed programming language that seeks to make use of the Common Language Infrastructure's support for Unicode, internationalization and web applications, while using a Python-inspired syntax[1] and a special focus on language and compiler extensibility. Some features of note include type inference, generators, multimethods, optional duck typing, macros, true closures, currying, and first-class functions.” Taken from: (http://en.wikipedia.org/wiki/Boo_(programming_language))

Appeared:
2003
Current Version:
Developed by:
Rodrigo B. De Oliveira
Creator:
Rodrigo B. De Oliveira
Influenced by:
Python (Guido van Rossum)
Predecessor Language
Predecessor Appeared
Predecessor Creator
Runtime Target:
CLR
Latest Framework Target:
3.5
Mono Target:
Yes
Allows Unmanaged Code:
Yes
Source Code Extension:
“.boo”
Keywords:
66
Case Sensitive:
Yes
Free Version Available:
Yes
Open Source:
Yes
Standard:
No
Latest IDE Support:
SharpDevelop 3.2/4.0 (beta)
MonoDevelop 2.2
Language Reference:
Extra Info:


No comments:

Post a Comment