Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. joerichey
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    joerichey

    @joerichey

    3
    Posts
    974
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    joerichey Follow

    Posts made by joerichey

    • RE: Allow access to Node's TextDecoder

      I was slightly wrong above, we could also solve this problem for Rust by exposing the Buffer class. However, as noted in the previous linked pull request, that requires a unnecessary polyfill for Browsers.

      I think the best approach is to just expose TextDecoder/TextEncoder either at global scope or in a require('util') module.

      posted in Feature Requests
      joerichey
    • RE: Allow access to Node's TextDecoder

      Github Issues:

      • https://github.com/rustyscreeps/screeps-game-api/issues/329
      • https://github.com/screeps/screeps/issues/120

      Relevant APIs:

      • Web TextDecoder
      • Node TextDecoder
      posted in Feature Requests
      joerichey
    • Allow access to Node's TextDecoder

      Re: Allow access to node's Buffer class

      I'm working on getting Screeps to work with Rust's wasm-bindgen (the official way to run Rust in Node.js). The only thing blocking this is that the Rust/JS shim makes use of TextDecoder for performance. This API has existing in Node since Node 8 (screeps uses Node 10) and is also supported in most major browsers, so it would also work with the simulator.

      In fact, TextDecoder is already available in the simulator at global scope, so Rust already works there. We just need TextDecoder to also be there when running in Node.

      Previous discussions mentioned allowing access to Node's Buffer class, but that's no longer necessary as the Rust Shims now just use TextDecoder and Uint8Array.

      This came up because the toolchain that the existing Rust API uses (stdweb) is no longer maintained, and the wasm-bindgen alternative is officially supported by the Rust org.

      posted in Feature Requests
      joerichey