4 ms·
As someone who has a passing knowledge of perl, what do you mean by nuances? It always seemed that perl the language is pretty minimal.
by rtpg 13y ago
As someone who has a passing knowledge of perl, what do you mean by nuances? It always seemed that perl the language is pretty minimal.
- stcredzero 13y agoNo. Perl has a lot of syntax. There is a lot of language containing a lot of nuance. Python is an example of a language with moderate syntax, probably several times smaller than Perl 5's, assuming Perl is about the same size as Ruby, which is a good assumption, given that they both depend on complex interactions between lexer, parser, and runtime to fully parse. Smalltalk is several times smaller than Python, and actual Lisp implementations have syntaxes that are 1/3rd to 1/2 the size of Smalltalk's. The above is all objective. You can reduce a language to a formal grammar and count the number of terminals and nonterminals in that grammar.
- jleader 13y agoNot all linguistic nuance is syntactic. For example, the semantics of object models can contain a lot of nuances, as can the lifetimes of variables, visibility of identifiers, etc. While there are ways of encoding semantics (denotational, axiomatic, etc.), the size of the encoding will depend a lot on how closely the language's semantics resemble the semantics of the encoding you choose.
- stcredzero 13y agoOkay, then. Single letters in regular expression statements.
- Mithaldu 13y agoAn interesting nuance, which many early Perl teaching books up until Modern Perl [1] failed to address properly is "context". Perl allows both single and multi-value function return. In return the function can ask whether the calling statement expects a single or multiple values. Additionally, this request for expectation propagates through the call stack from the first statement where this can be correctly determined, to the place where the question was asked. This makes it possible to do things like this: my $first = max( 1, 2, 3, 4, 5 ); my ( $first, $second, $third ) = max( 1, 2, 3, 4, 5 ); [1] http://onyxneon.com/books/modern_perl/ http://onyxneon.com/books/modern_perl/