比 Python ,语法更简短的编程语言,有吗?可以是新语言或小众语言,对,仅仅是比简短(排它性)

2017-07-05 18:08:34 +08:00
 ajeef

VB

Module MainFrm Sub Main() System.Console.WriteLine("Hello, World!") End Sub End Module

C

#include <stdio.h> int main() { printf("Hello, World!"); return 0; } Swift 1 print("Hello, World!")

Go

package main

import "fmt"

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

BATCH

@echo off echo Hello, World! pause


Java

public class HelloWorld { public static void main(String args[]) { System.out.println( "Hello, World!" ); } }


C++

#include <iostream> using namespace std; int main() { cout<<"Hello, World!"<<flush; return 0; }


C#

namespace HelloWorld { class Program { static void Main(string[] args) { System.Console.Write("Hello, World!"); } } }

PHP

echo "Hello, World!";

JavaScript

console.log("Hello, World!")

Python 3

print("Hello, World!")

LaTeX

\documentclass{article}

\begin{document} Hello, World!

\end{document}


Mathematica 方法一:基于 Wolfram 底层语言(进入表达式界面使用)

Cell["Hello, World!"]

方法二:直接使用数学输出函数

CellPrint[Cell["Hello, World!"]]

Ruby

def hello()
return "Hello , World"
end

易语言

调试输出( 1,“ Hello , World ”)


Kotlin

fun main(args: Array<string>) { println("Hello, world!") }

10076 次点击
所在节点    Python
77 条回复
g00001
2017-07-05 19:56:47 +08:00
只是控制台输出一句话就不写了,用 aardio 就写几句代码可以搞定一个完整的窗口程序,不要任何外部的第三方库,如果再多写几句代码那就是很漂亮的窗口
jyf
2017-07-05 20:04:27 +08:00
Forth

." hello, world"
Chingim
2017-07-05 20:16:15 +08:00
ruby 能写成这样, 连我这个门外汉都看不过去了
4ever911
2017-07-05 21:04:14 +08:00
printf("WTF!!!")
unsec
2017-07-05 21:21:22 +08:00
PHP 最短,不需要什么 echo 或者 print 或者 p,甚至不用引号:
Hello World
noli
2017-07-05 21:53:06 +08:00
楼主理解的编程美感就是为了短而短?抑或只是无聊带个节奏?
xyjtou
2017-07-05 22:23:57 +08:00
Python 不能再短了,直接输出,连 print 都可以不用吖

>>> 'hello world'
'hello world'
initialdp
2017-07-05 22:29:29 +08:00
Lua...

去年我们将内部一个业务模块从 Python 改用 Lua 重写,Lua 比 Python 简短多了。
AngelCriss
2017-07-05 22:29:36 +08:00
(display “ hello racket ”)
mingyun
2017-07-05 22:33:05 +08:00
@unsec 不会报错?
lululau
2017-07-05 22:47:02 +08:00
@xyjtou

➜ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 'hello world'
'hello world'


➜ ipython
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: 'hello world'
Out[1]: 'hello world'

还是 Ruby 短:

➜ irb
2.4.0 :001 > 'hello world'
=> "hello world"

➜ pry
[1] pry(main)> 'hello world'
=> "hello world"
cheneydog
2017-07-05 22:54:06 +08:00
groovy
println "hello world"
wwhc
2017-07-05 22:54:20 +08:00
perl -e 'print "Hello World\n"'
4641585
2017-07-05 23:07:37 +08:00
$ node
> "hello world"
'hello world'
lululau
2017-07-05 23:07:46 +08:00
@wwhc perl -le 'print "Hello World"'
lululau
2017-07-05 23:11:18 +08:00
还是 Shell 最短:

➜ brew install hello
➜ hello
Hello, world!
est
2017-07-05 23:11:25 +08:00
比 helloworld 没意思啊。要比就比从某个客户端证书 https 的 json API 里读取一个逗号分隔的字符串切成数组然后做快排。
paledream
2017-07-05 23:20:31 +08:00
看了这贴想学 PHP 啊。。
agostop
2017-07-05 23:51:28 +08:00
perl

say "hello,world";
Maic
2017-07-05 23:56:53 +08:00
为啥没人说 HTML,就直接 Hello World 就搞定了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/373285

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX