You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove Reason Associaton & Hemnet from users of reason
The Reason Association is using ReScript, and Hemnet needs to be taken
down for legal / copyright reasons (wanted to aid @believer in getting this
change upstream)
* Update landing page
- Update marketing blocks
- Remove ReScript related quick start
- Remove unrelated examples section (these are all outdated ReScript projects)
* Update Installation instructions
Remove outdated and wrong installation instructions
and add an esy / hello-reason quickstart example.
* Update installation instructions
* Update editor plugins
* Extra goodies: remove mention of bsb-native
* Remove newcomer-examples / project-structure
These two pages were almost exclusively targeted to old BuckleScript
conventions, that aren't even up to date. Removing this info will help
not mixing up BuckleScript'isms with native development.
* Merge native sections with installation
* Fine tune frontpage copy
* Update FAQ
* Update articles and videos
* Remove community examples
Like the landing page, the examples are terribly outdated and don't
reflect modern Reason at all.
* Remove roadmap page
This page is terribly outdated as well
* Remove dead links on community events page
* Update sidebar for community pages
* Fix typo in installation
* add faq link in installation
* Improve FAQ copy
* Update faq
* Update installation
* Update JSX docs
- Added note on ReScript JSX docs for ReasonReact usage
- Removed ReasonReact / BuckleScript mentions
- Added ReveryUI as a framework using the JSX semantics
* Update external docs
* Make FAQ leaner
* Remove note on object page to non-existing section
* Remove broken links in "users-of-reason"
Some companies seem to be gone, and I couldn't find
any sign of being renamed / being acquired, so I removed
them.
* Undo (obsolete) addition for JavaScript
* Less detailed faq
* Update en.json
-[ReasonML: Hype or next big thing?](https://www.youtube.com/watch?v=bqNploxWpjA&t): October 2017
25
9
-[The Why and How of ReasonML](https://www.youtube.com/watch?v=j5mlMUzpE5g): October 2017
26
10
-[Critical ReasonML'ing](https://www.youtube.com/watch?v=k77aR_JyvEE): October 2017
@@ -39,15 +23,6 @@ title: Articles & Videos
39
23
-[C# and F# approaches to illegal states](http://enterprisecraftsmanship.com/2015/09/28/c-and-f-approaches-to-illegal-states/): F# is a cousin of Reason. Great article on F#'s equivalent of variants
40
24
-[The algebra (and calculus!) of algebraic data types](https://codewords.recurse.com/issues/three/algebra-and-calculus-of-algebraic-data-types)
41
25
42
-
## Coding Philosophy
43
-
44
-
A few articles we find interesting, or agree with. Not to be taken as literal truth.
Copy file name to clipboardExpand all lines: docs/editor-plugins.md
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,17 +13,14 @@ Reason's nature lends itself to great editor support. Most of our editor plugins
13
13
14
14
And other features.
15
15
16
-
## BuckleScript Development:
16
+
## Editor Plugins & Language Server
17
17
18
-
-[VSCode](https://github.com/jaredly/reason-language-server): **Recommended**. Use [reason-vscode](https://marketplace.visualstudio.com/items?itemName=jaredly.reason-vscode) from the extensions marketplace.
-[Emacs](https://github.com/reasonml-editor/reason-mode): **Currently unmaintained**. We'd like to upgrade it to [reason-language-server](https://github.com/jaredly/reason-language-server) one day. Contributions welcome!
18
+
Since Reason is just an alternative syntax for OCaml, we integrate seamlessly into the official OCaml editor toolchain as well.
24
19
25
-
## Native Project Development (Community Supported):
20
+
- For VSCode, we recommend using the [vscode-ocaml-platform](https://github.com/ocamllabs/vscode-ocaml-platform) plugin, which offers OCaml & Reason support out of the box.
21
+
- For other editors, we recommend using a language server client plugin of your choice, and pairing it with the [`ocaml-lsp`](https://github.com/ocaml/ocaml-lsp). Check out the respective README's to get started.
22
+
23
+
**Other:**
26
24
27
-
-[VSCode](https://marketplace.visualstudio.com/items?itemName=freebroccolo.reasonml): Use [vscode-reasonml](https://marketplace.visualstudio.com/items?itemName=freebroccolo.reasonml) from the extensions marketplace. (Mac, Linux).
28
25
-[Vim/Neovim](https://github.com/reasonml-editor/vim-reason-plus): Make sure to use [ocaml-language-server](https://www.npmjs.com/package/ocaml-language-server) for native development as suggested. (Mac, Linux): `npm install -g ocaml-language-server`
29
-
-[vim-reasonml](https://github.com/jordwalke/vim-reasonml): For use with native [esy](https://esy.sh/), Reason, and Merlin (not LSP based). (Mac, Linux, Windows).
26
+
-[vim-reasonml](https://github.com/jordwalke/vim-reasonml): For use with [esy](https://esy.sh/), Reason, and Merlin (not LSP based). (Mac, Linux, Windows).
(The above is a [BuckleScript](https://bucklescript.github.io/docs/en/intro-to-external.html)-specific external that binds to a JavaScript function of the same name.)
19
-
20
13
**Note**: `external`s can only be at the top level, or inside a module definition. You can't declare them in e.g. a function body.
21
14
22
15
## Usage
23
16
24
17
You'd use an external value/function as if it was a normal let binding.
25
18
26
-
## Tips & Tricks
27
-
28
-
If you come from a JavaScript background: **do take some time to learn about the [BuckleScript externals](https://bucklescript.github.io/docs/en/intro-to-external.html)**! In the beginning, you'll likely encounter quite a few `external`s before you get to write 100% pure idiomatic Reason code.
29
-
30
-
## Design Decisions
31
-
32
-
Reason takes interoperating with existing code very seriously. Our type system has very strong guarantees. However, such strong feature also means that, without a great interop system, it'd be very hard to gradually convert a codebase over to Reason. Fortunately, the FFI allows us to cooperate very well with [dirty, existing code](converting-from-js.md). The combination of a sound type system + great interop means that we get the benefits of a traditional gradual type system regarding incremental codebase coverage & conversion, without the downside of such gradual type system: complex features to support existing patterns, slow analysis, diminishing return in terms of type coverage, etc.
19
+
For more infos on how to link up your C functions within your Reason application, have a look at the [Dealing with foreign libraries](https://dune.readthedocs.io/en/stable/foreign-code.html?highlight=foreign) section in the `dune` build system docs.
Copy file name to clipboardExpand all lines: docs/extra-goodies.md
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,3 @@ https://sketch.sh/
17
17
## Redex
18
18
19
19
[Redex](https://redex.github.io): the Reason packages registry.
20
-
21
-
## Bsb-native
22
-
23
-
[Bsb-native](https://github.com/bsansouci/bsb-native) is a tiny fork of our `bsb` build system (used by Reason and BuckleScript) that compiles to native assembly code through the familiar setup you've been using.
Think of what project you'd usually make if it was pure JavaScript; try porting/writing that in Reason + BuckleScript instead! We recommend trying to make concrete, end-user projects (e.g. a little command line util) rather than infra-level projects (e.g. a boilerplate generator). The latter category requires expertise and understanding idiomatic Reason code.
7
6
8
-
### What's the relation between Reason, BuckleScript and OCaml?
9
-
Reason's a syntax for OCaml and supports all its features. BuckleScript compiles OCaml/Reason code into JavaScript.
7
+
You can do all the things you'd usually do with OCaml! OCaml is an incredible useful language for systems programming, while still being able to compile to pretty type safe JS with the aid of the `js_of_ocaml` compiler.
10
8
11
-
### Where do all these `print_endline`, `string_of_int` functions come from?
12
-
They're from the standard library, pre-`open`ed during the compilation of your file. This is why you see them in scope.
9
+
Natively compiled CLI's are also known to be really fast (like... C-like fast), and since the language is garbage collected, you will find yourself in a very nice spot of not having to worry about borrow-checking like in Rust and you don't have to deal with verbose non-ML languages like Go.
13
10
14
-
You can read more about the Pervasives library in the api documentation:
11
+
Reason also gives access to the declarative UI framework [revery-ui](https://github.com/revery-ui/revery) to build native applications with a ReactJS like paradigm (+ JSX).
15
12
16
-
https://reasonml.github.io/api/Pervasives.html
13
+
### What is BuckleScript and ReScript, and why is it mentioned in so many Reason related resources?
17
14
18
-
### Can I have a function to print arbitrary data structures?
19
-
If you're compiling to JavaScript through BuckleScript, you can use the JS `console.log` through [`Js.log`](https://bucklescript.github.io/bucklescript/api/Js.html#VALlog).
15
+
Reason was originally bundled with BuckleScript (JS compiler) to provide a single toolchain for JS / ReactJS development.
20
16
21
-
### Why is there a + for adding ints and +. for adding floats, etc.?
22
-
See [here](integer-and-float.md#design-decisions).
23
-
24
-
### Does library ___ work with Reason?
25
-
Most JS libraries should easily work under Reason + BuckleScript.
26
-
27
-
### What's the server-side story? Should I compile to native or to JS and use node.js?
28
-
At this time, we recommend compiling to JS through BuckleScript and use the JS wrappers at [reasonml-community](https://github.com/reasonml-community) or somewhere else.
29
-
30
-
### What's BuckleScript's async story?
31
-
If you're not interfacing with any library that uses promises, you can simply use callbacks. Everyone gets them and they're performant.
32
-
33
-
If you need to bind to a JS library that uses promises, or communicate with such library, you can use BS's [Js.Promise](http://bucklescript.github.io/bucklescript/api/Js.Promise.html).
34
-
35
-
### What's the (unit) test story?
36
-
Some of OCaml's language features (not just types) might be able to defer the need for unit testing until later. In the meantime, for compilation to JS, we're working on [Jest wrapper](https://github.com/BuckleTypes/bs-jest). We'll look into using Jest for native too, if Jest is written using Reason in the future (no concrete plan yet). [OUnit](http://ounit.forge.ocamlcore.org) is a good, small native OCaml testing library right now.
37
-
38
-
### What's the `.merlin` file at the root of my project?
39
-
That's the metadata file for [editor support](editor-plugins.md). This is usually generated for you; You don't need to check that into your version control and don't have to manually modify it.
40
-
41
-
### I don't see any `import` or `require` in my file; how does module resolution work?
42
-
Reason/OCaml doesn't require you to write any import; modules being referred to in the file are automatically searched in the project. Specifically, a module `Hello` asks the compiler to look for the file `hello.re` or `hello.ml` (and their corresponding [interface file](module.md#signatures), `hello.rei` or `hello.mli`, if available).
43
-
44
-
A module name is the file name, capitalized. It has to be unique per project; this abstracts away the file system and allows you to move files around without changing code.
45
-
46
-
### Is `Some | None`, `contents`, `Array`, `List` and all of these special? Where do they come from?
47
-
They're ordinary variants/records/module definitions that come with the [standard library](/api/index.html), `open`ed by default during compilation out of convenience.
48
-
49
-
### What does an argument with a prepended underscore (e.g. `_` or `_foo`) mean?
50
-
Say you have `List.map(item => 1, myList);`. The argument `item` isn't used and will generate a compiler warning. Using `_ => 1` instead indicates that you're intentionally receiving and ignoring the argument, therefore bypassing the warning. Alternatively, `_item => 1` has the same effect, but indicates more descriptively what you're ignoring.
51
-
52
-
### What's this `MyModule.t` I keep seeing?
53
-
Assuming `MyModule` is a module's name, `t` is a community convention that indicates "the type that represents that module, whatever that means". For example, for the [`Js.String`](http://bucklescript.github.io/bucklescript/api/Js.String.html) module, [`String.t`](http://bucklescript.github.io/bucklescript/api/Js.String.html#TYPEt) is the type carried around and representing "a string".
54
-
55
-
### Why is there a [`Js_promise`](http://bucklescript.github.io/bucklescript/api/Js_promise.html) and then a [`Js.Promise`](http://bucklescript.github.io/bucklescript/api/Js.Promise.html)? What about [`Js_array`](http://bucklescript.github.io/bucklescript/api/Js_array.html), [`Js_string`](http://bucklescript.github.io/bucklescript/api/Js_string.html) and whatever else?
56
-
As a convention, `Js_foo` is the actual module, and `Js.Foo` is just an alias for it. They're [equivalent](https://github.com/bloomberg/bucklescript/blob/7bc37f387a726ba1ae4afeefe02b9c82577d9e10/jscomp/runtime/js.ml#L124-L138). Prefer `Js.Foo`, because that's the official, public module name.
57
-
58
-
### Why are BuckleScript and bsb so fast?
59
-
Software should at least be this fast.
17
+
In July 2020, BuckleScript released its own syntax and rebranded to ReScript to be its own language. More infos can be found in their [official rebranding announcement](https://rescript-lang.org/blog/bucklescript-is-rebranding).
0 commit comments