有可读的编程语言吗?

时间:2022-11-23 15:04:26

I mean, is there a coded language with human style coding? For example:

我的意思是,是否有一种带有人类风格编码的编码语言?例如:

Create an object called MyVar and initialize it to 10;
Take MyVar and call MyMethod() with parameters. . .

I know it's not so useful, but it can be interesting to create such a grammar.

我知道它不是那么有用,但创建这样的语法会很有趣。

51 个解决方案

#1


103  

COBOL is a lot like that.

COBOL很像那样。

SET MYVAR TO 10.
EXECUTE MYMETHOD with 10, MYVAR.

Another sample from Wikipedia:

*的另一个样本:

ADD YEARS TO AGE.
MULTIPLY PRICE BY QUANTITY GIVING COST.
SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.

Oddly enough though, despite its design to be readable as English, most programmers completely undermined this with bizarre naming conventions:

奇怪的是,尽管它的设计可以像英语一样可读,但大多数程序员完全用奇怪的命名约定来破坏它:

SET VAR_00_MYVAR_PIC99 TO 10.
EXECUTE PROC_10_MYMETHOD with 10, VAR_00_MYVAR_PIC99.

#2


120  

How about LOLCODE?

LOLCODE怎么样?

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

Simplicity itself!

#3


97  

Inform 7

Inform 7 is perhaps the language I feel is most appropriately designed in a human language fashion. It is quite application specific for writing adventure games.

Inform 7也许是我觉得最适合用人类语言设计的语言。它非常适合编写冒险游戏。

It is based on rule-based semantics, where you write a lot of rules describing the relationship between objects and their location. For instance, the section below is an Inform 7 program:

它基于基于规则的语义,您可以编写大量描述对象与其位置之间关系的规则。例如,以下部分是Inform 7程序:

"Hello Deductible" by "I.F. Author"

The story headline is "An Interactive Example".

The Living Room is a room. "A comfortably furnished living room."
The Kitchen is north of the Living Room.
The Front Door is south of the Living Room.
The Front Door is a door. The Front Door is closed and locked.

The insurance salesman is a man in the Living Room. The description is "An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand "man" as the insurance salesman.

A briefcase is carried by the insurance salesman. The description is "A slightly worn, black briefcase."  Understand "case" as the briefcase.

The insurance paperwork is in the briefcase. The description is "Page after page of small legalese." Understand "papers" or "documents" or "forms" as the paperwork.

Instead of listening to the insurance salesman: 
    say "The salesman bores you with a discussion of life  insurance policies.  From his briefcase he pulls some paperwork which he hands to you.";
    move the insurance paperwork to the player.

Example cited from Wikipedia

*引用的例子

#4


42  

AppleScript is pretty close to that, though that is obviously platform dependent.

AppleScript非常接近,尽管这显然取决于平台。

Here's a script for opening iTunes and playing a playlist

这是打开iTunes和播放播放列表的脚本

tell application "iTunes"
    activate
    play playlist "Party Shuffle"
end tell

Source: AppleScript Examples

来源:AppleScript示例

#5


32  

Projects promoting programming in "natural language" are intrinsically doomed to fail.

以“自然语言”推动编程的项目本质上注定要失败。

-- Edsger W.Dijkstra, How do we tell truths that might hurt?

- Edsger W.Dijkstra,我们如何说出可能伤害的真相?

#6


31  

This was "the next big thing" around about the early 1980s and I spent much of my first couple of years as a a coder working in "NATURAL", which was the supposedly the best of the new crop of 4GLs (fourth generation languages) which were designed to make data access (in this case to an ADABAS database) human readable.

这是20世纪80年代早期的“下一件大事”,我作为一名在“自然”工作的编码人员花费了我的头几年的大部分时间,这被认为是新一代4GL(第四代语言)中最好的一种。旨在使数据访问(在本例中为ADABAS数据库)人类可读。

Of course it did absolutely nothing of the type. All we ended up with was verbose badly structured code. Both of these products are still around, but you've never heard of them, which sort of proves the what a dead end it was.

当然它绝对没有什么类型。我们最终得到的只是冗长的结构化代码。这两种产品仍然存在,但你从来没有听说过它们,这证明了它的死胡同。

Actually at that period there appeared to be a general desire to move beyond 'programming' into some sort of 2001 inspired AI heaven. Oracle were really keen on code generation and I remember with some interest a product called 'the last one' that was being marketed to managers as a product that would automatically generate any program you wanted and make all your programming staff redundant. Seems not to have lived up to expectations ;-)

