Skip to content

Remove outdated content #719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
19ab289
Remove Reason Associaton & Hemnet from users of reason
ryyppy Jan 2, 2021
2b1a53e
Update landing page
ryyppy Jan 2, 2021
af88724
Update Installation instructions
ryyppy Jan 2, 2021
685ddeb
Update installation instructions
ryyppy Jan 2, 2021
87b4867
Update editor plugins
ryyppy Jan 2, 2021
ae730bc
Extra goodies: remove mention of bsb-native
ryyppy Jan 2, 2021
45dfd05
Remove newcomer-examples / project-structure
ryyppy Jan 2, 2021
27e0463
Merge native sections with installation
ryyppy Jan 2, 2021
849f753
Fine tune frontpage copy
ryyppy Jan 2, 2021
1a7fa6d
Update FAQ
ryyppy Jan 2, 2021
74d9a16
Update articles and videos
ryyppy Jan 2, 2021
386ea40
Remove community examples
ryyppy Jan 2, 2021
0300f96
Remove roadmap page
ryyppy Jan 2, 2021
41d118f
Remove dead links on community events page
ryyppy Jan 2, 2021
9d4389a
Update sidebar for community pages
ryyppy Jan 2, 2021
b67a12c
Fix typo in installation
ryyppy Jan 2, 2021
f5c30d7
add faq link in installation
ryyppy Jan 2, 2021
c241740
Improve FAQ copy
ryyppy Jan 2, 2021
a8dc6bd
Update faq
ryyppy Jan 3, 2021
758372f
Update installation
ryyppy Jan 3, 2021
5e53b2e
Update JSX docs
ryyppy Jan 3, 2021
5ccbfdc
Update external docs
ryyppy Jan 3, 2021
6c69f87
Make FAQ leaner
ryyppy Jan 3, 2021
fc65dad
Remove note on object page to non-existing section
ryyppy Jan 3, 2021
800d32f
Remove broken links in "users-of-reason"
ryyppy Jan 3, 2021
2e6b374
Undo (obsolete) addition for JavaScript
ryyppy Jan 3, 2021
acf2fd9
Less detailed faq
ryyppy Jan 5, 2021
851772e
Update en.json
ryyppy Jan 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions docs/articles-and-videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,9 @@
title: Articles & Videos
---

## BuckleScript

- [BuckleScript Documentation](https://bucklescript.github.io): the official documentations for our JavaScript backend.
- [BuckleScript JS API docs](http://bucklescript.github.io/bucklescript/api/index.html)
- [BuckleScript build system schema](https://bucklescript.github.io/docs/en/build-overview.html): comprehensive resource on `bsb`'s configuration.
- [BuckleScript Cookbook](https://github.com/glennsl/bucklescript-cookbook)
- [Unit Testing in ReasonML](https://jaketrent.com/post/unit-testing-in-reasonml/)

## ReasonReact

- [Documentation](//reasonml.github.io/reason-react/)
- [Interactive ReasonReact Tutorial](https://jaredforsyth.com/2017/07/05/a-reason-react-tutorial/): features runnable code and type hint on hover!
- [Deploying ReasonReact with Docker](https://medium.com/@anirudhmurali/how-i-deployed-a-reasonml-react-app-with-docker-29dd2ce6de82)
- [Building a Marvel Heroes App using ReasonReact](https://medium.com/oke-software-poland/reasonml-marvel-tutorial-part-0-e38e1bfe1866)

## Videos

- [React To The Future - ReasonConf 2019](https://www.youtube.com/watch?v=5fG_lyNuEAw)
- [Community-maintained Reason talks playlist](https://www.youtube.com/playlist?list=PLYU6eGtVFu8ZG3yh1FfLrqHBMUXj80wgK)
- [ReasonML: Hype or next big thing?](https://www.youtube.com/watch?v=bqNploxWpjA&t): October 2017
- [The Why and How of ReasonML](https://www.youtube.com/watch?v=j5mlMUzpE5g): October 2017
- [Critical ReasonML'ing](https://www.youtube.com/watch?v=k77aR_JyvEE): October 2017
Expand All @@ -39,15 +23,6 @@ title: Articles & Videos
- [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
- [The algebra (and calculus!) of algebraic data types](https://codewords.recurse.com/issues/three/algebra-and-calculus-of-algebraic-data-types)

## Coding Philosophy

A few articles we find interesting, or agree with. Not to be taken as literal truth.

- [Write dumb code](https://matthewrocklin.com/blog//work/2018/01/27/write-dumb-code)
- [Not Explicit](https://boats.gitlab.io/blog/post/2017-12-27-things-explicit-is-not/)
- [Always start with simple solution](http://buklijas.info/blog/2018/01/01/always-start-with-simple-solution/)
- [The Pony Philosophy](https://www.ponylang.org/discover/#the-pony-philosophy)

## Pro Links

The more dated they look, the richer the content =P
Expand Down
30 changes: 0 additions & 30 deletions docs/community-examples.md

This file was deleted.

17 changes: 7 additions & 10 deletions docs/editor-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ Reason's nature lends itself to great editor support. Most of our editor plugins

And other features.

## BuckleScript Development:
## Editor Plugins & Language Server

- [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.
- [Atom](https://github.com/reasonml-editor/atom-ide-reason)
- [Vim/Neovim](https://github.com/reasonml-editor/vim-reason-plus)
- [Sublime Text](https://github.com/reasonml-editor/sublime-reason)
- [IDEA](https://github.com/reasonml-editor/reasonml-idea-plugin)
- [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!
Since Reason is just an alternative syntax for OCaml, we integrate seamlessly into the official OCaml editor toolchain as well.

## Native Project Development (Community Supported):
- 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.
- 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.

**Other:**

- [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).
- [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`
- [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).
- [vim-reasonml](https://github.com/jordwalke/vim-reasonml): For use with [esy](https://esy.sh/), Reason, and Merlin (not LSP based). (Mac, Linux, Windows).
11 changes: 0 additions & 11 deletions docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,16 @@ title: Events
There are a Reason meetups all around the world, among others:

- [Alicante](https://www.meetup.com/Alicante-Frontend/events/256373865/)
- [Budapest](https://www.meetup.com/ReasonML-Budapest/)
- [Brussels](https://www.meetup.com/ReasonML-BXL/)
- [Chicago](https://www.meetup.com/Chicago-ReasonML/)
- [Copenhagen](https://www.meetup.com/ReasonML-CPH) ([Twitter](https://twitter.com/ReasonMLCPH))
- [Göteborg](https://www.meetup.com/got-lambda/)
- [Lisbon](https://www.meetup.com/ReasonML-Lisbon)
- [London](https://www.meetup.com/ReasonLDN/) ([Twitter](https://twitter.com/reasonldn))
- [Montreal](https://www.meetup.com/ReasonMTL/)
- [Munich](https://www.meetup.com/Munich-ReasonML-Meetup)
- [New York](https://www.meetup.com/ReasonML-NYC/) ([Twitter](https://twitter.com/nycreasonml))
- [Oslo](https://www.meetup.com/Reason-Oslo/) ([Twitter](http://twitter.com/reasonoslo/))
- [Paris](https://www.meetup.com/ReasonML-Paris/)
- [Phoenix](https://www.meetup.com/Phoenix-Reason)
- [Portland](https://www.meetup.com/Portland-ReasonML/) ([Twitter](https://twitter.com/ReasonPDX))
- [Prague](https://www.meetup.com/Reason-Prague/) ([Twitter](https://twitter.com/ReasonPrague))
- [San Francisco](https://www.meetup.com/sv-ocaml/)
- [Seattle](https://www.meetup.com/Seattle-ReasonML-OCaml-Meetup/)
- [Singapore](https://www.meetup.com/SG-OCaml/)
- [Stockholm](https://www.meetup.com/ReasonSTHLM/)
- [Sydney](https://www.meetup.com/reason-sydney/)
- [Vancouver](https://www.meetup.com/Reason-Vancouver/)
- [Vienna](https://www.meetup.com/Reason-Vienna/) ([Twitter](https://twitter.com/reasonvienna))

If you don't find your local area's Reason meetup, search on https://meetup.com or start one!
15 changes: 1 addition & 14 deletions docs/external.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,10 @@ Imagine writing a let binding, but with its body omitted and its (mandatory) typ
external myCFunction: int => string = "theCFunction";
```

```reason
[@bs.val] external getElementsByClassName: string => array(Dom.element) =
"document.getElementsByClassName";
```

(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.)

**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.

## Usage

You'd use an external value/function as if it was a normal let binding.

## Tips & Tricks

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.

## Design Decisions

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.
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.
4 changes: 0 additions & 4 deletions docs/extra-goodies.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ https://sketch.sh/
## Redex

[Redex](https://redex.github.io): the Reason packages registry.

## Bsb-native

[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.
54 changes: 6 additions & 48 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,15 @@ title: Frequently Asked Questions
---

### I'm not sure what to do with Reason
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.

### What's the relation between Reason, BuckleScript and OCaml?
Reason's a syntax for OCaml and supports all its features. BuckleScript compiles OCaml/Reason code into JavaScript.
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.

### Where do all these `print_endline`, `string_of_int` functions come from?
They're from the standard library, pre-`open`ed during the compilation of your file. This is why you see them in scope.
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.

You can read more about the Pervasives library in the api documentation:
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).

https://reasonml.github.io/api/Pervasives.html
### What is BuckleScript and ReScript, and why is it mentioned in so many Reason related resources?

### Can I have a function to print arbitrary data structures?
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).
Reason was originally bundled with BuckleScript (JS compiler) to provide a single toolchain for JS / ReactJS development.

### Why is there a + for adding ints and +. for adding floats, etc.?
See [here](integer-and-float.md#design-decisions).

### Does library ___ work with Reason?
Most JS libraries should easily work under Reason + BuckleScript.

### What's the server-side story? Should I compile to native or to JS and use node.js?
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.

### What's BuckleScript's async story?
If you're not interfacing with any library that uses promises, you can simply use callbacks. Everyone gets them and they're performant.

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).

### What's the (unit) test story?
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.

### What's the `.merlin` file at the root of my project?
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.

### I don't see any `import` or `require` in my file; how does module resolution work?
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).

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.

### Is `Some | None`, `contents`, `Array`, `List` and all of these special? Where do they come from?
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.

### What does an argument with a prepended underscore (e.g. `_` or `_foo`) mean?
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.

### What's this `MyModule.t` I keep seeing?
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".

### 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?
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.

### Why are BuckleScript and bsb so fast?
Software should at least be this fast.
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).
Loading