Re: Why not to implement everything in scheme?

2004-03-22 Thread Julian Squires
On Mon, Mar 22, 2004 at 02:06:11PM -0700, Paul Scott wrote:
> Bigloo produces C code which would then have to be compiled with gcc anyway.

g++ produces assembler which would then have to be assembled with gas
anyway.  Languages are for the programmer's benefit.  (It's interesting
to note that bigloo's output tends to be quite competitive with typical,
idiomatic C++ programs compiled with g++)

Anyway, I'm not arguing that someone should immediately translate
lilypond into some other language.  That would be silly.  I'm just
pointing out some myths that people are perpetuating here (scheme is
always slow and interpreted, C++ is equivalently expressive to these
other languages, etc).

Cheers.  No malice intended by my snarky comments above.

-- 
Julian Squires


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel


Re: Why not to implement everything in scheme?

2004-03-22 Thread Julian Squires
On Mon, Mar 22, 2004 at 09:01:17PM +0200, Heikki Johannes Junes wrote:
> Why not to implement everything in scheme and get rid of gcc -compiling of the
> source? Or, is it the lexical parser which forces the use of gcc?

Let's not forget that scheme can be compiled into fast code (see bigloo
etc).  I'd love to see lilypond become 100% scheme (or, in my
preference, common lisp, simply for the standard environment... also,
some of the compilers still seem to produce faster code).  But I suspect
that would be a rather mammoth undertaking.

Cheers.

-- 
Julian Squires


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel


Re: reading material?

2004-03-22 Thread Julian Squires
On Mon, Mar 22, 2004 at 12:51:12PM -0600, Douglas A Linhardt wrote:
> Agreed.  We're off target.  And I'm not trying to start a flame war.
> I really don't want to start an argument.  I just want to I promise
> not to post any more to this thread (unless, of course I change my
> mind ;) ).

Please don't take any of my comments on this as being flames in any way,
either.  But I can't resist a good language debate.

> > First-class means first-class citizens, that is, objects of that type
> > can be used in all language constructs just like other objects.  For
> > example, a function that returns a function in Scheme is natural,
> > 
> >  (define (iterate func k)
> >"Produce the function x -> FUNC(FUNC .. (x) .. ) "
> >(if (> k 0)
> >(lambda (x) (func ((iterate func (1- k)) x)))
> >(lambda (x) x)))
> > 
> >  (define to-6th-power (iterate sqr 3))

...

> The C++ solution is both natural and elegant.  Two example solutions
> follow, the first not using templates, the second using templates.  By
> the way, my favorite reference for using the Standard Template
> library, as well as things like these functor classes, is Nicolai M.
> Josuttis, "The C++ Standard Library", 1999.

Frankly, I would suggest that after studying some of these languages
more, particularly ocaml, haskell, and common lisp, you might have a
different attitude.

What you did idiomatically in 34 lines, he did idiomatically in 7 lines,
counting whitespace and comments.  Also, his version has no problems if
the function takes a string instead of an int, for example.  And, if it
were written in ocaml, like so:

let rec iterate f k =
if k == 0 then fun x -> x
else iterate (fun x -> f x) (k - 1)
;;

let sqr x = x * x;;
let laugh x = x ^ "ha";;

Then one can do:

let pow_8 = iterate sqr 3;;
let guffaw = iterate laugh 5;;

Printf.printf "%d %s\n" (pow_8 2) (guffaw "bwa");;

and yet, (guffaw 2) or (pow_8 "bwa") will be detected as an error at
compile time, not run-time.

Now imagine you'd like to iterate (really, composite) functions with
various type signatures.  Or partially apply a function, like:

let nonsense prefix suffix = prefix ^ "bar" ^ suffix;;
let n = nonsense "foo";;

Printf.printf "%s\n" (n "baz");;

These are just a few things among many that are much more arduous to do
in C++, certainly more lengthy, when one's time is better spent on
better tasks than housekeeping.

[Let's hope all that code is correct, I haven't checked it carefully...
hopefully you get the point. ;-)]

Arguments like these can go on forever, but truly, (and I feel sad for
saying this, as I'll explain momentarily,) I recommend some of Paul
Graham's essays:
http://www.paulgraham.com/avg.html
or
http://www.paulgraham.com/icad.html

I give the caveat that when I came across the first, I was highly
skeptical, and though I still don't agree entirely with what Graham is
saying, it wasn't until I spent a while writing some serious code in a
few languages more expressive than C++ that I finally conceded that he
has a point.

I still have to write a lot of C++ at work, but at least now I know
better than to propose it when I have the choice.

Cheers.

-- 
Julian Squires


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel


Re: Documentation of Architecture / Design?

2004-03-19 Thread Julian Squires
On Fri, Mar 19, 2004 at 02:21:49PM -0600, Douglas A Linhardt wrote:
> Thanks for your response.  Your answers clarified some things and confirmed
> other things that I had come across.  I will take your input and organize it a
> little better than my original questions and create some HTML pages together
> that can be put on the lilypond website (with your permission, of course).
...
> The problem isn't necessarily that I can't find the answers to my
> questions, but that it can take hours of searching through code to
> find a particular design-level fact.  And by that time, I've pushed
> and popped so many elements on my mental stack, that I can't remember
> how I got there and what I already dismissed as dead ends.  A roadmap
> would direct a developer's search for appropriate code and reduce the
> learning curve.

I'd like to de-lurk to say that this is great news to me, as I went
through pretty much the same thing, and though I have some (now
obsolete) changes that I've been sitting on for a while, the effort
involved was sufficiently exhausting that I never completely finished.
I however was too stupid to just ask my questions on the list, though.

Not that I think lilypond is badly structured, as I have had to do
plenty of maintenance of much worse in the past.  It's just that it
isn't trivial to dive into, and some developer documentation, or at
least a periodically updated set of links to mailing list discussions
such as this one would be of great benefit.  Maybe a section on the
wiki?

Cheers.

-- 
Julian Squires


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel


Re: New website

2003-08-14 Thread Julian Squires
On Mon, Aug 11, 2003 at 05:35:52AM -0700, Graham Percival wrote:
> [EMAIL PROTECTED]:~/dev/lilypond$ grep TODO `find`
> bash: /bin/grep: Argument list too long
> [EMAIL PROTECTED]:~/dev/lilypond$ 

Try

$ find | xargs grep TODO

instead.

Cheers.

-- 
Julian Squires


___
Lilypond-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-devel