实际上在那个时期似乎有一种普遍的愿望,即超越“编程”,进入某种2001年启发的AI天堂。 Oracle非常热衷于代码生成,我还记得一些名为“最后一个”的产品,该产品作为一种产品销售给管理者,可以自动生成您想要的任何程序,并使您的所有编程人员都多余。似乎没有达到预期;-)

It's worth remembering to that SQL was originally marketed in some quarters as a way to allow management to directly query their data. I was even sent on a course to learn basic SQL (in a large national transport organization that ran on rails - the steel variety) where junior management types were included because they had plans to put basic query tools in their hands. What a disaster that was.

值得记住的是,SQL最初在某些方面作为一种允许管理层直接查询其数据的方式进行销售。我甚至被派去学习基本的SQL课程(在一个大型国家运输组织中运行 - 钢铁品种),其中包括初级管理类型,因为他们计划将基本查询工具放在他们手中。真是个灾难。

Maybe it might be different in 50 years, but at the current stage of play coding demands a certain clarity of thought and implementation which is best mediated through a dedicated syntax designed for those ends, not any approximation to a natural language which is unclear and ambiguous. The nearest approximation is possibly physics where the essence of the subject is in the mathematics used (think a programming language for physics) not verbose wordage.

也许它可能在50年内有所不同,但在目前的游戏编码阶段需要一定的思想和实现清晰度,这最好是通过为这些目的而设计的专用语法来调解,而不是对自然语言的任何近似,这是不明确和模棱两可的。最接近的近似可能是物理学,其中主题的本质是在所使用的数学中(想想物理的编程语言)而不是冗长的词汇。

ADDED

I was forgetting, apart from COBOL there was also PL/1, sometime credited with allowing NASA to put a man on the moon it was just as verbose as COBOL and tried even harder to be 'Manager-readable'. Which is why no-one has really heard of it now either :-)

我忘记了,除了COBOL之外还有PL / 1,有时因为允许美国宇航局将一个人放在月球上,它就像COBOL一样冗长,并且更加努力地成为“经理可读”。这就是为什么现在没人真正听说过:-)

#7


18  

Chef! Anyone can read recipes right? Behold hello world!

厨师!任何人都可以阅读食谱吗?看看你好世界!

Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes

Method.
Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. 
Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. 
Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. 
Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. 
Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. 
Pour contents of the mixing bowl into the baking dish.

Sorry if it's not a serious answer, but this is way awesome. :-)

对不起,如果这不是一个严肃的答案,但这是非常棒的。 :-)

#8


17  

All languages are 'human readable'. :) How else would someone be able to create it? That being said, languages that support DSLs can be incredibly intuitive such as Boo.

所有语言都是“人类可读的”。 :)别人怎么能够创建它?话虽这么说,支持DSL的语言可以非常直观,比如Boo。

#9


15  

Having a programming language read like a (verbose) normal language, would be like requiring people to converse all the time in legalese. All the extra verbiage just gets in the way.

让编程语言像(详细的)正常语言一样,就像要求人们在法律术语中一直交谈一样。所有额外的措辞都会妨碍你。

An ideal programming language should have syntax that is as transparent as possible and let the concepts behind the program stand out. Obviously there is a trade off between having a quick learning curve and having minimal but obscure syntax (think Perl, or even K).

理想的编程语言应该具有尽可能透明的语法,并让程序背后的概念脱颖而出。显然,在快速学习曲线和具有最小但模糊的语法(想想Perl,甚至K)之间存在折衷。

#10


13  

By creating a set of rules, it is possible to do logic programming in Prolog like this. You can build a grammar (or download one) for a particular domain, create a knowledge base and then query it. After defining your grammar you could do something like:

通过创建一组规则,可以像这样在Prolog中进行逻辑编程。您可以为特定域构建语法(或下载一个),创建知识库然后进行查询。定义语法后,您可以执行以下操作:

bob is a parent of tim.
mary is a parent of bob.

?- X is a grandparent of tim.
X = mary

?- jim is a parent of bob.
false

#11


13  

I see the Shakespeare programming language have yet to be mentioned.

我看到莎士比亚的编程语言尚未被提及。

