Cmath
C++ Mathematics Libary & CLI
Install / Use
/learn @christianparpart/CmathREADME
cmath
This is a pet project, implementing a programming language for mathematics and related sciences.
Core Language Features:
- comprehensive syntax
- static type system
- custom functions and variables
Core Functions
Frontends
It should be able to render to different frontends, such as: OS-native widgets, Web, LaTeX, and plain text.
SYNTAX:
SYMBOL ::= [a-zA-Z]+
NUMBER ::= [1-9][0-9]*
Program ::= (ConstDef | MappingDef | StmtExpr)*
ConstDef ::= SYMBOL ':=' StmtExpr
MappingDef ::= SYMBOL ':' MappingParamList '->' Expr
MappingParamList ::= SYMBOL | '(' SYMBOL (',' SYMBOL)* ')'
Expr ::= StmtExpr
StmtExpr ::= IfStmt | CaseStmt | CompoundStmt | ArithExpr
IfStmt ::= 'if' RelExpr 'then' Expr 'else' Expr
CaseStmt ::= 'case' Expr ('when' Expr 'then' Expr)* ['else' Expr]
CaseStmt ::= CaseWhenClause CaseWhenClause* CaseElseClause
CaseWhenClause ::= 'when' Expr 'then' Expr
CaseElseClause ::= 'else' Expr
CompoundStmt ::= '{' (Expr (LF | ';'))* Expr '}'
SolveExpr ::= `solve' equExpr 'for' variableExpr
SumExpr ::= 'sum' ['over'] Expr 'for' SYMBOL '=' Expr 'to' Expr
ProductExpr ::= 'product' ['over'] Expr 'for' SYMBOL '=' Expr 'to' Expr
ArithExpr ::= RelExpr
RelExpr ::= AddExpr (REL_OP AddExpr)*
REL_OP ::= '=' | '!=' | '<' | '>' | '<=' | '>='
AddExpr ::= MulExpr ( SumExpr
| (('+' | '-') MulExpr)+ )?
MulExpr ::= PowExpr ( ProductExpr
| (('*' | '/') PowExpr)+ )?
PowExpr ::= FacExpr ('^' FacExpr)*
FacExpr ::= PrimaryExpr ['!']
PrimaryExpr ::= NUMBER
| '(' Expr ')'
| Variable
| Function '(' Params? ')'
Params ::= Expr (',' Expr)*
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
