Re: HOF implementation of "until"



Joachim Durchholz wrote:

> > Case expressions themselves may be regarded as syntactic sugar
> > as described in figures 3.1 and 3.2 from the Haskell report.
> > I give one example of the productions there. The fact that
> > Haskell compilers may optimize these is beside the point.
>
> It's beside the point only if it's clear that macros can apply all
> optimisations that a compiler could. Anybody with insights into that?

The point was whether these expressions could be understood as syntactic
sugar or not. Optimization was beside it :-)

Macros are certainly not the place for these kinds of optimizations.
While it is clear that standard compiler techniques should be able to do
quite a bit of optimization on the post-macro-expanded object code,
it is true that a compiler written to handle certain constructs specially
will usually generate better code. But various Scheme compilers already
handle various standard macros specially, and do various types of
static type inference and optimizations, so there is no inherent
deficiency with this approach.

Regards
Andre
.



Relevant Pages

  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... what experienced programmers do, ... optimization, ... Thugs" ad nauseum fits that a lot more closely than discussing compiler ... be modified outside a loop, and guessing ...
    (comp.programming)
  • long(!) Re: need help on CFLAGS in /etc/make.conf please
    ... For example, MPlayer sets this high on purpose, so GCC will actually ... and the K&R compiler would've known exactly the kind of optimization we wanted. ... >> A msg from Richard Coleman, taken together with the GCC 3.x Known Bugs ...
    (freebsd-questions)
  • Re: SETF and variable issues in Self Similar program.
    ... The way to get a compiler to optimize a tail-call ... call optimization turned on. ... It changes the semantics of the language in a big way. ... In Common Lisp it has to interact with condition handling, ...
    (comp.lang.lisp)
  • Re: Debugging and optimizations
    ... and compiler optimizations. ... Earlier in the week I was talking to a developer about optimization ... The problem is in the compiler not the source level debugging format. ... The compilers should be able to provide source level debug information ...
    (comp.programming)
  • Functions abstractly represented by objects and compilers
    ... altering the generated assembler-code for optimization. ... could easily be done by writing a compiler in a script-based language ... layers to the single layer OOP does offer? ... another problem is seperation of error-checking of source-code ...
    (comp.object)