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
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
-
Issues are for bugs. If you have questions, ask them on a [community forum][comm]. Folks are friendly and happy to help!
1
+
Issues are for bugs. If you have questions, ask them on a [community forum][forum] or [chat][chat]. Folks are friendly and happy to help!
2
2
3
-
[comm]: https://discord.gg/reasonml
3
+
[forum]: https://reasonml.chat
4
+
[chat]: https://discord.gg/reasonml
4
5
5
6
For bug reports, in general, it is recommended to report potential bugs in **OCaml syntax**, this will help reduce the possible bug causes from Reason side.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+59-18Lines changed: 59 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,8 @@ npm run build
50
50
And whenever you modify a file in bucklescript, run this inside `jscomp/`:
51
51
52
52
```
53
-
make ../lib/bsc.exe && ./install-bsc.sh
54
-
make ../lib/bsb.exe && ./install-bsb.sh
53
+
make ../lib/bsc.exe && ./install-bsc.sh # build the compiler and make it available globally
54
+
make ../lib/bsb.exe && ./install-bsb.sh # build the build system and make it available globally
55
55
```
56
56
57
57
This will substitute the global `bsc.exe` & `bsb.exe` you just installed with the newly built one. Then run `npm build again` in the dummy project and see the changes! The iteration cycle for testing these should be around 2 seconds =).
@@ -61,16 +61,15 @@ This will substitute the global `bsc.exe` & `bsb.exe` you just installed with th
61
61
Did any of the above step not work?
62
62
63
63
- If you get compilation errors even from a supposedly clean compilation, you might have skipped the opam reinstall step above: `opam switch reinstall 4.02.3+buckle-master`
64
-
65
64
- Make sure you did "eval `opam config env`" In your CLI/bashrc/zshrc
66
-
67
65
-**If the vendored ocaml changed between when you last iterated on the repo and now**, you probably skipped the `opam switch reinstall 4.02.3+buckle-master` part. You'll have to do `git clean -xdf` and then restart with the build instructions. Careful, as `git clean` removes your uncommitted changes.
68
-
69
66
-**If these fail too**, make sure you do have the correct `ocamlopt` in your environment: `which ocamlopt` should show an `opam` path, not `reason-cli` path. If you see the latter, this means it overrode the global `ocamlopt` BuckleScript needed. In this case, either temporarily uninstall reason-cli or make sure your opam PATH overrides the reason-cli PATH (and not the other way around) in your bashrc/zshrc.
70
67
71
-
## Special Iteration Workflow
68
+
Whenever there are dependencies changes: do `make depend` in the specific directory, when available. This allows the makefile to track new dependencies.
69
+
70
+
## Change the Vendored OCaml Compiler
72
71
73
-
This section is reserved for when you're making a change to the vendored ocaml compiler itself, in vendor/ocaml, and then testing on super-errors changes at the same time. If you're doing this for whatever reason, then the previous quick iteration workflow wouldn't work. Here's what you have to do after each change:
72
+
This section is reserved for when you're making a change to the vendored ocaml compiler itself, in `vendor/ocaml`, and then testing on super-errors changes at the same time. If you're doing this for whatever reason, then the previous quick iteration workflow wouldn't work. Here's what you have to do after each change:
74
73
75
74
```
76
75
# at project root
@@ -121,27 +120,16 @@ The API reference is generated from doc comments in the source code.
121
120
Some tips and guidelines:
122
121
123
122
- The first sentence or line should be a very short summary. This is used in indexes and by tools like merlin.
124
-
125
123
- Ideally, every function should have **at least one**`@example`.
126
-
127
124
- Cross-reference another definition with `{! identifier}`. But use them sparingly, they’re a bit verbose (currently, at least).
128
-
129
125
- Wrap non-cross-referenced identifiers and other code in `[ ... ]`.
130
-
131
126
- Escape `{`, `}`, `[`, `]` and `@` using `\`.
132
-
133
127
- It’s possible to use `{%html ...}` to generate custom html, but use this very, very sparingly.
134
-
135
128
- A number of "documentation tags" are provided that would be nice to use, but unfortunately they’re often not supported for \`external\`s. Which is of course most of the API.
136
-
137
129
-`@param` usually doesn’t work. Use `{b <param>} ...` instead
138
-
139
130
-`@returns` usually doesn’t work. Use `{b returns} ...` instead.
140
-
141
131
- Always use `@deprecated` when applicable.
142
-
143
132
- Always use `@raise` when applicable.
144
-
145
133
- Always provide a `@see` tag pointing to MDN for more information when available.
146
134
147
135
See [Ocamldoc documentation](http://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html#sec333) for more details.
@@ -151,6 +139,59 @@ To generate the html, run `make docs` in `jscomp/`.
151
139
Html generation uses a custom generator located in `odoc_gen/` and
152
140
custom styles located in `docs/api_static`.
153
141
142
+
## Make a Release
143
+
144
+
In release mode, assuming you have NodeJS and OCaml compiler with the right version installed:
145
+
146
+
```sh
147
+
node scripts/install.js
148
+
```
149
+
150
+
The build process will generate configure file with correct `LIBDIR` path,
151
+
build all binaries and libraries and
152
+
install the binaries into `bin` and lib files into `lib`.
153
+
154
+
First it will try to generate `bin/config_whole_compiler.ml` based on existing
155
+
OCaml installation, if it fails, it will try to invoke `buildocaml.sh` to
156
+
install an OCaml compiler from scratch, and retry again.
157
+
158
+
### Publish Process
159
+
160
+
- Run `make force-snapshotml`
161
+
- Bump the compiler version
162
+
163
+
## Code structure
164
+
165
+
The highlevel architecture is illustrated as below:
166
+
167
+
```
168
+
Lambda IR (OCaml compiler libs) ---+
169
+
| ^ |
170
+
| | Lambda Passes (lam_* files)
171
+
| | Optimization/inlining/dead code elimination
172
+
| \ |
173
+
| \ --------------------------+
174
+
|
175
+
| Self tail call elimination
176
+
| Constant folding + propagation
177
+
V
178
+
JS IR (J.ml) ---------------------+
179
+
| ^ |
180
+
| | JS Passes (js_* files)
181
+
| | Optimization/inlining/dead code elimination
182
+
| \ |
183
+
| \ -------------------------+
184
+
|
185
+
| Smart printer includes scope analysis
186
+
|
187
+
V
188
+
Javascript Code
189
+
```
190
+
191
+
Note that there is one design goal to keep in mind, never introduce
192
+
any meaningless symbol unless real necessary, we do optimizations,
193
+
however, it should also compile readable output code.
194
+
154
195
## Contribution Licensing
155
196
156
197
Since BuckleScript is distributed under the terms of the [LGPL Version 3](LICENSE), contributions that you make
Copy file name to clipboardExpand all lines: Changes.md
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,39 @@
1
+
# 3.0.0
2
+
3
+
Features:
4
+
5
+
-#2740, #2726 Generalized safe/cleaner embedding raw function (https://bucklescript.github.io/docs/en/interop-cheatsheet.html#generaizlied-raw-js-since-300)
6
+
7
+
-#2687, #2665, #2663 bs.deriving abstract type, a powerful way for idiomatic JS and FFI
0 commit comments