{"repo":"nrkn/yuki-js","free":true,"listed":false,"github":"https://github.com/nrkn/yuki-js","clone":"git clone https://github.com/nrkn/yuki-js.git","description":"A tiny subset of JavaScript with configurable constraints for creating fantasy consoles","language":"TypeScript","stars":29,"topics":["fantasy-console","compile-to-js","retrocomputing","retrogaming","fantasy-computer","retro","gamedev"],"license":"MIT","category":"game-templates","readme_excerpt":"yuki-js A tiny subset of javascript allowing only numbers, arrays of numbers, subroutines (not functions), configurable constraints and externally provided functions. It is intended to be used by projects that want to allow limited user scripting with various constraints around memory and etc, eg for a fantasy console project This is an alpha release! install npm install yuki-js example In the examples folder you will find Pong implemented in yuki-js, with constraints set up to mirror the Fairchild Channel F: The fantasy console is set up to only allow for 64 bytes worth of memory for variables to be declared, the program must fit into 2048 bytes, 4 colors from a fixed palette of 8 per scanline, etc. Player 1 uses WASD, Player 2 uses arrow keys When a player wins a match their color will fill the screen, left or right arrow keys to start a new match Play it here compiling yuki-js programs TypeScript Example JavaScript Example compile options Pass an object as the second argument memorySize is the maximum size in bytes that the user-declared variables can use - any remaining memory is used for the call stack. Each function call when entered uses the amount of memory in bytes that would be required to address the program (see maxProgramSize below), and frees that memory when exited maxProgramSize is the maximum size in bytes that the program can take up - the program size is determined by walking the AST and counting each non-literal node as instructionSize bytes, and each nume","default_branch":null,"files":null,"tree":[],"storefront":"/r/nrkn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nrkn/yuki-js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}