Re: [DNG] OT: some ancient programming language history

2015-07-29 Thread Nuno Magalhães
On Mon, Jul 27, 2015 at 5:16 PM, Lars Noodén lars.noo...@gmail.com wrote:
 IIRC the Icon programming language had an exchange operator to swap the
 contents of two variables.

 a :=: b

C:

a = a ^ b;
b = a ^ b;
a = a ^ b;

Much more fun. Them :=: look like weird emoticons.



-- 
On the internet, nobody knows you're a dog.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Didier Kryn
T.J, would you please try to put dyne.org as To instead of CC, in 
the destination? I think it would enable the button reply to the list 
in Thunderbird.


Le 27/07/2015 02:28, T.J. Duchene a écrit :


  The affectation operator is := instead of = in C, and the
 comparison are = (instead of ==) and /= instead of != . The bad
 choice
 of operators, together with other tricks is probably the main source
 of
 bugs in C programs.

I like the fact that Ada is very strict, because it forces new
programmers to do things right.  On the other hand, that comes at the
cost of flexibility, which makes it useless for certain tasks.

Since C predates Ada by at least a decade, I don't think C is the
problem. I have never had a problem keeping ==, = or !=
straight.


I'm not a teacher and therefore can mostly speak for myself. I 
learned ALGOL in 1972, as already written, and then stopped programming 
for 6 years. Then I learned FORTRAN, which has the same assignment 
symbol as C, '=' . I discovered C in 1981 and used it up to now, which 
makes a honestly long experience, and it still happens to me to type '=' 
instead of '=='.


   The first Ada compiler appeared in 1983. It advertized some 
interesting features and I read a manual, then forgot it because I 
hadn't access to a compiler. This first compiler was running on VMS I 
think. I remember the year very well for other reasons.


So you cannot believe I was contaminated by the use of ALGOL-like 
languages.


Using C after FORTRAN, was a liberation. I could do a lot of things 
previously impossible. And there was structs and pointers. I loved 
programming in C. Later I wrote multitask and multithreaded DAQ 
programs. And discovered that a large program becomes rapidly 
un-maintainable, unless you work at least weekly on it.


Around 1994 I had the project of a large multi-host DAQ system and 
I decided to select an appropriate language because C was too low-level. 
I selected Ada after months of enquiry, reading various opinions and 
comparisons, without knowing the language at all. Then I had, by chance, 
the opportunity to follow a one week lecture in 1995 and came out 
thinking I would never write applications in any other language. I had 
the opposite opinion about C++ 5 years before after a one week lecture also.


C is a universal assembler. It is cast after the hardware. A unique 
feature of C is that an assignment has a value; this is because the 
value which has just been stored into memory is still there in a 
register, ready for use. It can be assigned to another variable (stored 
in another location), which allows instructions like a=b=c; while 
b=c; a=b; would mean an additional and useless load. C compilers have 
long been able to optimize out the additional load, but the instruction 
is still valid.


A lot of C features are driven by the will to give the programmer a 
quasi-direct access to machine instructions. This includes the case 
explained above and pre-increment and post-increment instructions. But 
it makes no sense with modern compilers. The compiler now wipes out 
these optimizations the programmer may think xe has done, reorders the 
instructions, bypasses memory access for non-volatile variables and 
optimizes the whole better than you could do. It remains these funny 
features which are the trademark of C but are nothing but a danger.


If you never make the mistake of using a single = in a comparison, 
then either you have a trick, or you are super-human. Whatever error is 
possible to do, a human will do it for sure. Gcc now gives a warning in 
such cases, but it's enough to enclose in parentheses to avoid the warning.


When you write C predates Ada, you probably mean there are more 
people programming in C than Ada. So what? That tells nothing on the 
respective merits of the two languages. The fact is there hasn't been a 
good Ada compiler for a decade, because it is a difficult job to write 
one, while, in the contrary, C had been designed to make it easy to 
write compilers. The lack of good Ada compilers is probably one of the 
reasons for the later success of C++ (which started as a C preprocessor).


C enables writing little things quickly and easily; for large 
things, it takes an infinite time to erradicate bugs. Ada is just the 
opposite: bad constructs are forbidden and the compiler checks a great 
many things. It takes longer to have your program compile without error, 
but then it works. There still remains a few possible bugs which cannot 
be found at compile time, but they will rather cause a crash than 
produce wrong results. At the end, you save time. Always.


Sorry for this very long mail. I should better have a web site like 
Steve, and post links.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Didier Kryn

Le 27/07/2015 17:45, Renaud (Ron) OLGIATI a écrit :

On Mon, 27 Jul 2015 11:20:03 -0400
Renaud (Ron) OLGIATI ren...@olgiati-in-paraguay.org wrote:


Or, as in APL, use = for assignment


You mean like in b+c = a ?

Interesting because assignment is an invention of imperative 
languages with no natural reason for the destination to be on the left 
side.



Sorry, read use A (left arrow) 1 2 3 4 for assignment


