From c7791e0b343f919ecf9c57d46421d39062c3eebe Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 7 Dec 2020 13:41:23 +0800 Subject: [PATCH 1/5] use the Formal name --- _blogposts/archive/bucklescript-is-rebranding.mdx | 2 +- pages/docs/manual/latest/faq.mdx | 2 +- pages/docs/manual/v8.0.0/faq.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_blogposts/archive/bucklescript-is-rebranding.mdx b/_blogposts/archive/bucklescript-is-rebranding.mdx index d37d17969..a7d8b32f8 100644 --- a/_blogposts/archive/bucklescript-is-rebranding.mdx +++ b/_blogposts/archive/bucklescript-is-rebranding.mdx @@ -47,4 +47,4 @@ Thank you for your support and keep shipping. A brighter future awaits us! Stay safe, -The ReScript team (Bob, Cheng, Cristiano, Maxim, Patrick, Ricky). +The ReScript team (Hongbo, Cheng, Cristiano, Maxim, Patrick, Ricky). diff --git a/pages/docs/manual/latest/faq.mdx b/pages/docs/manual/latest/faq.mdx index 58107f994..534c343c7 100644 --- a/pages/docs/manual/latest/faq.mdx +++ b/pages/docs/manual/latest/faq.mdx @@ -48,7 +48,7 @@ The existing Reason syntax is owned by a different team with a different vision. **Who is behind the project?** -The ReScript team (Bob, Cheng, Cristiano, Maxim, Patrick, Ricky). +The ReScript team (Hongbo, Cheng, Cristiano, Maxim, Patrick, Ricky). **We have a new forum; will we also have our own Discord?** diff --git a/pages/docs/manual/v8.0.0/faq.mdx b/pages/docs/manual/v8.0.0/faq.mdx index 5d8c1bffa..f7fd33c15 100644 --- a/pages/docs/manual/v8.0.0/faq.mdx +++ b/pages/docs/manual/v8.0.0/faq.mdx @@ -44,7 +44,7 @@ The existing Reason syntax is owned by a different team with a different vision. **Who is behind the project?** -The ReScript team (Bob, Cheng, Cristiano, Maxim, Patrick, Ricky). +The ReScript team (Hongbo, Cheng, Cristiano, Maxim, Patrick, Ricky). **We have a new forum; will we also have our own Discord?** From c4c71c1b79ccdbf0e61b6c621a6da5d15acf2420 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 7 Dec 2020 15:27:42 +0800 Subject: [PATCH 2/5] post for 8.4.1 --- _blogposts/2020-12-07-release-8-4-1.mdx | 93 +++++++++++++++++++++++++ index_data/blog_posts.json | 3 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 _blogposts/2020-12-07-release-8-4-1.mdx diff --git a/_blogposts/2020-12-07-release-8-4-1.mdx b/_blogposts/2020-12-07-release-8-4-1.mdx new file mode 100644 index 000000000..ecb30a0c4 --- /dev/null +++ b/_blogposts/2020-12-07-release-8-4-1.mdx @@ -0,0 +1,93 @@ +--- +author: hongbo +date: "2020-12-07" +previewImg: +category: compiler +title: ReScript 8.4 +description: | +--- + +## Introduction + +ReScript is a soundly typed language with an optimizing compiler focused on the JS platform. +It's focused on type safety, performance and JS interop. It used to be called BuckleScript. + +[ReScript@8.4](https://www.npmjs.com/package/bs-platform/v/8.4.1) is now available for testing, you can try it via + +``` +npm i bs-platform@8.4.1 +``` + +The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#841). + +We will go through some highlighted changes. + +### The integrity of `bsb -make-world` + +When we introduced `bsb` as a build system around four years ago, we made the assumption that dependencies are immutable, +so that once it's built for the first time, we don't need to rebuild it any more. The integrity of `bsb -make-world` will be broken +when the assumption does not hold. + +In this release, we fix the integrity of `bsb -make-world` which allows user to changes the dependencies. +The fix is well implementend that people who don't do such modifications will not pay for it. + +This is one of the highest desired feature request based on the +[user feedback](https://github.com/rescript-lang/rescript-compiler/issues/4361#issuecomment-739538789), so we will expand a bit here why it is tricky +to implement it without compromising performance. + +In ReScript compilation scheme, dependencies as packages are treated as a blackbox, +changes of dependencies should be *transitive*. The is due to that we have cross module +optimizations and the binary interface itself is a hash of its dependencies. +So for a package dependency chain: A -> B -> C, if A changes and B does not change, C still needs get rebuilt. +Because the intermediate output of B may still change due to the change of A. +To make things worse, each package comes with an installation process which is a shell script, so re-installation will make the +package look like freshly built. + +In this release, we track the installation in the build graph as well, and we calculate the hash of the installation of dependencies and put it in the +dependent's command line flags for building binary artifacts. Such strategy benefits in three aspects: +- The calculatino of the hash of installation is almost free since it is just one stat, we don't need track all dependencies' artifacts. +- The introducing of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing. +- Once the package installation is a nop, the transitive rebuild graph will be cut off so that we can save some unneeded rebuild. + + +### Introducing `pinned-dependencies` + +To make `bsb -make-world` more pratical, we also introduce a new concept called: `pinned-dependencies`. +In general, packages are classified as three categories: + +- toplevel + - warnings reported + - warn-error respected + - build dev dependency + - run custom rules + - package-specs like es6/commonjs overrides its all dependencies +- pinned dependencies + - warnings reported + - warn-error respected + - build dev dependency + - run custom rules +- normal dependencies + - warnings, warn-error ignored + - ignore dev directories + - ignore custom generator rules + +Previously, we only had `toplevel` and `normal dependencies`, by introducing `pinned-dependencies`, +such package will be built mostly like `toplevel` packages. + +The usage is quite simple, add `pinned-dependencies` in the toplevel package's `bsconfig.json`. +Note such field only make sense in toplevel's configuration. + + +### More robust hanlding of removal of staled output + +When people delete or rename rescript files, it will introduce dangling staled output, for example, renaming `src/A.res` +into `src/B.res` will bring `src/A.cmi` (and more intemediate outputs) stale. This is worse than it sounds like, suppose you have a +local `src/List.res` which shadows the stdlib's List. Now we remove it, it will introduce stale `List.cmi` file, without the proper removal +of such stale outptu, such stale `List.cmi` file will break the integrity of the build. + +In this release, we introduced a more robust algorithm that will always remove stale output before the build so +that such integrity is not broken. + +Last but not the least, we continue improving the readability, debuggability of the [generated output](https://github.com/rescript-lang/rescript-compiler/pull/4858) : ) + +Happy Hacking! -- Hongbo Zhang \ No newline at end of file diff --git a/index_data/blog_posts.json b/index_data/blog_posts.json index 066312557..61872f126 100644 --- a/index_data/blog_posts.json +++ b/index_data/blog_posts.json @@ -55,5 +55,6 @@ "whats-new-in-7-pt1": "archive/whats-new-in-7-pt1.mdx", "whats-new-in-7-pt2": "archive/whats-new-in-7-pt2.mdx", "editor-support-custom-operators-and-more": "2020-11-17-editor-support-custom-operators-and-more", - "editor-support-release-1-0": "2020-11-26-editor-support-release-1-0" + "editor-support-release-1-0": "2020-11-26-editor-support-release-1-0", + "bucklescript-release-8-4-1" : "2020-12-07-release-8-4-1" } From 7c14db06e84a9b3a59d0a5cb43dec88644ca3e38 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Tue, 8 Dec 2020 10:52:06 +0800 Subject: [PATCH 3/5] fix typos --- _blogposts/2020-12-07-release-8-4-1.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_blogposts/2020-12-07-release-8-4-1.mdx b/_blogposts/2020-12-07-release-8-4-1.mdx index ecb30a0c4..11c61c51b 100644 --- a/_blogposts/2020-12-07-release-8-4-1.mdx +++ b/_blogposts/2020-12-07-release-8-4-1.mdx @@ -45,8 +45,8 @@ package look like freshly built. In this release, we track the installation in the build graph as well, and we calculate the hash of the installation of dependencies and put it in the dependent's command line flags for building binary artifacts. Such strategy benefits in three aspects: -- The calculatino of the hash of installation is almost free since it is just one stat, we don't need track all dependencies' artifacts. -- The introducing of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing. +- The calculation of the hash of installation is almost free since it is just one stat, we don't need track all dependencies' artifacts. +- The introducion of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing. - Once the package installation is a nop, the transitive rebuild graph will be cut off so that we can save some unneeded rebuild. @@ -60,7 +60,7 @@ In general, packages are classified as three categories: - warn-error respected - build dev dependency - run custom rules - - package-specs like es6/commonjs overrides its all dependencies + - package-specs like es6/commonjs overrides all its dependencies - pinned dependencies - warnings reported - warn-error respected From 8a91dbcbb528353c488f938c6635aee27df6c4dd Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Fri, 11 Dec 2020 15:20:09 +0800 Subject: [PATCH 4/5] tweak release version --- ...{2020-12-07-release-8-4-1.mdx => 2020-12-07-release-8-4.mdx} | 0 index_data/blog_posts.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename _blogposts/{2020-12-07-release-8-4-1.mdx => 2020-12-07-release-8-4.mdx} (100%) diff --git a/_blogposts/2020-12-07-release-8-4-1.mdx b/_blogposts/2020-12-07-release-8-4.mdx similarity index 100% rename from _blogposts/2020-12-07-release-8-4-1.mdx rename to _blogposts/2020-12-07-release-8-4.mdx diff --git a/index_data/blog_posts.json b/index_data/blog_posts.json index 61872f126..304f26270 100644 --- a/index_data/blog_posts.json +++ b/index_data/blog_posts.json @@ -56,5 +56,5 @@ "whats-new-in-7-pt2": "archive/whats-new-in-7-pt2.mdx", "editor-support-custom-operators-and-more": "2020-11-17-editor-support-custom-operators-and-more", "editor-support-release-1-0": "2020-11-26-editor-support-release-1-0", - "bucklescript-release-8-4-1" : "2020-12-07-release-8-4-1" + "bucklescript-release-8-4" : "2020-12-07-release-8-4" } From ac1837ba2d69cdca83682a1f630cb2f013e74128 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Fri, 11 Dec 2020 15:23:30 +0800 Subject: [PATCH 5/5] add one more item for the benefits --- _blogposts/2020-12-07-release-8-4.mdx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_blogposts/2020-12-07-release-8-4.mdx b/_blogposts/2020-12-07-release-8-4.mdx index 11c61c51b..2c8980c4f 100644 --- a/_blogposts/2020-12-07-release-8-4.mdx +++ b/_blogposts/2020-12-07-release-8-4.mdx @@ -12,10 +12,10 @@ description: | ReScript is a soundly typed language with an optimizing compiler focused on the JS platform. It's focused on type safety, performance and JS interop. It used to be called BuckleScript. -[ReScript@8.4](https://www.npmjs.com/package/bs-platform/v/8.4.1) is now available for testing, you can try it via +[ReScript@8.4](https://www.npmjs.com/package/bs-platform/v/8.4.2) is now available for testing, you can try it via ``` -npm i bs-platform@8.4.1 +npm i bs-platform@8.4.2 ``` The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#841). @@ -44,11 +44,12 @@ To make things worse, each package comes with an installation process which is a package look like freshly built. In this release, we track the installation in the build graph as well, and we calculate the hash of the installation of dependencies and put it in the -dependent's command line flags for building binary artifacts. Such strategy benefits in three aspects: +dependent's command line flags for building binary artifacts. Such strategy benefits in such aspects: + - The calculation of the hash of installation is almost free since it is just one stat, we don't need track all dependencies' artifacts. - The introducion of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing. - Once the package installation is a nop, the transitive rebuild graph will be cut off so that we can save some unneeded rebuild. - +- When people make changes to the depdendencies, if such changes don't change the package interface, it will not trigger the build of its dependents. ### Introducing `pinned-dependencies`