Developer Calculator - Calculator with advanced numerical processing language
Developer Calculator is a powerful calculator with an interactive shell power by a simple yet advanced numerical processing language inspired by R, python, and javascript.
Developer calculator is a work in progress. Performance is not to great now since everything is interrupted. On dev machine fib(30) implementation takes 1.7 seconds to run while the same decimal implementation in C# takes .225 seconds. After language and UI front end is done will do optimizations including compilation of functions.
Release 2
if/elseif/else control structure support
if true: 1 elseif false: 2 else 0 end
while control structure support
while n != 0: print("The value is {0}", n); n = n - 1 end
recursion is now supported, runtime now has a virtual call stack which will prevent crashing
fib(n) = if n == 1 OR n == 2: 1 else fib(n - 1) + fib(n - 2) end
support for local and global variable scope using global/local keywords and implicit
global gX = 0; local gY = 1; gZ = 2; gX + gY + gZ
variables
f() = global fX = 0; local fY = 1; fZ = 2; fX + fY + fZ
f()
variables
support for multiple statements using ;
local x = 123 + 123; print("x = {0}", x)
support for multiline input using \
123 + 23 +\
123
support for invoking vararg functions
print("n = {0}, x = {1}", 1, 2)
execution now occurs on background thread and can be cancelled.
new functions and commands.
Release 1
Initial version
There a 4 basic types. Numeric, strings, Booleans, and functions
n = 1 + 1
s = "abc" + "123"
b = true | false;
f(x) = x * x
All standard operators are supported. + - * / % ^ | & >> << ! = > < >= <= != <> ~
x = 1 + 2 * -(2/5) + (64 % 4) + (232 ^ 12) | (1231 & 2) + (1 << 2) + (213 >> 1)
The ! can be used for Not operator on boolean is also used for POW
z = !(x > (y ! n))
variables can be defined like example
myVar = 1
functions can be defined like example
mul(x,y) = x * y
Functions can take functions as parameters and return other functions
f3(f, x) = x ! f(x)
Anonymous functions are supported using the func/function keyword.
f3(func(x) x * 2, 100)
Ternary conditionals are supported via the iif statement.
iif(x > y, z, 10)
Upcoming Features
graphing - plotting and graphing
scientific calculator frontend - for full touch use without virtual keyboard
objects - objects with properties and methods
arrays - single dimensional arrays
workspaces - persisted workspace and functions to create\manipulate
assign equal operators - support for +=, -=, /=, *=, etc
equation solving - reducing and solving equation for given variable
improved help - improve help API.
data type changes - new date time data type and numeric type improvements which allow numeric to grow to any size
support for closures
self modifying functions
many more functions and commands - API for network and disk i/o and more
Known Issues
History and historyTimes commands does not show history if same command is repeated.
Features:
- Calculator with interactive shell
- Advanced numeric programming language with support for variables, bitwise operators, user functions, control strctures while/if, etc, etc
- In addition to numerics support for strings, booleans, and functions
- Display result in decimal, hexadecimal, or binary.
- History with parse and execution time
- Batch asynchronous calculation support
- Standard math and string functions
- functions can be used as method parameters, support for anonymous functions