Skip to content

Commit f1a8e4e

Browse files
committed
Retrospectively update new syntax post to avoid confusion
Phrasing things so that we're not mutating the past, but don't mislead folks strumbling upon the post into deprecated places.
1 parent 628c14b commit f1a8e4e

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

_blogposts/archive/bucklescript-8-1-new-syntax.mdx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ date: "2020-07-01"
44
previewImg: https://res.cloudinary.com/dmm9n7v9f/image/upload/v1587472539/Reason%20Association/reasonml.org/reasonml_art1_1280_zfwnyo.png
55
category: syntax
66
badge: release
7-
title: "ReScript: A New Syntax for BuckleScript"
7+
title: "A New Syntax for BuckleScript"
88
description: |
99
First announcements on our latest efforts for a better syntax parser.
1010
---
1111

1212
> **Update / August 13th 2020:**
13-
> BuckleScript is now called ReScript, more infos [here](/blog/bucklescript-is-rebranding)
13+
> BuckleScript is now called ReScript, more infos [here](/blog/bucklescript-is-rebranding).
1414
1515
## What's new?
1616

17-
The release of BuckleScript 8.1 contains a new important addition: we've rewritten the Reason syntax parser and printer.
17+
The release of BuckleScript 8.1 contains a new important addition: we've rewritten the vendored Reason syntax parser and printer.
1818

1919
The rewrite was done by a community member of ours, [Maxim](https://twitter.com/_binary_search). Maxim was a main contributor to the old Reason repo, and together we've reached the conclusion a while ago that the codebase needed a revamp. After wrestling with it for the longest time, we've settled on a low-key rewrite.
2020

21-
We apologize for having kept this under wrap; syntax discussions have always been churny, so we didn't want to prematurity announce something before it's ready. After testing this extensively; we now deem it solid enough for your consumption.
21+
Syntax discussions have always been churny, so we didn't want to prematurity announce something before it's ready for proper critiques. After testing this extensively; we now deem it solid enough for your consumption.
2222

2323
**Here's what you need to know:**
24-
- The new syntax comes directly with your BuckleScript 8.1 installation. You won't have to install anything else. It does not depend on the old `refmt`.
25-
- There are a few differences in syntax, documented [here](/docs/manual/v8.0.0/migrate-from-bucklescript-reason).
26-
- This is BuckleScript-only currently.
27-
- Our editor support is currently limited; we'd like to take this occasion to clean it up. In the meantime, if you upgrade your [VSCode](https://marketplace.visualstudio.com/items?itemName=jaredly.reason-vscode) or [Sublime Text](https://github.com/reasonml-editor/sublime-reason) plugin, you should get the proper highlighting.
28-
- We've made a refmt-to-new-syntax converter that we'll release later. We'd like you to test it on small bits of code for now; a wholesale conversion at this stage would be a bit too rushed.
24+
- The new syntax comes directly with your BuckleScript >=8.1 installation. You won't have to install anything else. It does not depend on the old `refmt`.
25+
- There are a few differences in syntax between the Reason syntax, documented in the [migration docs](/docs/manual/v8.0.0/migrate-from-bucklescript-reason).
26+
- The migration docs also guides you toward converting your codebase to the new syntax, file by file or project by project.
27+
- This syntax isn't available on Reason native compilation.
28+
- As always, check our documentation's Editor Plugins section for your editor's support of this new syntax.
2929
- To avoid conflict, we've employed the new file extensions `.res` and `.resi`, for implementation and interface respectively.
30-
- This means the syntax sits alongside the existing Reason and ml syntax. We'd like to avoid eagerly deprecating the other syntaxes, but if this new one works well, we'd like to move onto more ambitious territories. Either way: your existing code will keep working!
31-
- Issues for the new syntax should go to [https://github.com/BuckleScript/syntax](https://github.com/BuckleScript/syntax) (to lessen the load on the main BuckleScript repo)
30+
- This means the syntax sits alongside the existing Reason and ml syntax. Your existing code will keep working!
31+
- Issues for the new syntax go [here](https://github.com/rescript-lang/syntax).
3232

3333
**This is how it looks like:**
3434

@@ -57,22 +57,21 @@ window["addEventListener"]("focus", onFocus)
5757
**Here is an example of an error message:**
5858

5959
```
60-
File "src/test.res", line 12, characters 57-231:
60+
Syntax error!
61+
src/test.res:7:31-8:0
6162
63+
5 │ }
64+
6 │
65+
7 │ let message = j`hello ${world}!
66+
8 │
6267
63-
10 │ }
64-
11 │
65-
12 │ let message = jHello ${userName->Js.String.toUpperCase}!`
66-
13 │
67-
14 │ type student<'extraInfo> = {
68-
69-
Did you forget to close this template expression with a backtick?
68+
Did you forget to close this template expression with a backtick?
7069
```
7170

72-
The short version: install [email protected], create a new `.res` file in your new/existing project, then have fun!
71+
The short version: install [email protected] or later, create a new `.res` file in your new/existing project, then have fun!
7372

74-
Quality-wise, the parser now features excellent error messages, is noticeably faster on projects of all scales, and should be much more robust. The rearchitecture also allows us to release in a more professional manner. We'll go into more details on the motivation and architecture in our upcoming blog posts; these will prove to be **very** interesting and illuminating for all engineers. Stay tuned! In the meantime, for any immediate questions, please ask in this [Discourse thread](https://reasonml.chat/t/bucklescript-8-1-new-syntax-option/2379).
73+
Quality-wise, the parser now features excellent error messages, is noticeably faster on projects of all scales, and should be much more robust. The rearchitecture also allows us to release in a more professional manner. We'll go into more details on the motivation and architecture in the future when the syntax pans out well; hopefully, these will prove to be **very** interesting and illuminating for all engineers. Stay tuned!
7574

76-
Maxim's effort is our community at its best and we hope that you'll enjoy his work as much as we did testing it!
75+
Maxim's effort is our community at its best and we hope that you'll enjoy his work as much as we did!
7776

7877
Stay safe!

0 commit comments

Comments
 (0)