Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions languages/Inumaki/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
16 changes: 16 additions & 0 deletions languages/Inumaki/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File with Arguments",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
}
]
}
21 changes: 21 additions & 0 deletions languages/Inumaki/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 EdwardTheLegend

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
96 changes: 96 additions & 0 deletions languages/Inumaki/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Inumaki

Programming language made for [Hack Club's langjam](https://langjam.hackclub.com) based off the speech of the Jujutsu Kaisen character [Toge Inumaki](https://jujutsu-kaisen.fandom.com/wiki/Toge_Inumaki). Though the original is of course Japanese, I'll be using the English translations of his vocabulary for the sake of my own sanity.

# Vocabulary
These are the phrases which will be used in place of normal keywords in this language. Not all of them will be used and I'll try to use them in line with their original meaning to have some sense come out of all this.

## Safe Words
| Word | Original use | Language use |
| --- | ---| --- |
| Salmon | Affirmation | True (Boolean) |
| Bonito Flakes | Negation | False (Boolean) |
| Kelp | Greeting | Comments |
| Mustard Leaf | Concern/Worry | Conditionals |
| Salmon Roe | "Well, well" | |
| Caviar | Expletive | Exceptions |
| Spicy Cod Roe | Motivational | |
| Tuna | Call attention | Print |
| Tuna Mayo | Do something | Function definitions |

## Cursed Speech
| Word | Language use|
| --- | --- |
| Explode | Else |
| Twist | For loops |
| Crush | |
| Plummet | While loops |
| Stop | |
| Sleep | |
| Return | Return from function |
| Run | |
| Blast | |

# Syntax Examples

## Comments
```
Kelp <This is a comment>
```

## Variables
```
Tuna <variableName> Tuna <value>
```

## Conditionals
```
Mustard_Leaf Tuna <condition> Tuna {
<main body>
} Explode {
<else body>
}
```
There are no elifs so multiple cascading Explode..Mustard_Lead statements are required in that case.

## For loops
```
Twist Tuna <iteration var> Tuna <inital value> Tuna <stopping condition> Tuna <increment statement> Tuna {
<main body>
}
```
The increment statement usually takes a structure like `Tuna <iteration var> Tuna <iteration var> + 1`

## While loops
```
Plummet Tuna <condition> Tuna {
<main body>
}
```
The `Stop` cursed keyword may be used in future to break out of loops but until that is implemented, the condition must be made false to exit the loop.

## Function definitions
```
Tuna_Mayo <function name> Tuna <parameters space-separated> Tuna {
<main body>
Return <space separated values>
}
```
Parameters are optional in which case there will be `Tuna Tuna`. Return is also optional.

# Standard Library
Tuna_Tuna for print, str and float all directly map to the python builtin functions.

# Note on flexible keywords
In order to allow the programming language to be more chaotic and greater resembling Inumaki's speech keywords which aren't crucial to telling the parser what the current statement is do not have to be the same. For example, in a while loop

```
Plummet Tuna <condition> Tuna {
<main body>
}
```

Once the parse sees `Plummet` it knows it's a while loop and I just need the `Tuna` to sandwich the condition as an easy way of knowing when to stop eating the condition. Therefore, in most of the places that `Tuna` has been used in the above examples, any other keyword can be used with no functional difference apart from cursedness. The exception is the assignment statement where `Tuna` is the primary indicator.

# Cursedness
All token is this language are either cursed or not depending on wether they are one of the words in the cursed table above. Any use of these words wether necessarily in a code statement or even in a string literal will increase the interpreter's internal cursed counter. Over use of cursed speech will result in throat irritation and may cause sever damage to Inumaki's throat (an exception will be thrown). To prevent this, `Cough_Syrup` should be administered at appropriate intervals to alleviate symptoms.
44 changes: 44 additions & 0 deletions languages/Inumaki/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions languages/Inumaki/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[project]
name = "Inumaki"
version = "0.1.0"
description = "Default template for PDM package"
authors = [
{name = "EdwardTheLegend", email = "40855056+EdwardTheLegend@users.noreply.github.com"},
]
dependencies = [
"argparse>=1.4.0",
]
requires-python = "==3.12.*"
readme = "README.md"
license = {text = "MIT"}


[tool.pdm]
distribution = false

[tool.pdm.dev-dependencies]
dev = [
"ruff>=0.4.8",
]

[tool.ruff]
line-length = 120
16 changes: 16 additions & 0 deletions languages/Inumaki/samples/FizzBuzz.inu
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Twist Tuna Tuna num Tuna 1 Tuna num < 101 Tuna Tuna num Tuna num + 1 Tuna {
Mustard_Leaf Tuna (num % 3 == 0) And (num % 5 == 0) Tuna {
Tuna_Tuna("FizzBuzz")
} Explode {
Mustard_Leaf Tuna num % 3 == 0 Tuna {
Tuna_Tuna("Fizz")
} Explode {
Mustard_Leaf Tuna num % 5 == 0 Tuna {
Tuna_Tuna("Buzz")
} Explode {
Tuna_Tuna(num)
Kelp Cough_Syrup <-- commented out code
}
}
}
}
9 changes: 9 additions & 0 deletions languages/Inumaki/samples/cursed_speech_overload.inu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Tuna_Mayo Liver Tuna Tuna {
Twist Tuna Tuna Rice Tuna 0 Tuna Rice < 4 Tuna Tuna Rice Tuna Rice + 1 Tuna {
Return "Hello"
}
}

Twist Tuna Tuna Egg Tuna 0 Tuna Egg < 100 Tuna Tuna Egg Tuna Egg + 1 Tuna {
Tuna_Tuna(Liver() + str(Egg))
}
Loading