public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch for sC++ to GNU C++.
@ 1998-10-21  3:27 Jan Madsen
  1998-10-21 19:20 ` Joe Buck
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Jan Madsen @ 1998-10-21  3:27 UTC (permalink / raw)
  To: egcs

Hello,

I have previously worked with Mike Stump concerning the insertion of
this patch (first time 3 years ago). In August I contanted Jason
(jason@cygnus.com) but I have never got any answer, Mike Stump has
therefore suggested me to contact you in order to get this patch into
egcs.

The patch allows the GNU C++ compiler to accept a small concurrent
extension called sC++ (home page: http://ltiwww.epfl.ch/sCxx ). The sC++
extension adds 6 new keywords to the C++ language, they are however only
reserved if the source file to be compiled have one of the extensions
'.scxx' or '.scc' (or the flag '-fsyncc++' is used). Otherwise this
extension does not change the behaviour of the C++ compiler frontend.
Below you find a suggestion for a changelog entry for this change.


Wed Aug 19 14:25:00 1998 Jan Madsen <Jan.Madsen@epfl.ch>

        Insertion of the sC++ language extension.
        * Makefile.in: Added rules for sc*.c files.

        * decl2.c: Added flag 'syncc++' to list of flags, and variable
         'flag_synccxx'.

        * gxx.gperf: Added reserved words for sC++, regeneration of
hash.h
          required.

        * lang-options.h: Added flag '-fsyncc++'.

        * lang-specs.h: Added part for sC++ extensions ('.scxx' and
'.scc') and
          specs part for these extensions.

        *lex.c (init_lex): Unset sC++ specific keywords if extension not
used.

        *parse.y: Inserted actions and rules for the sC++ extension
(embedded
         in an 'if (flag_synccxx)').

        *sc-accep.c, sc-activ.c, sc-body.c, sc-const.c, sc-defau.c,
sc-destr.c,
         sc-foral.c, sc-meth.c, sc-misc.c, sc-names.h, sc-selec.c,
sc-selec.h,
         sc-setre.c, sc-stack.c, sc-wait.c, sc-when.c, sc.c, sc.h: New
files. 


You may obtain the complete patch (60-100kb) at the address (or I can
send it to you upon request): 

          http://ltiwww.epfl.ch/~madsen/gnu.html

I have put up two different versions of the patch: one with and one
without the kernel realising the concurrency in sC++. Each patch
decompress into a directory called sc-diff. We have already assigned the
copyright for the patch and the kernel to FSF.


Regards,

Jan Madsen

PS. Please let me know if I can do anything in order to facilitate the
    integration of this patch.

------------------------------------------------------------------------
Computer Networking Laboratory        - Laboratoire de Teleinformatique
Computer Science Department           - Departement d'Informatique
Swiss Federal Institute of Technology - Ecole Polytechnique Federale
1015 Lausanne, Switzerland

email: Jan.Madsen@epfl.ch

Tel. 021 / 693 47 97
Fax. 021 / 693 66 00

http://ltiwww.epfl.ch/~madsen
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Patch for sC++ to GNU C++.
@ 1998-10-22 13:59 Mike Stump
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Stump @ 1998-10-22 13:59 UTC (permalink / raw)
  To: Jan.Madsen, jbuck; +Cc: egcs, jason

> From: Joe Buck <jbuck@Synopsys.COM>
> To: Jan.Madsen@epfl.ch (Jan Madsen)
> Date: Wed, 21 Oct 98 12:38:50 PDT
> Cc: egcs@cygnus.com, jason@cygnus.com


> The idea is that there would be a new directory gcc/sc which would
> be a peer of gcc/cp.  It would contain all of the new sc-xxx.c files.
> Initially, the parser would need to be duplicated and modified, which
> I don't much like.

Uhm, it's the whole compiler, not any subpart of the compiler.  I
don't like copying on that large a scale.

Maybe folks can talk about good ways to think about frontends and code
them so we can get more sharing of semantics between frontends.  This
I think is overdue.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Patch for sC++ to GNU C++.
@ 1998-11-13  5:01 Jan Madsen
  0 siblings, 0 replies; 17+ messages in thread
From: Jan Madsen @ 1998-11-13  5:01 UTC (permalink / raw)
  To: raeburn, law, jason; +Cc: Claude.Petitpierre, egcs

Hello,

Thank you for your continued interest. Actually we understand your
situation: more work and ideas than resources sounds familiar.

Can we try a new contact in a few months? We think that our approach is
an important step forward (see also A. Eilien's mail to info@cygnus.com
from Nov. 10, 1998). We now put our effort to port the language and
libraries to Windows 95 as well as supporting tools (we have a first
version of a model checker), and thus look forward to be integrated into
the EGCS package.


Regards,

Jan Madsen


PS. To contact us please use the e-mail address: scxx@di.epfl.ch
    (This is a generic e-mail address for questions about sC++).

PS. Below you find my comments to the sC++/Concurrent C/C++ "objections"
    made by Ken Raeburn.

------------------------------------------------------------------------
Computer Networking Laboratory        - Laboratoire de Teleinformatique
Computer Science Department           - Departement d'Informatique
Swiss Federal Institute of Technology - Ecole Polytechnique Federale
1015 Lausanne, Switzerland

email: Jan.Madsen@epfl.ch

Tel. 021 / 693 47 97
Fax. 021 / 693 66 00

http://ltiwww.epfl.ch/~madsen
------------------------------------------------------------------------

> Subject:  Re: Patch for sC++ to GNU C++.
> Date:     25 Oct 1998 20:03:51 -0500
> From:     Ken Raeburn <raeburn@cygnus.com>
> To:       Jan Madsen <Jan.Madsen@epfl.ch>, egcs@cygnus.com
> References:   1
>
>
>
>
> Here are some comments I had for Jason when he asked my opinion of the
> patches in August.  (I've spent a bit of time working on a Concurrent
> C front end, and when MRS was still at Cygnus, pestering him about
> thread-safety issues.)  We haven't discussed it since.

> Most of my comments are about the generic extension issues, a few
> about sC++ specifically.  Some of the issues have already been brought
> up in this discussion.  I didn't take as much time as I could've to
> investigate the details of the sC++ implementation, and didn't talk to
> Jan about it at all, so some of my concerns may be unfounded.
>
> Ken
>
> To: Jason Merrill <jason@cygnus.com>
> Subject: Re: [Jan Madsen <Jan.Madsen@epfl.ch>] Patch for the sC++ extension.
> From: Ken Raeburn <raeburn@cygnus.com>
> Date: 24 Aug 1998 16:28:45 -0400
>
> > Thoughts?
>
> Several...
>
> First: It'd be great to have some sort of extension for multithreaded
> programs available.  Yes, the Posix library spec is okay, but (1) it's
> only one thread API of several we have to deal with, and (2) it deals
> with low-level issues, and stuff like message-passing has to be built
> on top of it all the time, locking has to be explicitly done, etc.
> Having a language extension puts the API issues under the covers, and
> (generally) lets you specify in one places that all accesses to an
> object should be done with locks, and often lets you say "pass this
> message with these six values, and get a value back".
>
> I'd rather see something available for C as well, and if I get really
> psyched about it I'll work on Concurrent C/C++ again (looks like my
> previous work is lost to a disk crash and bad backup tapes, but hey,
> parts of it really needed a rewrite anyways).  In fact, some (not all)
> of the sC++ extensions look remarkably like Concurrent C/C++
> extensions, with slightly different syntax, and without support for C.
> (Of course, both the sC++ and Concurrent C extensions also bear some
> resemblance to Ada constructs.)

sC++ forms a coherent environment that harmonizes object oriented
programming and process modelling. It is bolstered by a heavy
theoretical background.

sC++ programs can be analysed for deadlocks by random walk validation,
state space reachability analysis, and model checking, for which tools
are already available. Comparing with Promela/SPIN, sC++ is
simultaneously the specification and implementation language. These
features should be preserved when harmonizing the concurrent extension
to other languages.

>
> Second: I think at some point we should address the general issue of
> extensions to C and C++.  Maybe there isn't anything "general" that we
> can do, but I think we should investigate, and as far as I know no one
> has.  There are several issues to look into, I'm sure; only a few come
> to me off the top of my head.
>
> * Grammar: The "@" additions to the C++ grammar might conflict with an
>   Objective C++ front end.  Some of the new keywords will definitely
>   conflict with Concurrent C++.  The grammar gets new hooks all over
>   the place for this extension, I think even more so than for
>   Concurrent C++.  The new rules in the grammar are active even if the
>   extensions are not enabled.

The new hooks are used to gather the names and visibility of the
different member functions belonging to an active class. This can also
be done by decoding the tree structure for a class, but I think the tree
structure is much more likely to change than the parser itself (the
bison rules) and thus it will be much more difficult to maintain.

A number of other hooks are used to test if a member function call calls
a function belonging to an active class. In this case some extra code is
generated by simulating the corresponding parser (bison) actions and
returning the modified tree structure.

> * How to hook in: Should we add command-line options to enable
>   extensions, as they've done, or create new programs like cc1obj that
>   have the extensions, and leave them out of the "ordinary" back end?
>   Does it matter if we're consistent?
>
> * Intrusiveness: Should we put "if objc" and "if (flag_synccxx)" hooks
>   in all over the place, specific to each extension, or can we find a
>   way to add generic hooks in all these places (including the grammar
>   and lexer themselves?) that an extension "package" (or more than
>   one) can make use of?

We let you decide, the sC++ extension can be made to conform to any of
these two ways.

> * Combining multiple extensions: Can we produce some mechanism by
>   which an "Objective sC++" compiler would just sort of fall out
>   naturally?  Grammar and keyword conflicts would have to be handled
>   somehow, so possibly the answer is no.  Maybe the answer is to add
>   all the hooks and grammar extensions and resolve conflicts up front,
>   then selectively enable those additions at run time.
>
> This could get into a big can of worms, and the easy way out is to
> just deal with it for each such language extension that comes along.
> That works, but has little chance of making it easier to write new
> language extensions.  Maybe that's not important; I don't expect all
> that many to come along, but some do.  For example, database
> extensions, other concurrent-execution models.
>
> Third: This appears to do synchronous, cooperative multithreading,
> rather than async posix-style (and gthr.h-style) multithreading.  This
> makes it of relatively limited use, in my opinion, but I'm sure it has
> its place.  You have to use their thread mechanism, and their new
> header file in every source file, at least if you use their
> extensions.  (The compiler could be hacked to always read the
> structures and function declarations from the header file without
> explicitly including it from the source file, or hard-code the info
> within the compiler.)  The header file is a little sloppy about
> namespace invasion, and includes some system header files.

Asynchronous communication makes modelling of a program difficult.
Moreover creating an active object simulating a channel (in a library)
is very easy in sC++, and its subsequent use in the program is as simple
as the use of, for example, the 'strlen()' function.

Concerning the scxx.h header (our new header file), we would also be
very happy if we have had the time to make it disappear (e.g. in the
compiler as you propose). The introduction of a separate namespace for
the kernel header can be done, however, the current header dates from
the GNU C++ version 2.7.0 where namespaces were not a part of GCC.

The inclusion of the system header files are required in order to rename
the "select" and "accept" functions defined in the UNIX operating
system. It is necessary to treat this problem in any concurrent
extension using any of these two keywords.

> They're assuming that sigsetjmp/siglongjmp are adequate for switching
> threads.  I'm not sure that's all that safe.

At some lowlevel point any thread package will be required to use the
sigsetjmp/siglongjmp (or equivalent) system calls to switch threads.

>
> It looks like the library support is only ported to Alpha, Sparc, and
> SGI systems, in the tar file I fetched.  Actually, there's a Linux one
> as well, but the fact that it's a separate distribution doesn't look
> good.  Maybe that's what the "generic" configuration part refers to,
> but how generic can it be if Alpha, Sparc, and SGI each need their own
> replacement definitions?

We provide our system only for these four OS'es because they are the
only systems we have been able to test the sC++ extension on. The sC++
extension to the compiler is, however, completely independent of the OS
on which the compiler is run. Only the sC++ kernel may need some
adaption and this can be made with the same configuration scheme as
other GNU packages.

>
> Fourth: Minor stuff...  Changing some of the names/spellings to
> English might make it easier on many of the users.  They use the name
> "sC++" in some places and "SyncC++" (the older name of the project, I
> think) in others, and that probably should be made consistent.  Also,
> I've got some minor concerns about just how the hooks into the grammar
> are written (e.g., are they changing the semantics more than they
> should), but I'm sure you'd review that more carefully than I have.
> And I doubt they've checked for proper interaction with templates.
>

Sorry for the spelling, if we can go forward, we will do our best to
improve it. SyncC++ was the old name and should be replaced by sC++
wherever it appears.

Templates have not yet been handled by lack of time. We also need to
know where we are heading before investing time in these features.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~1998-11-13  5:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-21  3:27 Patch for sC++ to GNU C++ Jan Madsen
1998-10-21 19:20 ` Joe Buck
1998-10-22 11:32   ` Mark Mitchell
1998-10-22 18:00     ` Joe Buck
1998-10-22 21:15       ` Jan Madsen
1998-10-22 22:22       ` Mark Mitchell
1998-10-22 18:00         ` Joe Buck
1998-10-22 13:59           ` Mark Mitchell
1998-10-22 21:15             ` Joe Buck
1998-10-23  4:36               ` Jan Madsen
1998-10-25 13:53                 ` Jeffrey A Law
1998-10-22 21:15     ` Chip Salzenberg
1998-10-21 22:10 ` Mark Mitchell
     [not found] ` <199810212214.PAA16044.cygnus.egcs@smtp.earthlink.net>
1998-10-22 22:22   ` Jason Merrill
1998-10-25 18:03 ` Ken Raeburn
1998-10-22 13:59 Mike Stump
1998-11-13  5:01 Jan Madsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).