These programs are coded to look like shakespear plays, the individial characters in the play being variables that can hold numbers and the various phrases in the play manipulate the characters and the number they hold. For instance, "Speak your mind" orders a character to output his value.

这些程序被编码为看起来像莎士比亚戏剧,戏剧中的个体角色是可以容纳数字的变量,并且戏剧中的各种短语操纵角色和他们持有的数字。例如,“说出你的想法”命令一个角色输出他的价值。

#12


9  

Applescript:

tell application "Finder"
 set the percent_free to ¬
 (((the free space of the startup disk) / (the capacity of the startup disk)) * 100) div 1
end tell
if the percent_free is less than 10 then
 tell application (path to frontmost application as text)
 display dialog "The startup disk has only " & the percent_free & ¬
 " percent of its capacity available." & return & return & ¬
 "Should this script continue?" with icon 1
 end tell
end if

#13


7  

I can read C. That means it's human-readable(because I'm a human). It's just too terse for the average person. The general concept of programming languages is to maximize the information about how the computer should operate in a given line.

我可以阅读C.这意味着它是人类可读的(因为我是一个人)。这对普通人来说太简洁了。编程语言的一般概念是最大化有关计算机应如何在给定行中操作的信息。

This is why Ruby is so popular; it maximizes the functionality in minimal text. English(or any other other natural language) is a pretty imprecise, low-information/character language.

这就是Ruby如此受欢迎的原因;它最大限度地减少了文本中的功能。英语(或任何其他自然语言)是一种非常不精确,低信息/字符的语言。

In sum, it is: (i)done before and (ii)a known weaker idea.

总之,它是:(i)之前完成的和(ii)已知的较弱的想法。

#14


7  

This is actually a hot topic.

这实际上是一个热门话题。

For starters - What is Human readable?

对于初学者 - 什么是人类可读?

A Chinese-reader cannot read Russian and vice versa. It you narrow your domain for example to Chinese pharmacists writing a perscription you could design a language around that. And that would be human readable.

中国读者不能读俄语,反之亦然。你缩小你的域名,例如中国药剂师写一个描述你可以设计一种语言。这将是人类可读的。

Such as language would fall under a the umbrella of Domain Specific Languages.

例如语言属于Domain Specific Languages的保护范围。

#15


7  

SQL

SELECT name, address FROM customers WHERE region = 'Europe'

#16


6  

Yes. It's called COBOL, and people generally detest it.

是。它被称为COBOL,人们通常会厌恶它。

#17


6  

Inform 7 is the most successful such system I've seen. It has two advantages over the cruder systems listed in other answers here: it's for a domain particularly appropriate for natural language (interactive fiction), and it does a fancier analysis of the input code based on more computational-linguistics lore, not just a conventional programming-language grammar that happens to use English words instead of braces, etc.

Inform 7是我见过的最成功的系统。它比其他答案中列出的更粗糙的系统有两个优点:它适用于特别适合自然语言(交互式小说)的领域,它基于更多的计算语言学知识对输入代码进行更精细的分析,而不仅仅是传统的编程语言语法碰巧使用英语单词而不是大括号等。

#18


5  

Perl, some people claim.

Perl,有些人声称。

print "hello!" and open my $File, '<', $path or die "Couldn't open the file after saying hello!";

#19


5  

Do a google search for "natural language programming" and you'll find lots of information (including why this is a bad idea).

谷歌搜索“自然语言编程”,你会发现很多信息(包括为什么这是一个坏主意)。

#20


5  

Clarity of Expression is important.

表达的清晰度很重要。

But Clarity of Thought is far, far more important.

但是,思想的清晰度远非如此重要。

#21


5  

HyperTalk and its descendant AppleScript were designed to be similar to the English language.

HyperTalk及其后代AppleScript的设计与英语类似。

#22


4  

VB is as close as I can think of one:

VB尽可能接近我想到的一个:

If MyLife.Sucks Then MyLife.End Else MyLife.Continue

如果MyLife.Sucks然后MyLife.End Else MyLife.Continue

#23


4  

Sure, Erlang.

-module(listsort).
-export([by_length/1]).

 by_length(Lists) ->
    F = fun(A,B) when is_list(A), is_list(B) ->
            length(A) < length(B)
        end,
    qsort(Lists, F).

 qsort([], _)-> [];
 qsort([Pivot|Rest], Smaller) ->
     qsort([ X || X <- Rest, Smaller(X,Pivot)], Smaller)
     ++ [Pivot] ++
     qsort([ Y ||Y <- Rest, not(Smaller(Y, Pivot))], Smaller).

