Skip to content

Commit

Permalink
Rename folder "jscomp" to "compiler" (#7086)
Browse files Browse the repository at this point in the history
* Rename folder "jscomp" to "compiler"

* Adapt to rename

* CHANGELOG
  • Loading branch information
cknitt authored Oct 7, 2024
1 parent 7372be9 commit b1bda7a
Show file tree
Hide file tree
Showing 2,621 changed files with 26 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2 # to be able to check for changes in subfolder jscomp/syntax later
fetch-depth: 2 # to be able to check for changes in subfolder compiler/syntax later

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
id: syntax-diff
shell: bash
run: |
if git diff --name-only --exit-code HEAD^ HEAD -- jscomp/syntax; then
if git diff --name-only --exit-code HEAD^ HEAD -- compiler/syntax; then
echo "syntax_status=unchanged" >> $GITHUB_ENV
else
echo "syntax_status=changed" >> $GITHUB_ENV
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
run: |
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
opam exec -- dune build --profile browser
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.js
- name: Test playground compiler
if: matrix.build_playground
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ tests/build_tests/*/lib/
*.jsoo.js
*.so
tmp/
jscomp/.lsp
tracing*.json
.nyc_output
.vscode/launch.json
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- Build runtime/stdlib files with rescript/bsb instead of ninja.js. https://github.com/rescript-lang/rescript-compiler/pull/7063
- Build tests with bsb and move them out of jscomp. https://github.com/rescript-lang/rescript-compiler/pull/7068
- Run `build_tests` on Windows. https://github.com/rescript-lang/rescript-compiler/pull/7065
- Rename folder "jscomp" to "compiler". https://github.com/rescript-lang/rescript-compiler/pull/7086

# 12.0.0-alpha.3

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ node scripts/test.js -bsb

**Run ounit tests:**

This will run unit tests for compiler related modules. The tests can be found in `jscomp/ounit_tests`.
This will run unit tests for compiler related modules. The tests can be found in `compiler/ounit_tests`.

```
node scripts/test.js -ounit
```

## Contributing to the Runtime

The runtime implementation is written in OCaml with some raw JS code embedded (`jscomp/runtime` directory).
The runtime implementation is written in ReScript with some raw JS code embedded (`runtime` directory).

The goal is to implement the runtime **purely in OCaml**. This includes removing all existing occurrences of embedded raw JS code as well whenever possible, and you can help!
The goal is to implement the runtime **purely in ReScript**. This includes removing all existing occurrences of embedded raw JS code as well whenever possible, and you can help!

Each new PR should include appropriate testing.

Expand Down Expand Up @@ -226,7 +226,7 @@ opam install js_of_ocaml.4.0.0

### Building the Bundle

The entry point of the JSOO bundle is located in `jscomp/jsoo/jsoo_playground_main.ml`, the compiler and its relevant runtime cmij files can be built via make:
The entry point of the JSOO bundle is located in `compiler/jsoo/jsoo_playground_main.ml`, the compiler and its relevant runtime cmij files can be built via make:

```sh
make playground
Expand Down
19 changes: 6 additions & 13 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,28 @@ Thanks to the [OCaml](https://ocaml.org) team, obviously, without such a beautif

ReScript builds on these parts of OCaml:

- [`jscomp/core/lam_pass_exits.ml`](jscomp/core/lam_pass_exits.ml)
- [`jscomp/core/lam_pass_lets_dce.ml`](jscomp/core/lam_pass_lets_dce.ml)
- [`compiler/core/lam_pass_exits.ml`](compiler/core/lam_pass_exits.ml)
- [`compiler/core/lam_pass_lets_dce.ml`](compiler/core/lam_pass_lets_dce.ml)

These modules were adapted from [`ocaml/bytecomp/simplif.ml`](ocaml/bytecomp/simplif.ml) for
JavaScript specific optimization purposes.

- [`jscomp/main/rescript_compiler_main.ml`](jscomp/main/rescript_compiler_main.ml)
- [`compiler/main/rescript_compiler_main.ml`](compiler/main/rescript_compiler_main.ml)

`jscomp/main/rescript_compiler_main.ml` is adapted from [`ocaml/driver/main.ml`](ocaml/driver/main.ml). It is the main entry
`compiler/main/rescript_compiler_main.ml` is adapted from [`ocaml/driver/main.ml`](ocaml/driver/main.ml). It is the main entry
point of the underlying compiler.

- [`jscomp/stdlib-406`](jscomp/stdlib-406)

`jscomp/stdlib-*` is copied from [`ocaml/stdlib`](ocaml/stdlib). It is compiled to JavaScript and included with ReScript.

ReScript imported one file from [jsoo](https://github.com/ocsigen/js_of_ocaml)

- [`jscomp/core/js_dump.ml`](jscomp/core/js_dump.ml) (pretty printer)
- [`compiler/core/js_dump.ml`](compiler/core/js_dump.ml) (pretty printer)

This file was imported but changed significantly in iterations later.

- [`tests/tests`](tests/tests)

`tests/tests` is based on [`ocaml/testsuite`](ocaml/testsuite).

ReScript unit test builds on parts of [OUnit](http://ounit.forge.ocamlcore.org/)

- [`jscomp/ounit`](jscomp/ounit) is adapted from ounit, the unit test
utilities are only used for dev purpose, they are not required for distribution
ReScript compiler unit test builds on [OUnit](http://ounit.forge.ocamlcore.org/)

## Ninja

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bench:
$(DUNE_BIN_DIR)/syntax_benchmarks

dce:
reanalyze.exe -dce-cmt _build/default/jscomp
reanalyze.exe -dce-cmt _build/default/compiler

rewatch:
cargo build --manifest-path rewatch/Cargo.toml
Expand Down Expand Up @@ -48,7 +48,7 @@ test-gentype:
test-all: test test-gentype

reanalyze:
reanalyze.exe -set-exit-code -all-cmt _build/default/jscomp -suppress jscomp/syntax/testrunner -exclude-paths jscomp/outcome_printer,jscomp/ounit_tests,jscomp/ml,jscomp/js_parser,jscomp/frontend,jscomp/ext,jscomp/depends,jscomp/core,jscomp/common,jscomp/cmij,jscomp/bsb_helper,jscomp/bsb
reanalyze.exe -set-exit-code -all-cmt _build/default/compiler -suppress compiler/syntax/testrunner -exclude-paths compiler/outcome_printer,compiler/ounit_tests,compiler/ml,compiler/js_parser,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb

lib: build node_modules/.bin/semver
./scripts/buildRuntime.sh
Expand All @@ -60,7 +60,7 @@ artifacts: lib
# Builds the core playground bundle (without the relevant cmijs files for the runtime)
playground:
dune build --profile browser
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
cp ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js playground/compiler.js

# Creates all the relevant core and third party cmij files to side-load together with the playground bundle
playground-cmijs: artifacts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ For discussions on ongoing development, see the [Development](https://forum.resc

ReScript is licensed under LGPL version 3, with relaxed rules about creating and distributing combined work. See the [LICENSE](LICENSE) file for details.

The ReScript parser (subdirectory `jscomp/syntax`) is licensed under the [MIT License](jscomp/syntax/LICENSE).
The ReScript parser (subdirectory `compiler/syntax`) is licensed under the [MIT License](compiler/syntax/LICENSE).

The `ninja` subdirectory contains the vendored [ninja](https://github.com/ninja-build/ninja) build system.
Refer to its copyright and license notices for information about its licensing.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ val include_dirs_by : 'a list -> ('a -> string) -> string

val mkp : string -> unit

(* The path of [bsc] and [bsdep] is normalized so that the invokation of [./jscomp/bin/bsb.exe]
(* The path of [bsc] and [bsdep] is normalized so that the invokation of [./compiler/bin/bsb.exe]
and [bsb.exe] (combined with a dirty bsconfig.json) will not trigger unnecessary rebuild.
The location of [bsc] and [bsdep] is configured by the combination of [Sys.executable_name]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ let oc_cmi buf namespace source =
it can be errored out earlier
#5368: It turns out there are many false positives on detecting self-cycles (see: `tests/build_tests/zerocycle`)
To properly solve this, we would need to `jscomp/ml/depend.ml` because
To properly solve this, we would need to `compiler/ml/depend.ml` because
cmi and cmj is broken in the first place (same problem as in ocaml/ocaml#4618).
So we will just ignore the self-cycles. Even if there is indeed a self-cycle, it should fail to compile anyway.
*)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b1bda7a

Please sign in to comment.