Main Page | Report this Page
Computers Forum Index  »  Computer Languages (Misc)  »  Comparison of programming language features...
Page 1 of 1    

Comparison of programming language features...

Author Message
James Harris...
Posted: Thu Sep 24, 2009 6:06 pm
Guest
I've been thinking for a while that it would be helpful to be able to
compare features of programming languages in a tabular form. The idea
would be to

1. see how designs changed over time - purely historical interest,
2. compare choices the designers made for different languages,
3. help a language designer consider some of the choices to be made.

Of course, a language is more than a combination of features so tables
can't show everything but I wonder how informative they could be.

I've made a start at

http://sundry.wikispaces.com/pl-features

It mainly shows only syntactic stuff at present though I have included
some semantic info concerned with divide operations. It seemed
sensible to include these with the symbols as languages use different
symbols for different types of integer divide so the two issues are
linked. A simple syntax/semantics split is not appropriate.

It's not a high priority for me. I'm just entering info sporadically.
Before I add any more I'd like to see what comments, recommendations
or criticisms you guys have. Do you like the idea? Is it useful? Is
there already something similar? How should it develop?

James
 
Rod Pemberton...
Posted: Fri Sep 25, 2009 1:48 am
Guest
"James Harris" <james.harris.1 at (no spam) googlemail.com> wrote in message
news:94314d7c-b42a-40ea-9cf6-1f6292138195 at (no spam) o36g2000vbl.googlegroups.com...
Quote:
I've been thinking for a while that it would be helpful to be able to
compare features of programming languages in a tabular form. The idea
would be to

1. see how designs changed over time - purely historical interest,
2. compare choices the designers made for different languages,
3. help a language designer consider some of the choices to be made.

Of course, a language is more than a combination of features so tables
can't show everything but I wonder how informative they could be.

I've made a start at

http://sundry.wikispaces.com/pl-features


It's definately interesting. For the most part, I've only see bits-n-pieces
of language comparisons here and there. Today, I wouldn't doubt it if
something more comprehensive is on Wikipedia somewhere, but I haven't
looked.

Quote:
It mainly shows only syntactic stuff at present though I have included
some semantic info concerned with divide operations. It seemed
sensible to include these with the symbols as languages use different
symbols for different types of integer divide so the two issues are
linked. A simple syntax/semantics split is not appropriate.

It's not a high priority for me. I'm just entering info sporadically.
Before I add any more I'd like to see what comments, recommendations
or criticisms you guys have. Do you like the idea? Is it useful? Is
there already something similar? How should it develop?


It's clear that the octal, represented as \ddd, in the "Character IDs" chart
is clearly limited 3 chars. But, it's not clear, at least for the C
language, that the hexadecimal, represented as \xdd, is *not* length
limited. Also, a common, but not standard, ASCII escape is \e for esc 0x27.
Also, the 1974 C manual indicates only \b \r \n \t, not the others. Is that
C row 1972 specific as indicated?

Do you plan to include a omparison of scoping or blocking delimiters? IIRC,
C (or B/BCPL...?) is the first curly brace language. The others use text
words to block or scope code.

I don't see a chart with assignment operators... Although it's not
relational operator, I'd expect the assignment operators to be with or near
equalty operator the "Relational Operators". E.g., C uses == for
comparitive equality, but uses = for assignment. Pascal, IIRC, used := for
assignment. PL/1, uses = for both.

Do you plan to add PL/1? I programmed in a variant of it for 3 years (which
was closer to Pascal, unfortunately. I learned that much later...). It's a
very powerful language, comparitive to C, if not better in certain areas:
e.g., pass by reference, by default. Hmm, I also see no chart of calling
conventions...

The "Numeric types" chart indicates "no" for "individual characters" in
BASIC. Was that just 1964 versions of BASIC? I know the later versions had
character support, e.g., chr$(), asc(). But, it seems to me these were
after ASCII was standardized...

What is the "0b" in the "Binary" column and "C" row of the "Numeric
literals" chart? AFAIK, there is no binary representation in C. Is that
C++ or C99? The 1974 C manual indicate no hexadecimal back then either,
just octal and decimal. Is the C row specifically 1972 as marked?

What about other languages FORTH? LISP?

Some basic info on PL/1
http://www.users.bigpond.com/robin_v/enterp.htm

This link has a small chart in it of assignment operators:
http://hhh.gavilan.edu/dvantassel/history/assignment.html

C Reference Manual 1974 in .pdf form is available as a raw scan and as a
formatted searchable versions from D.M. Ritchie's website. I stated 1974
above, but I think the searchable version might actually be 1975...
http://cm.bell-labs.com/cm/cs/who/dmr/index.html

Good job so far!

HTH,


Rod Pemberton
 
Torben Ægidius Mogensen...
Posted: Fri Sep 25, 2009 11:39 am
Guest
"Dmitry A. Kazakov" <mailbox at (no spam) dmitry-kazakov.de> writes:


Quote:
The Rosetta Code maintains multiple sections for language features,
such as basic constructs, operations, types, paradigms etc:

http://rosettacode.org/wiki/Main_Page

For example the comparison of major language topics there:

http://rosettacode.org/wiki/Language_Comparison_Table

I find this list strange. It includes a number of relatively obscure
languages like AutoHotKey, E, Nial and RapidQ, but omits better-knwon
and widely influential languages like Standard ML and APL. It lists
some languages derived from these (OCaml is derived from SML and J from
APL), but it is strange to omit the better-known and more influential
ancestors.

Torben
 
Calum...
Posted: Fri Sep 25, 2009 11:59 am
Guest
On Sep 24, 7:06 pm, James Harris <james.harri... at (no spam) googlemail.com>
wrote:
Quote:
I've been thinking for a while that it would be helpful to be able to
compare features of programming languages in a tabular form. The idea
would be to

1. see how designs changed over time - purely historical interest,
2. compare choices the designers made for different languages,
3. help a language designer consider some of the choices to be made.

Of course, a language is more than a combination of features so tables
can't show everything but I wonder how informative they could be.

I've made a start at

 http://sundry.wikispaces.com/pl-features

It mainly shows only syntactic stuff at present though I have included
some semantic info concerned with divide operations. It seemed
sensible to include these with the symbols as languages use different
symbols for different types of integer divide so the two issues are
linked. A simple syntax/semantics split is not appropriate.

It's not a high priority for me. I'm just entering info sporadically.
Before I add any more I'd like to see what comments, recommendations
or criticisms you guys have. Do you like the idea? Is it useful? Is
there already something similar? How should it develop?

James

Looks good so far. I'd be more interested in paradigms and
philosophy. How do they deal with concurrency?
 
James Harris...
Posted: Sat Sep 26, 2009 11:49 am
Guest
On 25 Sep, 12:59, Calum <spam... at (no spam) calumgrant.net> wrote:
Quote:
On Sep 24, 7:06 pm, James Harris <james.harri... at (no spam) googlemail.com
wrote:



I've been thinking for a while that it would be helpful to be able to
compare features of programming languages in a tabular form. The idea
would be to

1. see how designs changed over time - purely historical interest,
2. compare choices the designers made for different languages,
3. help a language designer consider some of the choices to be made.

Of course, a language is more than a combination of features so tables
can't show everything but I wonder how informative they could be.

I've made a start at

 http://sundry.wikispaces.com/pl-features

It mainly shows only syntactic stuff at present though I have included
some semantic info concerned with divide operations. It seemed
sensible to include these with the symbols as languages use different
symbols for different types of integer divide so the two issues are
linked. A simple syntax/semantics split is not appropriate.

It's not a high priority for me. I'm just entering info sporadically.
Before I add any more I'd like to see what comments, recommendations
or criticisms you guys have. Do you like the idea? Is it useful? Is
there already something similar? How should it develop?

James

Looks good so far.  I'd be more interested in paradigms and
philosophy.  How do they deal with concurrency?

For paradigms and philosophy what sort of detail are you thinking of?
A table saying language X is imperative and language Y is object
orientated sounds much too vague - and is probably catered for
elsewhere.

For concurrency what details would be required and how would it be
best to lay that information out?

Generally, rather than including everything on one page I wonder if it
might be better to have subpages for certain information. For example,
for each operation (plus, times, bit shift, etc) should there be a
separate page showing the consequences (data types accepted,
coercions, promotions, result type etc)?

James
 
Mike Austin...
Posted: Sat Sep 26, 2009 6:29 pm
Guest
On Sep 24, 11:06 am, James Harris <james.harri... at (no spam) googlemail.com>
wrote:
Quote:
I've been thinking for a while that it would be helpful to be able to
compare features of programming languages in a tabular form. The idea
would be to

1. see how designs changed over time - purely historical interest,
2. compare choices the designers made for different languages,
3. help a language designer consider some of the choices to be made.

Of course, a language is more than a combination of features so tables
can't show everything but I wonder how informative they could be.

I've made a start at

 http://sundry.wikispaces.com/pl-features

It mainly shows only syntactic stuff at present though I have included
some semantic info concerned with divide operations. It seemed
sensible to include these with the symbols as languages use different
symbols for different types of integer divide so the two issues are
linked. A simple syntax/semantics split is not appropriate.

It's not a high priority for me. I'm just entering info sporadically.
Before I add any more I'd like to see what comments, recommendations
or criticisms you guys have. Do you like the idea? Is it useful? Is
there already something similar? How should it develop?

James

If it hasn't been mentioned already:
http://merd.sourceforge.net/pixel/language-study/syntax-across-languages.html
 
Rod Pemberton...
Posted: Sun Sep 27, 2009 2:12 am
Guest
"James Harris" <james.harris.1 at (no spam) googlemail.com> wrote in message
news:62f4e7aa-22e8-4b15-baf8-50209cc60cb3 at (no spam) h30g2000vbr.googlegroups.com...
On 24 Sep, 22:48, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:
Quote:

What is the "0b" in the "Binary" column and "C" row of the "Numeric
literals" chart? AFAIK, there is no binary representation in C. Is that
C++ or C99? The 1974 C manual indicate no hexadecimal back then either,
just octal and decimal. Is the C row specifically 1972 as marked?

That has been corrected now.

"Based Numeric literals"
"Blank cells indicate a base that is not supported."

Decimal is not supported for C?... Oh, wait a minute:

"Notes"
" The assembler Macro-11 1970... All the other languages use decimal as the
default."

Odd place, reference to Macro-11, to make the note about decimal by
default... ;)

Quote:

I don't see a chart with assignment operators... Although it's not
relational operator, I'd expect the assignment operators to be with or
near
equalty operator the "Relational Operators". E.g., C uses == for
comparitive equality, but uses = for assignment. Pascal, IIRC, used :=
for
assignment. PL/1, uses = for both.

Yes, they will need to be added.


That was a huge issue for me with PL/1 variant. I always needed to locate
assignment of variables, but *not* conditionals containing equality.
However, the operator was identical, there was no way to differentiate the
two... PIA. Of course, C is not much better here. You want to identify
locations of assignment with a single equal '=', without locating equality
with a doubled equal '=='.

"Other fiddles in the transition from BCPL to B were introduced as a matter
of taste, and some remain controversial, for example the decision to use the
single character = for assignment instead of :=. Similarly, B uses /**/ to
enclose comments, where BCPL uses //, to ignore text up to the end of the
line. The legacy of PL/I is evident here."
- The Development of the C language, Dennis M. Ritchie, ACM 1993

Yes, I can confirm they made a mistake by not keeping colon-equal for
assignment for B and C... ;)


Rod Pemberton
PS. You've changed "C 1972" to "C 1975" in all but one location...
PPS. I'm not sure if you need a calling convention table, but it would be
interesting to know esp. for languages you're not familiar with.
 
robin...
Posted: Sun Sep 27, 2009 4:12 am
Guest
Rod Pemberton wrote in message ...


This is now:
http://members.dodo.com.au/~robin51/enterp.htm

If that should be not found, capitalise ENTERP.HTM
 
James Harris...
Posted: Sun Sep 27, 2009 12:39 pm
Guest
On 26 Sep, 23:12, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:
Quote:
"James Harris" <james.harri... at (no spam) googlemail.com> wrote in message

news:62f4e7aa-22e8-4b15-baf8-50209cc60cb3 at (no spam) h30g2000vbr.googlegroups.com...
On 24 Sep, 22:48, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:



What is the "0b" in the "Binary" column and "C" row of the "Numeric
literals" chart? AFAIK, there is no binary representation in C. Is that
C++ or C99? The 1974 C manual indicate no hexadecimal back then either,
just octal and decimal. Is the C row specifically 1972 as marked?

That has been corrected now.

"Based Numeric literals"
"Blank cells indicate a base that is not supported."

I'll reword it to say something like *explicit* selection is not
supported.

Quote:

Decimal is not supported for C?...  Oh, wait a minute:

"Notes"
" The assembler Macro-11 1970... All the other languages use decimal as the
default."

Odd place, reference to Macro-11, to make the note about decimal by
default... Wink

True. I don't want to put a different column to say the default base
as for nearly all languages it is decimal. Nor do I want to mention
Macro-11 before the table as it's quite obscure. I've included
Macro-11 as it may have been influential on B. So I'm not sure how
best to address this. Like Moonwatcher and Dave Bowman ... I'll think
of something. :-)


Quote:

I don't see a chart with assignment operators... Although it's not
relational operator, I'd expect the assignment operators to be with or
near
equalty operator the "Relational Operators". E.g., C uses == for
comparitive equality, but uses = for assignment. Pascal, IIRC, used :> for
assignment. PL/1, uses = for both.

Yes, they will need to be added.

That was a huge issue for me with PL/1 variant.  I always needed to locate
assignment of variables, but *not* conditionals containing equality.
However, the operator was identical, there was no way to differentiate the
two...  PIA.  Of course, C is not much better here.  You want to identify
locations of assignment with a single equal '=', without locating equality
with a doubled equal '=='.

Well, the equal sign may appear in various contexts in many languages:

1. Assignment
2. Comparison for equality
3. Comparison for inequality
4. Compare <= and >5. In comments
6. In string literals
7. For named arguments =>
8. In augmented assignment: +=, -= etc

Therefore in many languages text-based searching may not be helpful.
Perhaps a compiler should have an option to generate a number of cross-
reference tables. In fact it was a long time ago when I used PL/I but
I'd be surprised to learn that PL/I compilers don't have options to do
this, i.e. to identify all assignments.

Quote:

"Other fiddles in the transition from BCPL to B were introduced as a matter
of taste, and some remain controversial, for example the decision to use the
single character = for assignment instead of :=. Similarly, B uses /**/ to
enclose comments, where BCPL uses //, to ignore text up to the end of the
line. The legacy of PL/I is evident here."
- The Development of the C language, Dennis M. Ritchie, ACM 1993

Yes, I can confirm they made a mistake by not keeping colon-equal for
assignment for B and C...  Wink

If you had := as assignment would you also allow augmented assignment
and, if so, what symbols would you use? (I tried this a while ago but
the symbols looked a little absurd.)

Quote:

Rod Pemberton
PS.  You've changed "C 1972" to "C 1975" in all but one location...

Yes, I've still got one table to do.

Quote:
PPS.  I'm not sure if you need a calling convention table, but it would be
interesting to know esp. for languages you're not familiar with.

As mentioned, I'm open to suggestions but I think of this more as an
impementation issue rather than one of design. Perhaps such issues
need a separate page on the wiki.

James
 
Dmitry A. Kazakov...
Posted: Sun Sep 27, 2009 1:25 pm
Guest
On Sat, 26 Sep 2009 11:29:40 -0700 (PDT), Mike Austin wrote:


Nice, I wasn't aware of it. Thanks.

(it has some inaccuracies though)

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
 
Marco...
Posted: Sun Sep 27, 2009 3:51 pm
Guest
On Sep 27, 5:39 am, James Harris <james.harri... at (no spam) googlemail.com>
wrote:
Quote:
"Other fiddles in the transition from BCPL to B were introduced as a matter
of taste, and some remain controversial, for example the decision to use the
single character = for assignment instead of :=. Similarly, B uses /**/ to
enclose comments, where BCPL uses //, to ignore text up to the end of the
line. The legacy of PL/I is evident here."
- The Development of the C language, Dennis M. Ritchie, ACM 1993

Yes, I can confirm they made a mistake by not keeping colon-equal for
assignment for B and C...  ;)

If you had := as assignment would you also allow augmented assignment
and, if so, what symbols would you use? (I tried this a while ago but
the symbols looked a little absurd.)

same as they are in C
+ - then assignment operators would always be 2 characters wide

the key is = should have been left for equality comparison, the =choice was bad just to save a few punch card key strokes (maybe it was
paper tape)
 
Dmitry A. Kazakov...
Posted: Sun Sep 27, 2009 5:29 pm
Guest
On Sun, 27 Sep 2009 05:39:48 -0700 (PDT), James Harris wrote:

Quote:
On 26 Sep, 23:12, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:
"James Harris" <james.harri... at (no spam) googlemail.com> wrote in message

Yes, I can confirm they made a mistake by not keeping colon-equal for
assignment for B and C...  ;)

If you had := as assignment would you also allow augmented assignment
and, if so, what symbols would you use? (I tried this a while ago but
the symbols looked a little absurd.)

With Self or Idem. It has some advantages, e.g.

X := 1 - Self;

One could generalize it, considering certain formal parameters defined in
certain contexts. For example:

A (I) := Self + B (Index + 1)

Here "Index" refers to the current LHS index (cursor). "Container" might
refer to the LHS array etc. That could be useful in downward closures as
well.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
 
James Harris...
Posted: Sun Sep 27, 2009 8:31 pm
Guest
On 27 Sep, 20:11, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:

....

Quote:
augmented assignment

Augmented assignment?  Wikipedia to the rescue.  Is that what CS actually
calls them?

CS? Your turn to thrown in a confusing term, I see. Wikipedia to the
rescue again..... :-)

You've used the term CS before in at least one other thread and after
a bit of head scratching I assumed you mean computer science but maybe
that's not so. It doesn't make sense to me to say that computer
science names something. On the other hand people do name things and
the names they choose vary. Maybe you mean Computer Scientists. At any
rate, if you have another name for the same thing that may be just as
valid.

I used augmented assignment as a term without thinking about it.
Everyone seems to have understood it the way intended, including the
wikipedia article, but there may be other terms for the same thing. I
don't know where I got the term from.

Quote:
 Wikipedia indicates the page is an "orphan" - no other pages
link to it.

It is the first page that comes up for a Google search and there are
many others. I checked K&R C and they just call it an assignment. It's
got me wondering why it seems so familiar.

James
 
bartc...
Posted: Sun Sep 27, 2009 9:33 pm
Guest
James Harris wrote:
Quote:
On 26 Sep, 23:12, "Rod Pemberton" <do_not_h... at (no spam) nohavenot.cmm> wrote:

8. In augmented assignment: +=, -= etc

If you had := as assignment would you also allow augmented assignment
and, if so, what symbols would you use? (I tried this a while ago but
the symbols looked a little absurd.)

You mean like this:

+:=
-:=
*:=

and so on? I use these and they look perfectly acceptable. I know Algol 68
uses these and I'm sure many other languages using :=

If anything it's += -= etc that looks a little strange to me, because the
"=" component of these composite symbols doesn't shout 'assignment' at you
as strongly as the ":=" of the above.

The only thing that looks a bit odd (at least the way I do it) is replacing:

a := -a

with:

-:= a

--
Bartc
 
Rod Pemberton...
Posted: Sun Sep 27, 2009 11:11 pm
Guest
"James Harris" <james.harris.1 at (no spam) googlemail.com> wrote in message
news:f6c88201-7e2d-4988-84f8-80fb02dc456b at (no spam) l31g2000vbp.googlegroups.com...
Quote:

augmented assignment


Augmented assignment? Wikipedia to the rescue. Is that what CS actually
calls them? Wikipedia indicates the page is an "orphan" - no other pages
link to it. So, I suspect that's not a common CS term for this. Well, at
least, I'd never heard them called that before...

Quote:
If you had := as assignment would you also allow augmented assignment
and, if so, what symbols would you use?


I don't see any functional issues with keeping the existing C assignment
operators. No, I definately would NOT want Bartc's suggestions of +:=
, -:=, and *:= . Searching for := would match these operators. Except for
^= , I think they are recognizable across a few languages, and from
mathematic symbols. The ^ caret, IIRC, was exponentiation in some language
(BASIC?...). There is no reason a few more integer operations couldn't be
added to C, e.g., bitwise nand assignment, bitwise nor assignment, integer
exponentation assignment operator - instead of pow()... Since the compiler
must do something to convert a microprocessor's bitwise operations into
logical operations for C's logical operators, you might as well add this
functionality too. The compiler needs to convert 0 and non-zero values to 0
and all bits one respectively, and the opposite, e.g., a logical operator
and logical-not operator. This shouldn't be confused with not ! operator
which does 0 and 1, or with the not equal operator != (exclamation-equal)
:= as assignment, instead of =, is just to provide a two char text sequence
which is distinquishable from the other assignment operators and equality.
Since it also has an = in it, you'd still be able to search for all
assignment operators.

Continuing that thought... Since := also has an = in it, you'd still be
able to search for all assignment operators. This might actually slightly
ease parsing of C too. It's kind of the reverse of "long long". How do you
easily distinquish "long long" from "long" in a _very_ simple parser? "long
long" should've been a single word, just as assignment should've been two
chars, IMO. How do you distinguish = from +=, you have to store extra info,
i.e., personified: "I saw no +, -, *, %, <, >, &, ^, !, or | character
immediately prior to this equal, therefore it is an assignment and not part
of a larger token." C has other issues too: typdef's need a keyword prior
to typedef usage - they have "typedef" prior to a typedef declaration - a
semantic conflict arises if it's the same keyword for declaration and use,
implicit int's - also "invisible" and now obsolete - are only fully
determinable without typedef's present, ellipsis ... is required on
functions with variable arguments to ensure proper parameter passing order,
addresses aren't available on function or procedure returns since they are
unnamed, addresses aren't available on labels, etc.

I digress.


Rod Pemberton
 
 
Page 1 of 1    
All times are GMT
The time now is Tue Dec 08, 2009 4:11 am