Add other sites

This commit is contained in:
2025-10-04 23:35:31 +02:00
parent da49e9f340
commit 659084d544
27 changed files with 5871 additions and 9 deletions

View File

@@ -8,6 +8,9 @@ indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
[*.json]
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
indent_style = space

1
.gitattributes vendored
View File

@@ -1,2 +1,3 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.webm filter=lfs diff=lfs merge=lfs -text
*.woff2 filter=lfs diff=lfs merge=lfs -text

BIN
bun.lockb

Binary file not shown.

View File

@@ -2,9 +2,10 @@
"name": "renati.me",
"type": "module",
"scripts": {
"build": "tailwindcss -i tailwind.css -o src/css/style.css",
"watch": "tailwindcss -i tailwind.css -o src/css/style.css --watch"
},
"devDependencies": {
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.18"
}
}

829
pnpm-lock.yaml generated Normal file
View File

@@ -0,0 +1,829 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
tailwindcss:
specifier: ^3.4.18
version: 3.4.18
packages:
'@alloc/quick-lru@5.2.0':
resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
engines: {node: '>=10'}
'@isaacs/cliui@8.0.2':
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
'@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
'@jridgewell/resolve-uri@3.1.2':
resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
engines: {node: '>=6.0.0'}
'@jridgewell/sourcemap-codec@1.5.5':
resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
'@jridgewell/trace-mapping@0.3.31':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
'@nodelib/fs.stat@2.0.5':
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
engines: {node: '>= 8'}
'@nodelib/fs.walk@1.2.8':
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
'@pkgjs/parseargs@0.11.0':
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
ansi-regex@6.2.2:
resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==}
engines: {node: '>=12'}
ansi-styles@4.3.0:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
engines: {node: '>=8'}
ansi-styles@6.2.3:
resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==}
engines: {node: '>=12'}
any-promise@1.3.0:
resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
arg@5.0.2:
resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
binary-extensions@2.3.0:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
brace-expansion@2.0.2:
resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
camelcase-css@2.0.1:
resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
engines: {node: '>= 6'}
chokidar@3.6.0:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
cross-spawn@7.0.6:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
cssesc@3.0.0:
resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
engines: {node: '>=4'}
hasBin: true
didyoumean@1.2.2:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
eastasianwidth@0.2.0:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
emoji-regex@9.2.2:
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
fast-glob@3.3.3:
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
engines: {node: '>=8.6.0'}
fastq@1.19.1:
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
foreground-child@3.3.1:
resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
engines: {node: '>=14'}
fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
function-bind@1.1.2:
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
glob-parent@6.0.2:
resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
engines: {node: '>=10.13.0'}
glob@10.4.5:
resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
hasBin: true
hasown@2.0.2:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
is-binary-path@2.1.0:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
is-core-module@2.16.1:
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
engines: {node: '>= 0.4'}
is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
is-fullwidth-code-point@3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
jackspeak@3.4.3:
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
jiti@1.21.7:
resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==}
hasBin: true
lilconfig@3.1.3:
resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}
engines: {node: '>=14'}
lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
lru-cache@10.4.3:
resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
micromatch@4.0.8:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
minimatch@9.0.5:
resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
engines: {node: '>=16 || 14 >=14.17'}
minipass@7.1.2:
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
engines: {node: '>=16 || 14 >=14.17'}
mz@2.7.0:
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
nanoid@3.3.11:
resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
normalize-path@3.0.0:
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
engines: {node: '>=0.10.0'}
object-assign@4.1.1:
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
engines: {node: '>=0.10.0'}
object-hash@3.0.0:
resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==}
engines: {node: '>= 6'}
package-json-from-dist@1.0.1:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
path-scurry@1.11.1:
resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
engines: {node: '>=16 || 14 >=14.18'}
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
pify@2.3.0:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
pirates@4.0.7:
resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}
engines: {node: '>= 6'}
postcss-import@15.1.0:
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
engines: {node: '>=14.0.0'}
peerDependencies:
postcss: ^8.0.0
postcss-js@4.1.0:
resolution: {integrity: sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==}
engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.4.21
postcss-load-config@6.0.1:
resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==}
engines: {node: '>= 18'}
peerDependencies:
jiti: '>=1.21.0'
postcss: '>=8.0.9'
tsx: ^4.8.1
yaml: ^2.4.2
peerDependenciesMeta:
jiti:
optional: true
postcss:
optional: true
tsx:
optional: true
yaml:
optional: true
postcss-nested@6.2.0:
resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==}
engines: {node: '>=12.0'}
peerDependencies:
postcss: ^8.2.14
postcss-selector-parser@6.1.2:
resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}
engines: {node: '>=4'}
postcss-value-parser@4.2.0:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
postcss@8.5.6:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
read-cache@1.0.0:
resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==}
readdirp@3.6.0:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
resolve@1.22.10:
resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==}
engines: {node: '>= 0.4'}
hasBin: true
reusify@1.1.0:
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
shebang-regex@3.0.0:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
signal-exit@4.1.0:
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
engines: {node: '>=14'}
source-map-js@1.2.1:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
engines: {node: '>=0.10.0'}
string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
string-width@5.1.2:
resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
engines: {node: '>=12'}
strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
strip-ansi@7.1.2:
resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==}
engines: {node: '>=12'}
sucrase@3.35.0:
resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
supports-preserve-symlinks-flag@1.0.0:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
tailwindcss@3.4.18:
resolution: {integrity: sha512-6A2rnmW5xZMdw11LYjhcI5846rt9pbLSabY5XPxo+XWdxwZaFEn47Go4NzFiHu9sNNmr/kXivP1vStfvMaK1GQ==}
engines: {node: '>=14.0.0'}
hasBin: true
thenify-all@1.6.0:
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
engines: {node: '>=0.8'}
thenify@3.3.1:
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
hasBin: true
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
wrap-ansi@8.1.0:
resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
engines: {node: '>=12'}
snapshots:
'@alloc/quick-lru@5.2.0': {}
'@isaacs/cliui@8.0.2':
dependencies:
string-width: 5.1.2
string-width-cjs: string-width@4.2.3
strip-ansi: 7.1.2
strip-ansi-cjs: strip-ansi@6.0.1
wrap-ansi: 8.1.0
wrap-ansi-cjs: wrap-ansi@7.0.0
'@jridgewell/gen-mapping@0.3.13':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
'@jridgewell/trace-mapping': 0.3.31
'@jridgewell/resolve-uri@3.1.2': {}
'@jridgewell/sourcemap-codec@1.5.5': {}
'@jridgewell/trace-mapping@0.3.31':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5
'@nodelib/fs.scandir@2.1.5':
dependencies:
'@nodelib/fs.stat': 2.0.5
run-parallel: 1.2.0
'@nodelib/fs.stat@2.0.5': {}
'@nodelib/fs.walk@1.2.8':
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.19.1
'@pkgjs/parseargs@0.11.0':
optional: true
ansi-regex@5.0.1: {}
ansi-regex@6.2.2: {}
ansi-styles@4.3.0:
dependencies:
color-convert: 2.0.1
ansi-styles@6.2.3: {}
any-promise@1.3.0: {}
anymatch@3.1.3:
dependencies:
normalize-path: 3.0.0
picomatch: 2.3.1
arg@5.0.2: {}
balanced-match@1.0.2: {}
binary-extensions@2.3.0: {}
brace-expansion@2.0.2:
dependencies:
balanced-match: 1.0.2
braces@3.0.3:
dependencies:
fill-range: 7.1.1
camelcase-css@2.0.1: {}
chokidar@3.6.0:
dependencies:
anymatch: 3.1.3
braces: 3.0.3
glob-parent: 5.1.2
is-binary-path: 2.1.0
is-glob: 4.0.3
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.3
color-convert@2.0.1:
dependencies:
color-name: 1.1.4
color-name@1.1.4: {}
commander@4.1.1: {}
cross-spawn@7.0.6:
dependencies:
path-key: 3.1.1
shebang-command: 2.0.0
which: 2.0.2
cssesc@3.0.0: {}
didyoumean@1.2.2: {}
dlv@1.1.3: {}
eastasianwidth@0.2.0: {}
emoji-regex@8.0.0: {}
emoji-regex@9.2.2: {}
fast-glob@3.3.3:
dependencies:
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.8
fastq@1.19.1:
dependencies:
reusify: 1.1.0
fill-range@7.1.1:
dependencies:
to-regex-range: 5.0.1
foreground-child@3.3.1:
dependencies:
cross-spawn: 7.0.6
signal-exit: 4.1.0
fsevents@2.3.3:
optional: true
function-bind@1.1.2: {}
glob-parent@5.1.2:
dependencies:
is-glob: 4.0.3
glob-parent@6.0.2:
dependencies:
is-glob: 4.0.3
glob@10.4.5:
dependencies:
foreground-child: 3.3.1
jackspeak: 3.4.3
minimatch: 9.0.5
minipass: 7.1.2
package-json-from-dist: 1.0.1
path-scurry: 1.11.1
hasown@2.0.2:
dependencies:
function-bind: 1.1.2
is-binary-path@2.1.0:
dependencies:
binary-extensions: 2.3.0
is-core-module@2.16.1:
dependencies:
hasown: 2.0.2
is-extglob@2.1.1: {}
is-fullwidth-code-point@3.0.0: {}
is-glob@4.0.3:
dependencies:
is-extglob: 2.1.1
is-number@7.0.0: {}
isexe@2.0.0: {}
jackspeak@3.4.3:
dependencies:
'@isaacs/cliui': 8.0.2
optionalDependencies:
'@pkgjs/parseargs': 0.11.0
jiti@1.21.7: {}
lilconfig@3.1.3: {}
lines-and-columns@1.2.4: {}
lru-cache@10.4.3: {}
merge2@1.4.1: {}
micromatch@4.0.8:
dependencies:
braces: 3.0.3
picomatch: 2.3.1
minimatch@9.0.5:
dependencies:
brace-expansion: 2.0.2
minipass@7.1.2: {}
mz@2.7.0:
dependencies:
any-promise: 1.3.0
object-assign: 4.1.1
thenify-all: 1.6.0
nanoid@3.3.11: {}
normalize-path@3.0.0: {}
object-assign@4.1.1: {}
object-hash@3.0.0: {}
package-json-from-dist@1.0.1: {}
path-key@3.1.1: {}
path-parse@1.0.7: {}
path-scurry@1.11.1:
dependencies:
lru-cache: 10.4.3
minipass: 7.1.2
picocolors@1.1.1: {}
picomatch@2.3.1: {}
pify@2.3.0: {}
pirates@4.0.7: {}
postcss-import@15.1.0(postcss@8.5.6):
dependencies:
postcss: 8.5.6
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.10
postcss-js@4.1.0(postcss@8.5.6):
dependencies:
camelcase-css: 2.0.1
postcss: 8.5.6
postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.6):
dependencies:
lilconfig: 3.1.3
optionalDependencies:
jiti: 1.21.7
postcss: 8.5.6
postcss-nested@6.2.0(postcss@8.5.6):
dependencies:
postcss: 8.5.6
postcss-selector-parser: 6.1.2
postcss-selector-parser@6.1.2:
dependencies:
cssesc: 3.0.0
util-deprecate: 1.0.2
postcss-value-parser@4.2.0: {}
postcss@8.5.6:
dependencies:
nanoid: 3.3.11
picocolors: 1.1.1
source-map-js: 1.2.1
queue-microtask@1.2.3: {}
read-cache@1.0.0:
dependencies:
pify: 2.3.0
readdirp@3.6.0:
dependencies:
picomatch: 2.3.1
resolve@1.22.10:
dependencies:
is-core-module: 2.16.1
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
reusify@1.1.0: {}
run-parallel@1.2.0:
dependencies:
queue-microtask: 1.2.3
shebang-command@2.0.0:
dependencies:
shebang-regex: 3.0.0
shebang-regex@3.0.0: {}
signal-exit@4.1.0: {}
source-map-js@1.2.1: {}
string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
string-width@5.1.2:
dependencies:
eastasianwidth: 0.2.0
emoji-regex: 9.2.2
strip-ansi: 7.1.2
strip-ansi@6.0.1:
dependencies:
ansi-regex: 5.0.1
strip-ansi@7.1.2:
dependencies:
ansi-regex: 6.2.2
sucrase@3.35.0:
dependencies:
'@jridgewell/gen-mapping': 0.3.13
commander: 4.1.1
glob: 10.4.5
lines-and-columns: 1.2.4
mz: 2.7.0
pirates: 4.0.7
ts-interface-checker: 0.1.13
supports-preserve-symlinks-flag@1.0.0: {}
tailwindcss@3.4.18:
dependencies:
'@alloc/quick-lru': 5.2.0
arg: 5.0.2
chokidar: 3.6.0
didyoumean: 1.2.2
dlv: 1.1.3
fast-glob: 3.3.3
glob-parent: 6.0.2
is-glob: 4.0.3
jiti: 1.21.7
lilconfig: 3.1.3
micromatch: 4.0.8
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.1.1
postcss: 8.5.6
postcss-import: 15.1.0(postcss@8.5.6)
postcss-js: 4.1.0(postcss@8.5.6)
postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)
postcss-nested: 6.2.0(postcss@8.5.6)
postcss-selector-parser: 6.1.2
resolve: 1.22.10
sucrase: 3.35.0
transitivePeerDependencies:
- tsx
- yaml
thenify-all@1.6.0:
dependencies:
thenify: 3.3.1
thenify@3.3.1:
dependencies:
any-promise: 1.3.0
to-regex-range@5.0.1:
dependencies:
is-number: 7.0.0
ts-interface-checker@0.1.13: {}
util-deprecate@1.0.2: {}
which@2.0.2:
dependencies:
isexe: 2.0.0
wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi@8.1.0:
dependencies:
ansi-styles: 6.2.3
string-width: 5.1.2
strip-ansi: 7.1.2

