More evidence that iOS really just needs a declarative UI format. Storyboards/IB are trash and doing it programmatically is fine, but slow and error-prone.
Show HN: Write code using natural language
91–100 of 118 posts
Re: Show HN: Write code using natural language
#92Earlier quoted context omitted.
> "How do I undo a commit?" isn't something obvious like "git undo". Instead, it's the more cryptic "git reset HEAD~"[1] The issue with this example is that `git reset HEAD~` doesn't undo anything, and it doesn't undo _any_ commit, just the last one. It will also cause push and merge conflicts if the commit you're "undoing" was public, which may end up with you not really having "undoing" anything at all. It's also n…
>The issue with this example is that `git reset HEAD~` doesn't undo anything, and it doesn't undo _any_ commit, just the last one. I shortened the question in my comment for brevity. The full question I cited on StackOverflow was worded as: "How do I undo the most recent local commits in Git?" > It will also cause push and merge conflicts if the commit you're "undoing" was public, Yes, and StackOverflow answers also…
> Yes, and StackOverflow answers also warned of that scenario.
So the answer isn't git reset, but git reset + a whole lot more natural language, even for the more narrow question asked.
> In my comment, "cryptic" doesn't mean the syntax doesn't have its own internal logic that makes sense once one "groks it". It's just non-intuitive for someone who has a goal in their head but the only know plain English for describing that goal.
Isn't the true of anything? Everything has their own jargon to express precisely what they mean. Would you tell machinist they're being cryptic if they told you to make a bolt-hole pattern? Is an accountant cryptic if they talk about something being a liability and not an asset? A ham if they ask for fsk31 and to call them on 6m? Complex things require precise language to talk about precisely. That isn't being cryptic, it's a feature of natural language that it becomes more ridgid and precise with a specialized vocabulary when things require it.
Re: Show HN: Write code using natural language
#93Earlier quoted context omitted.
I toyed with the idea that corporate business analysts (who write requirements for products then hand to developers) could just write in a different syntax and pass them to a compiler that makes: 1. database tables 1. API CRUD endpoints with validation / sanitation 1. screens with input fields Most of the corporate work I did was very similar to this. It was either a batch job, a UI screen, or an API that talks to so…
Isn't that what UML was supposed to be for?
Re: Show HN: Write code using natural language
#94Earlier quoted context omitted.
>The issue with this example is that `git reset HEAD~` doesn't undo anything, and it doesn't undo _any_ commit, just the last one. I shortened the question in my comment for brevity. The full question I cited on StackOverflow was worded as: "How do I undo the most recent local commits in Git?" > It will also cause push and merge conflicts if the commit you're "undoing" was public, Yes, and StackOverflow answers also…
I know what the SO question said, but this hilights the problem with natural language: it isn't an unreasonable answer to "how do i undo a commit" and is infact a top result for that very search string in ddg and Google for me. > Yes, and StackOverflow answers also warned of that scenario. So the answer isn't git reset, but git reset + a whole lot more natural language, even for the more narrow question asked. > In m…
Yes, and like you confirmed, all of that was in the SO answers. I'm not exactly sure what you're debating here. I deliberately put an abbreviated SO question (some words elided) in my parent comment. I also put an abbreviated answer (some words elided). I cited the full SO answers that explained all the caveats, qualifications, in a footnote. Are you complaining that I didn't copy & paste the entire ~5000 words of StackOverflow answers into my comment instead of just typing "git reset"?
>Isn't the true of anything?
Yes! And that truism is why StackOverflow is so useful.
I think the root issue is that you think I'm making a claim I didn't actually make. I never claimed that natural language English is good enough for precise programming or that it didn't have ambiguities. I also think you misunderstood my blurb about git as if I was making an all-encompassing definitive answer for "git undo" instead of using it as a lead-in to a larger point about the tool discussed in this thread.
To hopefully convince you I know what you're talking about, we can also say that non-English programming languages themselves are also fuzzy and imprecise when trying to translate to another programming language. There's always a hidden underlying semantic layer that's not visible in the surface-level text of the code. E.g. converting Javascript to C++.
Javascript: var x = y + z;
But numbers in Javascript are always 64bit doubles. But we don't know if the programmer truly used them as doubles or whether all the runtime values were actually 32bit integers. That hidden semantic layer requires more analysis.Therefore we don't know if the correct translation to C/C++ is:
int x = y + z;
... or ... double x = y + z;
So even trying to perfectly translate non-English programminglanguage_A to non-English programminglanguage_B runs into The Halting Problem.Here's the key, even though programming language conversion is imperfect, the programmers still have a real-world need to translate them and that's why Google and StackOverflow are useful for attempting to convert Javascript to C++.[1] Again to emphasize: Not perfect, but useful.
You seem to be working bottom-up from some Platonic ideal of perfect precision. My parent comment was working backward from the existence of thousands of real-world questions on StackOverflow that translates natural (sometimes fuzzy) English to non-obvious answers about syntax. It's about why do those Git questions exist and why were they useful. The tool that this thread is about takes advantage of that phenomenon.
[1] https://www.google.com/search?q=C%2B%2B+for+javascript+progr...
Re: Show HN: Write code using natural language
#95Earlier quoted context omitted.
I agree that a lot of the unremovable difficulty in programming is translating natural English into something precise. But I also think git often makes the problem worse by splitting similar operations unnaturally across different commands. I believe that was the motivation behind mercurial.
I thought git and hg both started around the same time, didn't they?
Re: Show HN: Write code using natural language
#96More evidence that iOS really just needs a declarative UI format. Storyboards/IB are trash and doing it programmatically is fine, but slow and error-prone.
If you think it’s trash it’s probably that you don’t know how to use them. I’ve been making glorious UIs in IB for half a decade.
Re: Show HN: Write code using natural language
#97Cool 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.
Makes life easy.
Re: Show HN: Write code using natural language
#98Okay so I came here expecring something different. Turns out that this is a stack overflow search engine. So ever since I read a book on AI I have been pondering on when and how computers will steal our jobs. I do have an idea on the subject though if anybody is interested in working with me on this please comment: So with github and loads and loads of other open source repos don't we have enough training data. Could…
Anyway already part od programming work is deciding what you really want. Maybe that's where machines might help - with discoverability.
I actually think that more likely is some CRUD maker as an expert system? (you put what you vaguely need, answer questions and it comes with solution), doesn't need ML.
Re: Show HN: Write code using natural language
#99Okay so I came here expecring something different. Turns out that this is a stack overflow search engine. So ever since I read a book on AI I have been pondering on when and how computers will steal our jobs. I do have an idea on the subject though if anybody is interested in working with me on this please comment: So with github and loads and loads of other open source repos don't we have enough training data. Could…
>> Couldn't throwing loads and loads of processing power on training an AI on commits create an intelligence with an "actual" understanding of day to day programming problems. I'm curious to know why you think it's possible to create "an intelligence" with "actual understanding" thanks to lots of processing power and data. What makes you think this is actually doable? Do you think that this has been done before, for…
How would it work exactly, I wouldn't know which is sort of the point. But sooner or later representations of abstractions within the code would appear within the graphs.
I get that this is not either trivial and cheap. Let alone hosting the wast amount of source code and parse it would require computing power weighing in at quite a hefty sum.
Human beings probably have the advantage of having built in functionallity that we are born with encoded in our DNA.
I suppose that a fair bit of "intelligent design" would be required. That is having coded parses that breaks down the source code into input signals that would help speed up the evolution.
Even reaching halfway there could be useful. Say by providing useful analysis, maybe warn if something seem stupid. To some extent I believe that for a natural language programming language to be viable some understanding of abstract concepts have to be present in the algorithm. That's why I don't think we'll ever program via speech recognition for example. Whenever Siri is smart enough to parse what we are trying to do, why bother with programming. Why not cut the middle man and plug her directly into Jira. but I'd love to be proven wrong regarding this though.
I am by no means saying that it would be easy or even viable within the forseable future. Thank God for that because that would means unemployment for quite a few of us.
* As I am writing this it struck me that test driven development just happens to make this easier.
Re: Show HN: Write code using natural language
#100Okay so I came here expecring something different. Turns out that this is a stack overflow search engine. So ever since I read a book on AI I have been pondering on when and how computers will steal our jobs. I do have an idea on the subject though if anybody is interested in working with me on this please comment: So with github and loads and loads of other open source repos don't we have enough training data. Could…
Github basically did this themselves using (comment, code) pairs as training data: https://github.blog/2018-09-18-towards-natural-language-sema...
At a closer look I don't think that mapping up correlations in a vector space is good enough for the task of fixing bugs based on an issue tracker description though.
The way I see it word2vec is basically statistical connections. So if you compare it to google translate which also works via statistical correlation. Which explains the errors it might do. At some point to get a good translation you'd need human intelligence.
To continue with the google translate analogy. Imagine a translator trying to translate Fyodor Dostoyevski's The Karamazov Brothers to English. That person have to have a tremendous understanding of Russian and English culture not only now but also when it was written along with ideoms and so forth. Along with a deep understanding of politics and religion not to botch the job completely. Or imagine entering a greek epos written in hexameter into google translate and publishing the book.
So you see just as translation and translation might be two totally different things, search and making changes to source code might be different beasts.
Then again you are totally right in that they are doing it. Getting access to this datasource for minining is probably a huge factor in microsoft's purchase of github, so I'd think it would be a safe bet to say that they are working on it...
At least originally, I am sure it's an incredible complicated piece of software by now applying multiple heuresstics.