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


#31688 — Intel MPX

FromStephen Fuld <SFuld@alumni.cmu.edu.invalid>
Date2015-12-09 12:26 -0800
SubjectIntel MPX
Message-ID<n4a2kt$7gq$1@dont-email.me>
In Skylake, Intel introduced an extension called MPX.

https://en.wikipedia.org/wiki/Intel_MPX

and the references therein.

It seems to be a step toward higher reliability C programs by catching 
at least some instances of "pointers gone wild".

My guess is, while it is probably useful, and a step in the right 
direction, it is a pretty modest step.

How useful will it be, and is it a start towards even more robustness 
enhancements in commodity hardware?



-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)

[toc] | [next] | [standalone]


#31690

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-12-09 13:04 -0800
Message-ID<b258596e-5bae-44d5-8893-ffc4c1c8ba81@googlegroups.com>
In reply to#31688
On Wednesday, December 9, 2015 at 1:26:27 PM UTC-7, Stephen Fuld wrote:

> My guess is, while it is probably useful, and a step in the right 
> direction, it is a pretty modest step.

> How useful will it be, and is it a start towards even more robustness 
> enhancements in commodity hardware?

I can't answer those questions, but: more than a modest step would 
be hard to take without affecting compatibility - and given the 
prevalence of buffer overflows, it is a desperately needed step.

Of course, one does not need a new instruction to carefully check 
against the boundaries of a buffer before adding information to 
it, where the data is coming from an uncontrolled outside source. 
Making this kind of careful programming easier would perhaps be 
better dealt with through extensions to programming languages.

Or so I would think. Reducing the overhead, to encourage the good practice, and making it easier for assembler programmers, are still also useful.

John Savard

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


#31697

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-12-09 23:27 +0100
Message-ID<n4a9t2$qpu$1@speranza.aioe.org>
In reply to#31688
Stephen Fuld wrote:
> In Skylake, Intel introduced an extension called MPX.
>
> https://en.wikipedia.org/wiki/Intel_MPX
>
> and the references therein.
>
> It seems to be a step toward higher reliability C programs by catching
> at least some instances of "pointers gone wild".
>
> My guess is, while it is probably useful, and a step in the right
> direction, it is a pretty modest step.
>
> How useful will it be, and is it a start towards even more robustness
> enhancements in commodity hardware?
>
>
>
Not very useful at all, unless you can persuade yourself that the 
overhead of implementing this in your compiler and then enable it for 
(nearly?) all memory references will not cost too much in the form of 
hazzle or performance.

I suspect that Java JIT style boundary check hoisting away from most 
loop bodies is less actual overhead, and no hw support needed.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

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


#31699

FromMelzzzzz <mel@zzzzz.com>
Date2015-12-10 00:41 +0100
Message-ID<20151210004101.6c82f3bb@maxa-pc>
In reply to#31697
On Wed, 9 Dec 2015 23:27:49 +0100
Terje Mathisen <terje.mathisen@tmsw.no> wrote:

> Stephen Fuld wrote:
> > In Skylake, Intel introduced an extension called MPX.
> >
> > https://en.wikipedia.org/wiki/Intel_MPX
> >
> > and the references therein.
> >
> > It seems to be a step toward higher reliability C programs by
> > catching at least some instances of "pointers gone wild".
> >
> > My guess is, while it is probably useful, and a step in the right
> > direction, it is a pretty modest step.
> >
> > How useful will it be, and is it a start towards even more
> > robustness enhancements in commodity hardware?
> >
> >
> >  
> Not very useful at all, unless you can persuade yourself that the 
> overhead of implementing this in your compiler and then enable it for 
> (nearly?) all memory references will not cost too much in the form of 
> hazzle or performance.
> 
> I suspect that Java JIT style boundary check hoisting away from most 
> loop bodies is less actual overhead, and no hw support needed.
> 
> Terje
> 

As I read there is already Linux kernel support for MPX accompanying
gcc support for applications.
https://www.kernel.org/doc/Documentation/x86/intel_mpx.txt
https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler

They say no code change is needed, just recompile -fmpx.

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


#31717

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-12-10 12:22 +0100
Message-ID<n4bn8p$rne$1@speranza.aioe.org>
In reply to#31699
Melzzzzz wrote:
> On Wed, 9 Dec 2015 23:27:49 +0100
> Terje Mathisen <terje.mathisen@tmsw.no> wrote:
>
>> Stephen Fuld wrote:
>>> In Skylake, Intel introduced an extension called MPX.
>>>
>>> https://en.wikipedia.org/wiki/Intel_MPX
>>>
>>> and the references therein.
>>>
>>> It seems to be a step toward higher reliability C programs by
>>> catching at least some instances of "pointers gone wild".
>>>
>>> My guess is, while it is probably useful, and a step in the right
>>> direction, it is a pretty modest step.
>>>
>>> How useful will it be, and is it a start towards even more
>>> robustness enhancements in commodity hardware?
>>>
>>>
>>>
>> Not very useful at all, unless you can persuade yourself that the
>> overhead of implementing this in your compiler and then enable it for
>> (nearly?) all memory references will not cost too much in the form of
>> hazzle or performance.
>>
>> I suspect that Java JIT style boundary check hoisting away from most
>> loop bodies is less actual overhead, and no hw support needed.
>>
>> Terje
>>
>
> As I read there is already Linux kernel support for MPX accompanying
> gcc support for applications.
> https://www.kernel.org/doc/Documentation/x86/intel_mpx.txt
> https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler
>
> They say no code change is needed, just recompile -fmpx.
>
That was obviously the target, but with just 4 hw bounds registers which 
can cache the limits for an object the compiler will have to generate a 
lot of code to reload those bounds each time it issues a mem-op against 
any object.

If the bounds had worked as a normal cache, i.e. with a reasonable 
number of cache entries and transparent reloads when needed, then the 
overhead (at least in code size) would have been significantly reduced.

OTOH, this would not have stopped any kind of buffer overflow where the 
real access ends up in a different but still valid address range:

You need at least a way to tag bounds entries against a given base 
address, this is most easily implemented with a requirement that all 
table/object accesses have to be performed as [base+offset], where the 
base corresponds to a bounds entry and the effective offset is within 
the range of that bounds pair.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

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


#31702

Fromjacko <jackokring@gmail.com>
Date2015-12-09 17:36 -0800
Message-ID<45b0fede-a082-4ccd-a515-cb7cf99debae@googlegroups.com>
In reply to#31688
So the buffer with code is in program code, assuming shared data and code segments :(, and some program is written badly, and nests some call and crashes (how else will an exception), why ever would that stack segment ever be used to return to the shell?

So it's already got code in executing scope, how else would the stack be accessible? If you can overwrite the stack, surely you could just execute the code. Why would you even use a shared heap, or even ... ?

I must be an idiot, how does initial execution in one thread/process obtain rights an another processes stack segment? Probly some dick move relating to process isolation?

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


#31718

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-12-10 12:36 +0100
Message-ID<n4bo3c$u0q$1@speranza.aioe.org>
In reply to#31702
jacko wrote:
> So the buffer with code is in program code, assuming shared data and
> code segments :(, and some program is written badly, and nests some
> call and crashes (how else will an exception), why ever would that
> stack segment ever be used to return to the shell?
>
> So it's already got code in executing scope, how else would the stack
> be accessible? If you can overwrite the stack, surely you could just
> execute the code. Why would you even use a shared heap, or even ...
> ?
>
> I must be an idiot, how does initial execution in one thread/process
> obtain rights an another processes stack segment? Probly some dick
> move relating to process isolation?
>
Return Oriented Programming is one of those beautiful ideas which are 
totally obvious in hindsight:

Given a nice, big selection of library/system calls that take input 
parameters on the stack, a writeable stack segment and a single point of 
access in an arbitrary piece of code, you can write any code you want in 
the form of a set of function calls:

Taking them in reverse order you push all the arguments on the stack, 
followed by the function address, then when the current function returns 
it will not go back to where it was called from, but instead to the last 
of those ROP functions you stacked up.

After the final (first stacked) of these operations finish the stack has 
been unwinded back to where we started, so the return will resume back 
in the original caller's code.

Among all these ROP calls you would obviously insert whatever you need 
in the form of memmap/memory range protection operations so that the 
main part of your malware can execute without trapping.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

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


#31720

FromBruce Hoult <bruce.hoult@gmail.com>
Date2015-12-10 03:58 -0800
Message-ID<708bac8b-d1c1-4e39-ac50-88d35b845a65@googlegroups.com>
In reply to#31718
On Thursday, December 10, 2015 at 2:36:15 PM UTC+3, Terje Mathisen wrote:
> Given a nice, big selection of library/system calls that take input 
> parameters on the stack, a writeable stack segment and a single point of 
> access in an arbitrary piece of code, you can write any code you want in 
> the form of a set of function calls:

So, useless on RISC or x86_64 (at least on Linux and OS X .. I've never looked how Windows uses it).

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


#31725

Fromalready5chosen@yahoo.com
Date2015-12-10 07:39 -0800
Message-ID<8c2ac8b7-697e-41f2-be94-ecf0296212be@googlegroups.com>
In reply to#31720
On Thursday, December 10, 2015 at 1:58:27 PM UTC+2, Bruce Hoult wrote:
> On Thursday, December 10, 2015 at 2:36:15 PM UTC+3, Terje Mathisen wrote:
> > Given a nice, big selection of library/system calls that take input 
> > parameters on the stack, a writeable stack segment and a single point of 
> > access in an arbitrary piece of code, you can write any code you want in 
> > the form of a set of function calls:
> 
> So, useless on RISC or x86_64 (at least on Linux and OS X .. I've never looked how Windows uses it).

Of course it will work on x86_64 regardless of the OS.
It will work on Stanford-style RISCs (including ARM and PPC) as well, the only complication in this case is that you have to attack non-leaf function.
On Berkly-style RISCs (including IPF) it seems to be be harder. Or, may be, it's not harder, just my mind is not sufficiently dirty.

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


#31726

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2015-12-10 16:41 +0000
Message-ID<2015Dec10.174148@mips.complang.tuwien.ac.at>
In reply to#31725
already5chosen@yahoo.com writes:
[return-oriented programming]
>On Berkly-style RISCs (including IPF) it seems to be be harder. Or, may be, it's not harder, just my mind is not sufficiently dirty.

The presentation <http://cseweb.ucsd.edu/~hovav/dist/blackhat08.pdf>
also gives examples from a SPARC, a Berkeley-style RISC.

Even if you manage to totally prevent using returns (which the
Berkeley style does not), you can use gadgets that end in a non-return
indirect branch (or call), e.g., method dispatch in an OO language.

- 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]


#31727

Fromjacko <jackokring@gmail.com>
Date2015-12-10 10:06 -0800
Message-ID<be7b35c6-9b9e-4cb2-b1b0-55000380d20a@googlegroups.com>
In reply to#31726
A nice introduction to finding combinators. I guess the focus turns into hacking variables and hoping they're function pointers. An off stack register marker, and a PC target violation exception? 

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


#31728

Fromjacko <jackokring@gmail.com>
Date2015-12-10 11:14 -0800
Message-ID<8b2d7cf7-c514-4ee2-b520-f2501dc56400@googlegroups.com>
In reply to#31727
On Thursday, 10 December 2015 18:07:01 UTC, jacko  wrote:
> A nice introduction to finding combinators. I guess the focus turns into hacking variables and hoping they're function pointers. An off stack register marker, and a PC target violation exception?

yes, an RP for return addresses of calls, for expediency, and an insecure language feature exception which can by a supervisor loader sticky flag, to avoid vector trap slowing on secure class loaded languages. As disabling sub routines is a non starter.

It does however need a procedure for libraries written in insecure systems code (JNI?), to be declared "free of exception" for efficient use of this feature. Authentication bootstrap possible should be via secure automated testing of the code. 

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


#31729

Fromjacko <jackokring@gmail.com>
Date2015-12-10 11:23 -0800
Message-ID<ca005748-9d2a-48bc-81f5-83add1fab1ff@googlegroups.com>
In reply to#31728
A real botch of a shadow RP, clone write return addresses, and use it, not SP, along with register sticky bits 'infecting' unknown marking to not PC it, and a trap, could be back applied to some architectures.

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


#31724

Fromjacko <jackokring@gmail.com>
Date2015-12-10 07:37 -0800
Message-ID<27c15199-47a4-4574-81fc-27bda446dae8@googlegroups.com>
In reply to#31718
I guess that's why I took return addresses off the [SP] when doing virtual instruction set design.

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


#31886

Fromtimcaffrey@aol.com
Date2015-12-15 09:51 -0800
Message-ID<ba37e488-40c6-4880-b800-f9d92e298536@googlegroups.com>
In reply to#31688
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.
:)

          - Tim

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


#31887

FromMegol <golem960@gmail.com>
Date2015-12-15 09:57 -0800
Message-ID<3bf7bfbf-ea95-440b-886c-a54edcd78be3@googlegroups.com>
In reply to#31886
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.

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


#31888

FromStephen Fuld <SFuld@alumni.cmu.edu.invalid>
Date2015-12-15 11:07 -0800
Message-ID<n4po8q$53t$1@dont-email.me>
In reply to#31887
On 12/15/2015 9:57 AM, 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.


Check out the Turing language.  It may be (or should I say was) almost 
exactly what you are describing.


-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)

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


#31898

FromBruce Hoult <bruce.hoult@gmail.com>
Date2015-12-16 02:21 -0800
Message-ID<eddfe56f-23ed-4b3a-a676-73d2dfc91f7d@googlegroups.com>
In reply to#31887
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?

The only C feature I can think of that is missing from real world Pascal compilers is the ternary operator.

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.

C++ sealed the deal with multiple inheritance and templates in 1990ish, but before that there was no real advantage to writing Macintosh software in either C or Pascal.

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


#31901

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-12-16 08:01 -0800
Message-ID<11789597-da4e-4381-a5a9-eae96a5f36ba@googlegroups.com>
In reply to#31898
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.

John Savard

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


#31904

FromNiklas Holsti <niklas.holsti@tidorum.invalid>
Date2015-12-16 18:17 +0200
Message-ID<dddh5nFf444U1@mid.individual.net>
In reply to#31901
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.

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

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


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.arch


csiph-web