View File

@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2>Conditionals</h2>
<p>Conditionals are extensions to statements that by their nature do not contain a condition. You can make a conditional by inserting the following syntax right before a semicolon:</p>
<pre><span class="kw">if</span> CONDITION</pre>
<p>Conditionals serve as a shorthand for branches with only one statement and no else block.</p>
<p>Examples:</p>
<pre><span class="reg">rax</span> = <span class="num">0</num> <span class="kw">if</span> <span class="reg">rcx</span> &gt; <span class="num">5</span>;</span>
<span class="reg">rax</span> += <span class="reg">rcx</span> <span class="kw">if</span> <span class="reg">rsi</span> &lt;= <span class="num">-1</span>;
<span class="kw">continue</span> <span class="kw">if</span> <span class="num">0</span> != <span class="reg">r15</span>;</pre>
<p>Fun fact: the original intention behind conditionals is to have a syntax for conditional move intructions (cmov). Eventually I came to the conclusion that this syntax might as well be applicable to almost every statement, not just assignment. Conditional moves aren't implemented though, so when you use a conditional on an assignment, the compiler will just emit a conditional jump instruction.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,40 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2>Conditions</h2>
<p>Conditions are used in branch and looop statements and inside <a href="conditionals.html">conditionals</a>. Conditions look like so:</p>
<pre>SOURCE COMPARISON SOURCE</pre>
<p>Where <em>COMPARISON</em> is one of the following comparison operators:</p>
<ul>
<li>&lt;</li>
<li>&lt;=</li>
<li>&gt;</li>
<li>&gt;=</li>
<li>==</li>
<li>!=</li>
</ul>
<p>Examples:</p>
<pre><span class="reg">rax</span> == <span class="num">0</span>
<span class="reg">rbx</span> &lt;= <span class="reg">rcx</span>
-<span class="num">10</span> > <span class="reg">r8</span></pre>
<p>The compiler doesn't support conditions which have immediates on both sides (but why would you want that, anyway?).</p>
</main>
</body>
</html>

