Hello World (OCaml/F Sharp)

From LiteratePrograms
Jump to: navigation, search
Other implementations: Alice ML | Amiga E | Assembly Intel x86 Linux | Assembly Intel x86 NetBSD | AWK | bash | BASIC | Batch files | C | C, Cairo | C, Xlib | Candle | C++ | C# | Dylan | E | Forth | FORTRAN | Fortress | Go | Groovy | IBM PC bootstrap | Inform 7 | JavaScript | LaTeX | Logo | Lua | MATLAB | OCaml/F Sharp | occam | Oz | Perl | PHP | PIR | PLI | Prolog | Python | Rexx | Ruby | Scheme | sh | SQL | Standard ML | Tcl | Tcl Tk | Visual Basic

Hello World in Ocaml and F# (the program is identical for each). The "let () =" ensures that the return value of the following expression is "()" (the only value of type unit). This detects e.g. missing arguments (it is unecessary for such a simple program but better start with good habits!).

<<hello.ml>>=
let () = print_endline "Hello World!"
Download code
hijacker
hijacker
hijacker
hijacker