Programming in plain English: <https://osmosianpla...
# thinking-together
i
Programming in plain English: https://osmosianplainenglishprogramming.blog/
👍 5
o
In the article, it is answered "yes" to the question "can natural languages be parsed in a relatively “sloppy” manner?". But I wonder what are the edge cases, and if this "sloppy" parsing can lead to errors that are very subtle to debug where a formal syntax might have help to better grasp what is happening.
j
I like this. I’m very unlikely to use it anytime soon, but seeing those programs expressed in a more clear and succinct way breaks a lot of my intuition about this topic.
a
Very thought-provoking, thanks!
Natural language names make it very pleasant to write code—something I noticed while using my own similarly-motivated system, Ditty. I wasn't so bold as to eschew interface definitions entirely, but attaching behaviors to plain English names (e.g. "number of items in [x]") greatly encourages people to think of the most natural way of expressing what they want to do, and define it, even if a similar but less contextually clear alternative already exists.
❤️ 1
I like PEP's handling of collections. We have so many convenient idioms in natural language for those.
And yet this makes me laugh out loud…
And this makes me shudder…
g
I tried to download "The Prototype" file (www.osmosian.com/cal-4700.zip) from this blogpost, but Windows antivirus said this file contained a trojan. Update: now it downloads without any warning.
c
Wow, this is super cool! I bet @Steve would be interested
❤️ 1
Hmm. Any ideas how I can run this on a Mac?
s
@Chet Corcos very much so! Very long read 🤣 but a scroll through suggests that it’s more about visual design and drawing than business logic is is very much more my interest. Each domain has quite different requirements and constraints.
c
Well they built a compiler with it as well as a WYSIWYG text editor and a filesystem browser... so it much be pretty flexible.
s
@ibdknox If I may be candid: I don’t understand why you would apply NLP like this to drawing… strange result to use when art is is not language.
Drawing and business-logic(workflows and query) and Gaming are very very different scopes. I’m not optimistic that something can satisfy all 3 requirements when they are all ooh so different: users are different, domains, constraints, usage, execution behavior, error management, everything.
@Chet Corcos PS Storyscript is not “compiled” and it’s not a programming language by definition. Representing a program in plain-text (english or other) comes with significant restrictions and more tooling work than alternative solutions that we will be demonstrating soon.
c
I get what you mean -- this is definitely a different use-case and lacks a lot of the usability stuff that I think you're going for. But that said, its always good to have a solid foundation...
s
If this “plain english programming” is compiled than it will have the same limitations as the other hundreds of languages before it: you have to represent the entire programs state in text.
@Chet Corcos I cannot speak on the foundation, but IMO (just being candid and honest) if it’s “compiled” than the foundation is flawed by design.
c
Hmm. I think I see what you mean.
s
I think this is where Eve also failed: being compiled and to broad of scope.
I have not intention to be rude in my feedback and comments. I believe strongly in radical candor and honesty. Better than saying “cool stuff man” and moving on.
👍 1
c
Interested to hear more on your thinking behind "if it’s “compiled” than the foundation is flawed by design."
s
Let’s DM
Also… why? Why talk to a computer like this? It is very silly. Here is difference:
Start. Open tax folder. Open each 1099. Get the amount earned…… 1000 steps later
VS
computer, do my taxes
— The later is better. Drawing:
Start. Draw circle. Draw smaller circle inside. Draw 15 lines on top of the circle......
VS
Draw an eye.
Less than 0.3% of the world need the former while 99% need the later.
👍 1
a
Are you saying, drop everything and write AGI?
s
The world is not black and white. I order things on Amazon but they still need to be built by real people in a factory. Drop everything? Heck no! But creating software still remains out of reach for most the worlds population.
There will be farmers, there will be chefs and there will be waiters in the future of coding. I just think we should stop thinking about farmers only.
i
If this “plain english programming” is compiled ... you have to represent the entire programs state in text.
That's a very odd thing to say. Compilation has nothing to do with text or state.
Compilation is just the translation of semantics in one form to semantics in another form. We compile goals to motor actions all the time. Or thoughts to drawings, recipes, exercise routines, advice, and conversation.
Perhaps you mean something else?
Language itself is exceedingly general, so it seems unlikely that broadness is an inherent wall that can't be overcome. It is true that different domains use different vocabulary and different cognitive tools, but they're accessible within the same framework. You can move from one domain to the other in the course of a single sentence.
Art is definitely a language in so many ways. From the vocabulary and idioms to how we evaluate and even experience it. It's a domain with a set of actions and rules that has a wonderfully open and powerful set of semantics.
I would argue the problem with something like what's presented in the post isn't that it's NL talking about drawing. It's that it's only NL. To contradict your point about broadness of scope, to capture the domain of something like art you need much more than words and you'll need much more than turtle graphics.
💡 4
But you will need words, even if you have the most perfect set of tools in existence - afterall how would you communicate which tool you used to a friend? Or the motivation behind the art? How would others talk about how it made them feel? Or make a shopping list for the paint?
Without the language, we wouldn't have Bob Ross 🙂
Why talk to a computer like this? It is very silly.
s
Ok, “state” was the wrong word to choose. Maybe “the source of truth” is better. Same issue: plain-text compilation requires that the full truth is represented in the plain text which has significant limitations.
i
It's exactly how we talk to anyone that requires step by step instructions. A chef teaching a new line cook, an art teacher walking you through how to paint your first watercolor sky...
s
“Language itself is exceedingly general” is this not the problem of Eve? Why be general when you can be more pragmatic to scope to a domain. For example (not to plug it again, but it’s good example) Storyscript is not for gaming or drawing. It’s for business-logic QA and workflows. That scope makes our “language” (which it’s not really) can be designed differently.
i
It makes your language easier to design and easier to be business-wise successful, but it's not somehow fundamentally better. Generality isn't a problem to be solved, it's a thing to strive for. Language, math, art, kinesthetics, and so on are ridiculously general and have taken us from quite literally nothing to the civilization we have now. Narrower things fill in the details, but they don't expand the canvas. So no. I don't see generality as "the problem of Eve." 🙂
👍 1
It really just depends on your goals and what tools/experience/insights you have at your disposal.
s
I admit that my perspective of Eve is my own. Regardless, the demos shows how to make frontend and games which are domains that have better tools to achieve these problems, not to mention they are quite different (especially the users). I do think it was the lack of focus and to broad of scope.
i
It's sad that we see Python and Excel withering away in their generality 😛
😁 1
Or the internet for that matter.
s
I mostly agree too.
Language, math, art, kinesthetics, and so on are ridiculously general
“Programming” is an art and it has many mediums and abstraction layers. Just like in art and language and math, there are differnt requirements at different levels of need. Languages are not abstracted enough… but we do have hope. I can “code” without code already. “Alexa, what is 1+1” It’s basic… yes… but it’s betting smarter. With time, it will do things like
weekly, look at the forecast and adjust the number of drivers required to deliver food by comparing average orders and weather
^^ That problem today requires programming. But I promise you that it will not in the near future.
Futhermore, we won’t be writing this by saying
Start. New cron weekly. set variable weather to accuweather forcast for date…..
I think Python, Rust, Go, Typescript, CSS, etc. etc. are good languages, they solve problems in their domain well. We all know that to be a fact. The tooling will get better and new languages will replace old ones, yet remains that only very few NEED to and CAN understand this domain level. I’m not sure AI and NLP have much to help with on this level of abstraction…. but the level where the rest of the world needs technology (like Alexa and Siri level) where voice is king… that level of abstraction should not be for Python or any other language of today.
i
It might be worth actually reading the article rather than skimming it. It's presenting a different perspective on how english might be a better python than python is.
💯 1
You may disagree with that, but you're not doing so in a constructive way that points to actual fallacies in the argument.
j
It seems like the conversation in thread might be talking about several different (and mostly orthogonal!) things at once. How general a language's capabilities are, what it's input methods are, and even where on the spectrum of implicitness (draw an eye) to explicitness (start an arc at X100Y50, ...) it falls are all completely separable decisions.
It's useful to explore each of those axes separately -- I often find the most interesting ideas in the easy-to-overlook nooks formed by combining an odd set of positions.
Relatedly, most languages actually occupy a range rather than a point on those axes, which often provides a much better experience than one endpoint or the other ever could. As an easy example, I might struggle to perfectly recreate the mona lisa working only at the "draw an eye" level (and it'd take me ages to try to recreate it using only assembly...), but I'd likely have a much easier time of it if I could start there and then successively increase the explicitness of my instructions until I got the desired look.
i
☝️ that is what the new thing we're working on is trying to cover: how do you create an environment that lets you seamlessly flow between high level implicit statements to low-level explicit refinement?
😮 1
a
With previous Eves you’ve published reading lists of related tech. Do you have a reading list for this one yet? Holes and project templates are the extent of what I’ve seen for being able to refine software into existence.
i
In the programming world, Self and the Alternate Reality Toolkit are the closest things I know of. Entity Component System engines are related as well. As Ivan mentioned in another thread, 3d software definitely has this feel and there are lots of games to really dive into: Minecraft, Factorio, Dreams, Little Big Planet, etc.
FWIW, the new project doesn't have the same goal as Eve did. We're less concerned with explicitly trying to get end users into programming, though the approach may help do that. We just want to make an environment that we actually want to live in. 🙂
👍 3
We'll see where that ends up landing on the accessibility spectrum.
t
I have to say I'm impressed with how well this natural language system appears to work. I share some of the earlier concerns in this thread that it might be very difficult to tell what's going on when things aren't working as intended— not just in terms of how the syntax is being parsed, but what the compiler and resultant program are actually doing. The most difficult part of programming— mental simulation of invisible processes— is not really fixed by making the program into plain English. I'd hypothesize that an unambiguous notation is actually an aid to mental simulation, not a hindrance (it removes some guessing/degrees of freedom about what the computer might be thinking). Of course the use of a symbolic notation itself requires more complex mental simulation (i.e. of a parser/lexer/compiler), and this "bootstrapping problem" adds yet another layer of difficulty that makes even getting started with programming so hard for many beginners. But I think it's a big fallacy to think that removing this initial barrier is what will open up programming. It's just the first hurdle; after that comes a lifetime of mentally emulating every program you work with. It's my thesis that the future of programming will not come about until the need for mental simulation is largely removed. But this is a really interesting and unexpected peek into perhaps another, new niche of programming.
2
👍 1
a
Thanks, Chris!
@tbabb Are there ambiguities in the notation?
e
@Steve @ibdknox One problem with "Programming in plain English" is the exceptions problem. This is just not solvable unless you can solve the exceptions problem. Ripple Down Rules explains the problem, and describes a good human solution. The issues relates to rules. Rules typically have exceptions. This was made clear by some guy trying to create an expert system in a hospital. Experts would come to him with new rules for the expert system. He would code them in. Then they would come with a new rule than was an exception to the old rule. And so he invented Ripple Down Rules. This is a problem for coding, because, you need to uncover the exceptions. When given a text description of a problem, a lot of what a programmer does is look for the exceptions to the rule, the edge cases. Then they make a judgement call of if to include code that handles the exception or not. If you look at a program, sometimes it is mostly exceptions. It required a human to extract all the exceptions and then code them. Until a computer can work through a text description of a problem, and some how uncover the exceptions, I don't think we will see this kind of thing working.
t
@alltom There is ambiguity in English, so certainly! The compiler will make some choice in the face of ambiguity (including possibly to error; I don't know what this system does), but the human will still be faced with the problem of predicting what disambiguating choice the computer will make. It seems like the compiler is doing a sort of "fuzzy match" (?), so not being an AGI, it will certainly not guess correctly what the programmer meant in all cases. So when that happens, the human will be tasked with figuring out what the computer thought they meant.
1
e
@tbabb I though we had good solutions to the ambiguity in English problem already. Systems like https://donotpay.com/ can already handle ambiguity. I have not tested one, but I understand they do work successfully.
t
@Eddy Parkinson English (and pretty much all spoken language) is known to not be unambiguously parseable. Ex: "The boy lured the duck with a loaf of bread." Who had the bread, the boy or the duck? We humans know from world knowledge about ducks and loaves and animal behavior that one interpretation is more likely to be true; but either interpretation is a valid grammatical parsing. You basically couldn't solve this kind of problem in general without having a fully world-educated AGI. Even then, we can construct grammatical sentences that intelligent humans can't disambiguate with more information.
1
"Update the variable with the value 3". What happens there? Am I writing the value "3" to something, or am I searching for something which has the value "3"? We could imagine circumstances where it'd be obvious to a human programmer, but I wouldn't expect a compiler to do better than chance.
a
In PEP, you'd write one of those parses as
Put 3 into the variable
and the other as something like (guessing)
Find a variable with the value 3
. I don't think its goal is to let you write whatever you want, just to ensure you don't ever have to write
var = 3
or
variables.select { |v| v == 3 }
.
a.foo()
is ambiguous in JavaScript, and we've put a lot of engineering effort into being able to tell you which
foo
it will be. PEP seems simple enough that you could probably do it easily, maybe statically.
I made a language with no regularity, where most AST nodes presented as English-looking sentences/phrases with slots for arguments. I made it a blocks language because my parsing skills are ~0, and solved the "I don't know what to type" problem with autocomplete. Docstrings let you disambiguate the results if some were too similar to tell. If you haven't tried such a language, give it a shot, because I think the most obvious potential pitfalls are red herrings.
t
What would happen if the programmer wrote the sentence that I did?
a
In PEP, I dunno. I don’t have Windows. :( In mine, you’d have an ordered list of likely parses to choose from.
🤔 1
😛 Never promised my system was good, just that the problems the people in my user studies ran into had nothing to do with parsing. People loved that their autocomplete/search results looked like "Play a major scale starting at [note]" instead of "play_scale(base_note)". I wish I'd written more down, but oh well.
g
love this in particular:
>>Note that formal names (proper nouns) are not required for parameters and variables. This, we believe, is a major insight. A real-world chair or table is never (in normal conversation) called “c” or “myTable” — we refer to such things simply as “the chair” or “the table”. Likewise here: “the vertex” and “the polygon” are the most natural names for these variables.
w
I see the trick with articles and pronouns is to have interactive disambiguation, else you end up with the most nuanced scope and shadowing problems. (In one of my silly lisp phases I had
(the whatever)
,
it
,
him
, and
her
. The last two were bound when you used comparison operators, like, I don't know
(def (min-f f x y) (if (< (f x) (f y)) him her))
. So this returns the minium of
(f x)
and
(f y)
.
z
I really liked Chris's comment "We just want to make an environment that we actually want to live in". I actually think that before we think of making our tools for others, we have to make sure we love them ourselves! If we do that then we have already succeeded!
💯 2
o
@tbabb said:
The most difficult part of programming— mental simulation of invisible processes— is not really fixed by making the program into plain English. I'd hypothesize that an unambiguous notation is actually an aid to mental simulation, not a hindrance (it removes some guessing/degrees of freedom about what the computer might be thinking).
I totally agree. With ambiguous systems based on natural language programming, there is a new source of complexity: for some task it can be tricky to find/guess the sentence that will make the compiler produce the behavior that you want. And maybe one compiler will "choose" one behavior that will be different than the one chosen by an other compiler. We only have this kind of problem with "unambiguous" languages where some compilers/interpreters behave differently on some parts of some standard (like C or JavaScript).
c
I think that's true to an extent. I occasionally "resort" to mathematical style notation when English is getting clumsy - i.e. added brackets or using set notation. This is most common in reading legalese. I genuinely believe laws would be more approachable if written in pseudo-code. I think this is rare though. Natural language is normally unambiguous. It's more common to see, for example, natural language comments elucidating a piece of code. These two sentences convey essentially exactly the same semantic information; 1. Copy the value of the 'eax' register into the 'eab' register 2. mov ebx eax But #1 is much easier to understand. There's no reason that assembly code should necessarily be written like #2 and not like #1
☝🏼 2
Obviously the program that can take #2-style code and produce binary is much simpler to implement than a program that can take #1-style code and produce binary
e.g, just picking one of the first Google results for learning x86 - https://www.cs.virginia.edu/~evans/cs216/guides/x86.html - in every case it shows the assembly code on the left, and then a plain English explanation of the command on the right. Is it beyond our technical capability to build an assembler that takes the stuff on the right, instead of the stuff on the left? No, obviously not. To get something like "do my taxes" to execute on a processor, we have to somehow translate "do my taxes" into a series of processor instructions that can be physically realised. This is like "essential compilation". Every stage of this process can perfectly well be described unambigously in natural language. Separately to this, there might be an essentially arbitrary set of "compilation" between different programming languages.
☝🏼 1
e
@tbabb looks like my comment was too ambiguous 🙂 ... donotpay solves the ambiguously problem by having a conversation. It asks you questions to resolve ambiguously. ... I am not sure how else you could do it, because, as you say, many English statements are ambiguous. donotpay uses the IBM Watson software - there are quite a few podcasts about it https://www.listennotes.com/podcasts/415-stories/e7-joshua-browder-of-DL2dXgmfvPr/
👍 1