diff --git a/.env b/.env index 431fdc073..afab0bce3 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ VERSION_LATEST="v11.0.0" -VERSION_NEXT="v12.0.0" \ No newline at end of file +VERSION_NEXT="v11.0.0" \ No newline at end of file diff --git a/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx b/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx deleted file mode 100644 index 168c3abf5..000000000 --- a/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -author: rescript-team -date: "2020-08-10" -badge: roadmap -title: "BuckleScript & Reason Rebranding" -description: A new unified experience for the platform ---- - -We're pleased to announce that BuckleScript is getting a brand new name: **ReScript**. - -## History & Summary - -- **OCaml** is a typed FP language compiling to bytecode and native code. -- **Js_of_ocaml** is based on OCaml and compiles to JavaScript for OCaml users. -- **BuckleScript** is a fork of OCaml that also outputs JavaScript, optimized (features, JS interoperability, output, build tools) for JS developers rather than OCaml developers. -- **Reason** is an alternative, JS-looking syntax layer over OCaml, plus extra tools. Reason used 1. BuckleScript to produce JavaScript output and 2. OCaml to produce native output. Most of the community focused on the former usage. -- Reason and BuckleScript shared most teammates, who wanted to double down on the JS use-case. -- **ReScript**, thus born, is the new branding for BuckleScript that reimplements or cleans up Reason's syntax, tools, ecosystem & docs into a vertically integrated experience. -- Reason project will continue serving its purpose of a syntax layer for native OCaml. Some folks might use Reason with Js_of_ocaml to output JS code. - -## Community Situation - -BuckleScript started with the idea that **JavaScript programmers deserved a great typed language with a fast and lean toolchain**. This idea took root and, over the years, we've gradually accomplished feats such as: -- a state of the art compiled JavaScript output that rivals hand-written JS, -- a fast & reliable toolchain much needed in front-end and Node development, -- various JS interop features that spawned an ecosystem of well typed libraries, -- a production-ready standard library, -- [and recently](/blog/bucklescript-8-1-new-syntax), a fresh syntax made by a major contributor of Reason's old syntax. - -These developments have attracted many people into our community. But one bigger challenge persisted: newcomers dropped out at the sheer amount of extra incongruent tools and learning overhead from having to understand OCaml concepts, Reason concepts, and BuckleScript's concepts. Take, for example, what's required to make a React app using BuckleScript: -- Knowledge of React. -- Knowledge of JS. -- Knowledge of BuckleScript's specific bindings to React (that we've tried hard to keep to a minimum). -- Knowledge of OCaml idioms, which leaked through BuckleScript. -- Knowledge of BuckleScript's JS interop and the build system. -- Knowledge of the Reason syntax. -- Avoiding the distractions of OCaml and Reason's unrelated, native-oriented build tools, package manager, etc. - -Ironically, the more documentation we pile up, the more mental overhead newcomers suffered. During the meetups, we've frequently seen folks' enthusiasm crushed at the sheer prospect of making a web app while keeping 5+ tabs' worth of documentations open. This was discouraging for everyone. - -The adoption barrier is real, and it's about time we finally solve it. - -## The Rebranding - -Today, we'll start to truly unify the various BuckleScript-related projects under the ReScript umbrella. This includes: -- The compiler, build system and the new syntax unified under a single installation. -- Doubling down on editor tooling for ReScript usage. -- A single documentation site (this one), which unifies all the docs and greatly trims down on redundant and stale info. -- Streamlined communication through said website, a [forum](https://forum.rescript-lang.org) and a new [Twitter](http://twitter.com/rescriptlang). -- The renaming of various tools, always in a backward-compatible way. - -In short, all JS-related concepts previously under disparate Reason and BuckleScript ecosystems are now called ReScript. Previously, due to the messy situation, most real-world BuckleScript adoption came from a few heroic community members suffering through the technical and social risk of spreading our tech to their coworkers. From today onward, you can simply tell to your coworkers: **"this is ReScript"**, and point to them a clear starting point. - -It's worth emphasizing that while this rebranding seems disruptive, it's mostly a bunch of name changes for the same tech. The Q&A below addresses some of the worries on existing code. - -## Q & A - -**What's that recently released BuckleScript syntax called?** - -There's no dedicated name for the syntax anymore. It's simply called the ReScript syntax. The extension is `.res` and `.resi`. Existing tools operating on `.ml`, `.mli`, `.re` and `.rei` continue working. - -**Will there be a migration script to gradually convert our code to the new syntax?** - -Yes. See our [migration page](/docs/manual/v10.0.0/migrate-from-bucklescript-reason). You can mix and match old and new code for a smoother transition. - -**Will BuckleScript (now ReScript) break my existing code?** - -No. The new syntax & tools sit alongside the existing code. We **won't** remove OCaml and Reason support from ReScript for a long time. - -**What's the editor tooling story?** - -Much more streamlined now! See our [Editor Plugins](/docs/manual/latest/editor-plugins) page. - -Reason-language-server will continue working as-is for existing usage. We as first party don't work on ocaml's language server. - -**Will I be able to continue writing OCaml/Reason and compile to JS using BuckleScript in the future?** - -It follows from our previous answer that yes, you will still be able to. Though community-wise, we're encouraging the new syntax and tools. - -The compiler will also continue to acquire upstream OCaml features when relevant. - -**Will the new syntax prompt the move to a non-OCaml AST?** - -No, since that'd break existing ppxes (e.g. internationalization, graphql). If we feel the need to adopt a new AST in the future, it'll again be purely additive. - -**Will we have 3 syntaxes to worry about?** - -The plan is to emphasize the new syntax and focus our tooling around it. It'll be confusing to temporarily have different syntaxes in the same codebase, but that's the cost of a proper migration support. We hope this is transient; it's darkest before the dawn. - -**How do we address the fragmentation of the community by the new syntax?** - -Folks who have been in the community for a while know that there have always been opposing philosophies regarding newcomer funneling, tooling emphasis, library preferences, etc., due to differing cultures. - -Rather, it's more accurate to say a few pieces of awkwardly shared infrastructure held opposing forces together. This is true when Reason spun off from OCaml's engineering, and true when BuckleScript entered the picture. - -We can't realistically always release new features that are a compromise of various philosophies, but that's exactly what we've been trying to do for the past few years. BuckleScript's reimplementation of the Reason syntax is a departure from that (much tighter integration with the compiler, more JavaScript/TypeScript-friendly philosophy, fewer compromises, faster, less buggy). We believe that its quality speaks for said departure. - -The ReScript community will comprise of the majority of the old Reason community, most of which focused on the BuckleScript part already. The remainder of the Reason community still exists and will now focus on their existing use-case better. - -**The new changes make me worried about the future support I'm going to receive from the team.** - -_Retrospective edit, in 2021_: suffice to say that we've been doing well =). - -## Conclusion - -Thank you for your support and keep shipping. A brighter future awaits us! - -Stay safe, - -The ReScript team (Hongbo, Cheng, Cristiano, Maxim, Patrick, Ricky). diff --git a/_blogposts/2020-08-28-new-rescript-logo.mdx b/_blogposts/2020-08-28-new-rescript-logo.mdx deleted file mode 100644 index 0d40e3903..000000000 --- a/_blogposts/2020-08-28-new-rescript-logo.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -author: made_by_betty -date: "2020-08-27" -title: "A New Logo for ReScript" -articleImg: /static/blog/rescript-launch/ReScript-3.jpg -description: | - Today, our resident designer Bettina is unveiling to us the fresh new ReScript branding we've been long waiting for. We hope you're as excited about the result as us! ---- - -import Image from "src/components/Image"; - -## Why the Rebranding? - -ReScript is the evolution and fusion of Reason and BuckleScript. As we're a design-minded community, we'd like to convey this new identity not only through new technical changes as we've done so far, but also through a proper, more professionally crafted logo, color scheme and font. At the same time, we'd like to do so while recalling our roots. - -Here it is! - - - - - -The old Reason and BuckleScript logo had many limitations: -- The icons didn't really work well on round Social Media profile images (or round shapes at all). -- There's no guideline on how the logo works inverted, or on colored background. -- The large red rectangle makes it difficult to balance the logo with other elements. -- The buckle and belt were a bit too literal and did not convey much. - -The new logo addresses all these and more: - - - -## Creating Meaning Through Simple Shapes - -A minimal logo design is achieved by putting aside all distractions while focusing on legibility, meaning and small details like clear lines, interesting perspective and depth. - - - - - -**The letter "r"**, composed of two shapes, is inspired by Albers, a german-born American Bauhaus artist and typographer. An object should be simple, beautiful, functional and accessible for everyone - a statement which applies to ReScript's principles perfectly. - -**I/O**: The rectangle and circle represent the input / output, recalling the digital nature of a program. - -**The red app-shaped background** references the vibrant, playful applications our developers are empowered to create with ReScript. - -**The Logotype** ("rescript") complements the brand mark with its clean look and its embrace of technology while retaining a functional look. - -We'd like to position ReScript to be a community of product-first developers who care about the fit & finish of their work, while keeping an eye on the quality of their engineering. This interplay of design and engineering is a hard-to-achieve but beautifully worthwhile sweet spot that's frequently been missing in the programmer community; our vibrant logo is our renewed symbolic step toward this mission. Come along with us on our journey! - -## Next Steps - -In the next few weeks, we will gradually roll out our new brand identity across our official communication platforms. We'll also provide marketing material and assets on our [brand assets page](/brand) for our users. - -We hope you enjoyed our new design article. In the future, we're hoping to interleave our technical releases with a few design and UX-oriented posts. Stay tuned! - -## About the Designer / Creator - -[Bettina Steinbrecher](https://bettystein.com/) is a freelance designer and brand consultant, specialising in digital products and brands, based in Vienna. Previously she has been a Digital Designer and later on Head of Brand Design at [Adidas Runtastic](https://runtastic.com/), where she led major design efforts in the visual brand developing processes before and during the Runtastic / Adidas acquisition. She is now working as a freelance designer. - -She has been involved in our design processes since the inception of the [ReScript Association](https://rescript-association.org) in 2018, and was responsible for all the user-facing websites such as `reasonml.org` (now `rescript-lang.org`) and rescript-association.org. She also created the new logo of the [OCaml Software Foundation](https://ocaml-sf.org/). diff --git a/_blogposts/2020-09-25-release-8-3-2.mdx b/_blogposts/2020-09-25-release-8-3-2.mdx deleted file mode 100644 index a0ba49a92..000000000 --- a/_blogposts/2020-09-25-release-8-3-2.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -author: hongbo -date: "2020-09-26" -previewImg: -title: What's new in ReScript 8.3 (Part 2) -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.3](https://www.npmjs.com/package/bs-platform/v/8.3.0) is now available for testing, you can try it via - -``` -npm i bs-platform@8.3.1 -``` - -Following the [previous post](/blog/release-8-3), in this post we will go through -the enhancement over the build system. - -## Performance enhancement - -The underlying build engine for `bsb` is [ninja](https://ninja-build.org/), it is famous for -[being fast](https://www.aosabook.org/en/posa/ninja.html) -to build large C++ repos. - -In the last releases, we did lots of work for vertical integration into the bsb build chain. -For example, we replaced the dynamic dependency parser with a minimal specialized one for bsb. -we also removed the static dependencies parser which is only used for parsing C++ compiler output. - -Thanks to various other low-level improvements, the final outcome is quite impressive. -For example, The binary size for [Mac platform](https://github.com/ninja-build/ninja/releases/tag/v1.10.1) is 270 KB -while our vendored version is only 136KB. This is a non-trivial gain given that ninja is minimalist and already -optimized by top-level C++ experts. - -Note such vertical integration not only brings better performance, smaller sizes, it also brings new features - -## Build system enhancements for editor diagnostics - -When people are coding in their favorite editors, they expect to see syntax and type errors in real-time. -There are multiple ways to achieve this. The most reliable way is to always invoke the build system whenever the user saves a file. Due to not having an in-memory cache, our build system is very reliable. However we didn't yet optimize the build system for live feedback in editors. -what syntax errors, type checking errors do they have when editing? There are multiple ways to achieve this, the most easy -and reliable way is to always invoke the build system whenever the user saves the files, since it's the same build system -without any in-memory cache, the reliability is very high, however, there's several challenges to use the build system output as editor diagnostics. - -### The build system/compiler has to be fast to deliver real-time feedback - -Our build system is fast enough to deliver feedback for reasonable sized projects in less than 100ms. -thanks to our previous [hard work](/blog/scalable). We continue improving -Pushing the limits of performance in the build system allows us to provide real-time feedback in editors. - -### The warnings for each file should not be flushed during a rebuild - -For a typical file based build system, if the file A is compiled successfully with some warnings, the rebuild will not build A anymore. -This is problematic if we use the build system output for editor diagnostics. Since the second build will not capture those warnings, we -could use some caching mechanism to cache previous build output. But… stateful systems are not reliable and come with a whole range of different problems. - -To solve such a challenging problem, we did some innovations to co-ordinate the compiler and build system. When the file A is compiled with warnings, -the compiler will produce some marks to the build system, the build system will keep building but such marks are encoded in the build rules -so that the second build will do the rebuild. - -The benefit is two fold: - -- Rebuild will re-capture those warnings -- Rebuild will be fast since only those files with warnings get rebuilt, it will not trigger unnecessary builds since our build is [content-based](https://rescript-lang.org/blog/scalable) build system. - -The integration between compiler and build system is encoded in a specialized protocol. This makes it almost cost-free. - -### Notifying clients through .compiler.log - -To get the build output, instead of communicating through IPC, we adopted a simple protocol. Whenever a build is done, we write the output to a file called `.compiler.log`. -This makes the editor integration build-system agnostic, it does not need talk to the build system directly. - -It also makes our build tool work with other watchers including Facebook's [watchman](https://facebook.github.io/watchman/). -Watchman is a more scalable watcher tool for some specific platforms and less memory hungry, however, we still need a watchman-client to get the output of triggered job. -We write the output to `.compiler.log` per each build, allowing clients to read compiler diagnostics when they want. - -## A better algorithm for removing stale outputs - -Whenever we rename a file, e.g. `a.res` to `b.res`, will lead to the output of `a.res` being stale. Thanks to the deeper integration of the build system and compiler, -we employ a more advanced strategy to remove stale outputs in this release. Pruning stale outputs is done in the beginning of each build. - -There are two ways of removing staled artifacts, the second one is introduced in this release: - -- Based on live analysis and prebuilt-in knowledge - -We scan `lib/bs` directory and check some dangling `cm{i,t,j,ti}` files, if it does not exist in -the current build set, it is considered stale artifacts. If it is `cmt` file, it would trigger some hooks of `genType`, notably -cmt-rm. - -- Based on previous build logs -We store previous compilation stats. If a file is in the previous compiler output, but no longer in the output of the new build, it is considered stale and can be removed. -it is considered stale output which can be removed. - -In general, strategy two is more reliable and efficient. - -- We don't need to recompute the path since it is already done by the build system. -- When we change the in-source build to out-source build, it will still do the pruning properly - -However, strategy one is easier for tooling like `genType`. Not every tool has knowledge of the build system. - - -Sometimes a combination of both strategies is needed. -- When removing .cm* files, we use the first strategy. -- When removing generated javascript, we use strategy two, - - - -Happy Hacking! diff --git a/_blogposts/2020-09-25-release-8-3.mdx b/_blogposts/2020-09-25-release-8-3.mdx deleted file mode 100644 index 5975e6678..000000000 --- a/_blogposts/2020-09-25-release-8-3.mdx +++ /dev/null @@ -1,184 +0,0 @@ ---- -author: hongbo -date: "2020-09-25" -previewImg: -title: What's new in ReScript 8.3 (Part 1) -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.3](https://www.npmjs.com/package/bs-platform/v/8.3.0) is now available for testing, you can try it via - -``` -npm i bs-platform@8.3.0 -``` - -The changes are listed [here](https://github.com/rescript-lang/rescript/blob/master/Changes.md#83), this is a large release, and we will go through some highlighted changes. - - - -## Lightweight FFI attributes without `bs.` prefix - -In this release, we make the `bs.` prefix optional, this will make the FFI less verbose. - -For example, the old externals for `readFileAsUtf8Sync` used to be written like this - - - - -```res -@bs.val @bs.module("fs") -external readFileAsUtf8Sync: (string, @bs.as("utf8") _) => string = "readFileSync" -``` -```reason -[@bs.val] [@bs.module "fs"] -external readFileAsUtf8Sync: (string, [@bs.as "utf8"] _) => string = - "readFileSync"; -``` -```ocaml -external readFileAsUtf8Sync : string -> (_[@bs.as "utf8"]) -> string = "readFileSync" [@@bs.val] [@@bs.module "fs"] -``` - - - -It can now be simplified as - - - -```res -@val @module("fs") external readFileAsUtf8Sync: (string, @as("utf8") _) => string = "readFileSync" -``` -```reason -[@val] [@module "fs"] -external readFileAsUtf8Sync: (string, [@as "utf8"] _) => string = - "readFileSync"; -``` -```ocaml -external readFileAsUtf8Sync : string -> (_[@as "utf8"]) -> string = "readFileSync" -[@@val] [@@module "fs"] -``` - - - -Note almost all previous attributes with `bs.xx` can be simplified as `xx` -with the exception of the following two that don't have abbreviations: - -- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`; you can still use the existing one for backward compatibility. - -- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`; you can still use the existing one for -backward compatibility. - - -## default import in Es6 support - -If you use es6 module output, the default bindings will be compiled properly now: - - - -```res -@module("hello") external input: string => string = "default" - -let a = input("hello") -``` -```reason -[@module "hello"] external input: string => string = "default"; - -let a = input("hello"); -``` -```ocaml -external input : string -> string = "default" [@@module "hello"] - -let a = input "hello" -``` - - - -Will now be compiled properly under es6 format as below: - -```js -import Hello from "hello"; -var a = Hello("hello"); -``` - - -## Customized js file extension support - -Now user can pick up their js file extension support per module format: - -```json - "package-specs": [{ - "module": "es6", - "suffix": ".mjs" - },{ - "module": "commonjs", - "suffix": ".cjs" - }], - -``` - -## More flexible filename support - -To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript/issues/4624), -for example, Next.js/React Native, we allow file names like `404.res`, -`Button.Android.res` so that it can just be picked up by those tools - - - -## Better type based inference for pattern `let {a,b,c} = value` - -Previously, for code like this: - - - -```res -module N = { - type t = {x: int} -} - -let f = (u: N.t) => { - let {x} = u - x + 1 -} /* type error */ -``` -```reason -module N = { - type t = {x: int}; -}; - -let f = (u: N.t) => { - let {x} = u; - x + 1; -}; /* type error */ -``` -```ocaml -module N = struct - type t = { - x : int - } -end - -let f (u : N.t) = - let {x } = u in x + 1 (* type error *) -``` - - - -You will get a type error - -``` -Error: Unbound record field x -``` - -However, since the compiler already knows the type of `u`, it is capable of looking up the label `x` properly. -In this release, we make the original code style work out of the box without a work-around such as adding a module prefix -like `let {N.x} = ..` - -## Build system enhancement - -A lot of work is put in improving the build system, we will expand on this topic in the next post! - -Happy Hacking! diff --git a/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx b/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx deleted file mode 100644 index 43b21fe30..000000000 --- a/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx +++ /dev/null @@ -1,78 +0,0 @@ ---- -author: maxim -date: "2020-11-17" -previewImg: -badge: roadmap -title: "Editor Support, Custom Operators and More" -description: | - Update on what we're doing around the end of 2020 and early next year. ---- - -import Video from "src/components/Video"; - -## Upcoming Improvements - -As we're approaching the end of 2020, we'd like to inform our community of our remaining tasks for the year and early next year. - -## Editor Integration - -In the coming days, Cristiano and Cheng Lou will finally be ready to unveil the new VSCode ReScript experience, including diagnosis, autocompletion, jump to definition and type hints! - -