80
src/asmscript/index.html Normal file
View File

@@ -0,0 +1,80 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2>Overview</h2>
<p>asmscript (aka asms) is a JIT-compiled programming language made in 48h for the third langjam hosted at <a href="https://github.com/langjam/jam0003">langjam/jam0003</a> on GitHub. The theme was <em>Beautiful Assembly</em>.</p>
<p>This is a low-level language, which attempts to make x86_64 assembly look more structured and easier to read. The scope of this language is very limited because of the time constraints, but it is capable of doing some basic computations.</p>
<p>The source for this project is hosted on <a href="https://github.com/iszn11/asmscript">GitHub</a>.</p>
<h2>Features</h2>
<ul>
<li>Support for 15 general purpose <a href="operands.html#registers">registers</a> (all except rsp), only in 64-bit form.</li>
<li>Operations on 64-bit signed integers: addition, subtraction, multiplication, division, modulo, bitwise and, or, xor.</li>
<li>Support for 64-bit signed integer literals, even when x86_64 instruction don't accept 64-bit immediate values directly.</li>
<li><a href="statements.html#branch">Branches</a> resembling if/else statements from higher level languages.</li>
<li><a href="statements.html#loop">Loops</a> resembling while loops from higher level languages.</li>
<li>Control flow statements: <a href="statements.html#continue-break-return">continue, break and return</a>.</li>
<li>Bare-bones <a href="procedures.html#procedures">procedure</a> support (leaves calling convention up to you).</li>
<li>Indirect stack control through <a href="statements.html#push-pop">push and pop</a> statements.</li>
<li><a href="statements.html#stdout">Print</a> formatted numbers and string constants to stdout.</li>
</ul>
<h2>Examples</h2>
<p>Print integers from 1 to 100.</p>
<pre><span class="comm">// A procedure named "main", which is the entry point</span>
<span class="kw">proc</span> <span class="fn">main</span> {
<span class="reg">rax</span> = <span class="num">1</span>;
<span class="kw">loop</span> (<span class="reg">rax</span> &lt;= <span class="num">100</span>) {
&lt;&lt; <span class="reg">rax</span>; <span class="comm">// Print value in rax to stdout</span>
&lt;&lt; <span class="str">"\n"</span>; <span class="comm">// Print newline to stdout</span>
<span class="reg">rax</span> += <span class="num">1</span>;
}
}</pre>
<p>Print prime numbers between 2 and 100.</p>
<pre><span class="comm">// This procedure will print the rax register if it contains a prime</span>
<span class="kw">proc</span> <span class="fn">prime_test</span> {
<span class="reg">rbx</span> = <span class="num">2</span>; <span class="comm">// Our divisor</span>
<span class="kw">loop</span> { <span class="comm">// Loop without a condition is an infinite loop</span>
<span class="comm">// We only need to test divisors in range [2, sqrt(rax)]</span>
<span class="comm">// Loop until rbx * rbx &lt;= rax</span>
<span class="reg">r8</span> = <span class="reg">rbx</span>;
<span class="reg">r8</span> *= <span class="reg">rbx</span>;
<span class="kw">break</span> <span class="kw">if</span> <span class="reg">r8</span> > <span class="reg">rax</span>; <span class="comm">// Is prime, break and print the value</span>
<span class="reg">rdx</span> = <span class="reg">rax</span>;
<span class="reg">rdx</span> %= <span class="reg">rbx</span>;
<span class="kw">return</span> <span class="kw">if</span> <span class="reg">rdx</span> == <span class="num">0</span>; <span class="comm">// Not prime, return without printing</span>
<span class="reg">rbx</span> += <span class="num">1</span>;
}
&lt;&lt; <span class="reg">rax</span>;
&lt;&lt; <span class="str">"\n"</span>;
}
<span class="kw">proc</span> <span class="fn">main</span> {
<span class="reg">rax</span> = <span class="num">2</span>;
<span class="kw">loop</span> (<span class="reg">rax</span> &lt;= <span class="num">100</span>) {
<span class="fn">prime_test</span>; <span class="comm">// Call the "prime_test" procedure</span>
<span class="reg">rax</span> += <span class="num">1</span>;
}
}</pre>
</main>
</body>
</html>

