Skip to content

JSCompiler: cache, runtime implicit parameters...#3090

Open
xBZZZZ wants to merge 16 commits into
jmoenig:masterfrom
xBZZZZ:master
Open

JSCompiler: cache, runtime implicit parameters...#3090
xBZZZZ wants to merge 16 commits into
jmoenig:masterfrom
xBZZZZ:master

Conversation

@xBZZZZ

@xBZZZZ xBZZZZ commented Aug 1, 2022

Copy link
Copy Markdown
Contributor

runtime implicit parameters

very basic function cache

  • it's JSCompiler.prototype.functionCache array
  • is cleared before pushing new function if length ≥ 300
  • JSCompiler.prototype.compileFunction code makes more sense than my explanation

⚡ blocks now work with compiled rings (not with any other functions)

  • ⚡ blocks will error if can't compile instead of synchronously running not compiled rings
  • compiled rings have inputs property: array of explicit parameter names of original (not compiled ring)

changed how , , , are compiled

@jmoenig

jmoenig commented Aug 2, 2022

Copy link
Copy Markdown
Owner

This is very nice, thank you so much!
I love the changes you made to make the implicit parameter count obsolete, and also the introduction of a simple cache. But I think we do need the fallback to simply run a function that is not (yet) compilable in the "flash" blocks (instead of throwing a compile-error), because some of our existing libraries occasionally rely on this. Can you make that possible again? Thank you!

@xBZZZZ

xBZZZZ commented Aug 2, 2022

Copy link
Copy Markdown
Contributor Author

But I think we do need the fallback to simply run a function that is not (yet) compilable in the "flash" blocks (instead of throwing a compile-error), because some of our existing libraries occasionally rely on this.

Maybe make it fallback to behave like non-:zap: blocks instead of synchronously running snap rings.

Also how to edit pull request code?
edit: edit fork

Also why Process.prototype.reportAtomicSort exists but there is no sort block?
edit: it's used in extensions.js

@xBZZZZ

xBZZZZ commented Aug 3, 2022

Copy link
Copy Markdown
Contributor Author

added lst_sort(list, fn) without JS compiling and dta_group(list, fn) without JS compiling extensions

made ⚡ blocks behave like non-⚡ blocks if can't compile

@xBZZZZ

xBZZZZ commented Aug 4, 2022

Copy link
Copy Markdown
Contributor Author

about commit cad3a6e

made it return null because returns null

it might look like empty string but

@xBZZZZ

xBZZZZ commented Aug 16, 2022

Copy link
Copy Markdown
Contributor Author

is anyone reading this?

about commit ef1032f

now reports 4 instead of 1

@WarpedWartWars

Copy link
Copy Markdown
Contributor

is anyone reading this?

Yes.

@xBZZZZ

xBZZZZ commented Aug 21, 2022

Copy link
Copy Markdown
Contributor Author

about commits 2de90b3 and a3116e7

this now works:

@xBZZZZ

xBZZZZ commented Sep 2, 2022

Copy link
Copy Markdown
Contributor Author

cache is broken because (forum link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants