Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #31688 > unrolled thread

Intel MPX

Started byStephen Fuld <SFuld@alumni.cmu.edu.invalid>
First post2015-12-09 12:26 -0800
Last post2015-12-21 09:39 -0800
Articles 20 on this page of 69 — 22 participants

Back to article view | Back to comp.arch


Contents

  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 2 of 4 — ← Prev page 1 [2] 3 4  Next page →


#31908

Fromalready5chosen@yahoo.com
Date2015-12-16 08:31 -0800
Message-ID<44bf6b32-b041-48bd-872f-b801d68fb643@googlegroups.com>
In reply to#31904
On Wednesday, December 16, 2015 at 6:18:02 PM UTC+2, Niklas Holsti wrote:
> On 15-12-16 18:01 , 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.
> 
> So use Ada, the industrial-strength descendant of Pascal (but not only 
> of Pascal). Ada has all those features, and lots of nice features that C 
> does not have.
> 
> > Of course, that may have been an old article, and they may
>  > already have been added.
> 
> I do believe that modern Pascal has fixed some of those deficiencies, 
> and perhaps all. But I don't quite understand why one would use Pascal 
> instead of Ada.
>

Classic answer: because, unlike Pascal, Ada is a big language with steep learning curve and slow compilers.
Of course, the second point can be questioned and the third point is mostly irrelevant with today's fast computers. After all, they use C++ which compiles much slower than Ada itself.

The second classic answer: because Borland' Delphi is much nicer environment than anything Ada.
I don't know how true it is today.


> -- 
> Niklas Holsti
> Tidorum Ltd
> niklas holsti tidorum fi
>        .      @       .

[toc] | [prev] | [next] | [standalone]


#31910

FromGeorge Neuner <gneuner2@comcast.net>
Date2015-12-16 13:06 -0500
Message-ID<od837b1npcdbkg8baqr187arvks0f8char@4ax.com>
In reply to#31904
On Wed, 16 Dec 2015 18:17:59 +0200, Niklas Holsti
<niklas.holsti@tidorum.invalid> wrote:

>On 15-12-16 18:01 , 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.
>
>So use Ada, the industrial-strength descendant of Pascal (but not only 
>of Pascal). Ada has all those features, and lots of nice features that C 
>does not have.
>
>> Of course, that may have been an old article, and they may
>> already have been added.

A very old article indeed - circa 1980, "extended" Pascals had a
string type, and some had separate compilation: e.g., USCD had both.

Modula 2 addressed all of those criticisms, and was available before
Pascal even was standardized.


>I do believe that modern Pascal has fixed some of those deficiencies, 
>and perhaps all. But I don't quite understand why one would use Pascal 
>instead of Ada.

For writing an OS or a safety critical application, I would reach for
Ada ... but for most programming I preferred Modula 3.  I was never
happy with Ada's (IMO) clumsy package system.  For most applications,
Modula 3 had everything you needed and was easier to work with.

YMMV,
George

[toc] | [prev] | [next] | [standalone]


#31922

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-12-16 13:03 -0800
Message-ID<094a0473-4b49-47a9-95e2-42d1d63f7898@googlegroups.com>
In reply to#31904
On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:

> I do believe that modern Pascal has fixed some of those deficiencies, 
> and perhaps all. But I don't quite understand why one would use Pascal 
> instead of Ada.

Generally speaking, few people use Ada. It is generally decried as a language 
that is too large and complicated.

John Savard

[toc] | [prev] | [next] | [standalone]


#31925

FromNiklas Holsti <niklas.holsti@tidorum.invalid>
Date2015-12-16 23:42 +0200
Message-ID<dde46oFk5u2U1@mid.individual.net>
In reply to#31922
On 15-12-16 23:03 , Quadibloc wrote:
> On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:
>
>> I do believe that modern Pascal has fixed some of those deficiencies,
>> and perhaps all. But I don't quite understand why one would use Pascal
>> instead of Ada.
>
> Generally speaking, few people use Ada.

So? Our ancestors should all have remained in their trees, because few 
prehumans walked on the savannah?

> It is generally decried as a language that is too large and complicated.

In my experience, few people holding this common prejudice have actually 
tried Ada. Or they tried it in the 1980's, when compilers were slow.

Ada is certainly larger than C, in terms of features, but so what? Don't 
you want more from a programming language than C gives you? That was the 
origin of this exchange; my comment was just that if the transition is 
from C to Pascal, in makes more sense to continue to Ada than to stop at 
Pascal.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

[toc] | [prev] | [next] | [standalone]


#31935

FromBill Findlay <yaldnif.w@blueyonder.co.uk>
Date2015-12-16 23:34 +0000
Message-ID<421848295.472001343.743965.yaldnif.w-blueyonder.co.uk@news.individual.net>
In reply to#31925
Niklas Holsti <niklas.holsti@tidorum.invalid> wrote:
> On 15-12-16 23:03 , Quadibloc wrote:
>> On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:
>> 
>>> I do believe that modern Pascal has fixed some of those deficiencies,
>>> and perhaps all. But I don't quite understand why one would use Pascal
>>> instead of Ada.
>> 
>> Generally speaking, few people use Ada.
> 
> So? Our ancestors should all have remained in their trees, because few 
> prehumans walked on the savannah?
> 
>> It is generally decried as a language that is too large and complicated.
> 
> In my experience, few people holding this common prejudice have actually 
> tried Ada. Or they tried it in the 1980's, when compilers were slow.
> 
> Ada is certainly larger than C, in terms of features, but so what? Don't 
> you want more from a programming language than C gives you? That was the 
> origin of this exchange; my comment was just that if the transition is 
> from C to Pascal, in makes more sense to continue to Ada than to stop at 
> Pascal.

Indeed.  It is ludicrous to pine after non-standard extensions of an
obsolete language
when a GNU-supported language with an ISO 2012 standard is readily
available,
and offers far,  far more than any such ill-conceived hybrid possibly
could.

-- 
Bill Findlay

[toc] | [prev] | [next] | [standalone]


#31934

FromBill Findlay <yaldnif.w@blueyonder.co.uk>
Date2015-12-16 23:34 +0000
Message-ID<1387750795.472001138.937239.yaldnif.w-blueyonder.co.uk@news.individual.net>
In reply to#31922
Quadibloc <jsavard@ecn.ab.ca> wrote:
> On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:
> 
>> I do believe that modern Pascal has fixed some of those deficiencies, 
>> and perhaps all. But I don't quite understand why one would use Pascal 
>> instead of Ada.
> 
> Generally speaking, few people use Ada. It is generally decried as a language 
> that is too large and complicated.

By those who have no actual knowledge of it.

I was in charge of a beginners' programming lab that supported classes
taught in Ada
and classes taught in Pascal.  They latter were clearly at a disadvantage,
as evidenced
by the quality of their work.

-- 
Bill Findlay

[toc] | [prev] | [next] | [standalone]


#31940

FromWilliam Edwards <willvarfar@gmail.com>
Date2015-12-16 23:39 -0800
Message-ID<c62c51ab-52cb-445a-9076-5370392cc9e3@googlegroups.com>
In reply to#31934
We have strayed a long way from MPX?  I think most of us would agree that bounds checking is a good thing, and the cheaper this can be the better this will be.   We all know how hard it is to retrofit it to existing languages, and retrofit it to existing ISAs in ways that are backwards compatible etc but we can mostly laud Intel for trying?

So, lets fuel the language flame wars then ;)

I liked Pascal in the wild a lot.  It grew into a very good language.  People only focus on the shortcomings of the original draft to win internet argument points; the Pascal that a whole generation of programmers (mostly Europeans in the 80s) grew up learning and loving was not at all so constrained.

Some people are talking about how good Ada was.  Its interesting to contrast it with, say, Go.  Go is a language that is designed to be as dumb and straightforward as possible, and is being widely adopted by some experienced and capable programmers because of this.

