From ee3e5c16ba4720f2bf1dc022d2c7ebe8c94d7e98 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Wed, 1 Nov 2023 20:17:43 +1100 Subject: [PATCH 1/6] fix FFF links for wip site --- www/wip_new_website/content/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/wip_new_website/content/index.md b/www/wip_new_website/content/index.md index db6a5800fed..22df148432b 100644 --- a/www/wip_new_website/content/index.md +++ b/www/wip_new_website/content/index.md @@ -27,24 +27,24 @@
-

Fast

+

Fast

Roc code is designed to build fast and run fast. It compiles to machine code or WebAssembly.

-

What does fast mean here?

+

What does fast mean here?

-

Friendly

+

Friendly

Roc’s syntax, semantics, and included toolset all prioritize user-friendliness.

-

What does friendly mean here?

+

What does friendly mean here?

-

Functional

+

Functional

Roc has a small number of simple language primitives. It’s a single-paradigm functional language.

-

What does functional mean here?

+

What does functional mean here?

From 998e2ae3f71f531e970c88403e4fb7e73ffc6e86 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Wed, 1 Nov 2023 20:25:04 +1100 Subject: [PATCH 2/6] fix highlighting, remove breaking unicode char --- www/wip_new_website/content/friendly.md | 2 +- www/wip_new_website/content/functional.md | 30 +++++++++++------------ www/wip_new_website/content/index.md | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/www/wip_new_website/content/friendly.md b/www/wip_new_website/content/friendly.md index 6840edac4ad..cc2cd2201b1 100644 --- a/www/wip_new_website/content/friendly.md +++ b/www/wip_new_website/content/friendly.md @@ -53,7 +53,7 @@ If you like, you can run a program that has compile-time errors like this. (If t You can run `roc test` to run all your tests. Each test is declared with the `expect` keyword, and can be as short as one line. For example, this is a complete test: -``` +```roc ## One plus one should equal two. expect 1 + 1 == 2 ``` diff --git a/www/wip_new_website/content/functional.md b/www/wip_new_website/content/functional.md index bb1f079ed1f..59848f65a25 100644 --- a/www/wip_new_website/content/functional.md +++ b/www/wip_new_website/content/functional.md @@ -6,7 +6,7 @@ Roc is designed to have a small number of simple language primitives. This goal All Roc values are semantically immutable, but may be opportunistically mutated behind the scenes when it would improve performance (without affecting the program's behavior). For example: -```elm +```roc colors |> Set.insert "Purple" |> Set.insert "Orange" @@ -29,7 +29,7 @@ An ergonomics benefit of having no direct mutation primitives is that functions This makes Roc functions naturally amenable to pipelining, as we saw in the earlier example: -```elm +```roc colors |> Set.insert "Purple" |> Set.insert "Orange" @@ -53,41 +53,41 @@ In Roc, this will give a compile-time error. Once a name has been assigned to a A benefit of this design is that it makes Roc code easier to rearrange without causing regressions. Consider this code: -```elm +```roc func = \arg -> greeting = "Hello" welcome = \name -> "\(greeting), \(name)!" - … + ... message = welcome "friend" - … + ... ``` Suppose I decide to extract the `welcome` function to the top level, so I can reuse it elsewhere: -```elm +```roc func = \arg -> - … + ... message = welcome "Hello" "friend" - … + ... welcome = \prefix, name -> "\(prefix), \(name)!" ``` -Without knowing the rest of `func`, we can be confident this change will not alter the code's behavior. In contrast, suppose Roc allowed reassignment. Then it's possible something in the `…` parts of the code could have modified `greeting` before it was used in the `message =` declaration. For example: +Without knowing the rest of `func`, we can be confident this change will not alter the code's behavior. In contrast, suppose Roc allowed reassignment. Then it's possible something in the `...` parts of the code could have modified `greeting` before it was used in the `message =` declaration. For example: -```elm +```roc func = \arg -> greeting = "Hello" welcome = \name -> "\(greeting), \(name)!" - … + ... if someCondition then greeting = "Hi" - … + ... else - … - … + ... + ... message = welcome "friend" - … + ... ``` In this example, if we didn't read the whole function to see that `greeting` was later sometimes (but not always) changed from `"Hello"` to `"Hi"`, we might not have realized that changing it to `message = welcome "Hello" "friend"` would cause a regression due to having the greeting always be `"Hello"`. Because Roc disallows reassignment, this particular regression can't happen, and so the code can be confidently rearranged without checking the rest of the function. diff --git a/www/wip_new_website/content/index.md b/www/wip_new_website/content/index.md index 22df148432b..a1213470522 100644 --- a/www/wip_new_website/content/index.md +++ b/www/wip_new_website/content/index.md @@ -60,7 +60,7 @@