Commit Graph

357 Commits

Author SHA1 Message Date
Noah
69830bb44d Merge pull request #1675 from RustPython/coolreader18/demo-improvements
Demo improvements
2020-01-22 22:46:02 -06:00
coolreader18
049df44fe3 Fix default import from raw-loader 2020-01-19 23:08:00 -06:00
coolreader18
6feb0d7401 Fix contest 2020-01-12 21:57:58 -06:00
coolreader18
22653ac373 Add clean-webpack-plugin 2020-01-12 21:55:43 -06:00
coolreader18
53be1a07b5 Improve WASM testing and CI 2020-01-12 21:55:43 -06:00
coolreader18
338ac4db54 Update demo dependencies 2020-01-12 21:55:43 -06:00
coolreader18
e01e7116ca Add the other rp.py* functions to the mini-doc 2020-01-12 21:55:43 -06:00
coolreader18
96dfaa0eae Combine index.js and main.js into one to improve UX while loading rustpython 2020-01-12 21:55:43 -06:00
coolreader18
73b363dd60 Add asyncbrowser demo snippet 2020-01-12 21:55:43 -06:00
Jeong YunWon
943a1488b0 fix bytes for wasm 2020-01-13 12:30:11 +09:00
Jeong YunWon
70b63eb758 new_rustfunc -> new_function & new_method to distinguish bindable functions 2020-01-12 18:39:16 +09:00
coolreader18
c5264c942d Update wasm-bindgen, export PyError to JS 2020-01-11 12:43:06 -06:00
coolreader18
c090f45759 Add optional source_path argument to vm.run functions 2020-01-08 20:49:25 -06:00
coolreader18
6f43d22b56 Fix pyExec not returning errors, remove typescript hack 2020-01-08 18:50:48 -06:00
coolreader18
4a0a9167ca Improve wasm errors 2020-01-08 17:42:59 -06:00
Noah
73f1b1194b Merge pull request #1648 from yanganto/wasm-exec-mode
Support eval and exec mode in wasm
2020-01-03 09:58:52 -06:00
yanganto
1913f033be Support eval and exec mode in wasm
- Expose `pyEval`, `pyExec`, `pyExecSingle` in wasm module
2020-01-03 23:18:09 +08:00
coolreader18
777542f7ec Directly instantiate exceptions in the vm.new_*_error functions 2019-12-28 01:31:24 -06:00
coolreader18
1773025368 Convert to new PyResult in rustpython_wasm 2019-12-27 11:22:53 -06:00
yanganto
4c3642d19c Use enum for initialize parameters 2019-12-11 10:58:59 +08:00
yanganto
edf70924a9 Set initial parameter in PySettings
- Initialize VM after VM created
	- Some(true):
		VM will be created and initialized with the importers, which require external
		filesystem access
	- Some(false):
		VM will be created and initialized with the importers wihout external filesystem access
	- None:
		VM will be created but not initialized, so it is ready to be injected with modules.
		After injection, the `initialize_as_external` or `initialize_without_external`
		should be called, such that the VM will be ready to use.

- Prevent double initialize VM by `initialized` flag
2019-12-05 10:14:40 +08:00
yanganto
4003013026 Initalize VM in VirtualMachine::default()
- new and initalize as external in VirtualMachine::default()
- Implement VirtualMachine::without_external
- new, setup stdlib_inits, Initialize vm for wasm
2019-12-05 10:13:41 +08:00
yanganto
8a14abc445 Initialize hardcore modules and importlib
Initialize hardcore modules and importlib after vm created and
stdlib_inits setup
2019-12-05 10:13:41 +08:00
yanganto
241d3c5370 Update sys module when stdlib_inits is changed
Provide `update_sysmodule` in vm to update sys when update_sysmodule
changed
2019-12-05 10:13:41 +08:00
yanganto
d058b3debf Set default stdout of wasm to console.log
The print function of wasm will be
	- `console.log` by default or when giving undefined or "console"
	- a dumb function when giving `null`
	- the function when giving a function

Co-Authored-By: Noah <33094578+coolreader18@users.noreply.github.com>
2019-11-27 13:53:07 +08:00
Jeong YunWon
cb2a994b46 Result<T, PyObjectRef> -> PyResult<T> 2019-10-11 18:09:55 +09:00
coolreader18
2160f68d09 Improve the terminal's navigation 2019-09-29 12:56:06 -05:00
j30ng
b056044b5a Fix CI Build in Rust 1.38.0 2019-09-28 03:24:47 +09:00
Sang-Heon Jeon
545e9d39df Fix int type casting error with negative base value
Change base type from u32 to PyIntRef

Fixed: #1405
2019-09-25 01:01:21 +09:00
Noah
0def37d78e Make PyString.value private 2019-09-19 17:45:48 -05:00
coolreader18
d33d5ce5f6 Initialize attributes on new modules 2019-08-15 23:06:30 -05:00
Windel Bouwman
589c431c8c Merge master branch 2019-08-15 18:59:29 +02:00
Marcin Pajkowski
e65e9ff7c3 Make func_ref an &PyObjectRef 2019-08-15 13:45:47 +02:00
Windel Bouwman
d06dec77ea Attempt to reduce the size of the pyobject.rs files by splitting out builtin types. 2019-08-14 19:08:47 +02:00
coolreader18
4f9a71ff89 Change compile::compile() to take a Mode instead of an &Mode 2019-08-13 12:34:39 -05:00
coolreader18
ec6c016fa5 Fix wasm errors 2019-07-27 14:27:37 -05:00
Aviv Palivoda
8f1df4697d Freeze stdlib by default in WASM 2019-07-24 20:54:44 +03:00
Aviv Palivoda
321e43d51b Add freeze-stdlib to wasm build 2019-07-24 20:51:22 +03:00
Aviv Palivoda
6ca979e7be Merge pull request #1159 from palaviv/freeze-stdlib
Allow stdlib freeze
2019-07-24 20:41:35 +03:00
Windel Bouwman
e138a7303d Move get_item_option to PyDictRef struct. 2019-07-23 21:27:37 +02:00
Windel Bouwman
f7320cf545 Move Scope struct to its own file, making the frame module private in the process. 2019-07-23 20:39:47 +02:00
Windel Bouwman
e922a6a952 Fix trailing newline issue #17 2019-07-21 14:00:55 +02:00
Aviv Palivoda
7226c925d2 Add hashmap macro to __exports 2019-07-20 22:25:46 +03:00
coolreader18
97c9b2316e Update Dockerfile.wasm 2019-07-18 10:49:05 -05:00
coolreader18
5821bac2dc Update READMEs 2019-07-16 19:13:07 -05:00
coolreader18
402eb8a48b Merge branch 'master' into redox 2019-07-13 11:46:43 -05:00
coolreader18
6dc742baa8 Remove wasm/lib/target symlink 2019-07-12 16:36:51 -05:00
Windel Bouwman
704b15750e Add optimize flag to ignore assert statements. 2019-07-12 18:41:25 +02:00
Maxim Kurnikov
347d48198e fix remaining clippy warnings 2019-07-07 06:27:07 +03:00
Windel Bouwman
22c3ed3e1f Merge branch 'master' of github.com:RustPython/RustPython into update-docs 2019-07-06 17:01:33 +02:00