Overview
@@ -121,25 +27,33 @@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.
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.
-+
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 with unique (and possibly deranged) operators and keywords +
- Custom syntax with unique (and arguably deranged) operators and keywords
- Documentation comments using
#
, similar to Rust's style
- - Lexer and parser built from scratch in Rust +
- Lexer and parser built from scratch
Getting Started
+To clone the repo:
+git clone https://git.fddl.dev/tristan/fddl.git
To run the REPL:
-cargo run
+ cargo run
To run a fddl script:
-cargo run path/to/script.fddl
+ cargo run path/to/script.fddl
Examples
-##! This is a sample module
+ 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 {
@@ -148,8 +62,7 @@ module math {
}
define $number := 5;
-print(`The square of $number is ${math.square($number)}`);
-
+print(`The square of $number is ${math.square($number)}`);
(At least for right now.)
License
@@ -158,7 +71,7 @@ print(`The square of $number is ${math.square($number)}`);Notes and Next Steps
-
-
- Added first new set of tokens and features, added the first
lexer
tests.
+ - 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
.
@@ -170,18 +83,21 @@ print(`The square of $number is ${math.square($number)}`);
Running the Project
Make sure your project compiles and the tests pass:
-
-cargo build
-cargo test
-
- Although there's not much there right now. But the REPL works!
+cargo build
+cargo test
+
+
+
+
+
-
\ No newline at end of file
+