Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch > #31688 > unrolled thread
| Started by | Stephen Fuld <SFuld@alumni.cmu.edu.invalid> |
|---|---|
| First post | 2015-12-09 12:26 -0800 |
| Last post | 2015-12-21 09:39 -0800 |
| Articles | 20 on this page of 69 — 22 participants |
Back to article view | Back to comp.arch
Intel MPX Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2015-12-09 12:26 -0800
Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-09 13:04 -0800
Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-09 23:27 +0100
Re: Intel MPX Melzzzzz <mel@zzzzz.com> - 2015-12-10 00:41 +0100
Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-10 12:22 +0100
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-09 17:36 -0800
Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-10 12:36 +0100
Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-10 03:58 -0800
Re: Intel MPX already5chosen@yahoo.com - 2015-12-10 07:39 -0800
Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-10 16:41 +0000
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 10:06 -0800
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 11:14 -0800
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 11:23 -0800
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 07:37 -0800
Re: Intel MPX timcaffrey@aol.com - 2015-12-15 09:51 -0800
Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-15 09:57 -0800
Re: Intel MPX Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2015-12-15 11:07 -0800
Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-16 02:21 -0800
Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-16 08:01 -0800
Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-16 18:17 +0200
Re: Intel MPX already5chosen@yahoo.com - 2015-12-16 08:31 -0800
Re: Intel MPX George Neuner <gneuner2@comcast.net> - 2015-12-16 13:06 -0500
Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-16 13:03 -0800
Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-16 23:42 +0200
Re: Intel MPX Bill Findlay <yaldnif.w@blueyonder.co.uk> - 2015-12-16 23:34 +0000
Re: Intel MPX Bill Findlay <yaldnif.w@blueyonder.co.uk> - 2015-12-16 23:34 +0000
Re: Intel MPX William Edwards <willvarfar@gmail.com> - 2015-12-16 23:39 -0800
Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 04:44 -0800
Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-18 13:29 +0000
Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-18 14:42 +0000
Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-18 07:19 -0800
Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-18 15:49 +0000
Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-21 17:04 +0000
Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-21 18:10 +0000
Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-21 10:29 -0800
Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-21 19:36 +0000
Re: Intel MPX Noob <root@127.0.0.1> - 2015-12-18 22:29 +0100
Re: Ada vs C Noob <root@127.0.0.1> - 2015-12-18 22:37 +0100
Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 11:37 +0000
Re: Ada vs C Anonymous <no_email@invalid.invalid> - 2015-12-19 17:19 +0000
Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 18:32 +0000
Re: Intel MPX already5chosen@yahoo.com - 2015-12-16 08:25 -0800
Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-16 12:17 -0800
Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-16 12:30 -0800
Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-16 13:42 -0800
Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-16 13:24 -0800
Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-17 13:56 +0100
Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 05:22 -0800
Re: Intel MPX Chris Gray <cg@GraySage.COM> - 2015-12-17 10:59 -0700
Re: Intel MPX Tom Gardner <spamjunk@blueyonder.co.uk> - 2015-12-17 14:22 +0000
Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-17 15:48 +0100
Re: Intel MPX Tom Gardner <spamjunk@blueyonder.co.uk> - 2015-12-17 15:04 +0000
Re: Intel MPX Walter Banks <walter@bytecraft.com> - 2015-12-17 06:10 -0500
Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 03:33 -0800
Re: Intel MPX Walter Banks <walter@bytecraft.com> - 2015-12-17 08:19 -0500
Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 05:32 -0800
Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-17 23:02 +0200
Re: Intel MPX MitchAlsup <MitchAlsup@aol.com> - 2015-12-18 15:01 -0800
Re: Intel MPX Ivan Godard <ivan@millcomputing.com> - 2015-12-18 16:45 -0800
Re: Ada vs C Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-19 06:29 +0200
Re: Ada vs C Ivan Godard <ivan@millcomputing.com> - 2015-12-18 20:55 -0800
Re: Ada vs C Anonymous <no_email@invalid.invalid> - 2015-12-19 06:11 +0000
displays for nested functions (was Ada vs C) Ivan Godard <ivan@millcomputing.com> - 2015-12-18 23:07 -0800
Re: displays for nested functions (was Ada vs C) Anonymous <no_email@invalid.invalid> - 2015-12-19 17:19 +0000
Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 11:46 +0000
Re: Ada vs C jacko <jackokring@gmail.com> - 2015-12-19 05:59 -0800
Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 14:11 +0000
Re: Ada vs C jacko <jackokring@gmail.com> - 2015-12-19 06:29 -0800
Re: Ada vs C timcaffrey@aol.com - 2015-12-21 09:39 -0800
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
| From | nmm@wheeler.UUCP (Nick Maclaren) |
|---|---|
| Date | 2015-12-19 18:32 +0000 |
| Subject | Re: Ada vs C |
| Message-ID | <n547si$jtr$1@dont-email.me> |
| In reply to | #31996 |
In article <ddlhttFg5ohU2@mid.individual.net>, Anonymous <no_email@invalid.invalid> wrote: >> >> I have never used Ada, but have looked at it. My guess is that it >> would lose to modern Fortran on array-dominated codes, and win on >> many or most others. But not by a large factor. > >Ada certainly lacks Fortran's virtuosity at array slicing. >What other features would you say it lacks? I have not looked at it in enough depth to comment. Regards, Nick Maclaren.
[toc] | [prev] | [next] | [standalone]
| From | already5chosen@yahoo.com |
|---|---|
| Date | 2015-12-16 08:25 -0800 |
| Message-ID | <8f5bd64e-b446-484c-84e0-622f706d7db5@googlegroups.com> |
| In reply to | #31901 |
On Wednesday, December 16, 2015 at 6:01:35 PM UTC+2, Quadibloc wrote: > On Wednesday, December 16, 2015 at 3:21:23 AM UTC-7, Bruce Hoult wrote: > > On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: > > > > A Pascal dialect with some features from C would be very nice. > > > > What features? > > > > The only C feature I can think of that is missing from real world Pascal compilers is the ternary operator. > > I was just reading an article which itemized the various reasons why Pascal was > just a toy language. > > - No EQUIVALENCE or aliasing - ever, with absolutely no escape from that. variant record > > - No separate compilation. > > - The dimensions of an array are part of its type, so there's no way to write a > subroutine that will perform an operation on arrays of any size. > > - Oh, and since a string is an array of char, you can't write a subroutine that > works on strings of any length either. > > I'd say *those* are features from C that Pascal badly needs. > > Of course, that may have been an old article, and they may already have been > added. Ah - you did say "real-world Pascal compilers", and not the Pascal > standard. > It depends on what you call "Pascal standard". If "Pascal standard" = Wirth's "The Pascal Report" then it mostly correct. But if "Pascal standard" = ISO 7185 then it is incorrect. The problem with first interpretation is that the description of Pascal in Wirth's paper is very incomplete. BTW, there is another reason, which IIRC applies to both "The Pascal Report" and ISO 7185 - no good ways to implement delegation. The only tool supplied by the language is CASE statement. Not exactly sufficient if you want to implement, say, generic numeric integration library. Or million of other things. > John Savard
[toc] | [prev] | [next] | [standalone]
| From | Bruce Hoult <bruce.hoult@gmail.com> |
|---|---|
| Date | 2015-12-16 12:17 -0800 |
| Message-ID | <fb2a21a1-63db-4045-8871-696a0bfb2131@googlegroups.com> |
| In reply to | #31901 |
On Wednesday, December 16, 2015 at 7:01:35 PM UTC+3, Quadibloc wrote: > On Wednesday, December 16, 2015 at 3:21:23 AM UTC-7, Bruce Hoult wrote: > > On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: > > > > A Pascal dialect with some features from C would be very nice. > > > > What features? > > > > The only C feature I can think of that is missing from real world Pascal compilers is the ternary operator. > > I was just reading an article which itemized the various reasons why Pascal was > just a toy language. > > - No EQUIVALENCE or aliasing - ever, with absolutely no escape from that. > > - No separate compilation. > > - The dimensions of an array are part of its type, so there's no way to write a > subroutine that will perform an operation on arrays of any size. > > - Oh, and since a string is an array of char, you can't write a subroutine that > works on strings of any length either. > > I'd say *those* are features from C that Pascal badly needs. > > Of course, that may have been an old article, and they may already have been > added. Ah - you did say "real-world Pascal compilers", and not the Pascal > standard. Gosh! None of those were true of UCSD Pascal on the Apple ][, let alone Lisa Pascal or the various Pascal's on the Macintosh (MPW, THINK, Metrowerks) all of which had not only casting between pointers and integers (which lets you do any C trick you want) but also support for array and string descriptors. And all the Macintosh ones had single inheritance object systems, similar to modern Java less interfaces. Of course you could say that all those thousands of apps weren't actually written in Pascal but another language. But those people certainly thought they were programming in Pascal.
[toc] | [prev] | [next] | [standalone]
| From | jacko <jackokring@gmail.com> |
|---|---|
| Date | 2015-12-16 12:30 -0800 |
| Message-ID | <26b5db40-199f-4e2a-a470-752e8067888c@googlegroups.com> |
| In reply to | #31919 |
And free pascal is till available today. It even has a Turbo Pascal switch, but it's really minor differences. But yes, there is no code checking loader, for binary non modification checking ...
[toc] | [prev] | [next] | [standalone]
| From | Megol <golem960@gmail.com> |
|---|---|
| Date | 2015-12-16 13:42 -0800 |
| Message-ID | <aa73e610-84f6-4461-a868-210ddc68e18c@googlegroups.com> |
| In reply to | #31901 |
On Wednesday, December 16, 2015 at 5:01:35 PM UTC+1, Quadibloc wrote: > On Wednesday, December 16, 2015 at 3:21:23 AM UTC-7, Bruce Hoult wrote: > > On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: > > > > A Pascal dialect with some features from C would be very nice. > > > > What features? > > > > The only C feature I can think of that is missing from real world Pascal compilers is the ternary operator. > > I was just reading an article which itemized the various reasons why Pascal was > just a toy language. Is that relevant today or even when it was written? I guess you are referring to the "Why Pascal is Not My Favorite Programming Language" from 1981? > - No EQUIVALENCE or aliasing - ever, with absolutely no escape from that. AFAIK even the early PASCAL supported that via variant records? > - No separate compilation. Can't remember that one. All Pascal compilers I've seen/used supported that in one way or another. > - The dimensions of an array are part of its type, so there's no way to write a > subroutine that will perform an operation on arrays of any size. That was a real problem but was fixed in essentially all compilers by 1985. I write essentially because there were/are a lot of obscure compilers for obscure systems and all may not have been fixed. > - Oh, and since a string is an array of char, you can't write a subroutine that > works on strings of any length either. In practice the string support of Pascal compilers was much better than the C versions. Pascal strings were commonly used as an alternative name to counted strings, with a length field. > I'd say *those* are features from C that Pascal badly needs. And have since forever, or 30 years at least.
[toc] | [prev] | [next] | [standalone]
| From | Megol <golem960@gmail.com> |
|---|---|
| Date | 2015-12-16 13:24 -0800 |
| Message-ID | <998cb84c-6501-4656-8de9-08b752396fa5@googlegroups.com> |
| In reply to | #31898 |
On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult wrote: > On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: > > On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, timca...@aol.com wrote: > > > In the 80s we had Pascal (with real enums, stricter type checking, and bounds checks built-in to the language) and protected mode segments (yes, I know, everybody hates them). In another 20 years we might get C and flat mode addressing to work almost as well. > > > :) > > > > A Pascal dialect with some features from C would be very nice. > > What features? Less strict syntax, C-type for-loop, semicolon as terminator etc. Yes most of that is sugar but that is important too IMHO. > The only C feature I can think of that is missing from real world Pascal compilers is the ternary operator. Defining a selection function isn't a huge problem and it is IMHO more readable for a very small amount of extra typing. > In exchange you got bit manipulation in both word size via built in functions, and in arbitrary size via infix operators on sets. And lexical scoping. Yep. Which is why I'd like a C-ified Pascal and not the vice versa.
[toc] | [prev] | [next] | [standalone]
| From | Terje Mathisen <terje.mathisen@tmsw.no> |
|---|---|
| Date | 2015-12-17 13:56 +0100 |
| Message-ID | <n4ube6$kl0$1@speranza.aioe.org> |
| In reply to | #31923 |
Megol wrote: > On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult > wrote: >> On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: >>> On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, >>> timca...@aol.com wrote: >>>> In the 80s we had Pascal (with real enums, stricter type >>>> checking, and bounds checks built-in to the language) and >>>> protected mode segments (yes, I know, everybody hates them). >>>> In another 20 years we might get C and flat mode addressing to >>>> work almost as well. :) >>> >>> A Pascal dialect with some features from C would be very nice. >> >> What features? > > Less strict syntax, C-type for-loop, semicolon as terminator etc. Yes > most of that is sugar but that is important too IMHO. > >> The only C feature I can think of that is missing from real world >> Pascal compilers is the ternary operator. > > Defining a selection function isn't a huge problem and it is IMHO > more readable for a very small amount of extra typing. > >> In exchange you got bit manipulation in both word size via built in >> functions, and in arbitrary size via infix operators on sets. And >> lexical scoping. > > Yep. Which is why I'd like a C-ified Pascal and not the vice versa. > Isn't this _exactly_ what Anders Hejlsberg created when he left Borland (Pascal/Delphi) and went to Microsoft: C# C sharp is (or at least started out as) a very nice port of the Delphi single-inheritance object-oriented language to something with C syntax. Terje -- - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"
[toc] | [prev] | [next] | [standalone]
| From | already5chosen@yahoo.com |
|---|---|
| Date | 2015-12-17 05:22 -0800 |
| Message-ID | <53b68f9a-1df7-45f0-aaa5-6c6e3f80b44a@googlegroups.com> |
| In reply to | #31947 |
On Thursday, December 17, 2015 at 2:56:43 PM UTC+2, Terje Mathisen wrote: > Megol wrote: > > On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult > > wrote: > >> On Tuesday, December 15, 2015 at 8:57:39 PM UTC+3, Megol wrote: > >>> On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, > >>> timca...@aol.com wrote: > >>>> In the 80s we had Pascal (with real enums, stricter type > >>>> checking, and bounds checks built-in to the language) and > >>>> protected mode segments (yes, I know, everybody hates them). > >>>> In another 20 years we might get C and flat mode addressing to > >>>> work almost as well. :) > >>> > >>> A Pascal dialect with some features from C would be very nice. > >> > >> What features? > > > > Less strict syntax, C-type for-loop, semicolon as terminator etc. Yes > > most of that is sugar but that is important too IMHO. > > > >> The only C feature I can think of that is missing from real world > >> Pascal compilers is the ternary operator. > > > > Defining a selection function isn't a huge problem and it is IMHO > > more readable for a very small amount of extra typing. > > > >> In exchange you got bit manipulation in both word size via built in > >> functions, and in arbitrary size via infix operators on sets. And > >> lexical scoping. > > > > Yep. Which is why I'd like a C-ified Pascal and not the vice versa. > > > > Isn't this _exactly_ what Anders Hejlsberg created when he left Borland > (Pascal/Delphi) and went to Microsoft: C# > > C sharp is (or at least started out as) a very nice port of the Delphi > single-inheritance object-oriented language to something with C syntax. > C# radical object-orientation is too much for my liking. In fact, I'd live even with that if C# classes were open-ended, like in python. As it is, I don't like C# much more than I like Java. And I don't like Java at all. Another omission that I don't like in C# are first-class fixed arrays. That is, fixed arrays are here, but only in "unsafe" ghetto which means they are not going to be used. And even in "unsafe" they are only available as struct fields, which is not fatal, but ugly. However, I realize that most people probably don't care about fixed arrays. They just happen to be relevant for a specific job that I recently did. I guess, what makes me most uncomfortable about it is that I don't see a technical reasons why fixed arrays can not be equal citizen in "safe" managed land. > Terje > > -- > - <Terje.Mathisen at tmsw.no> > "almost all programming can be viewed as an exercise in caching"
[toc] | [prev] | [next] | [standalone]
| From | Chris Gray <cg@GraySage.COM> |
|---|---|
| Date | 2015-12-17 10:59 -0700 |
| Message-ID | <87d1u5ot0n.fsf@GraySage.COM> |
| In reply to | #31951 |
already5chosen@yahoo.com writes: > Another omission that I don't like in C# are first-class fixed arrays. That is, fixed arrays are here, but only in "unsafe" ghetto which means they are not going to be used. And even in "unsafe" they are only available as struct fields, which is not fatal, but ugly. > However, I realize that most people probably don't care about fixed arrays. They just happen to be relevant for a specific job that I recently did. > I guess, what makes me most uncomfortable about it is that I don't see a technical reasons why fixed arrays can not be equal citizen in "safe" managed land. No reason that I've found. My Zed language has both fixed-size arrays, which have no descriptor, and dynamically created matrixes which have a descriptor. They are not interchangeable of course, and you use whichever is appropriate. You can also write generic code which works on any size of fixed-size arrays by instantiating the generic with the bounds of the array, along with whatever else it may need. -- Chris Gray
[toc] | [prev] | [next] | [standalone]
| From | Tom Gardner <spamjunk@blueyonder.co.uk> |
|---|---|
| Date | 2015-12-17 14:22 +0000 |
| Message-ID | <3zzcy.4626$vc4.1835@fx38.am4> |
| In reply to | #31947 |
On 17/12/15 12:56, Terje Mathisen wrote: > Megol wrote: >> On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult >> wrote: >> Yep. Which is why I'd like a C-ified Pascal and not the vice versa. >> > > Isn't this _exactly_ what Anders Hejlsberg created when he left Borland > (Pascal/Delphi) and went to Microsoft: C# > > C sharp is (or at least started out as) a very nice port of the Delphi > single-inheritance object-oriented language to something with C syntax. Shortly before C# was released, Hejlsberg gave my workplace a talk about C#. It was clear from the talk and his answers that the only significant philosophical difference between C# and Java was in the deployment and run-time environment. Delphi was /not/ mentioned.
[toc] | [prev] | [next] | [standalone]
| From | Terje Mathisen <terje.mathisen@tmsw.no> |
|---|---|
| Date | 2015-12-17 15:48 +0100 |
| Message-ID | <n4uhv4$3u6$1@speranza.aioe.org> |
| In reply to | #31955 |
Tom Gardner wrote: > On 17/12/15 12:56, Terje Mathisen wrote: >> Megol wrote: >>> On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult >>> wrote: >>> Yep. Which is why I'd like a C-ified Pascal and not the vice versa. >>> >> >> Isn't this _exactly_ what Anders Hejlsberg created when he left Borland >> (Pascal/Delphi) and went to Microsoft: C# >> >> C sharp is (or at least started out as) a very nice port of the Delphi >> single-inheritance object-oriented language to something with C syntax. > > Shortly before C# was released, Hejlsberg gave my workplace a > talk about C#. It was clear from the talk and his answers that > the only significant philosophical difference between C# and > Java was in the deployment and run-time environment. > > Delphi was /not/ mentioned. I have never used C# in earnest, but I did take a close look at it when it first came out, and to me it was very obvious that Anders had brought along what he learned from Delphi. OTOH it was also quite obvious that this was intended as an answer to Java. :-) Terje -- - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"
[toc] | [prev] | [next] | [standalone]
| From | Tom Gardner <spamjunk@blueyonder.co.uk> |
|---|---|
| Date | 2015-12-17 15:04 +0000 |
| Message-ID | <F9Acy.36958$EE2.21704@fx33.am4> |
| In reply to | #31957 |
On 17/12/15 14:48, Terje Mathisen wrote: > Tom Gardner wrote: >> On 17/12/15 12:56, Terje Mathisen wrote: >>> Megol wrote: >>>> On Wednesday, December 16, 2015 at 11:21:23 AM UTC+1, Bruce Hoult >>>> wrote: >>>> Yep. Which is why I'd like a C-ified Pascal and not the vice versa. >>>> >>> >>> Isn't this _exactly_ what Anders Hejlsberg created when he left Borland >>> (Pascal/Delphi) and went to Microsoft: C# >>> >>> C sharp is (or at least started out as) a very nice port of the Delphi >>> single-inheritance object-oriented language to something with C syntax. >> >> Shortly before C# was released, Hejlsberg gave my workplace a >> talk about C#. It was clear from the talk and his answers that >> the only significant philosophical difference between C# and >> Java was in the deployment and run-time environment. >> >> Delphi was /not/ mentioned. > > I have never used C# in earnest, but I did take a close look at it when it first > came out, and to me it was very obvious that Anders had brought along what he > learned from Delphi. > > OTOH it was also quite obvious that this was intended as an answer to Java. :-) I'd be amazed if he hadn't brought that experience along; we are all "prisoners of our past", even if it is a gilded cage. I never bothered with c# since it didn't have sufficient advantages over Java. Curiously I had made the equivalent decision a couple of decades earlier when it was Delphi over C.
[toc] | [prev] | [next] | [standalone]
| From | Walter Banks <walter@bytecraft.com> |
|---|---|
| Date | 2015-12-17 06:10 -0500 |
| Message-ID | <n4u583$6m1$1@speranza.aioe.org> |
| In reply to | #31887 |
On 15/12/2015 12:57 PM, Megol wrote: > On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, timca...@aol.com > wrote: >> In the 80s we had Pascal (with real enums, stricter type checking, >> and bounds checks built-in to the language) and protected mode >> segments (yes, I know, everybody hates them). In another 20 years >> we might get C and flat mode addressing to work almost as well. :) > > A Pascal dialect with some features from C would be very nice. > Pascal style local functions in C (I know some C compilers have it as an extension) C has local variables right but Pascal's local functions and the way they scope variables is missed when I write application code in C. w..
[toc] | [prev] | [next] | [standalone]
| From | already5chosen@yahoo.com |
|---|---|
| Date | 2015-12-17 03:33 -0800 |
| Message-ID | <1821eff2-a122-4458-9a87-cf9db7db672d@googlegroups.com> |
| In reply to | #31943 |
On Thursday, December 17, 2015 at 1:11:04 PM UTC+2, Walter Banks wrote: > On 15/12/2015 12:57 PM, Megol wrote: > > On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, timca...@aol.com > > wrote: > >> In the 80s we had Pascal (with real enums, stricter type checking, > >> and bounds checks built-in to the language) and protected mode > >> segments (yes, I know, everybody hates them). In another 20 years > >> we might get C and flat mode addressing to work almost as well. :) > > > > A Pascal dialect with some features from C would be very nice. > > > Pascal style local functions in C (I know some C compilers have it as an > extension) > > C has local variables right but Pascal's local functions and the way > they scope variables is missed when I write application code in C. > > w.. I most definitely do not want a visibility of local variables of outer function in the inner function (Is what people call closures ?). That's the feature of Pascal (inherited by Ada) that in my experience is widely misused and very harmful for code readability. Nested function without such visibility appear harmless and may be event a little useful. I am not sure that they are sufficiently useful to care. Certainly not useful enough to be included in C++, where the same scoping effect could be easily achieved by static method of function-local class.
[toc] | [prev] | [next] | [standalone]
| From | Walter Banks <walter@bytecraft.com> |
|---|---|
| Date | 2015-12-17 08:19 -0500 |
| Message-ID | <n4ucpt$nlu$1@speranza.aioe.org> |
| In reply to | #31944 |
On 17/12/2015 6:33 AM, already5chosen@yahoo.com wrote: > On Thursday, December 17, 2015 at 1:11:04 PM UTC+2, Walter Banks > wrote: >> On 15/12/2015 12:57 PM, Megol wrote: >>> On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, >>> timca...@aol.com wrote: >>>> In the 80s we had Pascal (with real enums, stricter type >>>> checking, and bounds checks built-in to the language) and >>>> protected mode segments (yes, I know, everybody hates them). In >>>> another 20 years we might get C and flat mode addressing to >>>> work almost as well. :) >>> >>> A Pascal dialect with some features from C would be very nice. >>> >> Pascal style local functions in C (I know some C compilers have it >> as an extension) >> >> C has local variables right but Pascal's local functions and the >> way they scope variables is missed when I write application code >> in C. >> >> w.. > > I most definitely do not want a visibility of local variables of > outer function in the inner function (Is what people call closures > ?). That's the feature of Pascal (inherited by Ada) that in my > experience is widely misused and very harmful for code readability. > > Nested function without such visibility appear harmless and may be > even a little useful. I am not sure that they are sufficiently useful > to care. Certainly not useful enough to be included in C++, where the > same scoping effect could be easily achieved by static method of > function-local class. > How is it widely misused? My experience about readability is the opposite. Local functions I have found tend to change the way that application code can be organized into self contained functional blocks. They add flexibility and clarity to functions. Local functions can make assumptions that global functions should not. Local functions gets rid of a lot of clutter, I prefer them to C macros often used in similar code but prone to have unpleasant side effects. w..
[toc] | [prev] | [next] | [standalone]
| From | already5chosen@yahoo.com |
|---|---|
| Date | 2015-12-17 05:32 -0800 |
| Message-ID | <82617d84-f000-47e7-bda2-72d7ae2920cf@googlegroups.com> |
| In reply to | #31950 |
On Thursday, December 17, 2015 at 3:20:03 PM UTC+2, Walter Banks wrote: > On 17/12/2015 6:33 AM, already5chosen@yahoo.com wrote: > > On Thursday, December 17, 2015 at 1:11:04 PM UTC+2, Walter Banks > > wrote: > >> On 15/12/2015 12:57 PM, Megol wrote: > >>> On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1, > >>> timca...@aol.com wrote: > >>>> In the 80s we had Pascal (with real enums, stricter type > >>>> checking, and bounds checks built-in to the language) and > >>>> protected mode segments (yes, I know, everybody hates them). In > >>>> another 20 years we might get C and flat mode addressing to > >>>> work almost as well. :) > >>> > >>> A Pascal dialect with some features from C would be very nice. > >>> > >> Pascal style local functions in C (I know some C compilers have it > >> as an extension) > >> > >> C has local variables right but Pascal's local functions and the > >> way they scope variables is missed when I write application code > >> in C. > >> > >> w.. > > > > I most definitely do not want a visibility of local variables of > > outer function in the inner function (Is what people call closures > > ?). That's the feature of Pascal (inherited by Ada) that in my > > experience is widely misused and very harmful for code readability. > > > > Nested function without such visibility appear harmless and may be > > even a little useful. I am not sure that they are sufficiently useful > > to care. Certainly not useful enough to be included in C++, where the > > same scoping effect could be easily achieved by static method of > > function-local class. > > > > How is it widely misused? It is not easy to explain. You should go through the same experience of reading tens of KLOCs of code (it was Ada83, not Pascal, but I don't think it would be any better in Pascal) in order to understand. And the could was not even written by bad programmers, just not by the very best ones. > > My experience about readability is the opposite. Local functions I have > found tend to change the way that application code can be organized into > self contained functional blocks. They add flexibility and clarity to > functions. Local functions can make assumptions that global functions > should not. > > Local functions gets rid of a lot of clutter, I prefer them to C macros > often used in similar code but prone to have unpleasant side effects. As I said, I have nothing against local functions as such. I am against visibility of caller's local vars. And it's not theory, I never thought about it before I actually suffered from the consequences of this feature. > > w..
[toc] | [prev] | [next] | [standalone]
| From | Niklas Holsti <niklas.holsti@tidorum.invalid> |
|---|---|
| Date | 2015-12-17 23:02 +0200 |
| Message-ID | <ddgm6bF9fvuU1@mid.individual.net> |
| In reply to | #31944 |
On 15-12-17 13:33 , already5chosen@yahoo.com wrote:
> On Thursday, December 17, 2015 at 1:11:04 PM UTC+2, Walter Banks
> wrote:
>> On 15/12/2015 12:57 PM, Megol wrote:
>>> On Tuesday, December 15, 2015 at 6:51:07 PM UTC+1,
>>> timca...@aol.com wrote:
>>>> In the 80s we had Pascal (with real enums, stricter type
>>>> checking, and bounds checks built-in to the language) and
>>>> protected mode segments (yes, I know, everybody hates them).
>>>> In another 20 years we might get C and flat mode addressing to
>>>> work almost as well. :)
>>>
>>> A Pascal dialect with some features from C would be very nice.
>>>
>> Pascal style local functions in C (I know some C compilers have it
>> as an extension)
>>
>> C has local variables right but Pascal's local functions and the
>> way they scope variables is missed when I write application code in
>> C.
>>
>> w..
>
> I most definitely do not want a visibility of local variables of
> outer function in the inner function (Is what people call closures
> ?). That's the feature of Pascal (inherited by Ada) that in my
> experience is widely misused and very harmful for code readability.
That visibility is easy to control, at least in Ada: if you don't want
your local subprogram Bar to have visibility over its containing
subprogram's local variable X, write the body of Bar first, and declare
X after.
> Nested function without such visibility appear harmless and may be
> event a little useful.
But it seems to me that the main reason for having nested subprograms is
indeed to let those subprograms use the containing subprogram's
parameters and/or local variables, without having to pass them (again)
as parameters. From an object-oriented point of view, the local
variables represent the state of an (anonymous) "singleton object" (in
the context of a given call), and the nested subprograms are operations
on this "singleton object", and therefore do not need to have this
object as an explicit parameter.
IMO one level of nesting does not harm readability much, but deeper
levels of nesting would be harmful. Personally I don't remember ever
using even two levels of subprogram nesting, the most I've used is
package containing subprograms containing subprograms.
Note that if the Ada subprogram Foo contains the nested subprogram Bar,
then Bar can refer to a (visible) parameter or local X, of Foo, with the
qualified notation "Foo.X", as well as directly with "X". Systematically
using Foo.X instead of X could be made a coding rule.
In my day job (writing Ada programs) subprogram nesting is forbidden
because it is difficult to unit-test the inner subprograms.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
[toc] | [prev] | [next] | [standalone]
| From | MitchAlsup <MitchAlsup@aol.com> |
|---|---|
| Date | 2015-12-18 15:01 -0800 |
| Message-ID | <da452543-0d9e-4d6e-8a7d-36183ccdc4f7@googlegroups.com> |
| In reply to | #31964 |
On Thursday, December 17, 2015 at 3:02:09 PM UTC-6, Niklas Holsti wrote: > > I most definitely do not want a visibility of local variables of > > outer function in the inner function (Is what people call closures > > ?). That's the feature of Pascal (inherited by Ada) that in my > > experience is widely misused and very harmful for code readability. > > That visibility is easy to control, at least in Ada: if you don't want > your local subprogram Bar to have visibility over its containing > subprogram's local variable X, write the body of Bar first, and declare > X after. > > > Nested function without such visibility appear harmless and may be > > event a little useful. > > But it seems to me that the main reason for having nested subprograms is > indeed to let those subprograms use the containing subprogram's > parameters and/or local variables, without having to pass them (again) > as parameters. From an object-oriented point of view, the local > variables represent the state of an (anonymous) "singleton object" (in > the context of a given call), and the nested subprograms are operations > on this "singleton object", and therefore do not need to have this > object as an explicit parameter. Once the interior subroutine allocates a variable sized array on the stack, all of that ease of access disappears and you end up better off passing the parameters copy-in.
[toc] | [prev] | [next] | [standalone]
| From | Ivan Godard <ivan@millcomputing.com> |
|---|---|
| Date | 2015-12-18 16:45 -0800 |
| Message-ID | <n5296i$jo2$1@dont-email.me> |
| In reply to | #31982 |
On 12/18/2015 3:01 PM, MitchAlsup wrote: > On Thursday, December 17, 2015 at 3:02:09 PM UTC-6, Niklas Holsti wrote: > >>> I most definitely do not want a visibility of local variables of >>> outer function in the inner function (Is what people call closures >>> ?). That's the feature of Pascal (inherited by Ada) that in my >>> experience is widely misused and very harmful for code readability. >> >> That visibility is easy to control, at least in Ada: if you don't want >> your local subprogram Bar to have visibility over its containing >> subprogram's local variable X, write the body of Bar first, and declare >> X after. >> >>> Nested function without such visibility appear harmless and may be >>> event a little useful. >> >> But it seems to me that the main reason for having nested subprograms is >> indeed to let those subprograms use the containing subprogram's >> parameters and/or local variables, without having to pass them (again) >> as parameters. From an object-oriented point of view, the local >> variables represent the state of an (anonymous) "singleton object" (in >> the context of a given call), and the nested subprograms are operations >> on this "singleton object", and therefore do not need to have this >> object as an explicit parameter. > > Once the interior subroutine allocates a variable sized array on the > stack, all of that ease of access disappears and you end up better off > passing the parameters copy-in. > Well, not really; it depends on what support the hardware has for nesting. If the hardware maintains a display (https://en.wikipedia.org/wiki/Call_stack#Structure) then the dynamic allocation is irrelevant. If the hardware has no display and the implementation uses down-stack linkage the the dynamic allocation also is irrelevant but the nested function requires an extra hidden parameter, akin to the :this" pointer of method dispatch; in the presence of function pointers then all function pointers must contain two addresses to support nested functions. Whether copy-in is better than nested function is the same question as comparing copy-in against pass-by-reference. The former has constructor/destructor costs that the latter does not, but the latter has access costs that the former does not. As a rough rule of thumb, copy-in is better for scalars and by-reference (and nested functions) is better for anything larger.
[toc] | [prev] | [next] | [standalone]
| From | Niklas Holsti <niklas.holsti@tidorum.invalid> |
|---|---|
| Date | 2015-12-19 06:29 +0200 |
| Subject | Re: Ada vs C |
| Message-ID | <ddk4p2F57d1U1@mid.individual.net> |
| In reply to | #31982 |
On 15-12-19 01:01 , MitchAlsup wrote:
> On Thursday, December 17, 2015 at 3:02:09 PM UTC-6, Niklas Holsti wrote:
>
>>> I most definitely do not want a visibility of local variables of
>>> outer function in the inner function (Is what people call closures
>>> ?). That's the feature of Pascal (inherited by Ada) that in my
>>> experience is widely misused and very harmful for code readability.
>>
>> That visibility is easy to control, at least in Ada: if you don't want
>> your local subprogram Bar to have visibility over its containing
>> subprogram's local variable X, write the body of Bar first, and declare
>> X after.
>>
>>> Nested function without such visibility appear harmless and may be
>>> event a little useful.
>>
>> But it seems to me that the main reason for having nested subprograms is
>> indeed to let those subprograms use the containing subprogram's
>> parameters and/or local variables, without having to pass them (again)
>> as parameters. From an object-oriented point of view, the local
>> variables represent the state of an (anonymous) "singleton object" (in
>> the context of a given call), and the nested subprograms are operations
>> on this "singleton object", and therefore do not need to have this
>> object as an explicit parameter.
>
> Once the interior subroutine allocates a variable sized array on the
> stack, all of that ease of access disappears and you end up better off
> passing the parameters copy-in.
This is taking the HW point of view, as is perhaps appropriate for
comp.arch. I was talking about the programmer's point of view.
But it also depends on how the SW uses the HW. As I understand it, the
most accessible Ada compiler (GNAT) uses a "secondary stack" to hold
such dynamically sized, locally created objects, with a fixed-size
pointer from the main stack to the secondary stack. But the same
referencing problem occurs if the interior subprograms are recursive.
Probably the interior subprogram must be passed a pointer (not visible
in the source code) to the stack frame of the lexically exterior subprogram.
(I changed the "Subject", as "Noob" did, although I think that this
discussion is about wider issues than "Ada vs C".)
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
[toc] | [prev] | [next] | [standalone]
Page 3 of 4 — ← Prev page 1 2 [3] 4 Next page →
Back to top | Article view | comp.arch
csiph-web