{"id":16100844,"url":"https://github.com/pannous/english-script","last_synced_at":"2025-03-16T08:32:31.398Z","repository":{"id":16818183,"uuid":"19577324","full_name":"pannous/english-script","owner":"pannous","description":"🖊 Ｅｎｇｌｉｓｈ  as a programming language ","archived":false,"fork":false,"pushed_at":"2018-11-20T12:43:47.000Z","size":28872,"stargazers_count":164,"open_issues_count":7,"forks_count":19,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-02-27T05:55:57.713Z","etag":null,"topics":["compiler","programming-language","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pannous.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-08T14:53:59.000Z","updated_at":"2025-01-22T12:51:01.000Z","dependencies_parsed_at":"2022-08-25T14:40:51.908Z","dependency_job_id":null,"html_url":"https://github.com/pannous/english-script","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fenglish-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fenglish-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fenglish-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pannous%2Fenglish-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pannous","download_url":"https://codeload.github.com/pannous/english-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","programming-language","ruby"],"created_at":"2024-10-09T18:48:29.059Z","updated_at":"2025-03-16T08:32:28.623Z","avatar_url":"https://github.com/pannous.png","language":"Ruby","readme":"![ENGLISH SCRIPT](English_script.png \"ENGLISH SCRIPT\")\n\nThis is English as a programming language.\nThe main purpose of this language is to make programming accessible to many more people, more fun and to facilitate programming computers via voice.\n\nThe guiding philosophy is to have forgiving interfaces yet strict implementations, and to make sigil special chars (!@#$%^\u0026*[}...) completely optional.\n\nUPDATE: There now is a python implementation of English Script called [angle](https://github.com/pannous/angle), compiling to **bytecode**.  \nSoon: Compilation to **WebAssembly** … and Ruby 2.3 gets bytecode as well!\n\n📓 Examples\n-----------\nHere are some of our favorite examples from the [tests](test/unit), **working today**:\n\n`assert two minus 1½ equals 0.5`\n\n`beep three times`\n(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.)\n\n`assert square of [1,2 and 3] equals 1,4,9`\n\n`assert 3rd word in 'hi my friend' is 'friend'`\n\n`x is 2; if all 0,2,4 are smaller 5 then increase x; assert x equals 3 `\n\n`beep every three seconds`\n\n`last item in 'hi','you' is equal to 'you'`\n\n\n```\nWhile Peter is online on Skype\n\tmake a beep\n\tsleep for 10 seconds\nDone\n```\n\n```\nTo check if person is online on Skype:\n\tSkype.checkStatus(person)\n\tif result is \"online\": return yes \n\telse return no\nEnd\n```\n\n🖥 INSTALL\n----------\n`git clone --recursive git@github.com:pannous/english-script.git`\n\n`cd english-script`\n\n`./install.sh`\n\n🐁 EXPERIMENT\n-------------\n\nWarning: The project is still in alpha, don't expect all tests to pass!\n\n**experiment** by typing\n\n`./bin/angle \"6 plus six\"`\n\n`./bin/angle samples/factorial.e` or\n\nStart the shell : `./bin/angle` or `rake shell`\n\n`⦠ 6 plus six`\n\n`⦠ beep three times`\n\n`⦠ x is 2; if all 0,2,4 are smaller 5 then increase x`\n\nCheck out the [samples](https://github.com/pannous/english-script-samples) and [tests](test/unit)!\n\n**Test**\n\nRun the tests : `rake test`\n\nRun an angle file: `rake run[examples/test.e]`\n\n\n⏳ In progress\n--------------\n`add one to every odd number in 1,2,3 == 2,2,4`\n\n\nThe implicit list filter '**that**' applies a selection criterion to all elements. \n`delete all files in my home folder that end with 'bak'` translates to ruby:\n`folder(:home).files.select{|that|that.end_with?(\"bak\")}.map{|file| file.delete}`\n\n\nImplicit lambda variable '**it**' \n`for all mails by peter: mark it as read if its subject contains 'SPAM'` translates to ruby:\n`mails(by: Peter).each{|it| it.mark(:read) if it.subject.match('SPAM')}`\n\n\nThe last example also illustrates what we call **matching by type name**.\n```\nTo delete an email\n  move that email to the trash folder\nEnd\n```\nHere 'mail' acts as argument name and argument type at once.\nNo more Java style Mail mail=new Mail().getMail();\n\n\n📑 Language Specification\n-------------------------\nAngle is a multi-paradigm programming language with [gradual typing](https://en.m.wikipedia.org/wiki/Gradual_typing).\n\nRead the [DOSSIER](https://github.com/pannous/english-script/blob/master/DOSSIER.md) for a more complete [**language specification**](https://github.com/pannous/english-script/blob/master/DOSSIER.md), vision and some background. \n\nThe grammar is not meant to be linguistically complete, but [functionality complete](https://en.wikipedia.org/wiki/Functional_completeness) and easily extendable. It is currently running in the \n* [ruby](https://github.com/pannous/english-script) and [python](https://github.com/pannous/angle) environment, but will soon compile to the \n* WEB(!!) thanks to [WebAssembly](https://github.com/WebAssembly/design)\n* JVM thanks to [Mirah](https://github.com/mirah/mirah), [zippy](https://bitbucket.org/ssllab/zippy/overview) and [truffle](https://github.com/OracleLabs/Truffle)\n* [.Net/CLR/DLR](https://en.wikipedia.org/wiki/Dynamic_Language_Runtime) (via [Cecil](https://github.com/jbevain/cecil), maybe Mirah too), \n* As a final aim: run **natively**, maybe similar to [Crystal](https://github.com/manastech/crystal), [Vala](https://en.wikipedia.org/wiki/Vala_%28programming_language%29) or RPython\n\n\nHaving a [self-hosted \"bootstrapped\" compiler](https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29) is an important mid-term goal.\n\n\"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](http://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667.html) is a mistake.\n\nTo check out the current capabilities of English Script have a look at the [tests](https://github.com/pannous/english-script/tree/master/test/unit),\n[keywords](https://github.com/pannous/english-script/blob/master/src/core/english-tokens.rb) and\n[grammar](https://github.com/pannous/english-script/blob/master/src/core/english-parser.rb)\n\n\n📰UPDATE: Since we love to compile our language to native or at least bytecode, we focussed on the [python implementation](https://github.com/pannous/angle) of English script. \nFortunately finally Ruby now supports bytecode as well, since version [2.3.0](https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/)!\n\n👷 Todos\n--------\n* Use the abstract syntax tree to compile instead of interpret (export via XML and Lisp s-expressions)\n* Better (real) function argument matching: Integrate the sine curve in the interval 1 to 10 with step size .1\n* Implement event system: Beep three times whenever the disc space is over 80%\n* Hook into more existing libraries (java,ifttt,rubyosa?,...)\n* IntelliJ plugin\n* Promote\n\nThis language might soon be used in our successful beloved Jeannie assistant, which has over 5 million downloads so far:\nhttp://www.voice-actions.com\n\nFor a background story/vision/philosophy/future of this project read the [DOSSIER](https://github.com/pannous/natural-english/tree/master/DOSSIER.md) 👾🏺\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpannous%2Fenglish-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpannous%2Fenglish-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpannous%2Fenglish-script/lists"}