- removed redundant conditional, source: https://stackoverflow.com/questions/49917999/if-statements-made-redundant-by-else-statements - replaced if with if expression, https://www.guru99.com/if-loop-python-conditional-structures.html#:~:text=What%20is%20Python%20If%20Statement,code%20for%20the%20else%20condition. |
||
---|---|---|
examples | ||
src | ||
tests | ||
.gitignore | ||
LICENSE | ||
README.md | ||
build.py |
README.md
JAPL - Just Another Programming Language
JAPL is an interpreted, dynamically-typed, garbage-collected, and minimalistic programming language with C- and Java-like syntax.
J.. what?
You may wonder what's the meaning of JAPL: well, it turns out to be an acronym for Just Another Programming Language, but beware! Despite the name, the pronunciation is the same as "JPL".
Disclaimer
This project is currently a WIP (Work in Progress) and is not optimized nor complete. The design of the language may change at any moment and all the source inside this repo is alpha code quality, for now.
For other useful information, check the LICENSE file in this repo.
JAPL is licensed under the Apache 2.0 license.
Project roadmap
In no particular order, here's a list that is constantly updated and that helps us to keep track of what's done in JAPL:
- Parsing/Lexing ✔️
- Type system ✔️
- Control flow (if/else) ✔️
- Loops (for/while) ✔️
- Basic comparisons operators (
>
,<
,>=
,<=
,!=
,==
) ✔️ - Logical operators (
!
,or
,and
) ✔️ - Multi-line comments
/* like this */
(can be nested) ✔️ - Differentiation between integers and floating point numbers ✔️
inf
andnan
types ✔️- Basic arithmetic (
+
,-
,/
,*
) ✔️ - Modulo division (
%
) and exponentiation (**
) ✔️ - Bitwise operators (AND, OR, XOR, NOT) ✔️
- Global and local variables (WIP)
- Explicit scopes using brackets (WIP)
- Garbage collector
- String slicing, with start:end syntax as well ✔️
- Operations on strings (addition, multiplication) ✔️
- Functions and Closures (WIP)
- Functions default and keyword arguments (WIP)
- An OOP system (prototype- or class-based) (Coming soon)
- A proper import system (Coming soon)
- Native asynchronous (
await
/async fun
) support (Coming soon) - Bytecode optimizations such as constant folding and stack caching (Coming Soon)
- Arbitrary-precision arithmetic (Coming soon)
- Generators (Coming soon)
- A standard library with collections, I/O utilities, scientific modules, etc (Coming soon)
- Multithreading and multiprocessing support with a global VM Lock like CPython (Coming soon)
- Exceptions (Coming soon)
- Optional JIT Compilation (Coming soon)
Classifiers
- WIP: Work In Progress, being implemented right now
- Coming Soon: Not yet implemented/designed but scheduled
- Rework Needed: The feature works, but can (and must) be optimized/reimplemented properly
- ✔️: The feature works as intended
Contributing
If you want to contribute, feel free to open a PR!
Right now there are some major issues with the virtual machine which need to be addressed
before the development can proceed, and some help is desperately needed greatly appreciated!
To get started, you might want to have a look at the currently open issues and start from there
Community
Our first goal is to create a welcoming and helpful community, so if you are so inclined, you might want to join our Discord server and our forum! We can't wait to welcome you into our community :D
A special thanks
JAPL is born thanks to the amazing work of Bob Nystrom that wrote a book available completely for free at this link, where he describes the implementation of a simple language called Lox.
JAPL - Installing
JAPL is currently in its early stages and is therefore in a state of high mutability, so this installation guide might not be always up to date.
Requirements
To compile JAPL, you need the following:
- Nim >= 1.2 installed on your system
- Git (to clone the repository)
- Python >= 3.6 (Build script)
Cloning the repo
Once you've installed all the required tooling, you can clone the repo with the following command
git clone https://github.com/japl-lang/japl
Running the build script
As a next step, you need to run the build script. This will generate the required configuration files,
compile the JAPL runtime and run tests (when we'll actually have some tests). There are some options that
can be tweaked with command-line options, for more information, run python3 build.py --help
.
To compile the JAPL runtime, you'll first need to move into the project's directory you cloned before,
so run cd japl
, then python build.py ./src --flags gc:markAndSweep,d:release
and wait for it
to complete. You should now find an executable named japl
(or japl.exe
on windows) inside the src
folder.
If you're running under windows, you might encounter some issues when using forward-slashes as opposed to back-slashes in paths,
so you should replace ./src
with .\src