View File

@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2>Operands</h2>
<p>asmscript supports two types of operands: registers and immediates (aka literals).</p>
<h2 id="registers">Registers</h2>
<p>You can freely use 15 general purpose registers by refering to their names:</p>
<ul>
<li>rax</li>
<li>rbx</li>
<li>rcx</li>
<li>rdx</li>
<li>rsi</li>
<li>rdi</li>
<li>rbp</li>
<li>r8</li>
<li>r9</li>
<li>r10</li>
<li>r11</li>
<li>r12</li>
<li>r13</li>
<li>r14</li>
<li>r15</li>
</ul>
<p>Note that rsp (the stack pointer) is not available. However, you have access to <a href="statements.html#push-pop">push and pop</a> statements, which do interact with rsp. All registers are assumed to hold a 64-bit signed integer. There is no support for any other registers nor for more narrow versions (e.g. eax, ax, al) of general purpose registers.</p>
<h2>Immediates</h2>
<p>You can use a 64-bit signed integer literal as an operand. Only decimal literals are supported.</p>
<h2>Destination and source operands</h2>
<p>Statements can make use of two types of operands: destination operands and source operands. Source operands are read-only, while destination operands can be written to.</p>
<p>You can only use a register as a destination operand.</p>
<p>You can use either a register or an immediate as a source operand.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2 id="procedures">Procedures</h2>
<p>There is only one construct that can exist at the top-level of an asms file - procedure declaration. A procedure has a unique name and contains a block of statements.</p>
<pre><span class="kw">proc</span> <span class="fn">NAME</span> {
STATEMENTS
}</pre>
<p>You don't specify arguments or return types for procedures. It is up to you to decide how you will pass arguments and return values. In other words, you are responsible for defining and following your own calling convention.</p>
<p>A procedure name cannot be a reserved keyword and has to satisfy this regular expression:<br>[_a-zA-Z][_a-zA-Z0-9]*<br>Procedure named "main" is special and is considered the entry point. You must have a procedure named "main" in your program.</p>
<p>You can call a procedure using a <a href="statements.html#call">call</a> statement, which will emit a "call" instruction. A "ret" instruction is placed at the end (and also at every return statement), so you don't have to use a return statement if you don't need to.</p>
<h2>Entry point</h2>
<p>main isn't actually the <em>true</em> entry point. Right before calling main, every register you have access to is pushed on the stack, and then popped after main returns. This ensures that you can use registers in your code as you wish without worrying about breaking the calling convention of the JIT compiler.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,92 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>asmscript (asms) documentation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1><a href="index.html">asmscript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="operands.html">Operands</a></li>
<li><a href="procedures.html">Procedures</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="conditionals.html">Conditionals</a></li>
</ul>
</nav>
<h2>Statements</h2>
<p>You might've heard of expression-oriended programming languages, in which every or nearly every statement is also an expression. asmscript is the exact opposite: everything is a statement and there aren't really any expressions.</p>
<h2>Assignment</h2>
<p>Assignment statement lets you assign a source operand to a destination operand.</p>
<pre><span class="reg">DEST</span> = SOURCE;</pre>
<p>Examples:</p>
<pre><span class="reg">rax</span> = <span class="reg">rbx</span>;
<span class="reg">rcx</span> = <span class="num">42</span>;
<span class="reg">rdx</span> = -<span class="num">100</span>;</pre>
<h2>Shorthand</h2>
<p>Shorthands (as in <em>shorthand assignment</em>) let you do calculations.</p>
<pre><span class="reg">DEST</span> += SOURCE;
<span class="reg">DEST</span> -= SOURCE;
<span class="reg">DEST</span> *= SOURCE;
<span class="reg">DEST</span> /= SOURCE;
<span class="reg">DEST</span> %= SOURCE;
<span class="reg">DEST</span> &= SOURCE;
<span class="reg">DEST</span> |= SOURCE;
<span class="reg">DEST</span> ^= SOURCE;</pre>
<p>These statements perform (from top to bottom): addition, subtraction, multiplication, division, modulo, bitwise and, bitwise or, bitwise xor. Numbers are assumed to be 64-bit signed integers.</p>
<h2 id="branch">Branch</h2>
<p>Branch takes a <a href="conditions.html">condition</a>, a block of statements and an optional else block.</p>
<pre><span class="kw">branch</span> (CONDITION) {
STATEMENTS
}
<span class="kw">branch</span> (CONDITION) {
STATEMENTS
} <span class="kw">else</span> {
STATEMENTS
}</pre>
<p>Note that braces are mandatory. Branch by its nature contains a condition, so it cannot be combined with a <a href="conditionals.html">conditional</a>.</p>
<h2 id="loop">Loop</h2>
<p>Loop takes an optional <a href="conditions.html">condition</a> and a block of statements. Loop without a condition is an infinite loop.</p>
<pre><span class="kw">loop</span> {
STATEMENTS
}
<span class="kw">loop</span> (CONDITION) {
STATEMENTS
}</pre>
<p>Note that braces are mandatory. Loop by its nature contains a condition, so it cannot be combined with a <a href="conditionals.html">conditional</a>.</p>
<h2 id="push-pop">Push and pop</h2>
<p>You can push and pop registers on the stack. Note that this instruction supports only registers.</p>
<pre><span class="kw">push</span> <span class="reg">REGISTER</span>;
<span class="kw">pop</span> <span class="reg">REGISTER</span>;</pre>
<h2 id="continue-break-return">Continue, break and return</h2>
<p>You can use continue and break from inside a loop and return from anywhere inside a procedure. There are no labeled breaks or continues.</p>
<pre><span class="kw">continue</span>;
<span class="kw">break</span>;
<span class="kw">return</span>;</pre>
<p>Note that return never takes any operands. You return values by setting registers appropriately according to your own calling convention.</p>
<h2 id="call">Call</h2>
<p>You call a procedure by just stating its name followed by a semicolon.<p>
<pre><span class="fn">NAME</span>;</pre>
<h2 id="stdout">stdout</h2>
<p>You can output operands and constant strings to stdout through a special statement.</p>
<pre>&lt;&lt; SOURCE;
&lt;&lt; STRING;</pre>
<p>This statement emits a call to a function implemented in the JIT compiler, which performs the actual printing. All registers are saved before the call and restored afterwards, such that the calling convention in the JIT compiler won't interfere with any values in your registers.</p>
<p>A string is a special token used only for this statement. The string is contained in double quotes and supports the following escape sequences:</p>
<ul>
<li>\\</li>
<li>\0</li>
<li>\r</li>
<li>\n</li>
<li>\r</li>
</ul>
<p>Note that when you output a string, the string is placed in memory right beside the instruction that prints that string and a jump instruction is emitted that jumps over the string literal. This can confuse disassemblers when you try to decode generated machine code.</p>
</main>
</body>
</html>

