Thomas Weber
9dfbdba2d3
Factory variables
...
Variables that are evaluated once, at compile-time.
Makes every variable access even faster than before.
Implementation a bit dirty, will clean up later.
2020-07-13 23:52:18 -05:00
Thomas Weber
22a80d579e
warn on duplicate opcodes
2020-07-13 23:46:42 -05:00
Thomas Weber
e1aef16944
Simplify type conversions
...
It turns out that calling a function to do this this every time is rather slow, so we manually inline number and string conversions.
Boolean conversions are complex enough that I don't think inlining it would be a very good idea.
2020-07-13 23:45:20 -05:00
Thomas Weber
c5519634d4
Increase amount of blocks supported by compat layer
...
Haven't tested most of them, just hoping they work
2020-07-13 23:31:15 -05:00
Thomas Weber
e3e467365e
More compiling, less interpreting
...
- cache procedure compiling
- add more blocks to compat
- compile more blocks
- apparently the NUM field in numbers can be a real number sometimes
2020-07-13 20:12:16 -05:00
Thomas Weber
d537a9b36b
Make the forkphorus test suite (mostly) pass
...
- support fields in compatibility layer
- fix "last" of list
- add compiled control_for_each
- add compiled operator_contains
- round sin/cos, implement tan
- do not compile edge activated hats
2020-07-13 19:39:44 -05:00
Thomas Weber
7e767ad6fd
Fix some more bugs
...
- update readme to be more up-to-date
- fix compatibility layer stack frame handling
- fix broadcasting non-strings
- compile some more blocks
- add some more blocks to the compatibility layer
2020-07-13 19:00:04 -05:00
Thomas Weber
e23f29c798
Improve the compiler compatibility layer
2020-07-13 18:04:38 -05:00
Thomas Weber
fd0795d285
WIP "compatibility layer" to use some blocks from scratch-vm in compiled scripts
2020-07-13 17:16:31 -05:00
Thomas Weber
fa5cf0bad3
cleanup generator threads when retired
2020-07-09 13:29:40 -05:00
Thomas Weber
6a1f565759
fix list delete
2020-07-09 13:27:16 -05:00
Thomas Weber
57d8f9019f
fix list insert
2020-07-09 13:16:40 -05:00
Thomas Weber
aed4aceaa9
Don't store generator result
2020-07-07 14:45:04 -05:00
Thomas Weber
fd03197786
fix list contains
2020-07-07 14:44:49 -05:00
Thomas Weber
74ca976d2b
fixup script stopping blocks
2020-07-07 14:44:22 -05:00
Thomas Weber
fa34aa9f6a
Remove target global from executor
...
Just get it from thread
2020-07-07 13:45:47 -05:00
Thomas Weber
4c9eccf536
Convert some strings to numbers for performance
2020-07-07 13:44:58 -05:00
Thomas Weber
a5536bfa3c
Move script cache to Blocks
2020-07-07 11:05:46 -05:00
Thomas Weber
d5546c6b05
dirty hack to fix some wrongful caching
2020-07-06 23:44:49 -05:00
Thomas Weber
c6b9df757c
Script factories
2020-07-06 23:18:16 -05:00
Thomas Weber
da1c8e6abe
implement a few more blocks
...
- looks_size
- motion_direction
- sensing_username
2020-07-06 23:17:40 -05:00
Thomas Weber
f0d76864a4
minor cleanup
2020-07-06 23:16:51 -05:00
Thomas Weber
d27cc02bae
optimizations, bug fixes
2020-07-06 22:13:48 -05:00
Thomas Weber
5c56ba025a
transition more things to yielding
2020-07-06 20:42:16 -05:00
Thomas Weber
bf32e2e468
Back to a yielding compiler
2020-07-06 19:34:38 -05:00
Thomas Weber
5bec779b4a
minor optimizations/fixes
2020-07-06 18:23:16 -05:00
Thomas Weber
3bfc252a0e
fix a couple small bugs
2020-06-26 14:44:19 -05:00
Thomas Weber
fdad50f397
Get some more things to work in the compiler
...
- add event_broadcastandwait
- add looks_switchbackdropto
- add looks_backdrops
2020-06-26 12:45:06 -05:00
Thomas Weber
1714ebf5f6
Merge remote-tracking branch 'upstream/develop' into develop
2020-06-26 00:45:18 -05:00
Thomas Weber
930fe68112
More updates to the compiler
...
- remove unused local variable tracking and utilities
- add some jsdoc to the compiler executor
- improve variable reference finding
- add data_listcontainsitem
- add event_broadcast
- add event_broadcast_menu
2020-06-26 00:14:42 -05:00
Thomas Weber
ae5ce527b1
Some smaller bug fixes in the compiler
...
- throw if toString on asNumber, asString, asBoolean
- log compilation errors again
- add motion_setrotationstyle
- fix operator_divide NaN handling
- fix operator_mod second argument
2020-06-25 23:05:06 -05:00
Thomas Weber
3a8f0a11f5
Implement ScriptCache
2020-06-25 21:40:57 -05:00
Thomas Weber
ab9deb2d09
Smaller fixes/changes
...
- add looks_say
- add flags for CompiledInput
- add nullabe/NaNable
2020-06-24 12:47:34 -05:00
Thomas Weber
bdebad01bd
Add a couple more blocks
...
- add pen_stamp
- add data_insertatlist
2020-06-24 00:37:49 -05:00
Thomas Weber
73309e9fb1
A whole lot of compiler updates
...
- fix handling of missing inputs
- fix handling of NaN numbers
- fix color optimization
- events -> event (still empty)
- add control_wait_until
- add data_deleteoflist
- add looks_cleargraphiceffects
- add looks_costumenumbername
- add motion_setx
- add motion_sety
- add motion_changexby
- add motion_changeyby
- add operator_letter_of
- add operator_mod
- add operator_length
- add argument_reporter_boolean
- fix procedure_call default values
- add sensing_keypressed
- add sensing_mousedown
- add sensing_keyoptions
- add pen_changePenColorParamBy
- add pen_setPenColorParamTo
- fix pen size
- add pen_menu_colorParam
2020-06-24 00:29:23 -05:00
Thomas Weber
c79fa8b96f
Remove list item limit
...
Already ignored by compiled scripts.
2020-06-23 23:02:40 -05:00
Thomas Weber
d8c095271f
Improve some compiler internals
...
- fix procedures being compiled more than once
- remove Cast dependency from execute
2020-06-23 23:00:53 -05:00
Thomas Weber
8ecc1ba1c8
re-enable warp
...
We are about 3-4x slower than forkphorus but still significantly faster than Scratch 3
2020-06-23 19:16:06 -05:00
Thomas Weber
417fe21215
Get quicksort to run
...
- add control_stop
- fix control_repeatuntil
- fix control_while
- add data_hidelist
- add data_showlist
- add data_deletealloflist
- add data_addtolist
- add data_replaceitemoflist
- add data_lengthoflist
- add data_itemoflist
- add motion_xposition
- add motion_yposition
- fix procedures_call
2020-06-23 18:57:37 -05:00
Thomas Weber
85d34f03ac
Improve procedure support
...
Supports string arguments
Supports warp
2020-06-22 22:02:28 -05:00
Thomas Weber
b93558f850
Basic procedure support
2020-06-22 21:34:47 -05:00
Thomas Weber
4a4ba718c6
pen, colors, thread state
2020-06-22 19:34:30 -05:00
Thomas Weber
7a3e63d30d
More blocks and fixes
...
- fix startHats executing compiled scripts
Now implemented in compiler:
- control_if_else
- control_create_clone_of
- control_delete_this_clone
- control_create_clone_of_menu
- motion_movesteps
- motion_turnright
- motion_turnleft
- motion_ifonedgebounce
- operator_not
- operator_round
- operator_add
- operator_subtract
- operator_multiply
- operator_divide
- operator_mathop (except tan)
- operator_random
- sensing_mousex
- sensing_mousey
- pen_penDown
- pen_penUp
- pen_setPenSizeTo
- pen_changePenSizeBy
- pen_changePenHueBy
2020-06-22 18:29:30 -05:00
Thomas Weber
d782dca4b9
add control_wait, timers
2020-06-22 17:07:18 -05:00
Thomas Weber
c10a631d2e
get some more simple things to sortof work
2020-06-22 16:55:46 -05:00
Eric Rosenbaum
540d9c676c
Merge pull request #2341 from apple502j/patch-9
...
Clear some stats when disposing runtime
2020-06-22 10:25:41 -04:00
DD Liu
f7ab011c30
Merge pull request #2455 from adroitwhiz/filter-pen-blocks
...
When the stage is selected, hide all pen blocks except "erase all"
2020-06-19 12:47:41 -04:00
adroitwhiz
3478643f44
Revert "Set graphic effect to zero if it's Infinity"
2020-06-18 12:17:57 -04:00
adroitwhiz
62504cecb9
Hide pen blocks from palette on stage
2020-06-16 16:04:52 -04:00
adroitwhiz
5462fe9966
Merge pull request #2442 from adroitwhiz/filter-extension-blocks
...
Support extension block filtering per-target
2020-06-16 16:01:51 -04:00