I'm a human, it's a programming language, and I can read it. I don't know what any of it means, but I see a lot of English words in there, I think.

我是一个人,它是一种编程语言,我可以阅读它。我不知道它有什么意思,但我认为那里有很多英文单词。

(Tongue firmly in cheek.)

(舌头紧紧地贴在脸上。)

#24


4  

DSLs can be very natural-looking. See this example created with MGrammar:

DSL可以非常自然。请参阅使用MGrammar创建的此示例:

test "Searching google for watin"
    goto "http://www.google.se"
    type "watin" into "q"
    click "btnG"
    assert that text "WatiN Home" exists
    assert that element "res" exists
end

#25


3  

COBOL was intended to be read by managers, and has "noise words" to make it more readable.

COBOL旨在由经理阅读,并具有“噪音词”,使其更具可读性。

The funny thing is, it reads a bit like a verbose DSL.

有趣的是,它看起来有点像冗长的DSL。

#26


3  

Being more human-readable than most was one of the early selling points of Ada. I find it a silly argument these days, as any sufficently complex task in any language is going to require a competent practicioner to understand. However, it does beat the bejeezus out of C-syntax languages. Its dominant coding styles can enhance this effect too. For example, comparing loops in an if statement: Ada:

比大多数人更易读,是Ada的早期卖点之一。这些天我发现这是一个愚蠢的论点,因为任何语言中任何足够复杂的任务都需要有能力的实践者去理解。但是,它确实击败了C语法语言中的bejeezus。它的主要编码风格也可以增强这种效果。例如,比较if语句中的循环:Ada:

if Time_To_Loop then
   for i in Some_Array loop
      Some_Array(i) := i;
   end loop;
end if;

C:

if (timeToLoop != 0) {
   for (int i=0;i<SOME_ARRAY_LENGTH;i++) {
      someArray[i] = i;
   }
}

The C code would look even worse if I used Hungarian notation like Microsoft, but I'm trying to be nice. :-)

如果我使用像微软这样的匈牙利符号,C代码看起来会更糟,但我想要变得更好。 :-)

#27


3  

Interesting question. Your question can be read as "Is there any programming language that is easily readable by humans?", OR ELSE as "Is there a human language that can be used for programming?". All the answers here have focused on the former, so let me try answering the latter.

有趣的问题。您的问题可以理解为“是否有任何易于人类阅读的编程语言?”,或者是“是否有可用于编程的人类语言?”。这里的所有答案都集中在前者上,所以让我试着回答后者。

Have you heard of Sanskrit? It is an ancient Indian language on which modern Indian languages like Hindi are based.

你听说过梵语吗?它是一种古老的印度语言,印地语等现代印度语言就是以此为基础的。

wiki/Sanskrit

I've been hearing for years that it is precise and complete enough to be used, as it is, as a high-level language on a computer. Ofcourse, you need a compiler to convert Sanskrit instructions to machine language. I know the script & yes, it is precise (entirely phonetic so you never have to ask "how do you spell that"), but I don't know the grammer well enough.

多年来我一直听说它的精确性和完整性足以被用作计算机上的高级语言。当然,您需要一个编译器将Sanskrit指令转换为机器语言。我知道剧本和是的,它是精确的(完全是语音,因此你永远不必问“你怎么拼写”),但我不太了解语法。

This is completeley anecdotal, so I don't vouch for the accuracy of this. Just wanted to share what I know regarding this. :-)

这是完整的轶事,所以我不保证这个的准确性。只想分享我对此的了解。 :-)

#28


2  

I agree with the general consensus here. "Human readable" general purpose programming languages are mostly a bad idea, but human readable Domain Specific Languages are very worthwhile.

我同意这里的普遍共识。 “人类可读的”通用编程语言通常是一个坏主意,但人类可读的领域特定语言是非常值得的。

REBOL has a great system for creating DSLs.

REBOL有一个很好的系统来创建DSL。

#29


2  

GradStudent

It only has one statement: "you - write me a program to do x"
It's valid for all values of X and has the advantage that x doesn't have to be defined and can be changed after the program is written.

它只有一个声明:“你 - 给我写一个程序来做x”它对X的所有值都有效,并且有一个优点,就是不需要定义x,并且可以在编写程序后进行更改。

