## Visual Progress

Some building screenshots no one will care about. :)

## Overview

fddl is a small programming language inspired by various languages, designed to help learn language implementation concepts in Rust.

For years, I’ve tried to learn various programming languages, and while I could master the basics, the real-world projects often eluded me. And I wouldn't know who to turn to even if I knew where to start.

fddl was born out of this journey. fddl is my attempt to combine the aspects I appreciate from many languages into something uniquely my own.

I started learning Rust and have really liked it. I've been following tutorials and the Crafting Interpreters site as guides for this very problematic programming language.

I like aspects of so many programming languages, but I don't really like any of them, so I always found it hard to pick one and stick with it. But I had the same problem playing World of Warcraft, too.

So I, like many of you, decided to make a hobby programming language to see what may be able to be done with it. This is a brand new project as of September 2024 and I am one person.

The fact that I have a REPL working in this language is nothing short of amazing to me. It's fucking magic.

## Features

- Custom syntax: fddl introduces unique operators and keywords to make programming more intuitive and fun (at least for me).
- Lexer: Tokenizes fddl scripts into understandable pieces of the language.
- Parser: Currently under active development, the parser can successfully handle operators (including the Tilde Operator) and function calls. Work is ongoing to support more complex structures.
- Tilde Operator (`~` and `~=`): For when something almost equals something else. I had the idea from watching a video on Non-Euclidean Doom.

## Getting Started

Keep in mind, this is only at the lexer stage currently. It'll read your inputs and that's it. (Consider updating this statement based on parser progress)

To clone the repo:

    git clone https://git.fddl.dev/fddl/fddl.git

To run the REPL:

    cargo run

To parse a fddl script:

    cargo run path/to/script.fddl

## Examples:

(The following is an example of intended fddl syntax - actual runnable capability depends on current parser/interpreter state)

    func main() {
        // print statement
        print("hello, world in fddl");

        // variable declaration
        let y = 5;

        // if statement
        if (x > 10) {
            print("x is greater than 10");
        }

        // while loop
        while (x < 100) {
            print(x);
            let x = x + 1;
        }
    }

At least for right now. I still want to do something odd.

## Running the Project

Make sure your project compiles and the tests pass:

    cargo build
    cargo test
    cargo run

Again, `cargo run` only starts the REPL for testing.

running `fddl examples.fddl` (from the git repo) produces the following.

## Goals and Projections

Note: This is not a final list; it's words on paper (metaphorically) at the time of writing.

`Lexer`:

- Built and tested for basic syntax and operators.
- Supports single-line and documentation comments.
- Add support for more complex syntax and features.

`Parser`:

- Parser parsing tilde and minus successfully.
- Parser parsing the rest of the operators. (mostly complete)
- Parser parsing function calls.
- Working on building out functions to parse simple functionality in the language (if, while, for), and to read their expressions and values
- Implement parsing for function calls, expressions, checks, literally everything.

`Compiler`:

- Currently a placeholder. We're a long way from here. If I see this step I'll be lucky.

Comments:

- Added support for single-line and documentation comments.
- Implement multi-line comments.
- Implement document building comments.

Error Handling:

- Replace `stderr` with a more robust error handling mechanism.

Testing:

- Added initial `lexer` tests.
- Expand tests to cover more syntax and edge cases.

## License

This project is licensed under the GPL.

## Contact & Links

Contact via Email

Git repo

×