JMPL Devlog #9
Modularity
September 1st 2025
Tags:
C
JMPL
Programming Language
Welcome to the last weekly JMPL update and the last update on v0.2.2! This week marks the 10th week I've working on JMPL for my URSS, so the end is in sight. Therefore, this weeks update aims to make JMPL a small, but complete tool.
What's changed?
This update's main addition is modulariy. Before this, JMPL projects could only be one file with no way of importing functions from other projects. To fix this I've added a simple module system. This module system is quite bare-bones, working like a combination of Python's 'import' and C's '#include'. As JMPL is not object-oriented, including another file simply adds that file's functions and global variables to the main file's global table. In other words, it brings them into scope for the whole file. To do this you use the 'with' keyword.
with "path/to/file.jmpl"
For this syntax to work, the path to the target file must be surrounded by double quotes ("), and be a valid JMPL file, regardless of file extension. This system works with absolute files or relative files given they are relative to where the interpreter is being ran. In addition to this the pre-defined JMPL functions such as println (internally called natives) have been moved to in-built modules. The full list of functions and modules can be found here. So far there are two in-built modules, core and math. To import an in-built module you just write the name of the module inside the double quotes.
with "math"
The core module is implicitly loaded once the interpreter starts and cannot be imported explicitly. In the future I want to add the option to import specific functions, but this is fine for the current small size of JMPL.
In order to round out JMPL, I've added a few of the features that were missing before:
- Characters can now be compared with >, >=, <, <=
- Added a few conversion functions (in-built with core). These are
                                    - str(x) - converts any value to a string
- num(x) - parses a string to a number or converts character to its Unicode code point as a number. Invalid parsing returns 0
- char(x) - converts an integer code point to a Unicode character
 
- Added the e() and epsilon() functions to the math module which return Eulers number and 1e-10 respectively
- Characters can now be enumerated with the omission (...) operator in a set or tuple. Example: {'a' ... 'e'} is {'a', 'b', 'c', 'd', 'e'}
What's next?
As my goal of working on JMPL over the summer has nearly concluded, I won't be making updates as regularly, but I will still aim to improve JMPL. However, I am working on releasing a current stable build and a CLI so JMPL can be easily installed and used!