96
src/asmscript/style.css Normal file
View File

@@ -0,0 +1,96 @@
html, body {
margin: 0;
padding: 0;
}
body {
color: black;
background-color: white;
font-size: 20px;
font-family: 'Cascadia Mono', 'Fira Mono', Consolas, 'Courier New', 'Liberation Mono', monospace;
}
main {
margin: 0 auto;
max-width: 800px;
}
h1 {
margin: 16px 0;
font-size: 32px;
font-family: Arial, Helvetica, 'Liberation Sans', sans-serif;
}
h1 a:link, h1 a:active, h1 a:visited, h1 a:hover {
text-decoration: none;
}
a:link, a:active, a:visited {
color: inherit;
text-decoration: underline dotted;
}
h2 {
margin: 32px 0 8px;
font-size: 24px;
font-family: Arial, Helvetica, 'Liberation Sans', sans-serif;
}
p {
margin: 8px 0;
}
ul {
margin: 8px 0;
}
pre .kw {
color: #af00db;
}
pre .fn {
color: #795e26;
}
pre .num {
color: #098658;
}
pre .comm {
color: #008000;
}
pre .str {
color: #a31515;
}
@media (prefers-color-scheme: dark) {
body {
color: #d4d4d4;
background-color: #1E1E1E;
}
pre .kw {
color: #c586c0;
}
pre .fn {
color: #dcdcaa;
}
pre .num {
color: #b5cea8;
}
pre .comm {
color: #6a9955;
}
pre .str {
color: #ce9178;
}
pre .reg {
color: #9cdcfe;
}
}

View File

@@ -0,0 +1,14 @@
/* example/style.css */
html,
body {
margin: 0;
padding: 0;
}
html,
body,
canvas {
width: 100%;
height: 100%;
overflow: hidden;
}
/*# sourceMappingURL=bundle.css.map */

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["style.css"],
"sourcesContent": ["html, body {\n\tmargin: 0;\n\tpadding: 0;\n}\n\nhtml, body, canvas {\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n}\n"],
"mappings": ";AAAA;AAAM;AACL,UAAQ;AACR,WAAS;AACV;AAEA;AAAM;AAAM;AACX,SAAO;AACP,UAAQ;AACR,YAAU;AACX;",
"names": []
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>oktaeder example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bundle.css">
<script type="module" src="bundle.js"></script>
</head>
<body></body>
</html>

BIN
src/oktaeder/example/uvmap.png (Stored with Git LFS) Normal file

Binary file not shown.

23
src/oktaeder/index.html Normal file
View File

@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>oktaeder: 3D rendering library for WebGPU</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<h1>oktaeder</h1>
<p>3D rendering library for WebGPU</p>
<video autoplay disablepictureinpicture loop muted>
<source src="oktaeder.webm" type="video/webm">
</video>
<ul>
<li>oktaeder is <em>not</em> in active development.</li>
<li>You can find the repository at <a href="https://gitea.renati.me/renati/oktaeder">gitea.renati.me/renati/oktaeder</a>.</li>
<li>This is just a video. If your browser supports WebGPU, check out the <a href="example/">example</a>. Example script is in the repo at <a href="https://gitea.renati.me/renati/oktaeder/src/branch/main/example/script.ts">/example/script.ts</a></li>
</ul>
</main>
</body>
</html>

BIN
src/oktaeder/oktaeder.webm (Stored with Git LFS) Normal file

Binary file not shown.

51
src/oktaeder/style.css Normal file
View File

@@ -0,0 +1,51 @@
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');
html,
body {
margin: 0;
padding: 0;
}
body {
color: black;
background-color: white;
line-height: 150%;
font-size: 16px;
font-family: 'Fira Sans', sans-serif;
}
main {
margin: 0 auto;
max-width: 800px;
}
h1 {
margin: 16px 0;
font-size: 32px;
}
p {
margin: 8px 0;
}
video {
display: block;
width: 100%;
height: auto;
}
a:link, a:active, a:visited {
color: inherit;
text-decoration: underline dotted;
}
ul {
margin: 8px 0;
}
@media (prefers-color-scheme: dark) {
body {
color: white;
background-color: #1C1917;
}
}

View File

