-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Caml runtimes and primitives (#6984)
* remove Caml io/formatting/converting stuffs * remove Lexing/Parsing/Parser completely * remove Caml_sys completely * remove hash/digest/Hashtbl * format jscomp/test again * restore Hashtbl.hash * update lib artifacts * remove stale tests * remove Caml compile time constants * remove (almost) Caml String/Bytes/Char/Stream * remove floatarray * remove Caml int32/int64/nativeint * remove uint32 liternal which has never exposed * migrate caml_{type}_compare/min/max primitives * Drop OCaml `Array` module * drop other OCaml DS modules * fix hashtbl size hint * rename promise primitive * remove unused code * update artifacts * remove unused module * Drop `%lazy_force` primitive * remove unused code * remove/replace all remain `caml_*` primitives * Remove unwanted float primitives * remote unused/unnecessary exn primitives * migrate dict primitive * rename #import to %import * migrate obj and option primitives * migrate hash primitives * remove unused code path * remove unused internal primitives * migrate already ones from internal primitives * specialize every primitives in a path * drop/rename more interfaces * merge exn primitive modules * move curry primitive module * move util primitives * update artifacts * fix gentype test * add empty modules for core OCamlCompat * rename ref primitives * bring back a few primitives for Core compatibility * bring back error reporting on unknown #prim * add more compat * Js_runtime_modules -> Primitive_modules * Remove unused code path * Remove unused code path (floatarray) in frontend * remove unused builtin types * fix binding * refactor primitive externs * bring back Array module accessing pattern * more compat, deprecation, and migrate stdlib-406 dir completely * cleanup ninja dependencies Now the only `runtime` dir is the built-in primitive literally Removed dependency hacks from `ninja.js` and make the dependency graph clearly `others` -> `runtime` Removed `Belt_internals` module, use compiler primitive instead Removed `runtime/js`, so made `others/js` only source of JS bindings Primitives shouldn't rely on JS any binding * add deprecation on pervasives * tmp: try fix * clean a bit * added %modfloat primitive, added Pervasives.mod_float compat * added Pervasive string conversion compat * do not mention Js module * add clean-rewatch recipe
- Loading branch information
Showing
1,082 changed files
with
10,742 additions
and
107,105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
jscomp/build_tests/super_errors/expected/modules2.res.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/modules2.res[0m:[2m1:9-14[0m | ||
[36m/.../fixtures/modules2.res[0m:[2m1:9-19[0m | ||
|
||
[1;31m1[0m [2m│[0m let b = [1;31mList.b[0m | ||
[1;31m1[0m [2m│[0m let b = [1;31mBelt.List.b[0m | ||
2 [2m│[0m | ||
|
||
The value b can't be found in List | ||
The value b can't be found in Belt.List |
17 changes: 10 additions & 7 deletions
17
jscomp/build_tests/super_errors/expected/primitives7.res.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/primitives7.res[0m:[2m3:24[0m | ||
[36m/.../fixtures/primitives7.res[0m:[2m3:23[0m | ||
|
||
1 [2m│[0m /* Wanted list(float), found list(int) */ | ||
2 [2m│[0m let a = list{1, 2, 3} | ||
[1;31m3[0m [2m│[0m List.map(n => n +. 2., [1;31ma[0m) | ||
[1;31m3[0m [2m│[0m a->Belt.List.map(n => [1;31mn[0m +. 2.) | ||
4 [2m│[0m | ||
|
||
This has type: [1;31mlist<int>[0m | ||
But this function argument is expecting: [1;33mlist<float>[0m | ||
|
||
The incompatible parts: | ||
[1;31mint[0m vs [1;33mfloat[0m | ||
This has type: [1;31mint[0m | ||
But it's being used with the [1;33m+.[0m operator, which works on: [1;33mfloat[0m | ||
|
||
Floats and ints have their own mathematical operators. This means you cannot add a float and an int without converting between the two. | ||
|
||
Possible solutions: | ||
- Ensure all values in this calculation has the type [1;33mfloat[0m. You can convert between floats and ints via [1;33mBelt.Float.toInt[0m and [1;33mBelt.Int.fromFloat[0m. | ||
- Change the operator to [1;33m+[0m, which works on [1;33mint[0m | ||
|
||
You can convert [1;33mint[0m to [1;33mfloat[0m with [1;33mBelt.Int.toFloat[0m. | ||
If this is a literal, try a number with a trailing dot (e.g. [1;33m20.[0m). |
34 changes: 0 additions & 34 deletions
34
jscomp/build_tests/super_errors/expected/warnings3.res.expected
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
let b = List.b | ||
let b = Belt.List.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* Wanted list(float), found list(int) */ | ||
let a = list{1, 2, 3} | ||
List.map(n => n +. 2., a) | ||
a->Belt.List.map(n => n +. 2.) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.