Hello, Oxygene World!
Posted on 1月 24th, 2012 by cx20
Oxygene
Oxygene は RemObjects Software 社による .NET または Java 環境向けのプログラミング言語である。
Embarcadero 社の Delphi Prism のプログラミング言語として採用されている。
コンパイラ単体は「Command Line Compiler」として無償提供されている。
C# 同様に、UNIX 環境向けの .NET Framework 互換プロジェクト「Mono」により他の OS でも動作させることができる。
ソースコード(.NET ライブラリを使用した場合)
namespace hello;
interface
type
Hello = class
public
class method Main(args: array of String): Integer;
end;
implementation
class method Hello.Main(args: array of String): Integer;
begin
System.Console.WriteLine('Hello, Oxygene World!');
end;
end. |
namespace hello;
interface
type
Hello = class
public
class method Main(args: array of String): Integer;
end;
implementation
class method Hello.Main(args: array of String): Integer;
begin
System.Console.WriteLine('Hello, Oxygene World!');
end;
end.
ソースコード(Java ライブラリを使用した場合)
namespace hello;
interface
type
Hello = class
public
class method Main(args: array of String): Integer;
end;
implementation
class method Hello.Main(args: array of String): Integer;
begin
System.out.println('Hello, Oxygene World!');
end;
end. |
namespace hello;
interface
type
Hello = class
public
class method Main(args: array of String): Integer;
end;
implementation
class method Hello.Main(args: array of String): Integer;
begin
System.out.println('Hello, Oxygene World!');
end;
end.
コンパイル&実行方法(.NET プログラムとしてコンパイル&実行)
C:¥> oxygene HelloDotNet.pas -type:exe -mode:Net
C:¥> HelloDotNet |
C:¥> oxygene HelloDotNet.pas -type:exe -mode:Net
C:¥> HelloDotNet
コンパイル&実行方法(Java プログラムとしてコンパイル&実行)
C:¥> oxygene HelloJava.pas -mode:Java
C:¥> java -jar hellojava.jar |
C:¥> oxygene HelloJava.pas -mode:Java
C:¥> java -jar hellojava.jar
実行結果
Tags: Oxygene
Categories: .NET, Delphi, Java VM, Oxygene, Pascal