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

推荐订阅源

Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
S
Securelist
P
Proofpoint News Feed
H
Help Net Security
S
Schneier on Security
T
Tenable Blog
C
Cisco Blogs
S
Security @ Cisco Blogs
博客园 - 司徒正美
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
Google Online Security Blog
Google Online Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
腾讯CDC
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
Vercel News
Vercel News
小众软件
小众软件
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
博客园 - 聂微东
F
Full Disclosure
量子位
Scott Helme
Scott Helme
宝玉的分享
宝玉的分享
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Schneier on Security
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
Kaspersky official blog
AI
AI
SecWiki News
SecWiki News
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler

披萨盒的赛博日志

谈谈工作了半年的感受 使用策略模式重构复杂业务分支 像 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

披萨盒

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

个人主页