Kanbaru 🌟 (one hikari of too many)

i love that you can call toString() on a function in JS and get back its source code. it's not something you should do, but there are so many wonderfully silly applications for it. i love this shit

https://twitter.com/zzznah/status/1736117845438636500

3 replies →
3 replies

Zack

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari this "code is data" approach is one of the interesting side effects of the fact that Brendan Eich, the creator of JavaScript, originally wanted to create a lisp language, but was directed to create something more C-like instead

Kanbaru 🌟 (one hikari of too many)

(replying to Zack)

@zsarge oh, it would make sense if this were a lisp influence!


grawity

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari ah, I remember one of the Mozilla blog posts about XUL and WebExtensions, where they talked about how they ported some internal functions from JavaScript to C and then some big extensions broke because they were patching those functions by stringifying and regexing them...

Kanbaru 🌟 (one hikari of too many)

(replying to grawity)

@grawity hahahaha


A myriad of Qyriad

(replying to Kanbaru 🌟 (one hikari of too many))

@hikari oh this is *awful*. I adore this

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

i had a whimsical idea for a gpu compute library, a few years ago: true single-source programming in c, without changing your build flow. you'd just pass the function pointer to the run_on_gpu() function and it'd work even though it shouldn't. how? parsing x86 assembly at runtime

1 replies →
1 replies

Saagar Jha

(replying to Kanbaru 🌟 (one hikari of too many))
@hikari This is probably what CUDA 100 will look like

Kanbaru 🌟 (one hikari of too many)

(replying to Kanbaru 🌟 (one hikari of too many))

i never actually implemented it but i still love the idea, and what's great is the javascript equivalent is almost practical :3