From 8eaf7868c496e85ac167a48f249c5d74db58c6f5 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sat, 19 Jun 2021 21:30:52 +0800 Subject: [PATCH] Design --- Design.md | 26 +++++++++++++++++++++++--- README.md | 22 +--------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Design.md b/Design.md index a57e560a..860afcef 100644 --- a/Design.md +++ b/Design.md @@ -1,6 +1,26 @@ -# Readability +# Design Goals -## Turbofish and inference +1. Intuitive and ergonomic + +API should state the intention clearly. Provide syntax sugar for common things. + +2. Fast(er) compilation + +Balance between compile-time checking and compilation speed. + +3. Avoid 'symbol soup' + +Avoid macros with DSL, use derive macros where appropriate. Be friendly with IDE tools. + +## Test Time + +After some bitterness we realized it is not possible to capture everything compile time. But we don't +want to encounter problems at run time either. The solution is to perform checking at 'test time' to +uncover problems. These checks will be removed at production so there will be no run time penalty. + +## Readability + +### Turbofish and inference Consider the following method: ```rust @@ -31,7 +51,7 @@ then the Turbofish can be omitted: ``` provided that `fruit::Entity` is a unit struct. -## Builder pattern +### Builder pattern Instead of: ```rust diff --git a/README.md b/README.md index f1bfa3f9..94a53179 100644 --- a/README.md +++ b/README.md @@ -35,24 +35,4 @@ Use mock connections to write unit tests for your logic. 4. API oriented -Quickly build search models that help you filter, sort and paginate data in APIs. - -## Design Goals - -1. Intuitive and ergonomic - -API should state the intention clearly. Provide syntax sugar for common things. - -2. Fast(er) compilation - -Balance between compile-time checking and compilation speed. - -3. Avoid 'symbol soup' - -Avoid macros with DSL, use derive macros where appropriate. Be friendly with IDE tools. - -## Test Time - -After some bitterness we realized it is not possible to capture everything compile time. But we don't -want to encounter problems at run time either. The solution is to perform checking at 'test time' to -uncover problems. These checks will be removed at production so there will be no run time penalty. \ No newline at end of file +Quickly build search models that help you join, filter, sort and paginate data in APIs.