summaryrefslogtreecommitdiff
path: root/src/main.rs
AgeCommit message (Collapse)Author
2019-01-09Native ES modules (#1460)Ryan Dahl
* Native ES modules This is a major refactor of internal compiler. Before: JS and TS both were sent through the typescript compiler where their imports were parsed and handled. Both compiled to AMD JS and finally sent to V8 Now: JS is sent directly into V8. TS is sent through the typescript compiler, but tsc generates ES modules now instead of AMD. This generated JS is then dumped into V8. This should much faster for pure JS code. It may improve TS compilation speed. In the future this allows us to separate TS out of the runtime heap and into its own dedicated snapshot. This will result in a smaller runtime heap, and thus should be faster. Some tests were unfortunately disabled to ease landing this patch: 1. compiler_tests.ts which I intend to bring back in later commits. 2. Some text_encoding_test.ts tests which made the file invalid utf8. See PR for a discussion. Also worth noting that this is necessary to support WASM
2019-01-08Minimal Worker support (#1476)Ryan Dahl
This adds the ability to spawn additional Isolates from Rust and send and receive messages from them. This is preliminary work to support running the typescript compiler in a separate isolate and thus support native ES modules. Ref #975.
2019-01-02Happy new year!Ryan Dahl
2018-12-19log: bump default minimum log level to "warn"Bert Belder
2018-12-11Remove custom panic handler.Ryan Dahl
This was introduced because Tokio would swallow panics. This is still the case, but this panic handler causes more problems than it solves. It requires people to know how to use debuggers to inspect stacktraces. TODO: - Fix Tokio to not swallow errors. - Be vigilant in the intrim to not introduce broken tests due to this unfortunate "feature" of tokio.
2018-12-11Use default filename for Isolate::execute.Ryan Dahl
2018-12-10Use stderr for exceptions (#1303)Ryan Dahl
2018-12-06Process source maps in Rust instead of JS (#1280)Ryan Dahl
- Improves speed and binary size significantly. - Makes deno_last_exception() output a JSON structure. - Isolate::execute and Isolate::event_loop now return structured, mapped JSError objects on errors. - Removes libdeno functions: libdeno.setGlobalErrorHandler() libdeno.setPromiseRejectHandler() libdeno.setPromiseErrorExaminer() In collaboration with Ryan Dahl.
2018-12-05Isolate::from_raw_ptr and other cleanups.F001
`Isolate::from_void_ptr` is renamed to `from_raw_ptr`, to keep consistency with std libs. It is changed to `unsafe` function, because it can't guarantee that the input is valid. This guarantee should be provided by the caller. Its return type is changed to `&Isolate`, because `&mut Isolate` type requires that no other aliases co-exist in this period of time, this does not seem true. So I changed most of the methods to accept shared reference `&Isolate`. It is easier to reason about the correctness of `unsafe` blocks. As long as these shared references are in the same thread, these `unsafe` codes are probably correct.
2018-12-03Use include_bytes! instead of incbin.Ryan Dahl
This is the second attempt at this patch. The first version was reverted in 2ffd78daf9956a24098d1f959f21882e350e9d37 The problem, I suspect, was that the snapshot was represented as a source_set, which inserted a node into the dependency tree. include_bytes does properly insert the snapshot into rustc's depfile but the use of source_set confused gn. Now the that the deno executable has the create_deno_snapshot as a direct dependency, changes will be propagated.
2018-11-29Replace mutex by atomics (#1238)F001
2018-11-23Revert "Use include_bytes! instead of incbin. (#1182)"Ryan Dahl
Reverting because this is causing Appveyor to be red. However I hope we can reintroduce include_bytes! soon in a way that works on windows. Fixes #1208. This reverts commits 96c3641fffe8509af9351cec4580861e76d89cc9 and 92e404706b0b1a26cdaf6f8cf81aac148292557f.
2018-11-16Lift snapshot to be an argument of Isolate::new().Ryan Dahl
2018-11-14Support request method and headers in fetch() (#1188)Ryan Dahl
Adds a general HttpHeader flatbuffer message for serializing requests and responses.
2018-11-13Wrapper around hyper::Body so it can be used as AsyncReadRyan Dahl
2018-11-06Remove flags::processAndy Hayden
It was doing two independent things: - print help and exit - set log level It's better to do those explicitly in main.rs
2018-11-05Add repl (#998)Andy Hayden
- Running repl from js side. - Add tests for repl behavior. - Handle ctrl-C and ctrl-D.
2018-11-04Fix clippy warnings (#1149)Andy Hayden
Run with: cargo clippy https://github.com/rust-lang-nursery/rust-clippy
2018-11-03third_party: add tokio-process Rust crate and its dependenciesBert Belder
2018-11-02Rename EnvPair to KeyValue.Ryan Dahl
2018-10-31Support cargo check (#1128)Ryan Dahl
- Based on code from @qti3e and @piscisaureus in #724 and #1125 respectively. - TODO The DENO_BUILD_PATH env var must be supplied and must be an absolute path, this restriction should be removed in future work.
2018-10-31Better output on panic (#1129)Joseph
2018-10-31Upgrade Flatbuffers. (#1127)Ryan Dahl
Use msg_generated.rs as mod instead of crate.
2018-10-27Minor sorting not handled by format.Ryan Dahl
2018-10-27Ergonomics: Prompt TTY for permission escalation (#1081)Ryan Dahl
2018-10-24libdeno: deno_new should take a snapshot parameter.Ryan Dahl
2018-10-24Move eager functions into eager_unix.rsBert Belder
2018-10-23Switch to getopts for flag parsing (#1080)Kevin (Kun) "Kassimo" Qian
2018-10-20Allow partial writes.Ryan Dahl
Do not use tokio_io::io:write_all(). Adds src/tokio_write.rs
2018-10-15Exit cleanly on unrecognized arguments (#990)Andy Hayden
Refactor set_flags to return a Result
2018-10-10src/http.rs -> src/http_util.rsRyan Dahl
So as not to conflict with http crate.
2018-10-05Always die on panic.Ryan Dahl
2018-10-04Rename msg_from_js() to dispatch().Ryan Dahl
2018-10-04Rename handler.rs to ops.rsRyan Dahl
2018-10-03First pass at support for TCP servers and clients. (#884)Ryan Dahl
Adds deno.listen(), deno.dial(), deno.Listener and deno.Conn.
2018-10-01Rename FdTable to ResourceTable.Ryan Dahl
Add docs to src/resources.rs.
2018-09-28Adds basic File I/O and FD table.Ryan Dahl
Adds deno.stdin, deno.stdout, deno.stderr, deno.open(), deno.write(), deno.read(), deno.Reader, deno.Writer, deno.copy(). Fixes #721. tests/cat.ts works.
2018-09-26Use the thread pool for blocking I/ORyan Dahl
2018-09-25Make Deno multithreaded.Ryan Dahl
By using the tokio default runtime. This patch makes all of the ops thread safe. Adds libdeno to JS globals to make for easier testing. Preliminary work for #733.
2018-09-25Use lazy_static for HttpsConnectorRyan Dahl
And rename net.rs to http.rs Share HTTP connection.
2018-09-25Clean up flags.Ryan Dahl
2018-09-17Rename Deno to Isolate and move to own file.Ryan Dahl
2018-09-16Use `dirs::home_dir` to replace deprecated `std::env::home_dir`Kevin (Kun) "Kassimo" Qian
2018-09-12Add remove(), removeAll().Kevin (Kun) "Kassimo" Qian
and removeSync(), removeAllSync().
2018-09-09Remove namespace from src/msg.fbsRyan Dahl
2018-09-05Rename src/binding.rs -> src/libdeno.rsRyan Dahl
2018-09-02Log level code refactoringJ2P
2018-08-30Support https imports.Ryan Dahl
Adds hyper-rustls to the build. Use ring for sha1 instead of "ssh1" crate. Fixes #528.
2018-08-30Downgrading tokio to registry version.Ryan Dahl
Prep for rustls.
2018-08-29Implement makeTempDirSync()Bert Belder