ðŸ”±

Introduction

What is the best way to express and deliver our ideas?

Types

Complex Number. Real number. Rational number. Integer number. Natural number. $x:X$ï»¿ such that $X=\{...\}$ï»¿, $x\in X$ï»¿. Char. Array.

All types are first-class.

Expressions

Should expressions admit whitespaces in names?

Closure.

Some expressions

$+(||(0.7,0.2)-(0.2,0.3)||_2)$ + . ||(0.7,0.2)-(0.2,0.3)||_2
$||(0.7,0.2)-(0.2,0.3)||_2 | +$ (x => x+1)(1)
1
$interval(1000) | reduce(p => [p[1],p[0]+p[1]],[0,1])$ connect(protocol=WebRTC) | chat
abc
connect(protocol=WebRTC, key="abc") |
interval(1000) |
reduce(p => [p[1],p[0]+p[1]],[0,1]) |
echo

Declarations and assignments

You can declare new terms but alpha doesnâ€™t allow assignments.

Expressions

Alpha follows the convention that every expression has a value. The declarations or definitions return their references such that

x=6
// x
f(x)=x
// f

Functions

The type of argument is by default real numbers.

f(x)=x^2
f (a,b,c) = (x1, x2) where
expressions

Regular expressions

a ~ /REGULAR_EXPRESSION/g

Program

UTF-8

Programs are not evaluated on the fly.

f(x) = x^2
f.self
// f(x)=x^2 : self
f.self.body.self
// x^2 : self
f.self.body.self.evaluate({"x": 1})
// 1^2
f.self.body.self.evaluate({"x": 1}).apply()
// 1

Streams, composition, and pipes

The means of combinations are streams, composition ($f.g$ï»¿), and pipes (g|f).

Lexical Structure

id: Unicode symbols

Examples

Grammar

Consider a grammar G4 where its production rules are
S: X*
what is its type?
Consider G4:Grammar where its production rules are
S: X*
what is its type?
Consider G4:Grammar where we have a environment e and its production rules are
S: X* {x=1}

W
graph TD
G --> Expr
Expr --> Expr+Expr
Expr+Expr --> Expr
Expr+Expr --> Expr
Expr --> 1

G â€”> Expr â€”> 1

G â€”> Expr â€”> Expr+Expr â€”>

%% html
%% prolog
%% alpha

Authoring

Interactive

References

https://xtermjs.org/

https://www.npmjs.com/package/react-terminal#features

Jupyter

Wolfram Alpha