comp.lang.ada
 help / color / mirror / Atom feed
From: David Thompson <dave.thompson2@verizon.net>
Subject: Re: STM32F4 Discovery, communication and libraries
Date: Sat, 20 Sep 2014 16:50:56 -0400
Date: 2014-09-20T16:50:56-04:00	[thread overview]
Message-ID: <m2or1a5vlp9rs6a907escj0osr587qvhii@4ax.com> (raw)
In-Reply-To: 5kkrv9hejn2qhdckkeo8lidkbh3bkme1gn@4ax.com

On Wed, 27 Aug 2014 09:08:07 -0400, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
<snip>
> 	Do you have any experience with assembler (any) -- since so much of C
> mapped to the PDP series instruction set (pre/post increment/decrement
> operators, for example).
> 
That's not really true -- and the related idea that these operators
are *based on* hardware is an urban legend. The PDP-11 (but not other
quite different machines in DEC's PDP "family") has post-inc and
pre-dec (not pre-inc and post-dec) for pointers that happen to be in
registers, and if you look at it slantways pre-inc and pre-dec for
8-bit or 16-bit integers. C has all 4 operations on all scalar data
types, and predecessor B had all 4 on its sole data type "word".

Ritchie's paper on C in ACM HOPL 2 used to be available on his
bell-labs page, and I saw it still there after his death, but it's
gone now and I see no archive. I feel I can quote one paragraph:

> Thompson went a step further by inventing the ++ and -- operators, 
> which increment or decrement; their prefix or postfix position 
> determines whether the alteration occurs before or after noting 
> the value of the operand. They were not in the earliest versions 
> of B, but appeared along the way. People often guess that they were 
> created to use the auto-increment and auto-decrement address modes 
> provided by the DEC PDP-11 on which C and Unix first became popular. 
> This is historically impossible, since there was no PDP-11 when B 
> was developed. The PDP-7, however, did have a few `auto-increment' 
> memory cells, with the property that an indirect memory reference 
> through them incremented the cell. This feature probably suggested 
> such operators to Thompson; the generalization to make them both 
> prefix and postfix was his own. Indeed, the auto-increment cells 
> were not used directly in implementation of the operators, and a 
> stronger motivation for the innovation was probably his observation 
> that the translation of ++x was smaller than that of x=x+1.  

A confirming post is available at http://yarchive.net/comp/c.html .

OTOH the ambiguity whether C type 'char' is signed or unsigned does
trace largely to the PDP-11 preferring sign extension (MOVB) where
other systems either don't or have an equal choice.

> 	C, itself, is a fairly small language -- it's main feature being also
> its main problem: it assumes the programmer knows what they are doing and
> offers easy access to (mis)treating data as addresses in memory.
> 
Or treating garbage as addresses. Or garbage as data.

> 	If you are familiar with Java AND with disciplined software
> development, a copy of the K&R book for C should be all you need to learn
> the language itself (in my world, it was the even smaller first edition K&R
> with my experience of FORTRAN, COBOL, Pascal, and Assembler -- circa 1982).
> 
Bearing in mind that even K&R 2ed is C89 aka C90 and there are 
two later versions of the C standard (three if you count C90 NA1).
Although if you understand K&R2 well and some language-independent
fundamentals, looking at the specific items called out as changes in
C99 and C11 may be enough. And if you don't want to pay for the actual
standards, committee drafts that are equivalent for all practical
purposes are free-beer on http://www.open-std.org/jtc1/sc22/wg14/ .

> 	C++, OTOH... THAT is a nightmare language to pick up... Do NOT think of
> it as just a more powerful C.
> 
> >So far I have investigated the following high level language alternatives:
> >
> >1. www.espruino.com (JavaScript)
> 
> 	Interpreted... And not even full Java... I've not looked at the link --
> JavaScript is the "native" language for the BeagleBone Black, as I recall.
> 
Javascript and Java are almost completely unrelated except for the
latters J a v a and a little syntax copied from C. As wikipedia
correctly says, Javascript semantics are closer to Scheme.

<snip rest>



  parent reply	other threads:[~2014-09-20 20:50 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 22:38 STM32F4 Discovery, communication and libraries roy.emmerich
2014-08-27  2:40 ` Luke A. Guest
2014-08-27 12:35   ` Roy Emmerich
2014-08-27  7:41 ` Dmitry A. Kazakov
2014-08-27 13:35   ` Roy Emmerich
2014-08-27 16:00     ` Dmitry A. Kazakov
2014-08-27 13:08 ` Dennis Lee Bieber
2014-08-27 15:44   ` Roy Emmerich
2014-08-28  1:37     ` Dennis Lee Bieber
2014-08-27 16:03   ` Roy Emmerich
2014-08-28  1:48     ` Dennis Lee Bieber
2014-08-28 10:12       ` Roy Emmerich
2014-08-28 13:00         ` Dmitry A. Kazakov
2014-08-28 16:28           ` Mike Silva
2014-08-28 17:03             ` Roy Emmerich
2014-08-28 20:09             ` Dmitry A. Kazakov
2014-08-28 20:34               ` embeddedrelatedmike
2014-08-29  7:34                 ` Dmitry A. Kazakov
2014-08-29 15:59                   ` Niklas Holsti
2014-08-29 16:59                     ` [OT] Ravenscar (the place, not profile), was: " Simon Clubley
2014-08-29 17:18                       ` Niklas Holsti
2014-08-29 17:31                         ` Simon Clubley
2014-08-30 14:55                           ` Dennis Lee Bieber
2014-08-29 17:59                       ` Jeffrey Carter
2014-08-29 23:30                       ` Randy Brukardt
2014-08-30 11:25                         ` Simon Clubley
2014-08-31 11:09                           ` Phil Thornley
2014-08-30 12:36                         ` Peter Chapin
2014-08-31 18:37                         ` Dirk Craeynest
2014-08-31 19:38                           ` Simon Clubley
2014-08-29 17:24                   ` Mike Silva
2014-08-29 23:35                     ` Randy Brukardt
2014-08-29 13:06                 ` Dennis Lee Bieber
2014-08-29 16:52                   ` Niklas Holsti
2014-08-31  0:49                     ` Shark8
2014-08-28 21:17               ` Niklas Holsti
2014-08-29  0:07                 ` Roy Emmerich
2014-08-29 17:58                   ` Niklas Holsti
2014-08-29  7:41                 ` Dmitry A. Kazakov
2014-08-29 16:31                   ` Niklas Holsti
2014-08-29 16:47                     ` Roy Emmerich
2014-08-29 19:41                       ` Niklas Holsti
2014-08-30 22:00                         ` Roy Emmerich
2014-08-31 10:08                           ` Simon Wright
2014-09-01 20:15                           ` Niklas Holsti
2014-09-01 21:11                             ` Jeffrey Carter
2014-08-31  4:54                       ` gvdschoot
2014-09-09 19:17                         ` Roy Emmerich
2014-09-09 20:20                           ` Mike Silva
     [not found]                             ` <a54dcc42-d4e2-4d53-b381-2bb7a0eef1ee@googlegroups.com>
2014-09-10  1:41                               ` Dennis Lee Bieber
2014-09-10  8:52                                 ` Roy Emmerich
2014-09-10 13:05                                   ` Dennis Lee Bieber
2014-09-10 17:16                                     ` Simon Wright
     [not found]                               ` <a2e59fce-751c-46a0-90f3-80430c627732@googlegroups.com>
2014-09-10  7:22                                 ` Dmitry A. Kazakov
2014-09-10  9:35                                 ` Roy Emmerich
2014-09-10 14:11                               ` Stephen Leake
2014-09-10 17:46                                 ` Jeffrey Carter
2014-09-10 18:37                                   ` Dmitry A. Kazakov
2014-09-11  9:53                                   ` Stephen Leake
2014-09-11 17:19                                     ` Jeffrey Carter
2014-09-10 20:58                               ` Brian Drummond
2014-09-10 23:40                                 ` Dennis Lee Bieber
2014-08-29 16:58                     ` Niklas Holsti
2014-08-31  7:02                     ` Dmitry A. Kazakov
2014-08-31 15:44                       ` Brad Moore
2014-08-31 16:15                         ` Dmitry A. Kazakov
2014-09-01 16:15                           ` Brad Moore
2014-09-01 16:42                             ` Dmitry A. Kazakov
2014-08-31 18:41                       ` Niklas Holsti
2014-09-01 16:42                         ` Dmitry A. Kazakov
2014-09-01 17:21                           ` G.B.
2014-09-02  8:21                             ` Dmitry A. Kazakov
2014-09-02 13:04                               ` G.B.
2014-09-02 14:18                                 ` Dmitry A. Kazakov
2014-09-02 16:44                               ` Jeffrey Carter
2014-09-02 19:02                                 ` Niklas Holsti
2014-09-02 23:19                               ` Randy Brukardt
2014-09-03  1:40                                 ` gdotone
2014-09-04  9:26                                   ` Roy Emmerich
2014-09-04 17:58                                     ` Niklas Holsti
2014-09-05 11:47                                       ` Simon Clubley
2014-09-09 19:04                                         ` Roy Emmerich
2014-09-01 18:39                           ` Niklas Holsti
2014-09-02  8:19                             ` Dmitry A. Kazakov
2014-08-28 13:10         ` Dennis Lee Bieber
2014-08-29  2:52           ` Dennis Lee Bieber
2014-09-20 20:50   ` David Thompson [this message]
2014-08-27 16:17 ` Mike Silva
2014-08-27 16:36   ` Roy Emmerich
2014-08-27 16:58     ` Simon Clubley
2014-08-29 19:36 ` johnscpg
2014-08-30 15:06   ` Stephen Leake
2014-09-02 21:40 ` rrr.eee.27
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox