ITT we talk about doing metaprogramming in different ways that idiomatic lithp style (lisp/scheme-style macros, HOFs and lambdas, eval). what are your favorite unusual ways of writing programs that write programs? do you use metaclasses and AST rewriting in dynamic langs? have you ever written self-modifying asm? do you know rebol and red? metalua? mps? m4 macros? template dead dog? or maybe you're FrozenAnus and use the C preprocessor?
I program in javascript because it's scheme's successor
Name:
Anonymous2018-02-15 8:20
>>2 IHNBT. you should be ashamed of this poor attempt at baiting
Name:
Anonymous2018-02-15 8:22
>>1 C preprocessor can't qualify for being metaprogramming(writing programs that write programs), it just intermixes code and macro expansion of tokens. #define ABCD what #define BLAH(x) x+ABCD BLAH(2) -> 2+what (is this ``metaprogramming'?)
Name:
Anonymous2018-02-15 8:24
>>4 I mostly included it so that I can summon FrozenAnus and have him explain how the preprocessor is term rewriting and how it gives you the same power that lithp macros do
Name:
Anonymous2018-02-15 9:03
>>3 It is tho. Show me a mainstream language that's better suited for functional programming.
>>8 who are you quoting? and also, while Lua might be a bit niche, Ruby and Java are definitely mainstream
Name:
Anonymous2018-02-15 10:21
I like the idea of MPS because it's one of the few attempts at making a different kind of programming environment. I don't like the execution of MPS because if you want to generate code with it outside of the editor (i.e. in an automated build system), you need to use fucking Ant
Name:
Anonymous2018-02-15 10:23
metadubs
Name:
Anonymous2018-02-15 15:14
(define|let.*)-syntax is objectively the best form of macros.
Name:
Anonymous2018-02-15 15:22
C++ templates are Turing complete.
Name:
Anonymous2018-02-16 7:36
>>13 yeah, by accident. honestly, this has to be one of the most retarded ways to do metaprogramming: you write code in a C-like (but uglier and bloatier) language but you write code that writes code in a different, pseudo-functional, recursion-heavy language that is even uglier than the previous one
C++ templates are only barely better than search-and-replace in your favourite text editor. Zero type safety and full manual maintenance.
Name:
Anonymous2018-02-16 8:14
>>15 plus it's clunky and badly integrated into the language. obviously not a planned, well-designed feature
Name:
Anonymous2018-02-16 9:59
Ruby lets you do lots of fun stuff at runtime. Once I started writing bindings to the X11 protocol that read the XML specifications and generated matching methods and classes at runtime, but I got bored halfway through.