Is there a human readable programming language? [c

2019-01-29 20:07发布

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.

标签: nlp grammar
30条回答
叼着烟拽天下
2楼-- · 2019-01-29 20:36

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

查看更多
\"骚年 ilove
3楼-- · 2019-01-29 20:39

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.

查看更多
Deceive 欺骗
4楼-- · 2019-01-29 20:39

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).

查看更多
虎瘦雄心在
5楼-- · 2019-01-29 20:40

Perl, some people claim.

print "hello!" and open my $File, '<', $path or die "Couldn't open the file after saying hello!";
查看更多
劳资没心,怎么记你
6楼-- · 2019-01-29 20:40

VB is as close as I can think of one:

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

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-01-29 20:42

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.

查看更多
登录 后发表回答