惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

披萨盒的赛博日志

谈谈工作了半年的感受 使用策略模式重构复杂业务分支 像 systemd 一样管理 MacOS 后台常驻任务 以ORM看封装的边界 Git Merge VS Git Rebase: 如何优雅地合并分支? 修改Linux内核模块以支持WG OpenLDAP折腾日记 非特权模式容器 ssh 登录问题 在 Linux 开发环境中使用网络代理 白嫖 Aseprite 像素绘图软件 MongoDB 增删改查 Python数据分析工具包-Numpy 解决 CLion 中文乱码问题 搭建 RLCraft 服务器 SpringBoot读取配置文件 Centos 配置 LNMP 环境 部署项目时遇到的坑 浅谈 xhr 请求跨域问题 JavaScript 学习笔记 Eclipse配置Web开发环境 Vue2 基本知识 Ribbon 简单使用 Nacos 简单使用 Spring Cloud Alibaba 环境搭建 什么是RSS?什么是Feed?它们有什么关系? Docker基本使用 TensorFlow启用GPU加速 如何进行内网穿透 Git基本使用 Butterfly常用标签外挂
Hello World!
披萨盒 · 2022-07-01 · via 披萨盒的赛博日志

“Hello, World!” 程序是编程世界的第一个仪式。

当你在新语言中写下这行代码并看到它成功输出时,就完成了与这门语言最初的握手。它简单到近乎平淡,却又至关重要——既是初学者验证语法规则的入门练习,也是开发者确认环境配置无误的快速检查。

这个传统始于1972年贝尔实验室的《A Tutorial Introduction to the Language B》,如今已成为跨越所有编程语言的共同起点。它不只是一段代码,更像是程序员之间的默契:如果连 “Hello, World!” 都跑不通,那更复杂的挑战也不必继续了。

“Hello, World!” 的 N 种写法

Ada

1
2
3
4
5
6
with Ada.Text_IO;
use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, World!");
end Hello;

ALGOL60

1
BEGIN DISPLAY("Hello, World!") END.

ALGOL68

1
2
3
begin
printf(($gl$,"Hello, World!"))
end

AppleScript

1
say "Hello, World!"
1
display alert "Hello, World!"

Assembly Language (Linux x64)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
section .text
global _start

_start:
; sys_write(1, msg, len)
mov rax, 1
mov rdi, 1
lea rsi, [rel msg]
mov rdx, len
syscall

; sys_exit(0)
mov rax, 60
xor rdi, rdi
syscall

section .rodata
msg: db "Hello, World!", 0xA
len: equ $ - msg

BASIC

1
PRINT "Hello, World!"

Batchfile

1
2
@echo off
echo Hello, World!

Bash

1
echo "Hello, World!"

C

1
2
3
4
5
6
#include <stdio.h>

int main() {
printf("Hello, World!");
return 0;
}

C++

1
2
3
4
5
6
#include <iostream>

int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}

c#

1
Console.WriteLine("Hello, World!");

Clojure

1
(println "Hello, World!")

COBOL

1
2
3
4
5
6
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
* simple hello world program
PROCEDURE DIVISION.
DISPLAY 'Hello, World!'.
STOP RUN.

D

1
2
3
4
5
import std.stdio;

void main() {
writeln("Hello, World!");
}

Dart

1
2
3
void main() {
print('Hello, World!');
}

Elixir

1
IO.puts("Hello, World!")

Ezhil

1
2
3
பதிப்பி "உலகே வணக்கம்"
பதிப்பி "Hello, World!"
exit()

Forth

1
." Hello, World!" CR

Fortran

1
2
3
program Hello
print *, "Hello, World!"
end program Hello

Go

1
2
3
4
5
6
package main
import "fmt"

func main() {
fmt.Println("Hello, World!")
}

Haskell

1
2
main :: IO ()
main = putStrLn "Hello, World!"

Java

1
2
3
4
5
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

JavaScript

1
console.log("Hello, World!");
1
document.write("Hello, World!");

Julia

1
println("Hello, World!")

Kotlin

1
2
3
fun main() {
println("Hello, World!")
}

Lisp

1
(print "Hello, World!")
1
print [Hello, World!]

Lua

1
print("Hello, World!")

Objective-C

1
2
3
4
5
#import <stdio.h>

int main() {
printf("Hello, World!\n");
}
1
2
3
4
5
6
7
8
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
@autoreleasepool {
NSLog(@"Hello, World!");
}
return 0;
}

OCaml

1
print_endline "Hello, World!"

Pascal

1
2
3
4
program Hello;
begin
writeln ('Hello, World!');
end.

Perl

1
print "Hello, World!\n";

Perl6

1
say 'Hello, World!'

PHP

1
2
3
<?php
echo 'Hello, World!';
?>

PowerShell

1
'Hello, World!'

Prolog

1
main() :- write("Hello, World!"), nl.

Python2

1
print "Hello, World!"

Python3

1
print("Hello, World!")

R

1
print("Hello, World!")

Racket

1
2
#lang cli
(displayln "Hello, World!")

Ruby

1
puts "Hello, World!"

Rust

1
2
3
fn main() {
println!("Hello, World!");
}

Simula

1
2
3
4
Begin
OutText ("Hello, World!");
Outimage;
End;

Smalltalk

1
Transcript show: 'Hello, World!'.

Standard ML

1
print "Hello, World!\n"

Swift

1
print("Hello, World!")

Tcl

1
puts "Hello, World!"

TI-BASIC

1
:Disp "Hello, World!"

VBScript

1
WScript.Echo "Hello, World!"

WebAssembly Text Format

1
2
3
4
5
6
7
(module
(import "console" "log" (func $log (param i32)))
(memory 1)
(data (i32.const 0) "Hello, World!\00")
(func (export "hello")
(call $log (i32.const 0))
)

易语言

1
信息框(“Hello, World!”,0,,)

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-ND 4.0 许可协议。转载请注明来源 披萨盒的赛博日志


avatar

披萨盒

反正身体这么好,今天继续笑下去吧

个人主页