A commercial dialect is available called intern: development cost is lower but it isn't guaranteed to work

可以使用称为实习生的商业方言:开发成本较低但不能保证有效

#30


1  

Cobol was kind of like that.

科博尔有点像那样。

#1


103  

COBOL is a lot like that.

COBOL很像那样。

SET MYVAR TO 10.
EXECUTE MYMETHOD with 10, MYVAR.

Another sample from Wikipedia:

*的另一个样本:

ADD YEARS TO AGE.
MULTIPLY PRICE BY QUANTITY GIVING COST.
SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.

Oddly enough though, despite its design to be readable as English, most programmers completely undermined this with bizarre naming conventions:

奇怪的是,尽管它的设计可以像英语一样可读,但大多数程序员完全用奇怪的命名约定来破坏它:

SET VAR_00_MYVAR_PIC99 TO 10.
EXECUTE PROC_10_MYMETHOD with 10, VAR_00_MYVAR_PIC99.

#2


120  

How about LOLCODE?

LOLCODE怎么样?

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

Simplicity itself!

#3


97  

Inform 7

Inform 7 is perhaps the language I feel is most appropriately designed in a human language fashion. It is quite application specific for writing adventure games.

Inform 7也许是我觉得最适合用人类语言设计的语言。它非常适合编写冒险游戏。

It is based on rule-based semantics, where you write a lot of rules describing the relationship between objects and their location. For instance, the section below is an Inform 7 program:

它基于基于规则的语义,您可以编写大量描述对象与其位置之间关系的规则。例如,以下部分是Inform 7程序:

"Hello Deductible" by "I.F. Author"

The story headline is "An Interactive Example".

The Living Room is a room. "A comfortably furnished living room."
The Kitchen is north of the Living Room.
The Front Door is south of the Living Room.
The Front Door is a door. The Front Door is closed and locked.

The insurance salesman is a man in the Living Room. The description is "An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand "man" as the insurance salesman.

A briefcase is carried by the insurance salesman. The description is "A slightly worn, black briefcase."  Understand "case" as the briefcase.

The insurance paperwork is in the briefcase. The description is "Page after page of small legalese." Understand "papers" or "documents" or "forms" as the paperwork.

Instead of listening to the insurance salesman: 
    say "The salesman bores you with a discussion of life  insurance policies.  From his briefcase he pulls some paperwork which he hands to you.";
    move the insurance paperwork to the player.

Example cited from Wikipedia

*引用的例子

#4


42  

AppleScript is pretty close to that, though that is obviously platform dependent.

AppleScript非常接近,尽管这显然取决于平台。

Here's a script for opening iTunes and playing a playlist

这是打开iTunes和播放播放列表的脚本

tell application "iTunes"
    activate
    play playlist "Party Shuffle"
end tell

Source: AppleScript Examples

来源:AppleScript示例

#5


32  

Projects promoting programming in "natural language" are intrinsically doomed to fail.

以“自然语言”推动编程的项目本质上注定要失败。

-- Edsger W.Dijkstra, How do we tell truths that might hurt?

- Edsger W.Dijkstra,我们如何说出可能伤害的真相?

#6


31  

This was "the next big thing" around about the early 1980s and I spent much of my first couple of years as a a coder working in "NATURAL", which was the supposedly the best of the new crop of 4GLs (fourth generation languages) which were designed to make data access (in this case to an ADABAS database) human readable.

这是20世纪80年代早期的“下一件大事”,我作为一名在“自然”工作的编码人员花费了我的头几年的大部分时间,这被认为是新一代4GL(第四代语言)中最好的一种。旨在使数据访问(在本例中为ADABAS数据库)人类可读。

Of course it did absolutely nothing of the type. All we ended up with was verbose badly structured code. Both of these products are still around, but you've never heard of them, which sort of proves the what a dead end it was.

当然它绝对没有什么类型。我们最终得到的只是冗长的结构化代码。这两种产品仍然存在,但你从来没有听说过它们,这证明了它的死胡同。

Actually at that period there appeared to be a general desire to move beyond 'programming' into some sort of 2001 inspired AI heaven. Oracle were really keen on code generation and I remember with some interest a product called 'the last one' that was being marketed to managers as a product that would automatically generate any program you wanted and make all your programming staff redundant. Seems not to have lived up to expectations ;-)

