If you're OK in having a node-esm executable, please consider this solution.
#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_fileIf you're OK in having a node-esm executable, please consider this solution.
#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_fileComing from this tweet: https://twitter.com/mathias/status/1115525813670227968
Similar way scripts with type module has been introduced, script with type bytecode and a specific engine target, including wasm, could make it too, so that engines able to digest pre-optimized code can benefit from this.
<script type="bytecode" engine="v8" src="v8.bc"></script>
<script type="bytecode" engine="spidermonkey" src="sm.bc"></script>
<script type="bytecode" engine="jsc" src="jsc.bc"></script>lys is a programming language that produces WASM, and its design goal is to be as simple as possible, yet useful to create utilities.
I've been thinking about a subset of JavaScript that could run natively on the browser, similarly to asm.js, but with the ability, through a dedicated parser, to target another language able, on its own, to produce WASM.
The following crazy non sense works already thanks to an agglomerated of modern and deprecated JS features and it might be interesting as experiment to see if a JS to WASM compiler, through the lys indirection, could be possible.
function lys(fn) {
/*! (c) Andrea Giammarchi */| /*! porn.js (NSFW) */ | |
| let Ɛ = 'b'; | |
| ()=> {} // Shemale // arrow | |
| ()=>{} // // arrow | |
| Ɛ=> {} // Straight // arrow | |
| Ɛ=>{} // // arrow |
| const basicHTML = require('basichtml'); | |
| basicHTML.init(); | |
| document.documentElement.setAttribute('lang', 'en'); | |
| const {bind} = require('hyperhtml'); | |
| const model = { | |
| index: { | |
| title: 'hyperHTML does Cloudflare too', | |
| h1: { |
OK, the amount of gotchas with unigine-superposition 1.1 benchmark is too damn high, which is a pity because it's awesome!!!
chmod a+x qt-opensource-linux-x64-5.9.0.run./qt-opensource-linux-x64-5.9.0.runpakku -S --needed unigine-superposition and I suggest you do that after a sudo mount -o remount,size=20G,noatime /tmp. If it ends with an error, just sudo pacman -U the-big-tar-file-in-tmp| /*! (c) Andrea Giammarchi - ISC */ | |
| const Rel = typeof Map === 'undefined' ? | |
| function () { | |
| const k = [], v = []; | |
| return { | |
| has: value => -1 < k.indexOf(value), | |
| get: value => v[k.indexOf(value)], | |
| set: value => { | |
| const i = k.indexOf(value); | |
| v[i < 0 ? (k.push(value) - 1) : i] = value; |
How is ESM in NodeJS able to run any eecutable file as ES2015+ file ?
Example for a generic meta-url file:
#!/usr/bin/env node
console.log(import.meta.url);| // (c) 2018 Andrea Giammarchi | |
| function levenshtein(from, to) | |
| { | |
| const fromLength = from.length + 1; | |
| const toLength = to.length + 1; | |
| const size = fromLength * toLength; | |
| const grid = new Array(size); | |
| let x = 0; | |
| let y = 0; | |
| let X = 0; |