I see two main ways that more complex languages make it hard to read and maintain: first, if the language is such that you cannot look at an expression and know if or what code executes (operator overloading, properties etc); second, if it is too data-flow then you get a tendency to express your program logic in such a concise fashion that its really a form of ppm source code compression ;)

Its a shame that C didn't make it easy to do bounds checking.  I have a little hobby horse that is that a 'memory safe' subset of C/C++ could be defined and the compiler passes around array bounds etc behind the scenes so normal C/C++ code compiles, with pointer decay appearing to work as per C but behind the scenes the accounting being done at runtime etc.  Some programs would refuse to compile in this memory safe compiler, and so be it; roughly the same type of C programs that CHERI papers keep finding when they try and do capability-based addressing ;)  Would big C/C++ code bases like browsers and web servers want to adopt it?  I would imagine so.

On Thursday, 17 December 2015 00:35:00 UTC+1, Bill Findlay  wrote:
> Quadibloc wrote:
> > On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:
> > 
> >> I do believe that modern Pascal has fixed some of those deficiencies, 
> >> and perhaps all. But I don't quite understand why one would use Pascal 
> >> instead of Ada.
> > 
> > Generally speaking, few people use Ada. It is generally decried as a language 
> > that is too large and complicated.
> 
> By those who have no actual knowledge of it.
> 
> I was in charge of a beginners' programming lab that supported classes
> taught in Ada
> and classes taught in Pascal.  They latter were clearly at a disadvantage,
> as evidenced
> by the quality of their work.
> 
> -- 
> Bill Findlay

[toc] | [prev] | [next] | [standalone]


#31945

Fromalready5chosen@yahoo.com
Date2015-12-17 04:44 -0800
Message-ID<718106c4-b001-4adf-a9df-243b57f89b4d@googlegroups.com>
In reply to#31940
On Thursday, December 17, 2015 at 9:39:44 AM UTC+2, William Edwards wrote:
> We have strayed a long way from MPX?  I think most of us would agree that bounds checking is a good thing, and the cheaper this can be the better this will be.   We all know how hard it is to retrofit it to existing languages, and retrofit it to existing ISAs in ways that are backwards compatible etc but we can mostly laud Intel for trying?
>

I think, it's hopeless.
Looking at the rest of your post, you seem to think otherwise.

IMHO, people that want bound-checking should use languages that were designed with bound-checking in mind. And indeed, that's what actually happened - the use of C and C++ as application languages on general-purpose computers was shrinking quickly for several years. It's probably stop shrinking in last years due to C/C++ being one of the few common grounds for applications developed for both iOS and Android, but the current outcome is temporary. It is not going to last.
I don't know what happens next. May be, Google will implements Swift on Android. Or, may be, Apple allows Java on iOS. Or both of them find common ground with C#/Mono. Or something else, like most devs stop writing standalone apps and return to writing browser applets. But current situation wouldn't last and use of C and C++ as application languages will return to shrinking. As it should, because they are not proper application languages.


> So, lets fuel the language flame wars then ;)

Slightly necrophiliac language flame wars, I should say. Or more than slightly.

> 
> I liked Pascal in the wild a lot.  It grew into a very good language.  People only focus on the shortcomings of the original draft to win internet argument points; the Pascal that a whole generation of programmers (mostly Europeans in the 80s) grew up learning and loving was not at all so constrained.
> 
> Some people are talking about how good Ada was.  Its interesting to contrast it with, say, Go.  Go is a language that is designed to be as dumb and straightforward as possible, and is being widely adopted by some experienced and capable programmers because of this.
> 
> I see two main ways that more complex languages make it hard to read and maintain: first, if the language is such that you cannot look at an expression and know if or what code executes (operator overloading, properties etc); second, if it is too data-flow then you get a tendency to express your program logic in such a concise fashion that its really a form of ppm source code compression ;)
> 
> Its a shame that C didn't make it easy to do bounds checking.  I have a little hobby horse that is that a 'memory safe' subset of C/C++ could be defined and the compiler passes around array bounds etc behind the scenes so normal C/C++ code compiles, with pointer decay appearing to work as per C but behind the scenes the accounting being done at runtime etc. 