Don't understand what you mean :-)

Didier


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Lars Noodén
On 07/27/2015 07:07 PM, Didier Kryn wrote:
 Le 27/07/2015 17:45, Renaud (Ron) OLGIATI a écrit :
 On Mon, 27 Jul 2015 11:20:03 -0400
 Renaud (Ron) OLGIATI ren...@olgiati-in-paraguay.org wrote:

 Or, as in APL, use = for assignment
 
 You mean like in b+c = a ?
 
 Interesting because assignment is an invention of imperative
 languages with no natural reason for the destination to be on the left
 side.

IIRC the Icon programming language had an exchange operator to swap the
contents of two variables.

a :=: b

Or something like that.

Regards,
/Lars


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Hendrik Boom
On Sun, Jul 26, 2015 at 11:58:55PM +0200, Didier Kryn wrote:
...
 The affectation operator is := instead of = in C, and the
 comparison are = (instead of ==) and /= instead of != . The bad
 choice of operators, together with other tricks is probably the main
 source of bugs in C programs.

It you only program one language in your life, of course this doesn't 
matter much.

But if you frequently change languages, you rapidly find:

= is a bad choice for assignment, because it also means equality.
= is a bad choice for equality, because it also means assignment.

So the only sane choice is to use := for assignment and == for 
equality.  Forget about = altogether.

-- hendrik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Ron
On Mon, 27 Jul 2015 11:20:03 -0400
Renaud (Ron) OLGIATI ren...@olgiati-in-paraguay.org wrote:

 Or, as in APL, use = for assignment 

Sorry, read use A (left arrow) 1 2 3 4 for assignment
 
Cheers,
 
Ron.
-- 
   And it should be the law: If you use the word `paradigm' without knowing
  what the dictionary says it means, you go to jail. No exceptions.
 -- David Jones

   -- http://www.olgiati-in-paraguay.org --
 

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Ron
On Mon, 27 Jul 2015 10:32:06 -0400
Hendrik Boom hend...@topoi.pooq.com wrote:

 But if you frequently change languages, you rapidly find:
 
 = is a bad choice for assignment, because it also means equality.
 = is a bad choice for equality, because it also means assignment.
 
 So the only sane choice is to use := for assignment and == for 
 equality.  Forget about = altogether.

Or, as in APL, use = for assignment and = for equality   (all in one line ;-3)
 
Cheers,
 
Ron.
-- 
   And it should be the law: If you use the word `paradigm' without knowing
  what the dictionary says it means, you go to jail. No exceptions.
 -- David Jones

   -- http://www.olgiati-in-paraguay.org --
 

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-27 Thread Ron
On Mon, 27 Jul 2015 18:07:30 +0200
Didier Kryn k...@in2p3.fr wrote:

  use A (left arrow) 1 2 3 4 for assignment  
 
  Don't understand what you mean :-)

(letter A) (left arrow symbol) (one or several values or variables)

 You mean like in b+c = a ?

that would be:

(letter a) (left arrow symbol) (b + c)
 
Cheers,
 
Ron.
-- 
 Animals can be driven crazy by putting too many in too small a pen.
Homo sapiens is the only animal that voluntarily does this to himself.
   -- Lazarus Long

   -- http://www.olgiati-in-paraguay.org --
 

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-26 Thread T.J. Duchene



On 07/26/2015 11:08 AM, Hendrik Boom wrote:



I also had a long discussion with some of the guys in charge of the
ADA project -- they really wanted the security that comes from
completely automatic storage management but they couldn't afford to
have their weapons systems stop for garbage collection,

I told them exactly what the trade-offs were -- too what extent they
could have their cake and eat it too.  In the end they decided that
they could afford neither the language complexity of the
garbage-collector-free storage management schemes, nor the garbage
collection delays.  I'm not sure to what extent they ended up avoiding
dynamically allocated storage in the first official language
definition.


ADA!  I remember that!  I've not used it in the better part of 20 
years.  Nicely designed language for its time - and very strict. Having 
learned C in advance of ADA, I never liked its Pascal style operators.


Too bad the only one who really uses it in the US is the government.

I think you can find the answer to your memory comment here, Hendrik. 
https://en.wikipedia.org/wiki/Ada_(programming_language)



T.J.




___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-26 Thread Miles Fidelman

T.J. Duchene wrote:



ADA!  I remember that!  I've not used it in the better part of 20 
years.  Nicely designed language for its time - and very strict. 
Having learned C in advance of ADA, I never liked its Pascal style 
operators.


Too bad the only one who really uses it in the US is the government.


Actually, not true.  ADA seems to have a major following in the 
real-time control systems community, for mission/life-critical systems 
like avionics and SCADA.  Not surprising, actually - it was designed for 
that kind of thing.


Miles Fidelman

--
In theory, there is no difference between theory and practice.
In practice, there is.    Yogi Berra

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-26 Thread Didier Kryn

Le 26/07/2015 20:19, T.J. Duchene a écrit :



