Skip to content
/ angle Public
forked from pannous/angle

⦠ Angle: new speakable syntax for python 💡

Notifications You must be signed in to change notification settings

smac89/angle

 
 

Repository files navigation

![ENGLISH SCRIPT](English script.png "ENGLISH SCRIPT")

Angle is the Python implementation of English as a programming language. The main purpose of this language is to facilitate programming computers via voice. Angle is the first speakable programing language and thus makes programing accessible to many more people.

🖥 INSTALL

pip install angle

OR from source:

git clone --recursive git@github.com:pannous/angle.git

cd angle

./install.sh

Start the shell : ./bin/angle

📓 Examples

Here are some of our favorite working examples from the tests:

assert two minus 1½ equals 0.5

beep three times (There will be a generation of programmers who will shake their heads that there ever was a programming language which did not interpret that sentence correctly.)

assert square of [1,2 and 3] equals 1,4,9

assert 3rd word in 'hi my friend' is 'friend'

x is 2; if all 0,2,4 are smaller 5 then increase x; assert x equals 3

beep every three seconds

last item in 'hi','you' is equal to 'you'

While Peter is online on Skype
	make a beep
	sleep for 10 seconds
Done
To check if person is online on Skype:
	Skype.checkStatus(person)
	if result is "online": return yes 
	else return no
End

Status:

ALPHA, partly usable, some tests not yet passing: Build Status

⏳ In progress

add one to every odd number in 1,2,3 == 2,2,4

The implicit list filter 'that' applies a selection criterion to all elements.

delete all files in my home folder that end with 'bak'

translates to ruby:

folder(:home).files.select{|that|that.end_with?("bak")}.each{|file| file.delete}

Implicit lambda variable 'it'

for all mails by peter: mark it as read if its subject contains 'SPAM'

translates to ruby:

mails(by: Peter).each{|it| it.mark(:read) if it.subject.match('SPAM')}

The last example also illustrates what we call matching by type name.

To delete mail:
  move that mail to trash folder
End

Here 'mail' acts as argument name and argument type at once. No more Java style Mail mail=new Mail().getMail();

🐁 EXPERIMENT

Run it and see yourself!

experiment by typing

angle "6 plus six"

angle examples/test.e

angle (no args to start the shell)

⦠ 1/4

⦠ 6 plus six

⦠ beep three times

⦠ x is 2; if all 0,2,4 are smaller 5 then increase x

⦠ ls | item 2

📑 Language Specification

Angle is a multi-paradigm programming language with gradual typing.

Read the DOSSIER for a more complete language specification, vision and some background.

The grammar is not meant to be linguistically complete, but functionality complete and easily extendable. "Premature optimization is the root of all evil." Many programming languages 'optimize' on the syntax level in order to optimize the resulting applications. Maybe this is a mistake.

To check out the current capabilities of English Script have a look at the tests, keywords and grammar

🕶 Future

English Script / Angle is currently running in the

Having a self-hosted "bootstrapped" compiler is an important mid-term goal.

Why the new implementation in python🐍?

We can compile English script / Angle directly to python byte-code: As opposed to Ruby, Python(3) comes with a very nice and clean abstract syntax tree as well as byte code capabilities preinstalled. Compiling is so much nicer & faster than interpreted code. Also the Python execution model is a bit more friendly than the Ruby VM, but both have their advantages and drawbacks. The biggest advantage of Python is that objects can be given attributes at any time o.x='y'! However pythons limited lamda capabilities are a painful limitation.

"There should be one-- and preferably only one --obvious way to do it" Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested.

For a background story/vision/philosophy/future of this project read the DOSSIER

About

⦠ Angle: new speakable syntax for python 💡

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 53.6%
  • Ruby 25.3%
  • JavaScript 21.0%
  • Other 0.1%