Giter Club home page Giter Club logo

horus's Introduction

Horus

![Gitter](https://badges.gitter.im/Join Chat.svg)

Horus is a simple mathematical programming language/scientific calculator. The main advantage over a traditional scientific calculator is that functions and variables are supported, and tied to the user's session. A working instance can be found here.

Variables

There are two different types of variables, although they can be generalized as a variable is a value that is always equal to the right hand side of its definition. A traditional variable is defined as follows

a = 2 + 3

A bound variable is a variable whose value depends on the current value of another variable. It is defined as such

b := a * 4

Currently b would be 20, but if a changed, so would b. Recursive definitions are not allowed.

Functions

Functions work as usual, with local parameters shadowing global variables. For example, in

a = 4
f(x) = x + a

the function f will add the value of its parameter x to the current value of the global variable a. Functions can call other functions, but scopes do not propogate in any way. Many standard scientific functions are built in.

Installation

Horus requires GHC >= 7.8.*, and node.js for tests. Here are Ubuntu instructions for installing GHC if you need a place to start. Package installation for Horus can be done using cabal and npm. For example

# Working directory is the clone of Horus
cabal sandbox init
cabal install --only-dependencies

make

If you don't want to use a cabal sandbox you will have to remove the applicable GHC args in the Makefile.

To run the tests do

npm install
make tests

Ensure that the local node_modules is in your path, or install the protractor and mocha modules globally.

Hosting

Static files are all in resources, so these can be served with your method of choice. The default port for the server executable is 3000, and needs to be served on the same port as the static files, under the path /api. A sample nginx config is

location ^~ /Horus {
	alias $CHECKOUT_DIR/Horus/resources/html;
	
	location ~* \.(css|js)$ {
		root $CHECKOUT_DIR/Horus/resources/;
	    rewrite ^/Horus/(.*)$ /$1 break;
	}
	
	location ~ api/ {
	    rewrite ^/Horus/api/(.*) /$1 break;
	    proxy_pass http://localhost:3000;
	}
}

where $CHECKOUT_DIR is specific to you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.