
public account: @buildwithdjdev
Toronto, Ontario
Joined May 2021
- Tweets486
- Following222
- Followers273
- Likes3.8K
Replying to @jmeistrich
seems like @nativescript Solid is sittin' pretty at 5.5 MB compressed 😉
Seamless integration of Python modules in JS in @bunjavascript
Replying to @DeveloperrDj @bunjavascript
Nearly on par with bun:ffi. Deno can do faster FFI calls due to turbocall and V8 fastapi, but there are some limitations - cannot call back into JS, or do any allocations on the JS heap. There is a fallback mode but it's slow
Bun (@bunjavascript) Node-API implementation, though not fully compatible yet, is speedy, I think it's because JSC, in general, has faster JS->Native access compared to V8
Replying to @jakeshelley @trunarla
Here’s an ✨ improved ✨ version that can handle arrays of any length 😆
![const cache = new Map() function reverse_better(arr) { const rev = cache.get(arr.length) if (rev) return rev(arr) let expr = "" for (let i = arr.length - 1; i >= 0; i--) { if (expr) expr += ",a[" + i + "]" else expr = "a[" + i + "]" } const fn = new Function( ` return function(a) { return [${expr}] } ` )() cache.set(arr.length, fn) return fn(arr) }](https://pbs.twimg.com/media/FrxU28ZaIAECxJo.jpg?name=small&format=webp)
ALT const cache = new Map() function reverse_better(arr) { const rev = cache.get(arr.length) if (rev) return rev(arr) let expr = "" for (let i = arr.length - 1; i >= 0; i--) { if (expr) expr += ",a[" + i + "]" else expr = "a[" + i + "]" } const fn = new Function( ` return function(a) { return [${expr}] } ` )() cache.set(arr.length, fn) return fn(arr) }





















