From 1c8aaafb0c2bd3fa46dbeb30858b6bec99aede5f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 24 Aug 2022 16:42:42 +0000 Subject: [PATCH] Update 'Guidelines' --- Guidelines.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Guidelines.md b/Guidelines.md index a3f71b6..d8595dc 100644 --- a/Guidelines.md +++ b/Guidelines.md @@ -1,3 +1,5 @@ +# Introduction +These are guidelines to follow when working on the compiler, or designing new language features. # 0. Decouple Standard Library In some languages, certain syntactical or environmental features depend on the presence of a standard library. Even C does to an extent, with the `= { 0 }` intializer (it calls memset in the background). The ARF standard library will be fully optional, and decoupled from the language. Parts of the standard library should be decoupled from eachother as well. There must be some internal dependencies among them (for example, things like IO and memory management, as well as common interfaces and generics) but it should be as non-monolithic as possible. @@ -15,8 +17,8 @@ Data must be immutable by default. If the user wants to modify a value at some p # 5. Manual Memory Management We can't have anything like a garbage collector, because that violates guideline 4. A borrow checker similar to rust's could be implemented, though. -# Zero Ambiguity +# 6. Zero Ambiguity When looking at any part of ARF syntax, it should be abundantly clear what it means. A good rule of thumb is if its hard for the parser to reason about it, its hard for the user to reason about it too. Syntax should be thematically cohesive, but asymmetrical. Conceptually different things should *look* different. -# One line at a Time +# 7. One line at a Time You've probably seen some gross java code that flies off the right side of the screen before. We are here to avoid that. The language's syntax should encourage writing code that flows vertically and not horizontally, with minimal nesting.