实际上在那个时期似乎有一种普遍的愿望,即超越“编程”,进入某种2001年启发的AI天堂。 Oracle非常热衷于代码生成,我还记得一些名为“最后一个”的产品,该产品作为一种产品销售给管理者,可以自动生成您想要的任何程序,并使您的所有编程人员都多余。似乎没有达到预期;-)

It's worth remembering to that SQL was originally marketed in some quarters as a way to allow management to directly query their data. I was even sent on a course to learn basic SQL (in a large national transport organization that ran on rails - the steel variety) where junior management types were included because they had plans to put basic query tools in their hands. What a disaster that was.

值得记住的是,SQL最初在某些方面作为一种允许管理层直接查询其数据的方式进行销售。我甚至被派去学习基本的SQL课程(在一个大型国家运输组织中运行 - 钢铁品种),其中包括初级管理类型,因为他们计划将基本查询工具放在他们手中。真是个灾难。

Maybe it might be different in 50 years, but at the current stage of play coding demands a certain clarity of thought and implementation which is best mediated through a dedicated syntax designed for those ends, not any approximation to a natural language which is unclear and ambiguous. The nearest approximation is possibly physics where the essence of the subject is in the mathematics used (think a programming language for physics) not verbose wordage.

也许它可能在50年内有所不同,但在目前的游戏编码阶段需要一定的思想和实现清晰度,这最好是通过为这些目的而设计的专用语法来调解,而不是对自然语言的任何近似,这是不明确和模棱两可的。最接近的近似可能是物理学,其中主题的本质是在所使用的数学中(想想物理的编程语言)而不是冗长的词汇。

ADDED

I was forgetting, apart from COBOL there was also PL/1, sometime credited with allowing NASA to put a man on the moon it was just as verbose as COBOL and tried even harder to be 'Manager-readable'. Which is why no-one has really heard of it now either :-)

我忘记了,除了COBOL之外还有PL / 1,有时因为允许美国宇航局将一个人放在月球上,它就像COBOL一样冗长,并且更加努力地成为“经理可读”。这就是为什么现在没人真正听说过:-)

#7


18  

Chef! Anyone can read recipes right? Behold hello world!

厨师!任何人都可以阅读食谱吗?看看你好世界!

Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes

Method.
Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. 
Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl. 
Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl. 
Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl. 
Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl. 
Pour contents of the mixing bowl into the baking dish.

Sorry if it's not a serious answer, but this is way awesome. :-)

对不起,如果这不是一个严肃的答案,但这是非常棒的。 :-)

#8


17  

All languages are 'human readable'. :) How else would someone be able to create it? That being said, languages that support DSLs can be incredibly intuitive such as Boo.

所有语言都是“人类可读的”。 :)别人怎么能够创建它?话虽这么说,支持DSL的语言可以非常直观,比如Boo。

#9


15  

Having a programming language read like a (verbose) normal language, would be like requiring people to converse all the time in legalese. All the extra verbiage just gets in the way.

让编程语言像(详细的)正常语言一样,就像要求人们在法律术语中一直交谈一样。所有额外的措辞都会妨碍你。

An ideal programming language should have syntax that is as transparent as possible and let the concepts behind the program stand out. Obviously there is a trade off between having a quick learning curve and having minimal but obscure syntax (think Perl, or even K).

理想的编程语言应该具有尽可能透明的语法,并让程序背后的概念脱颖而出。显然,在快速学习曲线和具有最小但模糊的语法(想想Perl,甚至K)之间存在折衷。

#10


13  

By creating a set of rules, it is possible to do logic programming in Prolog like this. You can build a grammar (or download one) for a particular domain, create a knowledge base and then query it. After defining your grammar you could do something like:

通过创建一组规则,可以像这样在Prolog中进行逻辑编程。您可以为特定域构建语法(或下载一个),创建知识库然后进行查询。定义语法后,您可以执行以下操作:

bob is a parent of tim.
mary is a parent of bob.

?- X is a grandparent of tim.
X = mary

?- jim is a parent of bob.
false

#11


13  

I see the Shakespeare programming language have yet to be mentioned.

我看到莎士比亚的编程语言尚未被提及。

These programs are coded to look like shakespear plays, the individial characters in the play being variables that can hold numbers and the various phrases in the play manipulate the characters and the number they hold. For instance, "Speak your mind" orders a character to output his value.