That's exactly what Intel MPX is after.
The biggest obstacle is that fat pointers are too big. So Intel and the rest of MPX-aware compilers replaces (stored, not live) pointers to objects with pointers to fat pointers to objects.

> Some programs would refuse to compile in this memory safe compiler, and so be it; roughly the same type of C programs that CHERI papers keep finding when they try and do capability-based addressing ;)  Would big C/C++ code bases like browsers and web servers want to adopt it?  I would imagine so.
> 
> On Thursday, 17 December 2015 00:35:00 UTC+1, Bill Findlay  wrote:
> > Quadibloc wrote:
> > > On Wednesday, December 16, 2015 at 9:18:02 AM UTC-7, Niklas Holsti wrote:
> > > 
> > >> I do believe that modern Pascal has fixed some of those deficiencies, 
> > >> and perhaps all. But I don't quite understand why one would use Pascal 
> > >> instead of Ada.
> > > 
> > > Generally speaking, few people use Ada. It is generally decried as a language 
> > > that is too large and complicated.
> > 
> > By those who have no actual knowledge of it.
> > 
> > I was in charge of a beginners' programming lab that supported classes
> > taught in Ada
> > and classes taught in Pascal.  They latter were clearly at a disadvantage,
> > as evidenced
> > by the quality of their work.
> > 
> > -- 
> > Bill Findlay

[toc] | [prev] | [next] | [standalone]


#31968

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2015-12-18 13:29 +0000
Message-ID<2015Dec18.142937@mips.complang.tuwien.ac.at>
In reply to#31940
William Edwards <willvarfar@gmail.com> writes:
>Its a shame that C didn't make it easy to do bounds checking.  I have a lit=
>tle hobby horse that is that a 'memory safe' subset of C/C++ could be defin=
>ed and the compiler passes around array bounds etc behind the scenes so nor=
>mal C/C++ code compiles, with pointer decay appearing to work as per C but =
>behind the scenes the accounting being done at runtime etc.  Some programs =
>would refuse to compile in this memory safe compiler, and so be it; roughly=
> the same type of C programs that CHERI papers keep finding when they try a=
>nd do capability-based addressing ;)  Would big C/C++ code bases like brows=
>ers and web servers want to adopt it?  I would imagine so.

There were a number of works around 2000 about such C implementations.
A few years later I heard an interesting talk by George Necula where
he explained why these implementations had not caught on: IIRC the
reason was that these implementations did not follow the ABI of the
platform, and therefore would need all the libraries compiled for
their ABI (and that would mean that all the libraries would have to
satisfy the bounds-checking constraints).

He then presented another solution that is ABI compatible, but where
programmers can include additional information in the source code that
leads to run-time bounds checks (unless the compiler can prove that
the constraint is satisfied).  This looked promising to me, but
somehow this has not caught on, either; at least not in C, maybe in
other languages (Rust?).

I think the work his talk was aboyt was "CCured: Type-Safe
Retrofitting of Legacy Software".

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html

[toc] | [prev] | [next] | [standalone]


#31969

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2015-12-18 14:42 +0000
Message-ID<n515vq$sed$1@dont-email.me>
In reply to#31968
In article <2015Dec18.142937@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>William Edwards <willvarfar@gmail.com> writes:
>>Its a shame that C didn't make it easy to do bounds checking. ...

One of the many things that the UK tried and failed to get properly
specified was what bounds checking was allowed and what was not.

>There were a number of works around 2000 about such C implementations.
>A few years later I heard an interesting talk by George Necula where
>he explained why these implementations had not caught on: IIRC the
>reason was that these implementations did not follow the ABI of the
>platform, and therefore would need all the libraries compiled for
>their ABI (and that would mean that all the libraries would have to
>satisfy the bounds-checking constraints).

Well, that's the official line, but there is another one.  C is very
badly inconsistent here, and any such implementation would break at
least some conforming code.  In particular, it introduces the issue
that two pointers can be legally derived from two separate base
objects, compare equal, and one subscription would fail but another
work.  But that conflicts with the C standard's assertion that two
pointers that compare equal are the same pointer.

EVERYBODY who has claimed that they can do any real C checking has
defined their own C variant (and it's not just a matter of using a
subset).  The sane ones admit it and accept that they will reject
some valid (if revolting) C code, and the C fanbois deny it, often
abusively.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#31970

FromBruce Hoult <bruce.hoult@gmail.com>
Date2015-12-18 07:19 -0800
Message-ID<c5d2d168-df1e-45d5-8200-1dd94d4f3198@googlegroups.com>
In reply to#31969
On Friday, December 18, 2015 at 5:44:36 PM UTC+3, Nick Maclaren wrote:
> In article <2015Dec18.142937@mips.complang.tuwien.ac.at>,
> Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> >William Edwards <willvarfar@gmail.com> writes:
> >>Its a shame that C didn't make it easy to do bounds checking. ...
> 
> One of the many things that the UK tried and failed to get properly
> specified was what bounds checking was allowed and what was not.
> 
> >There were a number of works around 2000 about such C implementations.
> >A few years later I heard an interesting talk by George Necula where
> >he explained why these implementations had not caught on: IIRC the
> >reason was that these implementations did not follow the ABI of the
> >platform, and therefore would need all the libraries compiled for
> >their ABI (and that would mean that all the libraries would have to
> >satisfy the bounds-checking constraints).
> 
> Well, that's the official line, but there is another one.  C is very
> badly inconsistent here, and any such implementation would break at
> least some conforming code.  In particular, it introduces the issue
> that two pointers can be legally derived from two separate base
> objects, compare equal, and one subscription would fail but another
> work.  But that conflicts with the C standard's assertion that two
> pointers that compare equal are the same pointer.
> 
> EVERYBODY who has claimed that they can do any real C checking has
> defined their own C variant (and it's not just a matter of using a
> subset).  The sane ones admit it and accept that they will reject
> some valid (if revolting) C code, and the C fanbois deny it, often
> abusively.

One imagines that this revolting code might well have a large intersection with code that some people complain is mis-compiled by current versions of gcc and llvm.

[toc] | [prev] | [next] | [standalone]


#31971

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2015-12-18 15:49 +0000
Message-ID<n519v4$ds1$1@dont-email.me>
In reply to#31970
In article <c5d2d168-df1e-45d5-8200-1dd94d4f3198@googlegroups.com>,
Bruce Hoult  <bruce.hoult@gmail.com> wrote:
>> 
>> EVERYBODY who has claimed that they can do any real C checking has
>> defined their own C variant (and it's not just a matter of using a
>> subset).  The sane ones admit it and accept that they will reject
>> some valid (if revolting) C code, and the C fanbois deny it, often
>> abusively.
>
>One imagines that this revolting code might well have a large
>intersection with code that some people complain is mis-compiled by
>current versions of gcc and llvm.

Indeed.  I can witness that there is definitely an association, based
on the codes which don't compile with aggressive optimisation.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#32056

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2015-12-21 17:04 +0000
Message-ID<2015Dec21.180442@mips.complang.tuwien.ac.at>
In reply to#31969
nmm@wheeler.UUCP (Nick Maclaren) writes:
>In article <2015Dec18.142937@mips.complang.tuwien.ac.at>,
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>William Edwards <willvarfar@gmail.com> writes:
>>>Its a shame that C didn't make it easy to do bounds checking. ...
>
>One of the many things that the UK tried and failed to get properly
>specified was what bounds checking was allowed and what was not.
>
>>There were a number of works around 2000 about such C implementations.
>>A few years later I heard an interesting talk by George Necula where
>>he explained why these implementations had not caught on: IIRC the
>>reason was that these implementations did not follow the ABI of the
>>platform, and therefore would need all the libraries compiled for
>>their ABI (and that would mean that all the libraries would have to
>>satisfy the bounds-checking constraints).
>
>Well, that's the official line, but there is another one.  C is very
>badly inconsistent here, and any such implementation would break at
>least some conforming code.

Well, given that "conforming programs" is the set of programs accepted
by any C compiler ("comforming implementation"), that's not saying
much.  Indeed, some C compiler maintainers consider most conforming
programs "buggy" and "not according to the documentation" and are
proud of breaking them.

>In particular, it introduces the issue
>that two pointers can be legally derived from two separate base
>objects, compare equal, and one subscription would fail but another
>work.

I thought about how that could happen.  I guess it can happen when two
objects happen to be adjacent to each other, and one pointer points to
the address beyond one object and the other points to the start of the
next object.

But I doubt that there is a guarantee that you can get pointers from
two base objects that compare equal.  So such a fat-pointer
implementation could either add padding to avoid that or also include
the base pointer in the comparison to avoid that, and then the problem
you describe cannot happen.

>EVERYBODY who has claimed that they can do any real C checking has
>defined their own C variant (and it's not just a matter of using a
>subset).  The sane ones admit it and accept that they will reject
>some valid (if revolting) C code, and the C fanbois deny it, often
>abusively.

I don't think that there is much code that relies on the particular
issue you mention above.  But there is a lot of low-level code around,
in particular in various libraries, that does things that you may
consider revolting, and that Mike Stump and the GCC and LLVM
maintainers probably considers "buggy" or whatever wordings they use,
and that would not work on the fat-pointer implementations.

So if one wanted to use the fat-pointer approach in for more than just
a proof-of-concept, one would have to convert lots of libraries to be
compatible with it, either by "fixing" them to avoid things that would
upset the checking that the fat-pointer implementations provide, or by
at least making the libary conform to the fat-pointer ABI; in the
latter case the checking does not extend to the library, and any
buffer overflow in the library would compromise the program, reducing
the appeal of using fat pointers.

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html

[toc] | [prev] | [next] | [standalone]


#32062

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2015-12-21 18:10 +0000
Message-ID<n59fba$t6u$1@dont-email.me>
In reply to#32056
In article <2015Dec21.180442@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>
>Well, given that "conforming programs" is the set of programs accepted
>by any C compiler ("comforming implementation"), that's not saying
>much.  Indeed, some C compiler maintainers consider most conforming
>programs "buggy" and "not according to the documentation" and are
>proud of breaking them.

I was using that in the sense of "conforming on any conforming
compiler", though I accept I was being sloppy.

>>In particular, it introduces the issue
>>that two pointers can be legally derived from two separate base
>>objects, compare equal, and one subscription would fail but another
>>work.
>
>I thought about how that could happen.  I guess it can happen when two
>objects happen to be adjacent to each other, and one pointer points to
>the address beyond one object and the other points to the start of the
>next object.

That is only one of many ways.  There are far fouller ones in C99.

>But I doubt that there is a guarantee that you can get pointers from
>two base objects that compare equal.  So such a fat-pointer
>implementation could either add padding to avoid that or also include
>the base pointer in the comparison to avoid that, and then the problem
>you describe cannot happen.

Nope.  While you are correct that a C program cannot arrange that to
order, though a C++11 one can, neither of the techniques you propose
would protect against that occurring.  The minimum requirement is
BOTH to include the base pointer in all pointers AND to never
allocate any memory more than once, or equivalent.

>I don't think that there is much code that relies on the particular
>issue you mention above.  But there is a lot of low-level code around,
>in particular in various libraries, that does things that you may
>consider revolting, and that Mike Stump and the GCC and LLVM
>maintainers probably considers "buggy" or whatever wordings they use,
>and that would not work on the fat-pointer implementations.

There is far more than you think.  Garbage collectors, for one.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#32066

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-12-21 10:29 -0800
Message-ID<305d0c34-77fc-45e2-bea4-918b0e734fcc@googlegroups.com>
In reply to#32062
On Monday, December 21, 2015 at 11:13:25 AM UTC-7, Nick Maclaren wrote:
> In article <2015Dec21.180442@mips.complang.tuwien.ac.at>,
> Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>> (and somebody else wrote)

> >>In particular, it introduces the issue
> >>that two pointers can be legally derived from two separate base
> >>objects, compare equal, and one subscription would fail but another
> >>work.

> >I thought about how that could happen.  I guess it can happen when two
> >objects happen to be adjacent to each other, and one pointer points to
> >the address beyond one object and the other points to the start of the
> >next object.

> That is only one of many ways.  There are far fouller ones in C99.

There is an obvious solution.

When comparing pointers, don't compare the data contained in the pointer. 
Perform the address arithmetic to figure out the location to which the pointer 
points, as you would need to do when you fetch it, and compare the effective 
addresses.

Then not only would testing pointers for equality work, but the < and > 
relational operators would be applicable to pointers once again. (If == fails 
for the reason cited, then in addition < and > would be meaningless for 
pointers.)

John Savard

[toc] | [prev] | [next] | [standalone]


#32069

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2015-12-21 19:36 +0000
Message-ID<n59kbl$i0d$1@dont-email.me>
In reply to#32066
In article <305d0c34-77fc-45e2-bea4-918b0e734fcc@googlegroups.com>,
Quadibloc  <jsavard@ecn.ab.ca> wrote:
>
>There is an obvious solution.
>
>When comparing pointers, don't compare the data contained in the pointer. 
>Perform the address arithmetic to figure out the location to which the pointer 
>points, as you would need to do when you fetch it, and compare the effective 
>addresses.

No, that is not a solution to the problem as described, but the dual
of it.  What you are doing is to change the language to remove all
of the rules about legal pointer use, and going back to the pre-ISO
assumed behaviour.

The primary reason that the rules were introduced was to extend the
classes of machine on which C could be implemented, and there were
(and may still be) some in which the same logical location can be
accessed in two different modes, with the mode information kept in
the pointer.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#31978

FromNoob <root@127.0.0.1>
Date2015-12-18 22:29 +0100
Message-ID<n51tmv$8um$1@dont-email.me>
In reply to#31934
On 17/12/2015 00:34, Bill Findlay wrote:

> I was in charge of a beginners' programming lab that supported
> classes taught in Ada and classes taught in Pascal.  They latter were
> clearly at a disadvantage, as evidenced by the quality of their
> work.

A few weeks ago, either in comp.arch or comp.lang.c (can't remember)
someone posted a link to an article where a teacher explained that
students could never complete the class project in C, but many were
able to when they wrote in Ada.

Does someone have a link to that article?

Regards.

[toc] | [prev] | [next] | [standalone]


#31979 — Re: Ada vs C

FromNoob <root@127.0.0.1>
Date2015-12-18 22:37 +0100
SubjectRe: Ada vs C
Message-ID<n51u5u$8um$2@dont-email.me>
In reply to#31978
On 18/12/2015 22:29, Noob wrote:

> On 17/12/2015 00:34, Bill Findlay wrote:
> 
>> I was in charge of a beginners' programming lab that supported
>> classes taught in Ada and classes taught in Pascal.  They latter were
>> clearly at a disadvantage, as evidenced by the quality of their
>> work.
> 
> A few weeks ago, either in comp.arch or comp.lang.c (can't remember)
> someone posted a link to an article where a teacher explained that
> students could never complete the class project in C, but many were
> able to when they wrote in Ada.

Ah yes, it was in the comp.lang.c thread titled
"Is it possible C is the security problem?"
Message-ID: <5b9a2e66-305a-4a36-8df2-fde8f4078066@googlegroups.com>

http://archive.adaic.com/projects/atwork/trains.html

I found that interesting.

Regards.

[toc] | [prev] | [next] | [standalone]


#31989 — Re: Ada vs C

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2015-12-19 11:37 +0000
SubjectRe: Ada vs C
Message-ID<n53fhp$s8s$1@dont-email.me>
In reply to#31979
In article <n51u5u$8um$2@dont-email.me>, Noob  <root@127.0.0.1> wrote:
>On 18/12/2015 22:29, Noob wrote:
>> On 17/12/2015 00:34, Bill Findlay wrote:
>> 
>>> I was in charge of a beginners' programming lab that supported
>>> classes taught in Ada and classes taught in Pascal.  They latter were
>>> clearly at a disadvantage, as evidenced by the quality of their
>>> work.
>> 
>> A few weeks ago, either in comp.arch or comp.lang.c (can't remember)
>> someone posted a link to an article where a teacher explained that
>> students could never complete the class project in C, but many were
>> able to when they wrote in Ada.
>
>Ah yes, it was in the comp.lang.c thread titled
>"Is it possible C is the security problem?"
>Message-ID: <5b9a2e66-305a-4a36-8df2-fde8f4078066@googlegroups.com>
>
>http://archive.adaic.com/projects/atwork/trains.html
>
>I found that interesting.

I am involved in an HPC Academy, where budding PhD students are taught
the rudiments of scientific programming in a fortnight; the language
components take about 2 days.  Our success rate with Fortran is MUCH
higher than our success rate with C, but note that this is modern
Fortran, which is vastly more usable than Fortran 77.

I am also uniquely (?) well-qualified to adjudicate between modern
Fortran and simple C++ - the former is about 1/5 the size and takes
1/5 the length of time to teach, for a realistically usable subset.

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.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#31996 — Re: Ada vs C

FromAnonymous <no_email@invalid.invalid>
Date2015-12-19 17:19 +0000
SubjectRe: Ada vs C
Message-ID<ddlhttFg5ohU2@mid.individual.net>
In reply to#31989
Nick Maclaren <nmm@wheeler.UUCP> wrote:
> In article <n51u5u$8um$2@dont-email.me>, Noob  <root@127.0.0.1> wrote:
>> On 18/12/2015 22:29, Noob wrote:
>>> On 17/12/2015 00:34, Bill Findlay wrote:
>>> 
>>>> I was in charge of a beginners' programming lab that supported
>>>> classes taught in Ada and classes taught in Pascal.  They latter were
>>>> clearly at a disadvantage, as evidenced by the quality of their
>>>> work.
>>> 
>>> A few weeks ago, either in comp.arch or comp.lang.c (can't remember)
>>> someone posted a link to an article where a teacher explained that
>>> students could never complete the class project in C, but many were
>>> able to when they wrote in Ada.
>> 
>> Ah yes, it was in the comp.lang.c thread titled
>> "Is it possible C is the security problem?"
>> Message-ID: <5b9a2e66-305a-4a36-8df2-fde8f4078066@googlegroups.com>
>> 
>> http://archive.adaic.com/projects/atwork/trains.html
>> 
>> I found that interesting.
> 
> I am involved in an HPC Academy, where budding PhD students are taught
> the rudiments of scientific programming in a fortnight; the language
> components take about 2 days.  Our success rate with Fortran is MUCH
> higher than our success rate with C, but note that this is modern
> Fortran, which is vastly more usable than Fortran 77.
> 
> I am also uniquely (?) well-qualified to adjudicate between modern
> Fortran and simple C++ - the former is about 1/5 the size and takes
> 1/5 the length of time to teach, for a realistically usable subset.
> 
> 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?

--
Bill Findlay

[toc] | [prev] | [next] | [standalone]


Page 2 of 4 — ← Prev page 1 [2] 3 4  Next page →

Back to top | Article view | comp.arch


csiph-web