Thomas Weber
2a12e70dce
Fix some more compiler bugs
...
- add data_itemnumoflist
- fix compatibility layer operator precedence issues
- don't cache procedures until compilation completed
2020-07-14 12:45:38 -05:00
Thomas Weber
1c0b3c9088
Remove targetVariables, stageVariables aliases
...
Now redundant, only adds useless runtime data.
2020-07-14 00:22:26 -05:00
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
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
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
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
fa34aa9f6a
Remove target global from executor
...
Just get it from thread
2020-07-07 13:45:47 -05:00
Thomas Weber
c6b9df757c
Script factories
2020-07-06 23:18:16 -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
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
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
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
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
Thomas Weber
99c570f459
New compiler/runtime model
...
Use continuations instead of generators
Lots of things taken quite directly from forkphorus/phosphorus
2020-06-14 20:53:09 -05:00
Thomas Weber
d62232d744
Get some more basic things to work at all
...
- add operator_gt
- add operator_lt
- add operator_join
- add sensing_resettimer
- add sensing_touchingobject
- add sensing_timer
- fix casting
2020-06-12 19:18:40 -05:00
Thomas Weber
f95b12dc7e
Lay out more of the compiler groundwork
...
- add CompiledInput, will allow more complex operations later
- add eval.js to handle runtime data & methods
- move compiler executor to own file
- simplify compiler execute, scripts are now responsible for all thread status on their own
- add type annotations for compilers
- add math_angle
- add math_integer
- add math_positive_number
- add data_variable
2020-06-11 01:01:35 -05:00