这些程序被编码为看起来像莎士比亚戏剧,戏剧中的个体角色是可以容纳数字的变量,并且戏剧中的各种短语操纵角色和他们持有的数字。例如,“说出你的想法”命令一个角色输出他的价值。

#12


9  

Applescript:

tell application "Finder"
 set the percent_free to ¬
 (((the free space of the startup disk) / (the capacity of the startup disk)) * 100) div 1
end tell
if the percent_free is less than 10 then
 tell application (path to frontmost application as text)
 display dialog "The startup disk has only " & the percent_free & ¬
 " percent of its capacity available." & return & return & ¬
 "Should this script continue?" with icon 1
 end tell
end if

#13


7  

I can read C. That means it's human-readable(because I'm a human). It's just too terse for the average person. The general concept of programming languages is to maximize the information about how the computer should operate in a given line.

我可以阅读C.这意味着它是人类可读的(因为我是一个人)。这对普通人来说太简洁了。编程语言的一般概念是最大化有关计算机应如何在给定行中操作的信息。

This is why Ruby is so popular; it maximizes the functionality in minimal text. English(or any other other natural language) is a pretty imprecise, low-information/character language.

这就是Ruby如此受欢迎的原因;它最大限度地减少了文本中的功能。英语(或任何其他自然语言)是一种非常不精确,低信息/字符的语言。

In sum, it is: (i)done before and (ii)a known weaker idea.

总之,它是:(i)之前完成的和(ii)已知的较弱的想法。

#14


7  

This is actually a hot topic.

这实际上是一个热门话题。

For starters - What is Human readable?

对于初学者 - 什么是人类可读?

A Chinese-reader cannot read Russian and vice versa. It you narrow your domain for example to Chinese pharmacists writing a perscription you could design a language around that. And that would be human readable.

中国读者不能读俄语,反之亦然。你缩小你的域名,例如中国药剂师写一个描述你可以设计一种语言。这将是人类可读的。

Such as language would fall under a the umbrella of Domain Specific Languages.

例如语言属于Domain Specific Languages的保护范围。

#15


7  

SQL

SELECT name, address FROM customers WHERE region = 'Europe'

#16


6  

Yes. It's called COBOL, and people generally detest it.

是。它被称为COBOL,人们通常会厌恶它。

#17


6  

Inform 7 is the most successful such system I've seen. It has two advantages over the cruder systems listed in other answers here: it's for a domain particularly appropriate for natural language (interactive fiction), and it does a fancier analysis of the input code based on more computational-linguistics lore, not just a conventional programming-language grammar that happens to use English words instead of braces, etc.

Inform 7是我见过的最成功的系统。它比其他答案中列出的更粗糙的系统有两个优点:它适用于特别适合自然语言(交互式小说)的领域,它基于更多的计算语言学知识对输入代码进行更精细的分析,而不仅仅是传统的编程语言语法碰巧使用英语单词而不是大括号等。

#18


5  

Perl, some people claim.

Perl,有些人声称。

print "hello!" and open my $File, '<', $path or die "Couldn't open the file after saying hello!";

#19


5  

Do a google search for "natural language programming" and you'll find lots of information (including why this is a bad idea).

谷歌搜索“自然语言编程”,你会发现很多信息(包括为什么这是一个坏主意)。

#20


5  

Clarity of Expression is important.

表达的清晰度很重要。

But Clarity of Thought is far, far more important.

但是,思想的清晰度远非如此重要。

#21


5  

HyperTalk and its descendant AppleScript were designed to be similar to the English language.

HyperTalk及其后代AppleScript的设计与英语类似。

#22


4  

VB is as close as I can think of one:

VB尽可能接近我想到的一个:

If MyLife.Sucks Then MyLife.End Else MyLife.Continue

如果MyLife.Sucks然后MyLife.End Else MyLife.Continue

#23


4  

Sure, Erlang.

-module(listsort).
-export([by_length/1]).

 by_length(Lists) ->
    F = fun(A,B) when is_list(A), is_list(B) ->
            length(A) < length(B)
        end,
    qsort(Lists, F).

 qsort([], _)-> [];
 qsort([Pivot|Rest], Smaller) ->
     qsort([ X || X <- Rest, Smaller(X,Pivot)], Smaller)
     ++ [Pivot] ++
     qsort([ Y ||Y <- Rest, not(Smaller(Y, Pivot))], Smaller).

I'm a human, it's a programming language, and I can read it. I don't know what any of it means, but I see a lot of English words in there, I think.