On 07/26/2015 11:08 AM, Hendrik Boom wrote:



I also had a long discussion with some of the guys in charge of the
ADA project -- they really wanted the security that comes from
completely automatic storage management but they couldn't afford to
have their weapons systems stop for garbage collection,

I told them exactly what the trade-offs were -- too what extent they
could have their cake and eat it too.  In the end they decided that
they could afford neither the language complexity of the
garbage-collector-free storage management schemes, nor the garbage
collection delays.  I'm not sure to what extent they ended up avoiding
dynamically allocated storage in the first official language
definition.


ADA!  I remember that!  I've not used it in the better part of 20 
years.  Nicely designed language for its time - and very strict. 
Having learned C in advance of ADA, I never liked its Pascal style 
operators.


Too bad the only one who really uses it in the US is the government.


Ada is not an acronym, it's after the first name of the first 
person who wrote programs, the daughter of Byron, the english poet.


Ada is used in many places where human life is at stake: eg. 
planes, missiles, Eurocontrol (the european air cirulation regulation), 
the driver-less metro in Paris. The initial version was Ada83. There 
have been some revisions since. Add95 was a major one and the last is 
Ada2012.


The affectation operator is := instead of = in C, and the 
comparison are = (instead of ==) and /= instead of != . The bad choice 
of operators, together with other tricks is probably the main source of 
bugs in C programs.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] OT: some ancient programming language history

2015-07-26 Thread T.J. Duchene
On Sun, 2015-07-26 at 23:58 +0200, Didier Kryn wrote:


  Ada is not an acronym, it's after the first name of the first
 person who wrote programs, the daughter of Byron, the english poet.

Yes, I know.


  Ada is used in many places where human life is at stake: eg.
 planes, missiles, Eurocontrol (the european air cirulation
 regulation),
 the driver-less metro in Paris. The initial version was Ada83. There
 have been some revisions since. Add95 was a major one and the last is

 Ada2012.

Yes.  Allow me to rephrase.  When I was taught Ada, it was assumed that
Ada was used primarily by the US Department of Defense, who had a hand
its creation.



  The affectation operator is := instead of = in C, and the
 comparison are = (instead of ==) and /= instead of != . The bad
 choice
 of operators, together with other tricks is probably the main source
 of
 bugs in C programs.

I like the fact that Ada is very strict, because it forces new
programmers to do things right.  On the other hand, that comes at the
cost of flexibility, which makes it useless for certain tasks.

Since C predates Ada by at least a decade, I don't think C is the
problem.  I have never had a problem keeping ==, = or !=
straight.

It's just my opinion, but there are at least a 2 dozen languages that
use the same syntax. Programmers who spent a large part of their
careers in low level or embedded have no problems with it that I can
tell.  I think the only ones who DO have that problem are programmers
who learned things like Pascal or Ada first, along with the new kids
who can't seem to program their way out of a paper bag without
resorting to OOP.

Example?  Have a good laugh.  I know I did.


http://blog.pluralsight.com/give-me-those-old-time-programmers

“These younger engineers can write a lot of sloppy code, and it doesn’t
matter, but here, with very limited capacity, you have to be extremely
precise and have a real strategy.”
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] OT: some ancient programming language history

2015-07-26 Thread Hendrik Boom
On Sun, Jul 26, 2015 at 04:52:10PM +0200, Didier Kryn wrote:
 Le 25/07/2015 20:55, Hendrik Boom a écrit :
 ...
 This really
 violates the standing principle of paying for only what you use.
 I encountered this principle long ago when I got involved in the
 design and implementation of Algol 68 -- they deliberately violated it
 with one feature -- they decided that everyone would pay the price of
 a procedure calling mechanism that supported recursion.
 
 Sometimes it is the right thing to do.  The same decision was made by
 practically eveery language designed afterward.
 
 Not to say they didn't accidentally violate it a few times, of course.
 I'm talking five decades ago, back when people were inventing the
 language design principles we now take for granted.
 
 So you were involved in the design of Algol68! This was the
 first language I learned, in 1972-1973. The second of a great
 lineage which comprises Pascal and Ada. Kudos Hendrik! That's a
 pretty long carreer.

Not the original 1968 version, but I was involved in the discussions 
leading to the revised report, as a post-doc under Barry Mailloux.  I 
also wrote what's probably the most complete unfinished Algol 68 
compiler in existence back then (source code still available if anyone 
wants to read it).

I also had a long discussion with some of the guys in charge of the  
ADA project -- they really wanted the security that comes from 
completely automatic storage management but they couldn't afford to 
have their weapons systems stop for garbage collection,

I told them exactly what the trade-offs were -- too what extent they 
could have their cake and eat it too.  In the end they decided that 
they could afford neither the language complexity of the 
garbage-collector-free storage management schemes, nor the garbage 
collection delays.  I'm not sure to what extent they ended up avoiding 
dynamically allocated storage in the first official language 
definition.

-- hendrik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng