facebookresearch / nle

The NetHack Learning Environment
Other
939 stars 113 forks source link

WASM #360

Open apowers313 opened 1 year ago

apowers313 commented 1 year ago

🚀 Feature

Nethack has the ability to cross-compile to a Web Assembly (WASM) module that provides a windowing API for rendering maps, displaying messages, displaying attributes, etc. Python has a Wasmer library that can run WASM modules.

I'd like to suggest that NLE use WASM rather than the Nethack C code.

[disclaimer: I wrote the Nethack WASM port]

Motivation

  1. Increase NLE adoption by getting rid of the cmake dependency
  2. Increase cross-platform portability and reduce likelihood of build issues
  3. Greater access to Nethack internals (glyphs, stats, messages, etc.) without parsing
  4. Enable Multi-objective learning through various Nethack stats (hunger, HP, load, etc.)

Pitch

I'd be happy to create a PR to ditch all the C code in this repo and replace it with a WASM module. I'm not sure how hard it would be to keep backwards compatibility with existing gym Spaces.

Alternatives

Create an alternative gym environment.