Skip to main content

joyfl (pronounced ˈjȯi-fəl) is a dialect of the programming language Joy.

Joy is a stack-based programming environment that’s both functional and concatenative, which results in highly expressive but short programs. joyfl is an implementation of Joy in Python in its early stages; it’s not entirely backwards compatible by design.

EXAMPLES

You can run a simple REPL (read-eval-print loop) by typing: python3 joyfl.py repl. From there, try typing these statements:

# Take the number one, the number two, add them. Then the number three and add it to the
# previous result. Is six equal to that?
1 2 + 3 +
    6 equal? .
>>> true

# Take the list of numbers seven eight nine. Take a program that subtracts one. Map the
# program onto the list, then reverse it.
[7 8 9] [1 -] map reverse .
>>> [8 7 6]

# Take a list of symbols 'a 'b 'c. Take the symbol 'd. Swap the symbol with the list. Get
# the "rest" of the list omitting the first item. Construct a new list with "cons" that
# uses 'd as the new head.
['a 'b 'c] 'd swap rest cons .
>>> ['d 'b 'c]

Also look at the #/examples/ folder and run them with python3 joyfl.py <filename>.

MOTIVATION

While it’s fun to implement languages, this project has particular #ML / #LLM research questions in mind…

“ What if there was a language for a ‘micro-controller’ able to process 99% of tokens? ”

📥 TRAINING: To produce training data, what’s the middle ground between a web-template (gasp!) and a synthetic theorem generator (whew!)? The answer looks more like another language than a hacked-together Python script.

📤 INFERENCE: For output tokens, how can we make sure prompts are followed, any arithmetic is correct, no items are missed, and formatting is right? The solution isn’t more Python but special tokens that can be interpreted as instructions…

The research goal of this project is to find out where and how Joy can shine in these cases!

DIFFERENCES

While some of the tests from the original Joy pass, many also do not. Here are the design decisions at play:

  1. Symbols vs. Characters — Individual byte characters are not supported, so it’s not possible to extract or combine them with strings. Instead, the single quote denotes symbols (e.g. 'alpha) that can only be compared and added to containers.

  2. Data-Structures — Sets are not implemented yet, but will be. When they are, the sets will have the functionality of the underlying Python sets. Lists too behave like Python lists. Dictionaries will likely follow too at some point.

  3. Conditionals — Functions that return booleans are encouraged to use the ? suffix, for example equal? or list?. This change is inspired by Factor, and makes the code more readable so you know when to expect a boolean.

  4. Stackless - The interpreter does not use the Python callstack: state is stored entirely in data-structures. There’s a stack (for data created in the past) and a queue (for code to be executed in the future). Certain advanced combinators may feel a bit different to write because of this!

REFERENCES

Metadata

Release files for joyfl 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for joyfl 0.9
File Size Uploaded Provenance Actions
joyfl-0.9.tar.gz 580.8 kB Without provenance Details for joyfl-0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for joyfl 0.9
File Interpreter ABI Platform Actions
joyfl-0.9-cp314-cp314-manylinux_2_27_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64 Details for joyfl-0.9-cp314-cp314-manylinux_2_27_x86_64.whl

Total release size: 2.0 MB

Release files / joyfl-0.9.tar.gz

Download URL joyfl-0.9.tar.gz
Size 580.8 kB
Tags Source
SHA-256 checksum
How to use checksums
680585a9117b9df4142eb189d96ad654e8e714e57def757942774784100b6253
BLAKE2b-256 checksum
How to use checksums
c1f86f81239b9771968f055ab0615a20c7dfe12a25ba0e31acebdcb58565b380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / joyfl-0.9-cp314-cp314-manylinux_2_27_x86_64.whl

Download URL joyfl-0.9-cp314-cp314-manylinux_2_27_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64
SHA-256 checksum
How to use checksums
243dc7bdba22f53cd4ff09814e928a80b2695eebf72b83ff664d5da43d15cd42
BLAKE2b-256 checksum
How to use checksums
a5ea509a9cc3f1804f3c6bbd7694f5989290ac4349991de88aa5b93771619903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for joyfl 0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page