我是一个人,它是一种编程语言,我可以阅读它。我不知道它有什么意思,但我认为那里有很多英文单词。

(Tongue firmly in cheek.)

(舌头紧紧地贴在脸上。)

#24


4  

DSLs can be very natural-looking. See this example created with MGrammar:

DSL可以非常自然。请参阅使用MGrammar创建的此示例:

test "Searching google for watin"
    goto "http://www.google.se"
    type "watin" into "q"
    click "btnG"
    assert that text "WatiN Home" exists
    assert that element "res" exists
end

#25


3  

COBOL was intended to be read by managers, and has "noise words" to make it more readable.

COBOL旨在由经理阅读,并具有“噪音词”,使其更具可读性。

The funny thing is, it reads a bit like a verbose DSL.

有趣的是,它看起来有点像冗长的DSL。

#26


3  

Being more human-readable than most was one of the early selling points of Ada. I find it a silly argument these days, as any sufficently complex task in any language is going to require a competent practicioner to understand. However, it does beat the bejeezus out of C-syntax languages. Its dominant coding styles can enhance this effect too. For example, comparing loops in an if statement: Ada:

比大多数人更易读,是Ada的早期卖点之一。这些天我发现这是一个愚蠢的论点,因为任何语言中任何足够复杂的任务都需要有能力的实践者去理解。但是,它确实击败了C语法语言中的bejeezus。它的主要编码风格也可以增强这种效果。例如,比较if语句中的循环:Ada:

if Time_To_Loop then
   for i in Some_Array loop
      Some_Array(i) := i;
   end loop;
end if;

C:

if (timeToLoop != 0) {
   for (int i=0;i<SOME_ARRAY_LENGTH;i++) {
      someArray[i] = i;
   }
}

The C code would look even worse if I used Hungarian notation like Microsoft, but I'm trying to be nice. :-)

如果我使用像微软这样的匈牙利符号,C代码看起来会更糟,但我想要变得更好。 :-)

#27


3  

Interesting question. Your question can be read as "Is there any programming language that is easily readable by humans?", OR ELSE as "Is there a human language that can be used for programming?". All the answers here have focused on the former, so let me try answering the latter.

有趣的问题。您的问题可以理解为“是否有任何易于人类阅读的编程语言?”,或者是“是否有可用于编程的人类语言?”。这里的所有答案都集中在前者上,所以让我试着回答后者。

Have you heard of Sanskrit? It is an ancient Indian language on which modern Indian languages like Hindi are based.

你听说过梵语吗?它是一种古老的印度语言,印地语等现代印度语言就是以此为基础的。

wiki/Sanskrit

I've been hearing for years that it is precise and complete enough to be used, as it is, as a high-level language on a computer. Ofcourse, you need a compiler to convert Sanskrit instructions to machine language. I know the script & yes, it is precise (entirely phonetic so you never have to ask "how do you spell that"), but I don't know the grammer well enough.

多年来我一直听说它的精确性和完整性足以被用作计算机上的高级语言。当然,您需要一个编译器将Sanskrit指令转换为机器语言。我知道剧本和是的,它是精确的(完全是语音,因此你永远不必问“你怎么拼写”),但我不太了解语法。

This is completeley anecdotal, so I don't vouch for the accuracy of this. Just wanted to share what I know regarding this. :-)

这是完整的轶事,所以我不保证这个的准确性。只想分享我对此的了解。 :-)

#28


2  

I agree with the general consensus here. "Human readable" general purpose programming languages are mostly a bad idea, but human readable Domain Specific Languages are very worthwhile.

我同意这里的普遍共识。 “人类可读的”通用编程语言通常是一个坏主意,但人类可读的领域特定语言是非常值得的。

REBOL has a great system for creating DSLs.

REBOL有一个很好的系统来创建DSL。

#29


2  

GradStudent

It only has one statement: "you - write me a program to do x"
It's valid for all values of X and has the advantage that x doesn't have to be defined and can be changed after the program is written.

它只有一个声明:“你 - 给我写一个程序来做x”它对X的所有值都有效,并且有一个优点,就是不需要定义x,并且可以在编写程序后进行更改。

A commercial dialect is available called intern: development cost is lower but it isn't guaranteed to work

可以使用称为实习生的商业方言:开发成本较低但不能保证有效

#30


1  

Cobol was kind of like that.

科博尔有点像那样。