Natural language is ambiguous. Grammars for computer languages are designed to remove ambiguity. A natural language that is used to program a computer, too, will have to remove ambiguity, thus only using a severely constricted subset of a natural language. Is it worth it beyond curiosity? If a person can't grok a computer language are they going to grok such a terse natural language?
Only a Subset of features of natural langage introduce ambiguities, equivocations, etc. It is perfectly doable to force one and only one meaning per keyword (just like do programming keywords already (if, while, etc), removing the ability to use coreferences, etc I would love to see a great constrained English, formal without the readability and expressivity loss of formal symbolic grammars / formal maths
Show HN: Write code using natural language
31–40 of 118 posts
Re: Show HN: Write code using natural language
#32In the code builder demo, it strikes me that all that code in swift could be replaced with a declarative format:
let TestVC = viewController(
button(
padding: { left: 5 },
width: 100,
height: 200
)
)
And probably be easier to type than these snippet demos. Has there emerged a good declarative API for iOS? As a web developer, as much as I hate the insanity of the javascript tooling ecosystem it's hard to imagine going back to the spaghetti I see with swift/iOS apps.Re: Show HN: Write code using natural language
#33If you want to understand why this is bad just look at AppleScript, probably the closest thing I've ever seen to natural language, the only problem is that it's impossible to just figure something out if there isn't a tutorial, because there's no real convention you can make guesses based on.
Re: Show HN: Write code using natural language
#34It was a pretty complex language, and meant to use English syntax to mix both the fiction writing and the coding. So you can end up with code that looks like the following, for example
---
"Stage is a room.
The old lady is a woman in the Stage. Understand "mother" or "stepmother" as the old lady. The old lady is active. The description of the lady is "She looks plucked: thin neck with folds of skin exposed, nose beaky, lips white. Perhaps when her fortunes are mended her cosmetics too will improve.""
---
And it obviously gets more complex as you create things like objects with weights and inventory limits etc. My experience of it is that when it worked it was pretty magical, but when it didn't it was utterly maddening to figure out how to get it to parse.
Kinda felt like a voice help that barely works.
Best of luck with this, I like where it looks like it is going, but it simply has to be /really good/ to be value-added and not frustration-added
Re: Show HN: Write code using natural language
#35Natural language is ambiguous. Grammars for computer languages are designed to remove ambiguity. A natural language that is used to program a computer, too, will have to remove ambiguity, thus only using a severely constricted subset of a natural language. Is it worth it beyond curiosity? If a person can't grok a computer language are they going to grok such a terse natural language?
Only a Subset of features of natural langage introduce ambiguities, equivocations, etc. It is perfectly doable to force one and only one meaning per keyword (just like do programming keywords already (if, while, etc), removing the ability to use coreferences, etc I would love to see a great constrained English, formal without the readability and expressivity loss of formal symbolic grammars / formal maths
Re: Show HN: Write code using natural language
#36Re: Show HN: Write code using natural language
#37Re: Show HN: Write code using natural language
#38Earlier quoted context omitted.
Is all "code of code" inevitably destined for a Lisp dialect?
IMHO: There is a good chance that Lisp is pretty close to expressing "natural language" in code. I would argue that written text / prose is even a bad starting point. I'd rather think about having an UML Activity Diagram, add a way to add parameters / variables to it. Then visually imagine that you take away the full bubbles around the commands and just leave the sides. They look like brackets, right? Now fiddle in a…
Re: Show HN: Write code using natural language
#39If you want to understand why this is bad just look at AppleScript, probably the closest thing I've ever seen to natural language, the only problem is that it's impossible to just figure something out if there isn't a tutorial, because there's no real convention you can make guesses based on.
Ah, interesting! The difference between Metacode and something like AppleScript is that the artifact left over from using Metacode is still the rigorous programming language you're used to. If we retain a query log, you could even convert your natural language queries into code comments alongside your code to actually improve clarity.
Re: Show HN: Write code using natural language
#40Is there a summary in text? I don't watch videos without a reason.