File tree Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ include/Ark/Constants.hpp
3030
3131# WASM
3232/public /node_modules
33- /public /* .wasm.wasm
34- /public /* .wasm.js
33+ /public /ArkEmscripten. *
3534/public /package.json
3635/public /package-lock.json
3736
Original file line number Diff line number Diff line change 6060- ` APPEND_IN_PLACE_SYM ` and ` APPEND_IN_PLACE_SYM_INDEX ` super instructions
6161- ` PUSH_RETURN_ADDRESS ` instruction now replaces the VM auto push of IP/PP
6262- remove the stack swapping by pushing arguments in the reverse order by which they are loaded
63+ - wasm export: we can now run ArkScript code on the web!
6364
6465### Changed
6566- instructions are on 4 bytes: 1 byte for the instruction, 1 byte of padding, 2 bytes for an immediate argument
Original file line number Diff line number Diff line change 1313</ div >
1414
1515< script >
16- let output = "" ;
1716 log = console . log ;
17+ var can_capture = false ;
18+
1819 window . console . log = ( message ) => {
19- output = message ;
20+ log ( message ) ;
21+ if ( can_capture )
22+ document . getElementById ( "output" ) . value += message + "\n" ;
2023 } ;
2124
2225 var Module = {
2326 onRuntimeInitialized : function ( ) {
2427 document . getElementById ( "run" ) . addEventListener ( "click" , ( ) => {
28+ document . getElementById ( "output" ) . value = "" ;
2529 const code = document . getElementById ( "code" ) . value ;
26- console . log ( code ) ;
2730
2831 try {
32+ can_capture = true ;
2933 Module . run ( code ) ;
30- document . getElementById ( "output" ) . innerText = output ;
3134 } catch ( e ) {
32- document . getElementById ( "output" ) . innerText = e ;
35+ document . getElementById ( "output" ) . value = e ;
3336 }
37+
38+ can_capture = false ;
3439 } ) ;
3540 }
3641 } ;
Original file line number Diff line number Diff line change @@ -209,9 +209,9 @@ int main(int argc, char** argv)
209209 " sizeof(Ark::Value) = {}B\n "
210210 " sizeof(Value_t) = {}B\n "
211211 " sizeof(ValueType) = {}B\n "
212- " sizeof(ProcType) = {}B\n "
213- " sizeof(Ark::Closure) = {}B\n "
214- " sizeof(Ark::UserType) = {}B\n "
212+ " sizeof(Ark::Procedure) = {}B\n "
213+ " sizeof(Ark::Closure) = {}B\n "
214+ " sizeof(Ark::UserType) = {}B\n "
215215 " \n Virtual Machine\n "
216216 " sizeof(Ark::VM) = {}B\n "
217217 " sizeof(Ark::State) = {}B\n "
You can’t perform that action at this time.
0 commit comments