nnatural

0.1.4 • Public • Published

nNatural - near Natural Language Programming Language

nNatural is a new computer language aiming to resemble as much as possible natural language such as English. Its resemblance to natural language makes it easier to understand, maintain and collaborate with, than existing computer languages. nNatural is near natural language and not natural language - it is a computer language with clear syntax and form that needs to be learned.

At this stage, nNatural is in concept proof state. We would really like to hear what you think of it. Send us a message at nnaturallang@gmail.com.

Why nNatural

Languages are means of communication. Computer languages facilitate communication between human beings and computers. Existing computer languages are constructed so they will be easy for computers to understand. We believe, computer languages should focus on being easy for humans to understand. Humans understand best natural language such as English, therefore computer languages should resemble as much as possible natural languages.

Natural Language Programming? Really?

The immediate question asked is how can computers understand natural language with all its subtleties , ambiguities and modes. Well, nNatural is not a natural language. It is a computer language that is constructed in a way that is similar to natural language, making it easier to understand. For example, computer languages like Javascript uses the function notation such as:

function move(dom,x,y){//function definition
   //code goes hear
}

move(getElementById('qeury'),120,240) //function call

can be replaced by nNatural actions like this:

define action move element with id Id to position X Y //action definition
   //code goes here

move element with id 'query' to position 120 240 //action call

Both options have clear definition of the format required to use when calling. They are both unambiguous. They are two different ways of writing the same thing. However, the second option reads like plain english and therefore a lot easier to understand.

Computer Science evolved from Math and Science university departments. We assume that is the reason programming languages look more like mathematical formulas than plain English. Now that computer languages are used outside of University's Math Departments by many that mathematical notation is not intuitive for them, it is time to change the notation of computer languages to closer resemble natural language.

What are the benefits of using nNatural

  • Easier to understand - human beings need to make an effort to understand computer language while understanding natural language is, well, more natural.
  • Easier to maintain - the challenge of maintaining other programmers code or even ones own code written a while ago is not trivial. Having the code easier to understand makes it easier to maintain.
  • Easier to integrate - integrating third party libraries presents the challenge of learning new APIs and understanding the correct way of using it. Having the API in natural language makes it a lot easier to learn new APIs
  • Easier to communicate to non-programmers - with current programming languages there is an iron wall between programmer's world and user world (users, product managers, managers). Having near natural language programming allows the user side understand the logic implemented in programmers code.

nNatural's Main Features

  • Compiles into javascript node.js style modules
  • Integrates functional programming and imperative programming - nNatural [[expressions | Expression]] use declarative syntax while [[actions | Action]] use imperative programming style
  • Asynchronous first programming - nNatural assumes actions can be asynchronous and makes it easy to handle asynchronous programming using [[do-all | Action#do-all]] and [[do-in-order | Action#do in order]] syntax
  • Components - nNatural uses [[Components | Component]] to integrate functionality and state.
  • Reports - Communication between [actions|Action] and there caller actions is done using reports
  • Context Variables - Variables within an action (function) can used context variables that are defined within the calling action or further up the calling chain. This eliminates the need to repeat arguments such as user token that are required for several actions in the same context without using global variables.

Next Steps

Readme

Keywords

Package Sidebar

Install

npm i nnatural

Weekly Downloads

0

Version

0.1.4

License

MPL-2.0

Last publish

Collaborators

  • nnatural