-
Notifications
You must be signed in to change notification settings - Fork 198
Runtime: allow one to directly access values exported in the runtime #2086
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
Open
hhugo
wants to merge
10
commits into
master
Choose a base branch
from
custom
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7dbb19a
WIP
hhugo b93e4be
X
hhugo ef9966e
WIP
hhugo 07ed5a1
Wasm implementation
vouillon a8d8688
WIP
hhugo 80073bb
Make the test work with wasm_of_ocaml
vouillon 920bb9b
Revert unnecessary changes
vouillon c0dd53e
WIP
hhugo 7bc56d7
WIP
hhugo 57b483c
WIP
hhugo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| Missing | ||
| ------- | ||
|
|
||
| From unix.bc: | ||
| caml_assume_no_perform | ||
| caml_continuation_use | ||
| caml_int_as_pointer | ||
| caml_jsoo_runtime | ||
| caml_reset_afl_instrumentation | ||
| caml_unix_accept | ||
| caml_unix_bind | ||
| caml_unix_clear_close_on_exec | ||
| caml_unix_clear_nonblock | ||
| caml_unix_connect | ||
| caml_unix_create_process | ||
| caml_unix_dup | ||
| caml_unix_dup2 | ||
| caml_unix_environment | ||
| caml_unix_execv | ||
| caml_unix_execve | ||
| caml_unix_execvp | ||
| caml_unix_execvpe | ||
| caml_unix_filedescr_of_channel | ||
| caml_unix_getaddrinfo | ||
| caml_unix_gethostbyaddr | ||
| caml_unix_gethostbyname | ||
| caml_unix_gethostname | ||
| caml_unix_getnameinfo | ||
| caml_unix_getpeername | ||
| caml_unix_getpid | ||
| caml_unix_getprotobyname | ||
| caml_unix_getprotobynumber | ||
| caml_unix_getservbyname | ||
| caml_unix_getservbyport | ||
| caml_unix_getsockname | ||
| caml_unix_getsockopt | ||
| caml_unix_listen | ||
| caml_unix_lockf | ||
| caml_unix_map_file_bytecode | ||
| caml_unix_pipe | ||
| caml_unix_putenv | ||
| caml_unix_realpath | ||
| caml_unix_recv | ||
| caml_unix_recvfrom | ||
| caml_unix_select | ||
| caml_unix_send | ||
| caml_unix_sendto | ||
| caml_unix_set_close_on_exec | ||
| caml_unix_set_nonblock | ||
| caml_unix_setsockopt | ||
| caml_unix_shutdown | ||
| caml_unix_sleep | ||
| caml_unix_socket | ||
| caml_unix_socketpair | ||
| caml_unix_string_of_inet_addr | ||
| caml_unix_system | ||
| caml_unix_terminate_process | ||
| caml_unix_waitpid | ||
| debugger | ||
|
|
||
| Unused | ||
| ------- | ||
|
|
||
| From +array.js: | ||
| caml_check_bound | ||
|
|
||
| From +bigarray.js: | ||
| caml_ba_create_from (deprecated) | ||
| caml_ba_init | ||
|
|
||
| From +bigstring.js: | ||
| caml_bigstring_blit_ba_to_ba | ||
| caml_bigstring_blit_ba_to_bytes | ||
| caml_bigstring_blit_bytes_to_ba | ||
| caml_bigstring_blit_string_to_ba | ||
| caml_bigstring_memcmp | ||
| caml_hash_mix_bigstring | ||
|
|
||
| From +effect.js: | ||
| jsoo_effect_not_supported | ||
|
|
||
| From +fs.js: | ||
| caml_ba_map_file | ||
| caml_ba_map_file_bytecode | ||
| caml_fs_init | ||
| jsoo_create_file | ||
| jsoo_create_file_extern | ||
|
|
||
| From +graphics.js: | ||
| caml_gr_arc_aux | ||
| caml_gr_blit_image | ||
| caml_gr_clear_graph | ||
| caml_gr_close_graph | ||
| caml_gr_close_subwindow | ||
| caml_gr_create_image | ||
| caml_gr_current_x | ||
| caml_gr_current_y | ||
| caml_gr_display_mode | ||
| caml_gr_doc_of_state | ||
| caml_gr_draw_arc | ||
| caml_gr_draw_char | ||
| caml_gr_draw_image | ||
| caml_gr_draw_rect | ||
| caml_gr_draw_str | ||
| caml_gr_draw_string | ||
| caml_gr_dump_image | ||
| caml_gr_fill_arc | ||
| caml_gr_fill_poly | ||
| caml_gr_fill_rect | ||
| caml_gr_lineto | ||
| caml_gr_make_image | ||
| caml_gr_moveto | ||
| caml_gr_open_graph | ||
| caml_gr_open_subwindow | ||
| caml_gr_plot | ||
| caml_gr_point_color | ||
| caml_gr_remember_mode | ||
| caml_gr_resize_window | ||
| caml_gr_set_color | ||
| caml_gr_set_font | ||
| caml_gr_set_line_width | ||
| caml_gr_set_text_size | ||
| caml_gr_set_window_title | ||
| caml_gr_sigio_handler | ||
| caml_gr_sigio_signal | ||
| caml_gr_size_x | ||
| caml_gr_size_y | ||
| caml_gr_state | ||
| caml_gr_state_create | ||
| caml_gr_state_get | ||
| caml_gr_state_init | ||
| caml_gr_state_set | ||
| caml_gr_synchronize | ||
| caml_gr_text_size | ||
| caml_gr_wait_event | ||
| caml_gr_window_id | ||
|
|
||
| From +hash.js: | ||
| caml_hash_mix_int64 | ||
|
|
||
| From +ints.js: | ||
| caml_div | ||
| caml_mod | ||
|
|
||
| From +jslib.js: | ||
| caml_is_js | ||
| caml_trampoline | ||
| caml_trampoline_return | ||
| caml_wrap_exception | ||
|
|
||
| From +marshal.js: | ||
| caml_marshal_constants | ||
|
|
||
| From +mlBytes.js: | ||
| caml_array_of_bytes (deprecated) | ||
| caml_array_of_string (deprecated) | ||
| caml_bytes_of_utf16_jsstring | ||
| caml_new_string (deprecated) | ||
| caml_string_concat | ||
| caml_to_js_string (deprecated) | ||
|
|
||
| From +runtime_events.js: | ||
| caml_runtime_events_create_cursor | ||
| caml_runtime_events_free_cursor | ||
| caml_runtime_events_read_poll | ||
| caml_runtime_events_user_resolve | ||
|
|
||
| From +stdlib.js: | ||
| caml_is_printable | ||
| caml_maybe_print_stats | ||
|
|
||
| From +sys.js: | ||
| caml_fatal_uncaught_exception | ||
| caml_format_exception | ||
| caml_is_special_exception | ||
| caml_set_static_env | ||
| caml_sys_const_naked_pointers_checked | ||
|
|
||
| From +toplevel.js: | ||
| jsoo_get_runtime_aliases | ||
| jsoo_toplevel_init_compile | ||
| jsoo_toplevel_init_reloc | ||
|
|
||
| From +unix.js: | ||
| caml_strerror | ||
| caml_unix_fchmod | ||
| caml_unix_getegid | ||
| caml_unix_geteuid | ||
| caml_unix_getgid | ||
| caml_unix_getpwnam | ||
| caml_unix_getuid | ||
| caml_unix_rewinddir | ||
| unix_error_message | ||
|
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| //Provides: process | ||
| var process = "process"; | ||
|
|
||
| //Provides: obj | ||
| var obj = { process: 42 }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ;; This ensures that the referenced JavaScript values are linked in the | ||
| ;; runtime with separate compilation and is optimized away in case of | ||
| ;; whole program compilation. | ||
|
|
||
| (global (export "_caml_js_delete") (import "js" "caml_js_delete") anyref) | ||
| (global (export "_process") (import "js" "process") anyref) | ||
| (global (export "_obj") (import "js" "obj") anyref) |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| open Js_of_ocaml | ||
|
|
||
| let () = | ||
| let p : Js.js_string Js.t = Jsoo_runtime.Sys.external_ "process" in | ||
| let o : _ Js.t = Jsoo_runtime.Sys.external_ "obj" in | ||
| let del = Jsoo_runtime.Sys.external_ "caml_js_delete" in | ||
| ignore (Js.Unsafe.fun_call del [| o; Js.Unsafe.coerce (Js.string "process") |]); | ||
| print_endline (Js.to_string p) |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very happy with the name
Jsoo_runtime.Sys.external_and its signature.Maybe
val Jsoo_runtime.Js.runtime : string -> Jsoo_runtime.Js.twould be a better fit. @vouillon, any thoughts ?