Thanks to visit codestin.com
Credit goes to github.com

Skip to content

port-javascript: check list #4993

Closed
Closed
@pmp-p

Description

@pmp-p

easy to fix

annoying things :

  • not so easy to use a pure async stdlib out of the box because of basic discrepancies
    butilin iterator tool RFC: MICROPY_PY_BUILTINS_NEXT2 always set to (0) ? #5046

  • not so easy to interface with browser nor subprocess ( proxies )

    class.mro() is notimpl RFC: class.mro() is notimpl #5106

  • why isn't javascript port yet the experimental platform of choice avaiable to everyone ?
    nodejs has a sandbox mode equivalent to browser.
    and import of online module can be done.
    cf triaging : separate ideas-features-request from BUGS #4444

  • passing script data for interactive or script should be separate functions, actually all use mp_js_do_str(text) and alloc context of text is not clear if pausing/resuming is needed. But those are not the same :
    https://docs.python.org/3/c-api/veryhigh.html#c.PyRun_SimpleString
    https://docs.python.org/3/c-api/veryhigh.html#c.PyRun_InteractiveLoop

  • parser/lexer should work on a pre allocated buffer either for interactive or script mode, filled with stringToUTF8( text, pointer, max_size ) as a real C string.

    • why pre alloc ? because max size of code that interpreter can compile is fixed by heap limit anyway so save useless/unclear malloc/free operations beetween js/C
    • execution mode could be simply set at end of buffer in a # comment when using asynchronous execution.
  • mp_js_do_str(text) is not wasm compliant and won't work when using clang 10 from latest-upstream emscripten branch. so better implement the two previous point and just get rid of it.

  • javascript port can't blink a led.
    well not yet but soon https://wicg.github.io/webusb ;)
    apart from the usb joke it can via websocket and a networked board but there's no sample.

heavy lifting :

probably too heavy without branching/forking/redesign.

UPDATE 05/09 : a fix is in progress https://reviews.llvm.org/D66784

  • performance and I/O : asyncify is 10x slower than real thing : the solution is C-stackless design
    that's both solve asynchronous I/O on any port and Allow pausing and resuming execution #3619 ( also called "checkpoint and restore in userspace" ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions