diff --git a/01.png b/01.png index 87b5e6c..710f93b 100644 Binary files a/01.png and b/01.png differ diff --git a/02.png b/02.png index 591b1cd..b77d1a0 100644 Binary files a/02.png and b/02.png differ diff --git a/03.png b/03.png index 6402d50..d1cddec 100644 Binary files a/03.png and b/03.png differ diff --git a/04.png b/04.png index 0f732f1..432124f 100644 Binary files a/04.png and b/04.png differ diff --git a/index.html b/index.html index 3bc9796..50f7918 100644 --- a/index.html +++ b/index.html @@ -38,17 +38,18 @@

Overview

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

-

I have, off and on throughout the last 15 or so years attempted to learn a programming language of some sort. I could always get through the basics, but would get stuck with any real-world projects. And I wouldn't know who to turn to even if I knew where to start.

-

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

+

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

Getting Started

@@ -57,50 +58,72 @@
git clone https://git.fddl.dev/fddl/fddl.git

To run the REPL:

cargo run
-

To run a fddl script:

+

To parse a fddl script:

cargo run path/to/script.fddl

Examples

Your basic "hello, world":

-

-func main() {
-    print(`hello, world in fddl`);
-}                    
-        
+
func main() {
+    print("hello, world in fddl");
+}

Defining a function inside a module, squaring a number:

-
##! This is a sample module
+        
# This is a sample module
 
 module math {
 
-    ### Computes the square of a number
+    // Computes the square of a number
     func square(x) => x ^ 2;
 }
 
-define $number := 5;
+sym number = 5;
 print(`The square of $number is ${math.square($number)}`);
-

(At least for right now.)

- -

License

-

This project is licensed under the MIT License.

- -
-

Notes and Next Steps

-
    -
  • Added first new set of tokens and features, added the first lexer tests.
  • -
  • parser module is a placeholder.
  • -
  • interpreter module is a placeholder.
  • -
  • Implement a more robust error handling mechanism instead of using stderr.
  • -
  • Implement string interpolation (backticks with $variable)
  • -
  • Continue to expand tests to cover all new syntax and features.
  • -
  • Made a crappy website.
  • -
-
+

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 build
+cargo test
+cargo run
+

Again, cargo run only starts the REPL for testing.

+ +
+

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:

+
    +
  • Currently a placeholder. Implement parsing for function calls, expressions, checks, literally everything.
  • +
+

Compiler:

+
    +
  • Currently a placeholder. Implement the compiler to compile parsed code.
  • +
+

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 MIT License.

+

Contact

Git repo

diff --git a/index2.html b/index2.html new file mode 100644 index 0000000..a93bb1f --- /dev/null +++ b/index2.html @@ -0,0 +1,111 @@ + + + + + fddl Programming Language + + + + + + + + + + + + + + + + + + + + + + +
+

fddl Programming Language

+
+
+
+ Lexer Screenshot + Lexer Tests Screenshot + REPL Screenshot + Parsing 'hello, world' +
+ +

Overview

+

fddl is a small, experimental programming language, built in Rust, designed to explore language implementation concepts. It's a blend of ideas from various languages but remains unique, with its own syntax and quirks.

+

For years, I’ve tried to learn various programming languages, and while I could master the basics, the real-world projects often eluded me. Rust, however, clicked for me, and fddl was born out of this journey.

+ +

I like aspects of many programming languages, but I didn’t fully enjoy any of them, which made it difficult to commit to one. So, like many others, I decided to create my own hobby programming language.

+ +

Features

+
    +
  • Custom syntax with unique operators and keywords
  • +
  • Documentation comments using #, similar to Rust's style
  • +
  • Lexer and parser built from scratch
  • +
+ +

Getting Started

+

To clone the repo:

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

To run the REPL:

+
cargo run
+

To run a fddl script:

+
cargo run path/to/script.fddl
+ +

Examples

+

Your basic "hello, world":

+

+func main() {
+    print(`hello, world in fddl`);
+}
+        
+

Defining a function inside a module, squaring a number:

+
##! This is a sample module
+
+module math {
+
+    ### Computes the square of a number
+    func square(x) => x ^ 2;
+}
+
+define $number := 5;
+print(`The square of $number is ${math.square($number)}`);
+        
+

(At least for now.)

+ +

Notes and Next Steps

+
    +
  • Added first new set of tokens and features, added the first lexer tests.
  • +
  • parser module is a placeholder.
  • +
  • interpreter module is a placeholder.
  • +
  • Implement a more robust error handling mechanism instead of using stderr.
  • +
  • Implement string interpolation (backticks with $variable).
  • +
  • Continue to expand tests to cover all new syntax and features.
  • +
  • Made a basic website.
  • +
+ +

Running the Project

+

Make sure your project compiles and the tests pass:

+
cargo build
+cargo test
+ + +
+
+ © 2024 fddl Programming Language +
+ + + + + + +