Dewy is a general purpose programming language with a focus on engineering.
Still very work in progress
For now, the only dependancy is Python >= 3.11 with an optional dependancy on rich
for rich printing/errors (pip install rich
)
Later dependancies will probably include clang
/llvm
python install.py
This should work on most linux distros with most common shells (sh
, bash
, zsh
, fish
). This script just attempts to add the lines below from the Manual
section to your .profile
or equivalent file, or your .rc
file (e.g. .bashrc
) if available.
If you don't have a .rc
file, You will need to logout and log back in for changes to take effect. Otherwise, you can run source ~/.rc
to apply changes, or open a new terminal.
-
Add the following to your distribution/shell's corresponding
.profile
or.rc
file:if [ -d "/home/user/path/to/dewy-lang" ]; then PATH="/home/user/path/to/dewy-lang:$PATH" fi
Note: Be sure to adjust the path in the command to match the current absolute path of this repo
Note: If modifying
.profile
, you must logout, and log back in for changes to take effect. If modifying a.rc
file (e.g..bashrc
), then either runsource path/to/.rc
to apply changes, or open a new terminal
Note that the language parser is largely incomplete, and there are very many different syntaxes that will get trapped at breakpoints marking TODO, or cause exceptions for
NotImplementedError
If you completed the install steps, you can simply run:
dewy my_script.dewy
otherwise you can run the python script directly
cd src/compiler
python compiler.py ../path/to/my_script.dewy
Several example programs are available in examples/. Here is a breakdown of which ones work with the current progress:
Filename | status |
---|---|
hello.dewy | [✓] |
hello_func.dewy | [✓] |
hello_name.dewy | [✓] |
hello_loop.dewy | [✓] |
anonymous_func.dewy | [✓] |
if_else.dewy | [✓] |
if_else_if.dewy | [✓] |
dangling_else.dewy | [✓] |
if_tree.dewy | [✓] |
loop_in_iter.dewy | [✓] |
loop_and_iters.dewy | [✓] |
enumerate_list.dewy | [✓] |
loop_or_iters.dewy | [✓] |
nested_loop.dewy | [✓] |
block_printing.dewy | [✓] |
loop_iter_manual.dewy | [✗] |
range_iter_test.dewy | [✗] |
functions.dewy | [✗] |
partial_functions.dewy | [✗] |
unpack_test.dewy | [✗] |
fizzbuzz-1.dewy | [✓] |
fizzbuzz0.dewy | [✗] |
fizzbuzz1.dewy | [✗] |
mdbook_preprocessor.dewy | [✗] |
random.dewy | [✗] |
fast_inverse_sqrt.dewy | [✗] |
rule110.dewy | [✗] |
dewy_syntax_examples.dewy | [✗] |
syntax.dewy | [✗] |
tokenizer.dewy | [✗] |
Currently out of date documentation is available at: https://david-andrew.github.io/dewy-lang/
This project is dual-licensed under the MIT License and the Apache License 2.0. You may choose to use this project under the terms of either the MIT License or the Apache License 2.0. See the LICENSE-MIT and LICENSE-APACHE files in this repository for the full text of the licenses.
Contributions to this project are accepted under the same dual-license terms as the project itself. By contributing, you agree to license your contributions under both the MIT License and the Apache License 2.0.