Live data from Hacker News

The English Programming Language

github.com

41–50 of 78 posts

Re: The English Programming Language

#41
post #28

As someone who worked on a 35 million loc cobol and jcl system for several years in the late 90's, I don't find this to be funny at all. Cobol was purported to be readable with english language like syntax to make it more understandable. Giving gems such as: MULTIPLY TAX-RATE OF STATE(43) BY BALANCE GIVING SALES-TAX-AMOUNT. Note the period is sigificant.

It's actually a pretty interesting question why programming languages that work like that are a bad idea. From decades of experience, I know intuitively that they are, but I find myself unable to formulate a concise description of what exactly is wrong with this approach.

Because they turn out to be just as precisely fiddly as any other programming language, but deceptively appear not to be.

If you treat them as English you'll get burned. You have to still treat them as very precise formal languages where apparently trivial/irrelevant details are significant, and minor hard-to-spot mistakes will break your program.

Having more explicitly formal/structured syntax makes it easier to distinguish the different parts of the language, make sense of the details, and figure out what is or isn't allowed.

The best description I have for languages like this, e.g. Applescript, is that they are "read only languages" (in the opposite direction old-style Perl has been called a "write only language"): That is, if you have an already written program in hand it will be easier for a complete novice to read (at least, single isolated lines of code will be). But writing new programs is a huge pain in the ass.

Re: The English Programming Language

#42

Earlier quoted context omitted.

That is surprisingly readable and makes me want to go learn COBOL. Could I now get you to criticize eating healthy, please? :)

Before jumping in with both feet, please check out the ALTER statement. GOTO on steroids and more.

Fair critique. That's why INTERCAL was so much better.

Re: The English Programming Language

#43
post #32

Earlier quoted context omitted.

Too much ambiguity that needs a large amount of context to resolve.

But why is that a problem? That's literally how we speak every single day. In fact, given that this is how all the languages that humans are already familiar with work, it's hard to see why this wouldn't be the best approach for constructing a programming language.

I agree with your sarcastic reply that naturally grown languages are simply horrible for shared comprehension!

For instance, the poem, or should I say program using the example in the post has several different interpretations, and at least some of those teachers would say are flabbergastingly incorrect.

Re: The English Programming Language

#45
I've often described telling LLMs what to do as "programming in English", and I genuinely think some people have an unusually low opinion of the capabilities of LLMs because they're not so great at expressing ideas and concepts in English.

Re: The English Programming Language

#46
post #32

Earlier quoted context omitted.

Too much ambiguity that needs a large amount of context to resolve.

But why is that a problem? That's literally how we speak every single day. In fact, given that this is how all the languages that humans are already familiar with work, it's hard to see why this wouldn't be the best approach for constructing a programming language.

It’s quite literally a problem, every day.

Re: The English Programming Language

#48
post #36

As someone who worked on a 35 million loc cobol and jcl system for several years in the late 90's, I don't find this to be funny at all. Cobol was purported to be readable with english language like syntax to make it more understandable. Giving gems such as: MULTIPLY TAX-RATE OF STATE(43) BY BALANCE GIVING SALES-TAX-AMOUNT. Note the period is sigificant.

There are multiple responses to the above parent noting how readable the above line of code is and yet how it might go wrong. The first pitfall of using english as a programming language that occurs to me (as a totally Cobol ignorant person): * Human languages tend to be nebulous around the edges and fluid, often with single word taking up multiple meanings and same function done by multiple words. There are multiple…

> I have made 3 changes here, which might or might not work with COBOL (I am Cobol ignorant ;) ).

I've never used COBOL before, but this thread and your post made me curious and I installed GNU Cobol and found a sample program that demonstrates a few language features.

After playing around with it a little, I think I've understood that "OF" is like a struct element (or object property) accessor, the parens are an array index, and the hyphen is a syntactically significant part of the identifier. "BY" is apparently a mandatory part of the multiplication operator.

Conclusion: each of your three changes (while, as you said, perfectly reasonable from the English language point of view) would indeed break the COBOL code!

By the way, I remember this being a bit of an issue when I tried programming in HyperTalk: on occasion I would unintentionally come up with an English synonym for some natural-language HyperTalk code, and it wouldn't be valid HyperTalk.

Re: The English Programming Language

#49

I've often described telling LLMs what to do as "programming in English", and I genuinely think some people have an unusually low opinion of the capabilities of LLMs because they're not so great at expressing ideas and concepts in English.

It can be tough to unambiguously express ideas and concepts in English.

Re: The English Programming Language

#50

As someone who worked on a 35 million loc cobol and jcl system for several years in the late 90's, I don't find this to be funny at all. Cobol was purported to be readable with english language like syntax to make it more understandable. Giving gems such as: MULTIPLY TAX-RATE OF STATE(43) BY BALANCE GIVING SALES-TAX-AMOUNT. Note the period is sigificant.

[deleted]
Post reply on HN