天下武功,心法为上;唯有身心合一方成绝学;一切语言,皆为工具,既有适用范围;以下为本人用过的语言,不是都熟练,但都用来写过一些比Hello World要有用的功能。
汇编语言- 1949
bdos equ 0005H ; BDOS entry point start: mvi c,9 ; BDOS function: output string lxi d,msg$ ; address of msg call bdos ret ; return to CCP msg$: db 'Hello, world!$' end start
Fortran - 1957
PROGRAM Hello WRITE (*,*) 'Hello, World!' STOP END
BASIC - 1964
PRINT "Hello, World!" END
Pascal - 1970
begin writeln('Hello, World!') end.
C - 1972
#include <stdio.h> int main(void) { printf("Hello, World!\n"); return 0; }
SQL - 1978
CREATE TABLE message (text char(15)); INSERT INTO message (text) VALUES ('Hello, World!'); SELECT text FROM message; DROP TABLE message;
C++ - 1980
#include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; }
Objective-C - 1986
#import <Foundation/Foundation.h> int main() { @autoreleasepool { NSLog(@"Hello, World!"); } }
Python - 1991
print("Hello, World!")
Visual Basic - 1991
Public Sub Main() Debug.Print "Hello, World!" End Sub
Lua - 1993
print("Hello, World!")
Java - 1995
class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
JavaScript - 1995
document.write('Hello, World!');
PHP - 1995
<? echo "Hello, World!" ?>
C# - 2000
using System; internal static class HelloWorld { private static void Main() { Console.WriteLine("Hello, World!"); } }
Go - 2009
import "fmt" func main() { fmt.Println("Hello, World!") }
文章评论