Live data from Hacker News

Show HN: Write code using natural language

metacode.app

11–20 of 118 posts

Re: Show HN: Write code using natural language

#12
post #7
post #6

This will just converge to some kind of lisp and then pragmatically end up as XML and then be thrown away when it is realised it is a poor imitation html.

Is all "code of code" inevitably destined for a Lisp dialect?

"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp." - Greenspun's Tenth Rule

Re: Show HN: Write code using natural language

#14
post #7
post #6

This will just converge to some kind of lisp and then pragmatically end up as XML and then be thrown away when it is realised it is a poor imitation html.

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 syntax for having parameters, maybe place them next to the text that describes what the program wants to achieve.

The next step is to define what the program or routine is actually doing, so think about step one again.

... Every time I think about a non-graphical way of writing a program as intuitive as possible I usually end up with some sort of Lisp.

EDIT: several edits for wording

Re: Show HN: Write code using natural language

#16
post #6

This will just converge to some kind of lisp and then pragmatically end up as XML and then be thrown away when it is realised it is a poor imitation html.

I've never laughed so hard from an HN comment. It's funny because it's exactly what will happen as it has in the past

Re: Show HN: Write code using natural language

#18
In a tightly-scoped domain like "write code in Vue.js" it might be really cool. Looking forward to seeing how this evolves!

But just like self-driving cars, once you start expanding the scope, and only just a little bit, it doesn't look so cool anymore. I would love to see how far they can take this.

Programming in the purest sense is taking problems that real people have, expressed in their own words, and creating a logical symbolic construct that automates a sequence of interactions that pleases them. Human language is an extremely fuzzy and messy affair involving all sorts of things like body language that don't transfer to writing. Programming is not like that. These are not just different things. These are completely different domains of things.

Neat. Best of luck, guys!

Re: Show HN: Write code using natural language

#19
post #8

Wow I really like this! My main problem when programming against mac/iOS APIs is constantly looking up how to do the little things shown in the demo video. I don't look forward to writing macOS/iOS apps but this makes me think differently.

I think you've nailed it. Getting all the constructs right can be tough - Metacode solves that.

Re: Show HN: Write code using natural language

#20
post #9
post #4

Cool experiment. Really shows how poorly conceived/verbose Auto Layout is. The first thing I do in any iOS project is add some sort of wrapper around all that constraint nonsense.

Can you elaborate your approach? I've been making iOS apps for a decade now but auto layout and constraints scare the bajesus out of me.

Of course: the app draws from a database of thousands of snippets that are cleaned up and generalized with some scripting. Natural language queries are handled like search, with semantic matching over both natural language and code structures. Content within the snippet like naming, "subject"/"target", and values are dynamic (use # to modify those values) – but it still needs work. As for auto layout, I actually have a feature for that on the roadmap but wasn't sure it was a common problem – bumping up its priority!
Post reply on HN