Hacker News new | ask | show | jobs
by bad_login 3190 days ago
The specific problem of wrapper around HTTP API have been resolved with WSDL (https://www.w3.org/TR/wsdl) assumming the use of WSDL the only thing a macro could do is equivalent of what an external program that generate a python file implementing the WSDL could do. I have written a php parser with the racket LLAR macro and it doesn't add more than an external tool like bison.

Reducing boilerplater could make your code less buggy (bugs you catch with your eyes) and could make the meaning of the code more clear.

Racket match is realy nice but it will shine if:

- You use a lot of immutable datasctructures.

- Explore shallow tree like data structures.

> and my personal opinion is macros are a meme

As far i has understand macro is already in use as Annotations for java.

In php, programmers developped complex frameworks that generate code (Symfony for instance) before running the user's code even if it isn't a macro per-se it share the same goal.

And i could have mention c++ template, so i don't think macro are a meme they already exists and there is a demand for it.

1 comments

> assumming the use of WSDL the only thing a macro could do is equivalent of what an external program that generate a python file implementing the WSDL could do.

I am not assuming the use of WSDL and macros still don't do much.

> Reducing boilerplate could make your code less buggy (bugs you catch with your eyes) and could make the meaning of the code more clear.

Macros aren't required for reducing boilerplate and don't necessarily reduce boilerplate compared to a non-macro solution in an expressive language.

I read almost all of racket's documentation cover to cover and learnt Clojure about 5 years ago. There are a lot of good things to say about them but as far as expressiveness go, but I didn't found them anymore expressive than Ruby or Python.

> Racket match is realy nice but it will shine if: > - You use a lot of immutable datasctructures. > - Explore shallow tree like data structures.

The things you pointed out are non-macro things. I like match, especially when it's well integrated in the lang. viz f#. I just don't like the difference that being able to cook up your match using macros makes a huge difference when it comes to programming productivity.

> i don't think macro are a meme

You misunderstand my point. Code generation with or without macros is useful. That's not a meme. "Macros are a secret sauce" is a meme.

> Macros aren't required for reducing boilerplate and don't necessarily reduce boilerplate compared to a non-macro solution in an expressive language.

So i suspect you are thinking of ruby metaprogramming, in that case you have good and bad. With macro you can expand your code and have static tool reason about your code (IDE à la Éclipse). In the other hand in metra prog. you have all the info availlable at runtime and it is more easy to implement.

> I just don't like the difference that being able to cook up your match using macros makes a huge difference when it comes to programming productivity.

For the specific racket's match you can build your own match rule (http://docs.racket-lang.org/reference/match.html?q=match#%28...) and that is macro power..

In my own use of lisps i havn't realy used any macro.

> "Macros are a secret sauce"

It is probably an overstatement, if they have been useless for you (and me) doesn't mean they are.

> It is probably an overstatement, if they have been useless for you (and me) doesn't mean they are.

You are conflating "useless" with "secret sauce". I didn't claim they are useless. I said macros are a meme and are useful in very limited circumstances.