@@ -0,0 +1,237 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>RuntypeScript (rts) documentation</title>
<link rel="stylesheet" href="style_v2.css">
</head>
<body>
<main>
<h1><a href="index.html">RuntypeScript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="type-system.html">Type system</a></li>
<li><a href="global-constants.html">Global constants</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="expressions.html">Expressions</a></li>
</ul>
</nav>
<h2>Binary operators</h2>
<table>
<thead>
<tr>
<th>Operator</th>
<th>Applicable to</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>+</td>
<td>number literals</td>
<td>addition</td>
</tr>
<tr>
<td>+</td>
<td>string literals</td>
<td>concatenation</td>
</tr>
<tr>
<td>-</td>
<td>number literals</td>
<td>subtraction</td>
</tr>
<tr>
<td>*</td>
<td>number literals</td>
<td>multiplication</td>
</tr>
<tr>
<td>/</td>
<td>number literals</td>
<td>division</td>
</tr>
<tr>
<td>%</td>
<td>number literals</td>
<td>modulo</td>
</tr>
<tr>
<td>==</td>
<td>all types</td>
<td>type equality</td>
</tr>
<tr>
<td>!=</td>
<td>all types</td>
<td>type inequality</td>
</tr>
<tr>
<td>&gt;</td>
<td>number literals</td>
<td>comparison</td>
</tr>
<tr>
<td>&gt;=</td>
<td>number literals</td>
<td>comparison</td>
</tr>
<tr>
<td>&lt;</td>
<td>number literals</td>
<td>comparison</td>
</tr>
<tr>
<td>&lt;=</td>
<td>number literals</td>
<td>comparison</td>
</tr>
<tr>
<td>and</td>
<td>false or true</td>
<td>logical and</td>
</tr>
<tr>
<td>or</td>
<td>false or true</td>
<td>logical or</td>
</tr>
<tr>
<td>|</td>
<td>all types</td>
<td>type union</td>
</tr>
<tr>
<td>&amp;</td>
<td>all types</td>
<td>type intersection</td>
</tr>
<tr>
<td>extends</td>
<td>all types</td>
<td>type assignability</td>
</tr>
</tbody>
</table>
<h2>Unary operators</h2>
<table>
<thead>
<tr>
<th>Operator</th>
<th>Applicable to</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>-</td>
<td>number literals</td>
<td>negation</td>
</tr>
<tr>
<td>#</td>
<td>tuples</td>
<td>tuple length</td>
</tr>
<tr>
<td>~</td>
<td>all types</td>
<td>deliteralization</td>
</tr>
<tr>
<td>not</td>
<td>false or true</td>
<td>logical not</td>
</tr>
<tr>
<td>decltype</td>
<td>identifiers</td>
<td>declared type</td>
</tr>
</tbody>
</table>
<h2>Operator priority</h2>
<table>
<thead>
<tr>
<th>Priority</th>
<th>Operators</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>or</td>
</tr>
<tr>
<td>1</td>
<td>and</td>
</tr>
<tr>
<td>2</td>
<td>&lt; &gt; &lt;= &gt;= == != extends</td>
</tr>
<tr>
<td>3</td>
<td>|</td>
</tr>
<tr>
<td>4</td>
<td>&amp;</td>
</tr>
<tr>
<td>5</td>
<td>+ - (binary)</td>
</tr>
<tr>
<td>6</td>
<td>* / %</td>
</tr>
<tr>
<td>7</td>
<td>- (unary) not # ~ decltype</td>
</tr>
</tbody>
</table>
<h2>Identifier</h2>
<p>An identifier starts with a letter (as defined by Unicode <em>Letter</em> category) or underscore optionally followed by a sequence of letters, numbers (as defined by Unicode <em>Letter</em>, <em>Decimal Number</em> and <em>Letter Number</em> categories) and underscores, and is not one of the reserved keywords:</p>
<ul>
<li>and</li>
<li>break</li>
<li>const</li>
<li>continue</li>
<li>decltype</li>
<li>elif</li>
<li>else</li>
<li>extends</li>
<li>fn</li>
<li>if</li>
<li>not</li>
<li>or</li>
<li>return</li>
<li>sig</li>
<li>var</li>
<li>while</li>
</ul>
<p>Keep in mind that there are also predefined global constants, and that shadowing is forbidden.</p>
<h2>Function call</h2>
<p>Function is called with a set of round brackets. Arguments are seperated by a comma. Leading comma is permitted.</p>
<p>Argument count has to match exactly or a runtime error will occur.</p>
<pre><span class="decl">const</span> <span class="fn">add</span> = <span class="decl">fn</span> (<span class="var">a</span>: <span class="const">number</span>, <span class="var">b</span>: <span class="const">number</span>) <span class="const">number</span> { <span class="kw">return</span> <span class="var">a</span> + <span class="var">b</span>; };
<span class="fn">println</span>(<span class="fn">add</span>(<span class="num">1</span>, <span class="num">2</span>));
<span class="fn">println</span>(<span class="fn">add</span>(<span class="num">1</span>, <span class="num">2</span>, <span class="num">3</span>)); <span class="comm">// wrong</span>
<span class="fn">println</span>(<span class="fn">add</span>(<span class="num">1</span>, <span class="str">"foo"</span>)); <span class="comm">// also wrong</span></pre>
<h2>Indexing</h2>
<p>Indexing is performed with a set of square brackets. You can index tuples with number literals or objects with string literals.</p>
<pre><span class="decl">const</span> <span class="const">array</span>: <span class="const">number</span>[] = [];
<span class="const">array</span>[<span class="num">0</span>] = <span class="num">1</span>;
<span class="decl">const</span> <span class="const">object</span>: <span class="const">any</span> = {};
<span class="const">object</span>[<span class="str">"foo"</span>] = <span class="str">"bar"</span>;</pre>
<p>Note that there is no shorthand notation (i.e. dot notation) for accessing object properties.</p>
<h2>Literals</h2>
<p>Check the documentation about type system to learn about literals.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,41 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>RuntypeScript (rts) documentation</title>
<link rel="stylesheet" href="style_v2.css">
</head>
<body>
<main>
<h1><a href="index.html">RuntypeScript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="type-system.html">Type system</a></li>
<li><a href="global-constants.html">Global constants</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="expressions.html">Expressions</a></li>
</ul>
</nav>
<h2>Global constants</h2>
<p>Global constants are implicitly defined constant variables at the top-level scope.</p>
<pre><span class="decl">const</span> <span class="const">nil</span>: <span class="const">nil</span> <span class="comm"> // the nil type</span>
<span class="decl">const</span> <span class="const">false</span>: <span class="const">false</span> <span class="comm"> // the false type</span>
<span class="decl">const</span> <span class="const">true</span>: <span class="const">true</span> <span class="comm"> // the true type</span>
<span class="decl">const</span> <span class="const">boolean</span>: <span class="const">boolean</span> <span class="comm"> // the boolean type</span>
<span class="decl">const</span> <span class="const">string</span>: <span class="const">string</span> <span class="comm"> // the string type</span>
<span class="decl">const</span> <span class="const">number</span>: <span class="const">number</span> <span class="comm"> // the number type</span>
<span class="decl">const</span> <span class="const">any</span>: <span class="const">any</span> <span class="comm"> // the any type</span>
<span class="decl">const</span> <span class="const">nan</span>: <span class="const">number</span> <span class="comm"> // not a number</span>
<span class="decl">const</span> <span class="const">inf</span>: <span class="const">number</span> <span class="comm"> // positive infinity</span>
<span class="decl">const</span> <span class="const">pi</span>: <span class="const">number</span> <span class="comm"> // pi constant</span>
<span class="decl">const</span> <span class="const">tau</span>: <span class="const">number</span> <span class="comm"> // tau constant (2 * pi)</span>
<span class="decl">const</span> <span class="const">e</span>: <span class="const">number</span> <span class="comm"> // Euler's number</span>
<span class="decl">const</span> <span class="const">print</span>: <span class="decl">sig</span> (<span class="const">any</span>) <span class="const">nil</span> <span class="comm"> // prints to stdout</span>
<span class="decl">const</span> <span class="const">println</span>: <span class="decl">sig</span> (<span class="const">any</span>) <span class="const">nil</span> <span class="comm"> // prints to stdout and appends a line feed</span>
<span class="decl">const</span> <span class="const">to_string</span>: <span class="decl">sig</span> (<span class="const">any</span>) <span class="const">string</span> <span class="comm">// converts every type to string</span>
<span class="decl">const</span> <span class="const">sqrt</span>: <span class="decl">sig</span> (<span class="const">number</span>) <span class="const">number</span> <span class="comm"> // square root</span>
<span class="decl">const</span> <span class="const">panic</span>: <span class="decl">sig</span> (<span class="const">string</span>) <span class="const">nil</span> <span class="comm"> // terminates the program with a runtime error</span></pre>
</main>
</body>
</html>

View File

@@ -0,0 +1,26 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>RuntypeScript (rts) documentation</title>
<link rel="stylesheet" href="style_v2.css">
</head>
<body>
<main>
<h1><a href="index.html">RuntypeScript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="type-system.html">Type system</a></li>
<li><a href="global-constants.html">Global constants</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="expressions.html">Expressions</a></li>
</ul>
</nav>
<h2>Overview</h2>
<p>RuntypeScript (aka rts) is a scripting language made in 48h for the fourth langjam hosted at <a href="https://github.com/langjam/jam0004">langjam/jam0004</a>. The theme was <em>The sound(ness) of one hand typing</em>.</p>
<p>The language is heavily inspired by TypeScript's type system, so being familiar with it will make it easier to understand this language.</p>
<p>The source for this project is hosted on <a href="https://github.com/iszn11/runtypescript">GitHub</a>.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,94 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>RuntypeScript (rts) documentation</title>
<link rel="stylesheet" href="style_v2.css">
</head>
<body>
<main>
<h1><a href="index.html">RuntypeScript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="type-system.html">Type system</a></li>
<li><a href="global-constants.html">Global constants</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="expressions.html">Expressions</a></li>
</ul>
</nav>
<h2>Comments</h2>
<pre><span class="comm">// Only single line comments</span></pre>
<h2>Declarations</h2>
<pre><span class="decl">var</span> <span class="var">x</span> = <span class="const">y</span>;
<span class="decl">var</span> <span class="var">x</span>: <span class="const">T</span> = <span class="const">y</span>;
<span class="decl">const</span> <span class="const">x</span> = <span class="const">y</span>;
<span class="decl">const</span> <span class="const">x</span>: <span class="const">T</span> = <span class="const">y</span>;</pre>
<p>Declaration with no declared type:</p>
<pre><span class="decl">const</span> <span class="const">x</span> = <span class="const">y</span>;</pre>
<p>is a shorthand for:</p>
<pre><span class="decl">const</span> <span class="const">x</span>: ~<span class="const">y</span> = <span class="const">y</span>;</pre>
<p>except that y is evaluated only once.</p>
<p>Declaration cannot shadow other variables.</p>
<h2>Assignment</h2>
<p>Left-hand side of an assignment can only consist of an identifier followed by an optional chain of indexing expressions. Indexes themselves can be arbitrary expressions.</p>
<p>An assignment results in a runtime error if a variable after assignment (including mutation) is not assignable to its declared type.</p>
<pre><span class="decl">const</span> <span class="const">x</span>: { <span class="var">prop</span>: <span class="const">string</span> } = { <span class="var">prop</span>: <span class="str">"foo"</span> };
<span class="comm">// allowed</span>
<span class="const">x</span>[<span class="str">"prop"</span>] = <span class="str">"bar"</span>;
<span class="comm">// not allowed, { prop: 1 } not assignable to { prop: string }</span>
<span class="const">x</span>[<span class="str">"prop"</span>] = <span class="num">1</span>;</pre>
<p>You can also use the following assignment shorthands:</p>
<ul>
<li>+=</li>
<li>-=</li>
<li>*=</li>
<li>/=</li>
<li>%=</li>
<li>|=</li>
<li>&=</li>
</ul>
<h2>If, elif, else</h2>
<pre><span class="kw">if</span> (CONDITION) {
<span class="comm">// (...)</span>
} <span class="kw">elif</span> (CONDITION) {
<span class="comm">// (...)</span>
} <span class="kw">else</span> {
<span class="comm">// (...)</span>
}</pre>
<p>Braces are always required.</p>
<h2>While</h2>
<pre><span class="kw">while</span> (CONDITION) {
<span class="comm">// (...)</span>
}</pre>
<p>Braces are always required.</p>
<p>You can use break and continue statements inside a while loop.</p>
<h2>Return</h2>
<pre><span class="kw">return</span> EXPRESSION;
<span class="kw">return</span>; <span class="comm">// shorthand for return nil;</span></pre>
</main>
</body>
</html>
<!--
if-else chain
parens and braces required
while loop
while (cond) {
}
OTHER
return; (equivalent to return nil; or when function ends)
return x;
continue;
break;
expression;
-->

View File

@@ -0,0 +1,145 @@
html, body {
margin: 0;
padding: 0;
}
body {
color: black;
background-color: white;
font-size: 20px;
font-family: 'Cascadia Mono', 'Fira Mono', Consolas, 'Courier New', 'Liberation Mono', monospace;
line-height: 1.35;
}
main {
margin: 0 auto;
max-width: 800px;
}
h1 {
margin: 16px 0;
font-size: 32px;
font-family: Arial, Helvetica, 'Liberation Sans', sans-serif;
}
h1 a:link, h1 a:active, h1 a:visited, h1 a:hover {
text-decoration: none;
}
a:link, a:active, a:visited {
color: inherit;
text-decoration: underline dotted;
}
h2 {
margin: 32px 0 8px;
font-size: 24px;
font-family: Arial, Helvetica, 'Liberation Sans', sans-serif;
}
p {
margin: 8px 0;
}
ul {
margin: 8px 0;
}
pre .kw {
color: #af00db;
}
pre .fn {
color: #795e26;
}
pre .num {
color: #098658;
}
pre .comm {
color: #008000;
}
pre .str {
color: #a31515;
}
pre .var {
color: #001080;
}
pre .const {
color: #0070c1;
}
pre .decl {
color: #0000ff;
}
table {
width: 100%;
border-color: black;
border-spacing: 0;
}
td, th {
padding: 0.25rem 0.5rem;
border-top-width: 1px;
border-top-style: solid;
border-left-width: 1px;
border-left-style: solid;
}
td:last-child, th:last-child {
border-right-width: 1px;
border-right-style: solid;
}
tr:last-child td {
border-bottom-width: 1px;
border-bottom-style: solid;
}
@media (prefers-color-scheme: dark) {
body {
color: #d4d4d4;
background-color: #1E1E1E;
}
pre .kw {
color: #c586c0;
}
pre .fn {
color: #dcdcaa;
}
pre .num {
color: #b5cea8;
}
pre .comm {
color: #6a9955;
}
pre .str {
color: #ce9178;
}
pre .var {
color: #9cdcfe;
}
pre .const {
color: #4fc1ff;
}
pre .decl {
color: #569cd6;
}
table {
border-color: #d4d4d4;
}
}

View File

