Skip to content

Instantly share code, notes, and snippets.

@APConduct
Last active August 7, 2025 06:19
Show Gist options
  • Save APConduct/281968d848b7889e51e2bf976affbe04 to your computer and use it in GitHub Desktop.
Save APConduct/281968d848b7889e51e2bf976affbe04 to your computer and use it in GitHub Desktop.
// cpp -E -P jsfpp.h
// cpp -E -P jsfpp.h | gzip -9 > jsfpp.js.gz
// wc -c jsfpp.js.gz
#define _false (![])
#define _true (!_false)
#define _0 (+[])
#define _1 (+_true)
#define _2 (_true+_true)
#define _3 (_2+_true)
#define _4 (_3+_true)
#define _5 (_4+_true)
#define _6 (_5+_true)
#define _7 (_6+_true)
#define empty_string ([]+[])
#define _undefined ([][[]])
#define _u (([]+_undefined)[_0])
#define _n (([]+_undefined)[_1])
#define _d (([]+_undefined)[_2])
#define _e (([]+_undefined)[_3])
#define _f (([]+_undefined)[_4])
#define _i (([]+_undefined)[_5])
#define _t (([]+_true)[_0])
#define _a (([]+_false)[_1])
#define _at (_a+_t)
#define _o ((_true+[][_at])[_1+[_0]])
#define _c (([][_at]+[])[_3])
#define _r (([]+_true)[_1])
#define _s (([]+_false)[_3])
#define _space ((+[_false]+[][_at])[_1+[_1]])
#define _l (([]+_false)[_2])
#define _31 (+(_3+[_1]))
#define _fontcolor (_f+_o+_n+_t+_c+_o+_l+_o+_r)
#define _constructor (_c+_o+_n+_s+_t+_r+_u+_c+_t+_o+_r)
#define _m ((_0[_constructor]+[])[_1+[_1]])
#define _name (_n+_a+_m+_e)
#define _String (empty_string[_constructor][_name])
#define _toString (_t+_o+_String)
#define _v (_31[_toString](_3+[_2]))
#define _italics (_i+_t+_a+_l+_i+_c+_s)
#define _return (_r+_e+_t+_u+_r+_n)
#define _entries (_e+_n+_t+_r+_i+_e+_s)
#define _j (([][_entries]()+[])[_3])
#define _DOT ((+(_1+[_1]+_e+[_2]+[_0])+[])[_1])
#define _eval (_e+_v+_a+_l)
#define _join (_j+_o+_i+_n)
#define _str_quote (empty_string[_fontcolor]()[_1+[_2]])
#define _p ((+(_2+[_1]+[_1]))[_toString](_3+[_1])[_1])
#define _split (_s+_p+_l+_i+_t)
#define _F_SLASH ((_false+[_0])[_italics]()[_1+[_0]])
#define _B_SLASH (([][_at][_constructor](_return+_F_SLASH+_false+_F_SLASH)()[_constructor](_F_SLASH)+[])[_1])
#define _t_escaped_console_log (_t+[_1]+[_4]+[_3]+_t+[_1]+[_5]+[_7]+_n+_s+_t+[_1]+[_5]+[_7]+_l+_e+_DOT+_l+_t+[_1]+[_5]+[_7]+_t+[_1]+[_4]+[_7]+_t+[_5]+[_0]+_t+[_4]+[_7]+_t+[_1]+[_5]+[_0]+_e+_l+_l+_t+[_1]+[_5]+[_7]+_t+[_4]+[_7]+_t+[_5]+[_1])
#define _BS_escaped_console_log (_t_escaped_console_log[_split](_t)[_join](_B_SLASH))
[][_at][_constructor](_return+_space+_eval)()([][_at][_constructor](_return+_str_quote+_BS_escaped_console_log+_str_quote)());
@APConduct
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment