https://github.com/thaliaarchi/xmlang
A functional programming language with XML syntax
https://github.com/thaliaarchi/xmlang
functional-programming programming-language
Last synced: 2 months ago
JSON representation
A functional programming language with XML syntax
- Host: GitHub
- URL: https://github.com/thaliaarchi/xmlang
- Owner: thaliaarchi
- Created: 2018-06-09T18:02:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-25T01:37:57.000Z (almost 7 years ago)
- Last Synced: 2025-01-25T10:08:37.788Z (4 months ago)
- Topics: functional-programming, programming-language
- Language: JavaScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XMLang
XMLang is a functional language with XML syntax.
# Operators
## Assignment
| Op | JS | Description |
|--------|------------|---------------------|
| `func` | `function` | Function |## Arithmetic
**Binary operators:**
| Op | JS | Description |
|--------|------|----------------|
| `add` | `+` | Addition |
| `sub` | `-` | Subtraction |
| `mul` | `*` | Multiplication |
| `div` | `/` | Division |
| `mod` | `%` | Modulo |
| `expt` | `**` | Exponentiation |
| `root` | | Root |**Unary operators:**
| Op | JS | Description |
|--------|-------------|----------------|
| `num` | `+` | Cast to number |
| `neg` | `-` | Negation |
| `abs` | `Math.abs` | Absolute value |
| `sin` | `Math.sin` | Sine |
| `cos` | `Math.cos` | Cosine |
| `tan` | `Math.tan` | Tangent |
| `asin` | `Math.asin` | Arc sine |
| `acos` | `Math.acos` | Arc cosine |
| `atan` | `Math.atan` | Arc tangent |## Comparison
| Op | JS | Description |
|-------|------|-----------------------|
| `eq` | `==` | Equal |
| `neq` | `!=` | Not equal |
| `gt` | `>` | Greater than |
| `lt` | `<` | Less than |
| `gte` | `>=` | Greater than or equal |
| `lte` | `<=` | Less than or equal |## Logical
| Op | JS | Description |
|-------|------|-------------|
| `not` | `!` | Logical not |
| `and` | `&&` | Logical and |
| `or` | `||` | Logical or |## Conditional
| Op | JS | Description |
|--------|----------|--------------|
| `if` | `? :` | If statement |
| `cond` | `switch` | Conditional |
| `case` | `case` | Case |## Comma
,
comma operator## Bitwise
| Op | JS | Description |
|--------|------|--------------|
| `band` | `&` | Bitwise and |
| `bor` | `|` | Bitwise or |
| `xor` | `^` | Exclusive or |
| `comp` | `~` | Complement |
| `lsh` | `<<` | Left shift |
| `rsh` | `>>` | Right shift |# Data Types
List, map, set
Each, map
# Utilities
| Func | JS | Description |
|---------|---------------|-------------|
| `print` | `console.log` | Print |# Credit
Credit to [Robert Prehn's article at Revelry](https://revelry.co/using-jsx-with-other-frameworks-than-react/) for the idea of this language.