develooper Front page | perl.bootstrap | Postings from July 2000

RE: Working Group Proposal

From:
Moore, Paul
Date:
July 21, 2000 01:56
Subject:
RE: Working Group Proposal
Message ID:
714DFA46B9BBD0119CD000805FC1F53B012A823A@UKRUX002.rundc.uk.origin-it.com
From: John Porter [mailto:jdporter@min.net]
> People want to have their cake and eat it too; and Perl has
> encouraged them by delivering this in ways other languages
> never did.  Can you fault the editor writer for wanting to
> include *accurate* perl syntax highlighting?

Urk. Syntax highlighting requires something different from a parser than
language compilation. For a start, it requires an "incremental" mode, where
it can just parse what's visible (with a bit of context hunting, but we
don't want to parse the whole file each time - that really kills
performance). Also, it needs to be able to recognise and resync on partial
fragments. Consider someone editing

    $var = fn() ? «» : «» if «»;

which I could easily imagine being generated by some sort of editor "insert
a template" functionality (indeed, I know one such).

Reusing a compiler parser on that is likely to be a challenge :-)

I don't have a problem with wanting to make it more possible to handle Perl
in this sort of context - but don't assume that splitting out the parser is
a "magic bullet". OTOH, I'm strongly against the idea that the language
syntax has to be constrained by the needs of the parser. And I don't think
that redesigning Perl's syntax to be easily parseable is going to get
anywhere - the result just wouldn't be Perl, in some very fundamental ways.

Paul.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About