@@ -0,0 +1,109 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>RuntypeScript (rts) documentation</title>
<link rel="stylesheet" href="style_v2.css">
</head>
<body>
<main>
<h1><a href="index.html">RuntypeScript</a></h1>
<nav>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="type-system.html">Type system</a></li>
<li><a href="global-constants.html">Global constants</a></li>
<li><a href="statements.html">Statements</a></li>
<li><a href="expressions.html">Expressions</a></li>
</ul>
</nav>
<h2>Type system is the value system</h2>
<p>Types and values are mixed with each other, so using the terms <em>type</em> and <em>value</em> interchangeably can get confusing (because they aren't different things in this language). Since these value/type hybrids work more like types than values, we will refer to them only as types on this page.</p>
<h2>nil</h2>
<p>Nil represents nothing. It is returned by a function when nothing is returned explicitly.</p>
<h2>false, true</h2>
<p>False and true are the results of comparison operators and can be used as operand for logical operators.</p>
<h2>boolean</h2>
<p>Boolean is a union of false and true.</p>
<h2>string</h2>
<p>String is a union of every possible string literal.</p>
<h2>String literals</h2>
<p>String literals are enclosed in double quotes. You can make use of the following escape sequences in a string literal:</p>
<ul>
<li>\\ (backslash)</li>
<li>\" (double quote)</li>
<li>\n (line feed)</li>
<li>\t (tab)</li>
<li>\r (carriage return)</li>
</ul>
<h2>number</h2>
<p>Number is a union of every possible number literal.</p>
<h2>Number literals</h2>
<p>Number literals are double presicion floating-point. Only decimal literals are supported (no hexadecimal or exponentials).</p>
<h2>Typed array</h2>
<p>Typed array is defined by specifying its element type. Type array is a union of every possible tuple, for which every element is assignable to typed array's element type. You can turn any type into a typed array by appending a pair of square brackets after the type.</p>
<pre><span class="decl">const</span> <span class="const">array_of_number</span> = <span class="const">number</span>[];
<span class="decl">const</span> <span class="const">array_of_zero_or_foo</span> = (<span class="num">0</span> | <span class="str">"foo"</span>)[];
<span class="decl">const</span> <span class="const">array_of_array</span> = <span class="const">any</span>[][];</pre>
<h2>Tuple</h2>
<p>Tuples are arrays of types and are indexed by number literals.</p>
<pre><span class="decl">const</span> <span class="const">tuple</span> = [<span class="const">number</span>, <span class="const">string</span>];
<span class="decl">const</span> <span class="const">also_tuple</span> = [<span class="num">0</span>, <span class="num">1</span>, <span class="num">2</span>, <span class="decl">fn</span> () <span class="const">nil</span> {}, <span class="const">boolean</span>, [<span class="const">number</span>, <span class="str">"foo"</span>]];</pre>
<p>Tuples are passed by reference and are mutable.</p>
<h2>Object</h2>
<p>Objects can hold multiple properties and are indexed by string literals.</p>
<pre><span class="decl">const</span> <span class="const">empty_obj</span> = {};
<span class="decl">const</span> <span class="const">simple_obj</span> = { <span class="var">foo</span>: <span class="str">"bar"</span>, <span class="var">baz</span>: <span class="const">string</span>[] };
<span class="decl">const</span> <span class="const">nested_obj</span> = { <span class="var">foo</span>: {}, <span class="var">baz</span>: [{}] };
</pre>
<h2>Signatures</h2>
<p>Signatures are specified by a list of argument types and a return type. A signature is a union of every possible function assignable to that signature.</p>
<pre><span class="decl">const</span> <span class="const">binary_sig</span> = <span class="decl">sig</span> (<span class="const">any</span>, <span class="const">any</span>) <span class="const">any</span>;
<span class="decl">const</span> <span class="const">filter_sig</span> = <span class="decl">sig</span> (<span class="const">any</span>[], <span class="decl">sig</span> (<span class="const">any</span>) <span class="const">boolean</span>) <span class="const">any</span>[];</pre>
<p>Signatures never contain names of arguments.</p>
<h2>Functions</h2>
<p>Every function is its own distinct type tied to its literal.</p>
<pre><span class="decl">const</span> <span class="const">concat</span> = <span class="decl">fn</span> (<span class="var">a</span>: <span class="const">string</span>, <span class="var">b</span>: <span class="const">string</span>) <span class="const">string</span> { <span class="kw">return</span> <span class="var">a</span> + <span class="var">b</span>; };</pre>
<p>Function arguments are not constants and can be reassigned inside the function body. A function will capture its outside scope.</p>
<p>There are <em>intrinsic</em> functions in this language, which are global constants and their function bodies are implemented in the interpreter itself instead of the language. They cannot be created by language users.</p>
<h2>Unions</h2>
<p>Unions represents a type, to which many other types are assignable. You can create unions using "|" operator. Unions do not nest (a union of unions collapses into a single union) and are immutable.</p>
<h2>any</h2>
<p>Any is a union of every possible type in this language, including itself.</p>
<h2>Deliteralization</h2>
<p><em>Deliteralization</em> is a transformation of types, that is performed to determine the declared type when none was provided. You can use unary "~" operator to perform the same process yourself. Deliteralization rules:</p>
<ul>
<li>false becomes boolean</li>
<li>true becomes boolean</li>
<li>string literals become string</li>
<li>number literals become number</li>
<li>tuples become typed arrays of union of all tuple's elements deliteralized</li>
<li>object become objects with their properties deliteralized</li>
<li>functions become signatures with equivalent argument and return types</li>
<li>unions become a union of its types deliteralized</li>
<li>other types are left intact</li>
</ul>
<h2>Assignability</h2>
<p><em>Assignability</em> is a process that determines whether a type can be assigned to a variable's declared type. You can use binary "extends" operator to perform the same process yourself. Assignability rules:</p>
<ul>
<li>a union is assignable to a type when all union's types are assignable to that type</li>
<li>only nil is assignable to nil</li>
<li>only false is assignable to false</li>
<li>only true is assignable to true</li>
<li>false, true and boolean are assignable to boolean</li>
<li>string and string literals are assignable to string</li>
<li>only identical string literals are assignable to string literals</li>
<li>number and number literals are assignable to number</li>
<li>only identical number literals are assignable to number literals</li>
<li>a typed array is assignable to other typed array if its element type is assignable to other typed array's element type</li>
<li>a tuple is assignable to a typed array if all its elements are assignable to typed array's element type</li>
<li>an object is assignable to other object if every property of other object also exists in the object and types of the object properties are assignable to correspoding types of the other object properties</li>
<li>a signature is assignable to other signature if every argument of the signature is assignable to corresponding other signature's arguments and other siganture's return type is assignable to the signature return type</li>
<li>a function is assignable to a signature if its deliteralization is assignable to the signature</li>
<li>only identical functions (by reference) are assignable to functions</li>
<li>a type is assignable to a union if its assignable to any of union's types</li>
<li>every type is assignable to any</li>
</ul>
</main>
</body>
</html>