Re: C / C++ skills



mc wrote:

That is why I like Pascal-like languages (including C#, which has C-like
syntax but Pascal-like semantics).

Agreed. I've used Delphi since version 1, and TP before that. I've also
done a lot of C, mostly with unix and embedded projects. In general you
need to spend more time debugging C code, and by a wide margin in some
cases.

We don't have a good version of .NET to target small embedded MCUs yet.
There was a company making a CLR for embedded targets but they went
under because their pricing model wasn't attractive for small companies
(http://www.windowsfordevices.com/news/NS4666205829.html). There's also
an open source CLR for the H8 as used in the first Lego robotics set,
but that's pretty weak.

I was thinking of making a CLR for embedded devices, where the JIT
would be done on the PC to target the MCU. I'd also consider using
static memory allocation, since the small targets I have in mind don't
lend themselves well to a background thread or process that manages
memory. In many cases with embedded OOP you end up with static classes,
instead of instances, since instances aren't needed for simple control
applications, and this greatly simplifies memory management. You only
allocate static classes once, and you never need to de-allocate them.

C is better than assembly language, but not a lot better. Most of the
unreliability of software as we know it is due to C, with its lack of
bounds-checking, uninitialized pointers, etc.

I think of C as being mostly a portable assembly language. And that's a
good thing when you need to get close to the hardware. C's pointers are
both it's best feature and it's worst feature. That's one reason why
lint programs are so helpful.

C# allows strongly typed references, which are akin to pointers. And
unlike the Java Virtual Machine, the .NET CLR supports the concept to
dereferencing pointers, making it suitable as a C target. An embedded
CLR could support both C# and C.

Eric

.



Relevant Pages

  • RE: when certain number is typed in a cell to display a message
    ... CLR Thanks for your prompt response. ... and then is it calling another macro (ShowForm) which does not yet ... Private Sub Worksheet_Change(ByVal Target As Range) ... this one limits the action to only cell A1. ...
    (microsoft.public.excel.misc)
  • Re: fast method of removing an element from STL list
    ... > the value of target. ... bool operator(const event*& ev) const ... be wary of storing pointers in STL containers - they're designed to ...
    (microsoft.public.vc.stl)
  • RE: when certain number is typed in a cell to display a message
    ... "CLR" wrote: ... If Target.Cells = "040" Then Call ShowForm ... Private Sub Worksheet_Change(ByVal Target As Range) ... MsgBox "Please contact your Manager " ...
    (microsoft.public.excel.misc)
  • TARGET components?
    ... corresponding to TARGET dummy, and do the assignment there, but is it ... I know that when a TARGET actual argument is associated with TARGET ... subroutine set_preferred ... pointers, I face problems like this constantly. ...
    (comp.lang.fortran)
  • Re: Reordering coordinates.
    ... array the target attribute. ... The whole reason (well, ok, 99% of the ... The target attribute tells the compiler ... help catch programmer errors by making sure that pointers could only ...
    (comp.lang.fortran)