* Writing a Mac Ada compiler @ 1995-03-06 22:09 Mike White 1995-03-07 2:04 ` Arthur Evans Jr ` (4 more replies) 0 siblings, 5 replies; 28+ messages in thread From: Mike White @ 1995-03-06 22:09 UTC (permalink / raw) Could anyone give me an idea of about how much of an effort it would be to write an Ada compiler for the mac/powermac (or if youve had similar experience on other computers...). I am quite dismayed by the general lack of Ada support on the mac and I figure others are too. I have heard of compilers being ported to the mac, but a) I'd rather not wait and b) I imagine it would be quite a learning experience. Call me crazy. Anyways, would it be MUCH more difficult to write an ada 9x compiler than ada83? mike white ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-06 22:09 Writing a Mac Ada compiler Mike White @ 1995-03-07 2:04 ` Arthur Evans Jr 1995-03-07 18:32 ` Mike White 1995-03-07 18:37 ` David Weller 1995-03-07 13:46 ` Theodore E. Dennison ` (3 subsequent siblings) 4 siblings, 2 replies; 28+ messages in thread From: Arthur Evans Jr @ 1995-03-07 2:04 UTC (permalink / raw) In article <3jg167$a3l@nic.umass.edu>, cons116@twain.oit.umass.edu (Mike White) wrote: > Could anyone give me an idea of about how much of an effort it would be > to write an Ada compiler for the Mac ... Many dozens of person-years. > I am quite dismayed by the general > lack of Ada support on the mac and I figure others are too. Yes, many of are dismayed. If you have time on your hands and want to address this problem, port GCC 2.6.3 to the Mac, and then bootstrap GNAT. That's a much more modest task and will result in a first class compiler. And many of us will applaud loudly! Art Evans Arthur Evans Jr, PhD Phone: 412-963-0839 Ada Consulting FAX: 412-963-0927 461 Fairview Road Pittsburgh PA 15238-1933 evans@evans.pgh.pa.us ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 2:04 ` Arthur Evans Jr @ 1995-03-07 18:32 ` Mike White 1995-03-07 21:31 ` Mark Johannes 1995-03-09 0:32 ` Robert Dewar 1995-03-07 18:37 ` David Weller 1 sibling, 2 replies; 28+ messages in thread From: Mike White @ 1995-03-07 18:32 UTC (permalink / raw) Arthur Evans Jr (evans@evans.pgh.pa.us) wrote: : If you have time on your hands and want to address this problem, port : GCC 2.6.3 to the Mac, and then bootstrap GNAT. That's a much more : modest task and will result in a first class compiler. Would it really be that much easier to port it? Have you seen the source code? I haven't, so I am wondering how well designed/documented it is. I realize it's a pretty big task, but 10+ man-years? O.K. I'll admit it's probably not a one-man project, but if others were interested in working on such a project... I mean seriously, I wrote a simple lexer and parser (both using Ada by the way) in my systems class both in a semester. Both of these were easily extensible for large projects, and the grammar for Ada is widely available. Beyond that, converting to machine code would seem my biggest problem, never having done mac or powermac assembly. Interfacing with mac system calls seems pretty basic since they are well defined. I imagine one would convert the parameter conventions from Ada to the system via MacHeaders. Just some thoughts. I need to do some more research obviously before making any attempt. Anyone interested in participating on a joint effort, either working from scratch or doing a port? Please reply here so that everyone interested can read it, myself included. mike white ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 18:32 ` Mike White @ 1995-03-07 21:31 ` Mark Johannes 1995-03-08 17:39 ` Mike White 1995-03-09 0:32 ` Robert Dewar 1 sibling, 1 reply; 28+ messages in thread From: Mark Johannes @ 1995-03-07 21:31 UTC (permalink / raw) In article <3ji8rc$rj8@nic.umass.edu>, cons116@twain.oit.umass.edu (Mike White) writes: >Arthur Evans Jr (evans@evans.pgh.pa.us) wrote: > >: If you have time on your hands and want to address this problem, port >: GCC 2.6.3 to the Mac, and then bootstrap GNAT. That's a much more >: modest task and will result in a first class compiler. > Amen... >Would it really be that much easier to port it? Have you seen the source >code? I haven't, so I am wondering how well designed/documented it is. >I realize it's a pretty big task, but 10+ man-years? O.K. I'll admit >it's probably not a one-man project, but if others were interested in >working on such a project... > Yes you would have to learn something about the internals of GCC but you would not have to write the large mass of code known as a compiler. Unless I am horribly off base here, your effort would focus on providing host configuration files and host specific code. Since both the m68k and PowerPC families are well covered by GCC/GNAT. > I mean seriously, I wrote a simple lexer and parser (both using Ada >by the way) in my systems class both in a semester. Both of these >were easily extensible for large projects, and the grammar >for Ada is widely available. Beyond that, converting to machine code >would seem my biggest problem, never having done mac or powermac assembly. >Interfacing with mac system calls seems pretty basic since they are well >defined. I imagine one would convert the parameter conventions from Ada >to the system via MacHeaders. yes a lexer and parser may not be too tough for you to develop but.. you need 2 code generators, linkers, assemblers, debuggers, and Ada runtime support to have a full environment. Again your effort should be restricted to providing MAC specific support. -- not reinventing the wheel. I personally don't relish the idea of even using the machine_code package much less implementing it. > Just some thoughts. I need to do some more research obviously before >making any attempt. Anyone interested in participating on a joint effort, >either working from scratch or doing a port? Please reply here so that >everyone interested can read it, myself included. > >mike white And let's not forget this issue: support and maintenance. The GNU tools have a lot of users. There is a large body of code shared between the C, Ada, Pascal, and now Fortran users. This significantly increases the user population for the toolset. Yes the port itself may only have a handful of users..but the code generator and other support components are shared and have who knows how many users. So the odds of finding bugs at a serious level are significantly reduced. Finally, a port of GNU Ada gives a lot more to the MAC community than an Ada compiler. It lays (all??) of the groundwork for ports of other GNU languages and gets enough tools in place to allow ports of other GNU tools. Wouldn't GNU C work when/before GNAT did? C++, Objective-C, Fortran, and Pascal would not be far behind. it starts as a trickle of tools and ends as the Hurd .. (sorry could not resist). I probably missed something... but you get the idea. Joel Sherrill jsherril@merlin.gcs.redstone.army.mil ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 21:31 ` Mark Johannes @ 1995-03-08 17:39 ` Mike White 1995-03-09 8:16 ` RonaldS60 1995-03-11 19:45 ` Writing a Mac Ada compiler Gary McKee 0 siblings, 2 replies; 28+ messages in thread From: Mike White @ 1995-03-08 17:39 UTC (permalink / raw) Lots of people wrote: : Lots of helpful things. Yes, as I was thinking it over, I realized that I had not fully considered the size of the project I proposed. Everyone seems to be pointing to a port of GCC 2.6.3 and then compiling GNAT, thus making the world happy. At first I winced at the concept of porting GCC, but it does seem a lot more reasonable than "reinventing the wheel". I unfortunately don't know much about GNAT, and have limited experience with compiler design. I was basically trying to find out if, as a learning experience, writing an Ada compiler from scratch was a doable project. (plus I really prefer building up my own code than working on others' code, but hey, who doesn't?) Obviously the approach I was considering is not really feasible, and I appreciate the warnings! So, porting GCC and then GNAT on top of that is the way to go. Or, just as a learning experience, implement a subset of Ada... I'm gonna have to start looking into those GCC sources, I guess! mike white ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-08 17:39 ` Mike White @ 1995-03-09 8:16 ` RonaldS60 1995-03-12 23:51 ` Vladimir Vukicevic 1995-03-17 23:04 ` Need complex Math Package James M. (Mike) Hill 575-6632 msgid MHIL 1995-03-11 19:45 ` Writing a Mac Ada compiler Gary McKee 1 sibling, 2 replies; 28+ messages in thread From: RonaldS60 @ 1995-03-09 8:16 UTC (permalink / raw) If your interested (and have a spare Sun sitting around) GCC 2.6.3 has been ported to A/UX (Apple's UNIX) and the responses I (and others) have received indicate that it would be fairly trivial (???) to run a cross compile from a Sun (using GNAT) to GNU's intemediate code and to finish it on the Mac. I would have tried this already but I've got a random parity error that keeps popping up on my builds. Have a nice day, Ron ====================================================== Computers now make it possible to make more mistakes more efficiently than ever before possible. ====================================================== ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-09 8:16 ` RonaldS60 @ 1995-03-12 23:51 ` Vladimir Vukicevic 1995-03-17 23:04 ` Need complex Math Package James M. (Mike) Hill 575-6632 msgid MHIL 1 sibling, 0 replies; 28+ messages in thread From: Vladimir Vukicevic @ 1995-03-12 23:51 UTC (permalink / raw) In article <3jmdg3$3or@newsbf02.news.aol.com> ronalds60@aol.com (RonaldS60) writes: > > If your interested (and have a spare Sun sitting around) > GCC 2.6.3 has been ported to A/UX (Apple's UNIX) and the > responses I (and others) have received indicate that it > would be fairly trivial (???) to run a cross compile from > a Sun (using GNAT) to GNU's intemediate code and to finish > it on the Mac. I would have tried this already but I've > got a random parity error that keeps popping up on my builds. Well, a port to A/UX, by comparison to a port to the general System 7 (MacOS) environment, is trivial since A/UX provides all the components that would have to be worked aroud for a port to MacOS, notably a shell. You should be able to compile GNAT for A/UX in this way, but this port will not work on macs not running A/UX. - Vladimir ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Need complex Math Package 1995-03-09 8:16 ` RonaldS60 1995-03-12 23:51 ` Vladimir Vukicevic @ 1995-03-17 23:04 ` James M. (Mike) Hill 575-6632 msgid MHIL 1995-03-19 0:24 ` Henry Baker 1995-03-19 15:25 ` Robert Dewar 1 sibling, 2 replies; 28+ messages in thread From: James M. (Mike) Hill 575-6632 msgid MHIL @ 1995-03-17 23:04 UTC (permalink / raw) I anyone has or knows where I can find a Ada83 complex math package please drop me a line. I have looked via WWW on some of the major repositories without much luck. Thanks in advance Mike Hill ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Need complex Math Package 1995-03-17 23:04 ` Need complex Math Package James M. (Mike) Hill 575-6632 msgid MHIL @ 1995-03-19 0:24 ` Henry Baker 1995-03-19 15:25 ` Robert Dewar 1 sibling, 0 replies; 28+ messages in thread From: Henry Baker @ 1995-03-19 0:24 UTC (permalink / raw) In article <3kd4h9$cn6@mksrv1.dseg.ti.com>, mhill@adrs1.dseg.ti.com wrote: > I anyone has or knows where I can find a Ada83 > complex math package please drop me a line. > I have looked via WWW on some of the major > repositories without much luck. I developed some stuff privately. What do you need? -- www/ftp directory: ftp://ftp.netcom.com/pub/hb/hbaker/home.html ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Need complex Math Package 1995-03-17 23:04 ` Need complex Math Package James M. (Mike) Hill 575-6632 msgid MHIL 1995-03-19 0:24 ` Henry Baker @ 1995-03-19 15:25 ` Robert Dewar 1 sibling, 0 replies; 28+ messages in thread From: Robert Dewar @ 1995-03-19 15:25 UTC (permalink / raw) You could pick up the complex packages from GNAT, they would need a little adaptation for Ada 83, but it should be easy enough to do. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-08 17:39 ` Mike White 1995-03-09 8:16 ` RonaldS60 @ 1995-03-11 19:45 ` Gary McKee 1995-03-12 21:13 ` Mike White 1 sibling, 1 reply; 28+ messages in thread From: Gary McKee @ 1995-03-11 19:45 UTC (permalink / raw) In Article <3jkq49$m1g@nic.umass.edu>, cons116@twain.oit.umass.edu (Mike White) wrote: >... >Yes, as I was thinking it over, I realized that I had not fully considered >the size of the project I proposed. Everyone seems to be pointing to a >port of GCC 2.6.3 and then compiling GNAT, thus making the world happy. >At first I winced at the concept of porting GCC, but it does seem a lot >more reasonable than "reinventing the wheel". I unfortunately don't know >much about GNAT, and have limited experience with compiler design. I was >basically trying to find out if, as a learning experience, writing an Ada >compiler from scratch was a doable project. (plus I really prefer building >up my own code than working on others' code, but hey, who doesn't?) > >Obviously the approach I was considering is not really feasible, and I >appreciate the warnings! > >So, porting GCC and then GNAT on top of that is the way to go. Or, just >as a learning experience, implement a subset of Ada... I'm gonna have >to start looking into those GCC sources, I guess! > >mike white ================================================================ Mike, I'd be interested in working with you if you decide to do the port of GCC. I don't know the GCC technology (and need to learn it) but I've been working with other Ada compilers for eleven years now. I've done some Mac programming and I do have an Ada83 compiler on the Mac (actually, I have both the Meridian & the GW/AdaEd compilers). Let me know if you can use another engineer on this excellent project that you are considering. Gary McKee -------------------------------------------------------------------- McKee Consulting (303) 795-7287 P. O. Box 3009 gmckee@cloudnine.com Littleton, CO 80161-3009 -------------------------------------------------------------------- ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-11 19:45 ` Writing a Mac Ada compiler Gary McKee @ 1995-03-12 21:13 ` Mike White 0 siblings, 0 replies; 28+ messages in thread From: Mike White @ 1995-03-12 21:13 UTC (permalink / raw) Well, I've been looking through gcc 2.6.3 for a while now, and am leaning towards doing the port. Because this is a both a port and a large program, I am trying to figure out how to accomplish a bare-minimal mac implement- ation upon which I can build a good one. Minimally, it seems, the port would take a single c file and compile it, outputting an assembler file. I need to choose an assembler (and linker...) to test the assembly output. Besides MPW, are there any good (free/ cheap) 68k or ppc assemblers out there for the mac? I don't have MPW or enough money to buy it right now. Fantasm is the only shareware one I can find, but it seems a bit limited. I really wish I could scrape up $500 and get MPW pro! Maybe if I sell that old 286... and printer... and monitor... and apple 2c clone... I might have enough for a down-payment. (Please sob now for the poor college student.) Another speed bump: I could either try to write the mac port as a cross- compilation on my unix account or compile gcc under a mac compiler. The former is sure to compile but requires lots of zmodeming and I'd have to ask for more disk allocation (ive now only got 8 megs and downloaded gcc into a temporary file space that gets regularly purged.) The latter is going to take quite some work to compile (some of the code is in >32k files, etc., ETC!) but I've got space on my hard drive and, well, it would be a lot more convenient. Any ideas or experiences? thats all for now... mike white ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 18:32 ` Mike White 1995-03-07 21:31 ` Mark Johannes @ 1995-03-09 0:32 ` Robert Dewar 1995-03-09 10:46 ` Richard Kenner ` (2 more replies) 1 sibling, 3 replies; 28+ messages in thread From: Robert Dewar @ 1995-03-09 0:32 UTC (permalink / raw) Mike, at this stage, I am afraid your lack of familiarity with compiler technology is showing. Writing a lexical analyzer and parser for Ada is by comparison with the rest of the task simple, but even these very simple tasks are by no means trivial, especially if you want to get any kind of decent error messages. As for the idea that the only remaining step is generating machine language, I am afraid it seems that your cource on compilers gave a rather false impression. The hard part of an Ada compiler is the semantic analysis. Developing a full Ada compiler with a code generator is indeed a difficult project. The estimates of person years you see are for people with extensive compiler experience. I would estimate that the time to complete such a project for people without this kind of experience would be essentially infinite. You would learn something trying, but you would have no chance of succeeding. If that seems like a challenge, fine, as I say you will certainly learn something trying. As for porting GCC, this is a task that is probably about one twentieth the effort of writing a compiler, but that too expects you to have significant experience with GCC and the technology. If you are starting from scratch and know little about compilers and processor architectures, you have a lot to learn before you can succeed in such a port. Also, a port to the Mac assumes a thorough familiarity with System-7, which in itself is not easy, the internals of this system are complex. After all, if it were easy to get a GCC port for the MAC, it would have been done some time ago. Note that getting a GNAT port once a GCC port is a MUCH simpler task, probably no more than a couple of person months at most to get a first attempt. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-09 0:32 ` Robert Dewar @ 1995-03-09 10:46 ` Richard Kenner 1995-03-09 13:42 ` Arthur Evans Jr 1995-03-09 19:25 ` Mike White 2 siblings, 0 replies; 28+ messages in thread From: Richard Kenner @ 1995-03-09 10:46 UTC (permalink / raw) In article <3jlibk$p5g@gnat.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) writes: >As for porting GCC, this is a task that is probably about one twentieth the >effort of writing a compiler, but that too expects you to have significant >experience with GCC and the technology. If you are starting from scratch >and know little about compilers and processor architectures, you have a lot >to learn before you can succeed in such a port. Though true, this is somewhat confusing in the present context. It is indeed the case that doing a port to a new processor architecture requires considerable knowlege about GCC. Theoretically, you can do a port with just the information in "Using and Porting GCC" but in practice you need to know more in order to debug and refine the port. I did the RS/6000 and Alpha ports in about one month each, but I spent many years learning GCC to get that proficient in porting it. If you are extremely knowlegable about compilers and architecture but know nothing about GCC, you can probably get far enough along the learning curve to do a port in about six months, but you have a high probability of getting stuck somewhere in the debugging stage. However, in the case at hand, we are NOT talking about doing a GCC port to a new architecture since GCC has long been ported to the m68k and is also supported on the PowerPC. Here, the major concerns are operating system issues. If the calling sequence used is the same as some other system (a big "if"), you could do the port with essentially no knowlege of GCC internals (if you need calling sequence changes, the amount you'd have to learn depends on the nature of the changes). However, what you do have to be very familiar with is System-7 and, even more importantly, the rest of the toolchain: the assembler and linker. >After all, if it were easy to get a GCC port for the MAC, it would have >been done some time ago. Note that getting a GNAT port once a GCC port is >a MUCH simpler task, probably no more than a couple of person months at most >to get a first attempt. To clarify, this talks about porting to a "foreign" OS like System-7. If you want to port GNAT to a Unix-like (or OS/2-like) system on which GCC is already running, the major task is one of recompilation, which, if you are familiar with basic cross-compilation strategies, can be done in a couple of days, barring surprises (and not worrying about tasking). However, there are some OS dependencies in GNAT beyond that of GCC, so doing the first GNAT port to a new OS can indeed take significantly longer than a few days. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-09 0:32 ` Robert Dewar 1995-03-09 10:46 ` Richard Kenner @ 1995-03-09 13:42 ` Arthur Evans Jr 1995-03-10 6:25 ` Vladimir Vukicevic 1995-03-09 19:25 ` Mike White 2 siblings, 1 reply; 28+ messages in thread From: Arthur Evans Jr @ 1995-03-09 13:42 UTC (permalink / raw) In article <3jlibk$p5g@gnat.cs.nyu.edu>, dewar@cs.nyu.edu (Robert Dewar) wrote about porting GCC to the Mac: > Also, a port to the Mac assumes a thorough familiarity with System-7, > which in itself is not easy, the internals of this system are complex. True, if you make GCC into a stand-alone Mac application. However, if you port GCC as an MPW tool, things are _much_ easier. MPW (Mac Programmers Workbench) is a development environment that looks sort of vaguely Unix-like, with a command-line driven interface. I do all my development under MPW and have little experience with the Mac OS interface; I don't suffer the lack (much). Before Mike Feldman jumps in to make this next (valid) point, I'll make it myself: A major advantage of GNAT and GCC is that they are free. Requiring folks to buy a multi-hundred dollar product to get started is, to say the least, unfortunate. Moreover, learning MPW is a serious impediment to students. That said, I will jump in to acquire GNAT under MPW, and I'm sure many others who want to do serious Ada development on the Mac will do likewise. Moreover, many of us will gladly pay ACT (or anyone else) a reasonable maintenance fee. Were I going to do this project, I would start by studying Metrowerks, a more modern product than MPW that will likely take over MPW's market. Since Apple has no visible plans to upgrade MPW for PowerPC, it seems to be a dead product. But, I have no idea how easy it is, or even if it's possible, to implement another language under Metrowerks. It now supports C, C++ and Pascal. Art Evans Arthur Evans Jr, PhD Phone: 412-963-0839 Ada Consulting FAX: 412-963-0927 461 Fairview Road Pittsburgh PA 15238-1933 evans@evans.pgh.pa.us ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-09 13:42 ` Arthur Evans Jr @ 1995-03-10 6:25 ` Vladimir Vukicevic 1995-03-10 14:17 ` Arthur Evans Jr 0 siblings, 1 reply; 28+ messages in thread From: Vladimir Vukicevic @ 1995-03-10 6:25 UTC (permalink / raw) In article <evans-090395084230@evans.pgh.pa.us> evans@evans.pgh.pa.us (Arthur Evans Jr) writes: > Were I going to do this project, I would start by studying > Metrowerks, a more modern product than MPW that will likely take > over MPW's market. Since Apple has no visible plans to upgrade MPW > for PowerPC, it seems to be a dead product. But, I have no idea > how easy it is, or even if it's possible, to implement another > language under Metrowerks. It now supports C, C++ and Pascal. You can indeed add new 'translators' to metrowerks, much like you can with gcc. However, the task of ripping out gnat from its gcc roots and performing surgery to get the piece to fit into metrowerks would be -significantly- harder than porting gcc. Metrowerks provides information on how to write new translators; however, there is virtually no chance that the tree structure they use is semi- compatible with gcc; they might not even use this type of 'translating'. However, if you do port GNAT to run under Metrowerks, please let me know :-) -- Vladimir -- vladimir@intrepid.com ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-10 6:25 ` Vladimir Vukicevic @ 1995-03-10 14:17 ` Arthur Evans Jr 1995-03-10 15:30 ` Richard Kenner 0 siblings, 1 reply; 28+ messages in thread From: Arthur Evans Jr @ 1995-03-10 14:17 UTC (permalink / raw) Commenting on my suggestion that a GCC port to the Mac might use Metrowerks, vladimir@speedy.intrepid.com (Vladimir Vukicevic) wrote: > You can indeed add new 'translators' to metrowerks, much like you can > with gcc. However, the task of ripping out gnat from its gcc roots and > performing surgery to get the piece to fit into metrowerks would be > -significantly- harder than porting gcc. Metrowerks provides > information on how to write new translators; however, there is > virtually no chance that the tree structure they use is semi- > compatible with gcc; they might not even use this type of > 'translating'. Interesting. An important early decision to make in planning a GCC port to MPW would be whether to use the MPW linker or GCC's. My guess, based on zero knowledge, is that GCC's linker is enough different from MPW's that it would require performing major surgery on GCC to use MPW's format. But, nothing keeps you from using your own linker under MPW. Since GCC runs on NeXT hardware, 680x0 code generators must exist. I would think that the major task here, as in any port to a non-Unix target, would be changing OS calls from Unix (or whatever) to Mac OS. And I certainly don't call that a trivial task. How does this discussion differ from the situation under Metrowerks? What "tree" is it that Vladimir refers to? Art Evans Arthur Evans Jr, PhD Phone: 412-963-0839 Ada Consulting FAX: 412-963-0927 461 Fairview Road Pittsburgh PA 15238-1933 evans@evans.pgh.pa.us ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-10 14:17 ` Arthur Evans Jr @ 1995-03-10 15:30 ` Richard Kenner 0 siblings, 0 replies; 28+ messages in thread From: Richard Kenner @ 1995-03-10 15:30 UTC (permalink / raw) In article <evans-100395091733@evans.pgh.pa.us> evans@evans.pgh.pa.us (Arthur Evans Jr) writes: >An important early decision to make in planning a GCC port to MPW would >be whether to use the MPW linker or GCC's. GCC is a compiler that generates assembly language, so the term "GCC's linker" is meaningless. Perhaps you mean the GNU linker (gld). As far as I know, it has not been ported to MPW. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-09 0:32 ` Robert Dewar 1995-03-09 10:46 ` Richard Kenner 1995-03-09 13:42 ` Arthur Evans Jr @ 1995-03-09 19:25 ` Mike White 2 siblings, 0 replies; 28+ messages in thread From: Mike White @ 1995-03-09 19:25 UTC (permalink / raw) Robert Dewar (dewar@cs.nyu.edu) wrote: : Mike, at this stage, I am afraid your lack of familiarity with compiler : technology is showing. Writing a lexical analyzer and parser for Ada is : by comparison with the rest of the task simple, but even these very : simple tasks are by no means trivial, especially if you want to get : any kind of decent error messages. Very true. I DO lack familiarity with compiler technology. I am an undergrad with NO real-life experience in compiler design. I do, however, feel that I have an understanding of most of the pieces which go into a compiler, and was interested in seeing if I can pull those pieces together and learn something about overall compiler design. : As for the idea that the only remaining step is generating machine language, : I am afraid it seems that your cource on compilers gave a rather false : impression. The hard part of an Ada compiler is the semantic analysis. True. I definitely took a simplistic view of what a compiler is. This whole thread is based on an interest of mine which I wanted to get some input on, and I posted some things which I did not think through. (By the way, I have definitely decided against designing a compiler from scratch.) : [more] : As for porting GCC, this is a task that is probably about one twentieth the : effort of writing a compiler, but that too expects you to have significant : experience with GCC and the technology. If you are starting from scratch : and know little about compilers and processor architectures, you have a lot : to learn before you can succeed in such a port. : [more] I do sincerely appreciate these comments. I freely admit I am naive about compilers as my coursework has only provided me with a general background in computer science, and not much in compilers. However, my coursework _has_ included courses in computer architecture, assembly language, programming languages, software engineering, and operating systems. I have been programming Macs (under system 7) for about two years now, and have been programming in all sorts of languages on all sorts of machines for over ten years. This may or may not be enough experience to tackle such a chore as we are discussing here. I am currently taking a look at the gcc source, analyzing my abilities, and researching compiler technology. I am pretty honest with myself and if I do not see myself able to complete a robust port in a reasonable amount of time, trust me: I will not take up the project. mike white ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 2:04 ` Arthur Evans Jr 1995-03-07 18:32 ` Mike White @ 1995-03-07 18:37 ` David Weller 1 sibling, 0 replies; 28+ messages in thread From: David Weller @ 1995-03-07 18:37 UTC (permalink / raw) In article <evans-060395210422@evans.pgh.pa.us>, Arthur Evans Jr <evans@evans.pgh.pa.us> wrote: > >If you have time on your hands and want to address this problem, port >GCC 2.6.3 to the Mac, and then bootstrap GNAT. That's a much more >modest task and will result in a first class compiler. > >And many of us will applaud loudly! > I think Cygnus would be glad to undertake that task for somewhere around $100K. Anybody want to start a collection pool? :-) -- Frustrated with C, C++, Pascal, Fortran? Ada95 _might_ be for you! For all sorts of interesting Ada95 tidbits, run the command: "finger dweller@starbase.neosoft.com | more" (or e-mail with "finger" as subj.) ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-06 22:09 Writing a Mac Ada compiler Mike White 1995-03-07 2:04 ` Arthur Evans Jr @ 1995-03-07 13:46 ` Theodore E. Dennison 1995-03-07 17:17 ` Laurent Gasser 1995-03-08 15:57 ` Robert Dewar 1995-03-08 1:08 ` Robert Dewar ` (2 subsequent siblings) 4 siblings, 2 replies; 28+ messages in thread From: Theodore E. Dennison @ 1995-03-07 13:46 UTC (permalink / raw) Mike White <ons116@twain.oit.umass.edu> wrote: > Could anyone give me an idea of about how much of an effort it would be > to write an Ada compiler for the mac/powermac (or if youve had similar > experience on other computers...). I am quite dismayed by the general I would imagine most Ada compilers (even crappy ones) take at least 10 man-years to complete. It really isn't a project for a single person. Yes, I have made a start of it (on the late, great, Amiga). Completing the lexer alone would have taken me over a month. The parser? <shudder> > lack of Ada support on the mac and I figure others are too. I have heard of > compilers being ported to the mac, but a) I'd rather not wait and > b) I imagine it would be quite a learning experience. Call me crazy. You're crazy. > Anyways, would it be MUCH more difficult to write an ada 9x compiler > than ada83? Uhh, unless I'm mistaken, GNAT is available for the MAC. If it doesn't exist for the MAC, porting it WOULD be a job one person could accomplish. You might want to consider that instead of building your own from scratch. If you really want to build your own compiler as an exercise, why not try something smaller? Good luck, and I'm sorry I was so negative. T.E.D. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 13:46 ` Theodore E. Dennison @ 1995-03-07 17:17 ` Laurent Gasser 1995-03-08 15:57 ` Robert Dewar 1 sibling, 0 replies; 28+ messages in thread From: Laurent Gasser @ 1995-03-07 17:17 UTC (permalink / raw) If you really know of a port of GNAT for Mac, I would be very interested to know about. To my knowledge, it has not yet appeared because gcc 2.6.2 is not available for Mac. Wishfully mistaking... In article <3jho2t$gf9@theopolis.orl.mmc.com>, "Theodore E. Dennison" <dennison@escmail.orl.mmc.com> writes: |> Uhh, unless I'm mistaken, GNAT is available for the MAC. If it doesn't exist |> for |> the MAC, porting it WOULD be a job one person could accomplish. You might want |> to consider that instead of building your own from scratch. |> |> If you really want to build your own compiler as an exercise, why not try |> something smaller? |> |> Good luck, and I'm sorry I was so negative. |> T.E.D. |> -- Laurent Gasser (gasser@dma.epfl.ch) Computers do not solve problems, they execute solutions. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-07 13:46 ` Theodore E. Dennison 1995-03-07 17:17 ` Laurent Gasser @ 1995-03-08 15:57 ` Robert Dewar 1 sibling, 0 replies; 28+ messages in thread From: Robert Dewar @ 1995-03-08 15:57 UTC (permalink / raw) Actually I thought T.E.D. was very positive, I wish he would tell me how to build an Ada 95 compiler in only 10 person years of effort! :-) Note that there is NO port of GNAT for the MAC, as has often been noted to this newsgroup, and yes, it would be very nice if someone would create such a port! ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-06 22:09 Writing a Mac Ada compiler Mike White 1995-03-07 2:04 ` Arthur Evans Jr 1995-03-07 13:46 ` Theodore E. Dennison @ 1995-03-08 1:08 ` Robert Dewar 1995-03-08 2:09 ` Tucker Taft 1995-03-10 4:05 ` Michael Feldman 4 siblings, 0 replies; 28+ messages in thread From: Robert Dewar @ 1995-03-08 1:08 UTC (permalink / raw) Mike White asks about writing an Ada 95 compiler from scratch for the MAC. This is certainly a feasible project but a large one. 15-25 person years is a reasonable estimate of the total effort required, if you count maintenance into the future, this may be low. Yes, Ada 95 is considerably harder to implement than Ada 83, it is a much bigger language, the new features, and the annexes, add a LOT of effort. A more practical effort (by more than an order of magnitude) would be to port GNAT to the MAC, and it would be nice if someone completed this port! ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-06 22:09 Writing a Mac Ada compiler Mike White ` (2 preceding siblings ...) 1995-03-08 1:08 ` Robert Dewar @ 1995-03-08 2:09 ` Tucker Taft 1995-03-10 4:05 ` Michael Feldman 4 siblings, 0 replies; 28+ messages in thread From: Tucker Taft @ 1995-03-08 2:09 UTC (permalink / raw) Mike White (cons116@twain.oit.umass.edu) wrote: : Could anyone give me an idea of about how much of an effort it would be : to write an Ada compiler for the mac/powermac (or if youve had similar : experience on other computers...). I am quite dismayed by the general : lack of Ada support on the mac and I figure others are too. I have heard of : compilers being ported to the mac, but a) I'd rather not wait and : b) I imagine it would be quite a learning experience. Call me crazy. : Anyways, would it be MUCH more difficult to write an ada 9x compiler : than ada83? Writing a full compiler for a language like C++, Ada 95, Fortran 90, Eiffel, Modula-3, etc., is generally a 10-30 person-year effort. On the other hand, if you just want something relatively simple for your own use, you could ignore all the nasty parts and try to put something together using Yacc, Lex, and some existing simple public domain compiler (I believe there is at least one such free C compiler for the Mac). You could build it up slowly over time. For even more fun ;-), you might try to bootstrap early, once you can compile very simple programs. If you can wait until the beginning of next year, the Academic Ada compiler will be coming out for the PC and the PowerMac. Or you could take GNAT and put your energy into porting that. Porting GNAT is probably about 100 times simpler than building a compiler from scratch. In any case, the GW Ada/Ed for the Mac is quite nice for small programs. You could probably use it as your "bootstrap" compiler at least. : mike white -Tucker Taft stt@inmet.com Intermetrics, Inc. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-06 22:09 Writing a Mac Ada compiler Mike White ` (3 preceding siblings ...) 1995-03-08 2:09 ` Tucker Taft @ 1995-03-10 4:05 ` Michael Feldman 1995-03-13 4:55 ` Fraser Wilson 4 siblings, 1 reply; 28+ messages in thread From: Michael Feldman @ 1995-03-10 4:05 UTC (permalink / raw) In article <3jg167$a3l@nic.umass.edu>, Mike White <cons116@twain.oit.umass.edu> wrote: >Could anyone give me an idea of about how much of an effort it would be >to write an Ada compiler for the mac/powermac (or if youve had similar >experience on other computers...). I am quite dismayed by the general >lack of Ada support on the mac and I figure others are too. I have heard of >compilers being ported to the mac, but a) I'd rather not wait and >b) I imagine it would be quite a learning experience. Call me crazy. >Anyways, would it be MUCH more difficult to write an ada 9x compiler >than ada83? The GNAT project has consumed >3 calendar years, so I suppose somewhere in the neighborhood of 20 person-years has been involved. And they are not writing code generators, as they are building on top of the GNU backend. If you are a Mac fan and have time on your hands, get busy developing a port of gcc to the Mac; GNAT can then follow on its heels. Ada compilers are not easy. Best to reuse something, especially if it is free. Mike Feldman ------------------------------------------------------------------------ Michael B. Feldman - chair, SIGAda Education Working Group Professor, Dept. of Electrical Engineering and Computer Science The George Washington University - Washington, DC 20052 USA 202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet) ------------------------------------------------------------------------ One, two, three ways an underdog: Ada fan, Mac fan, Old Liberal Democrat ------------------------------------------------------------------------ Ada on the WWW: http://lglwww.epfl.ch/Ada/ or http://info.acm.org/sigada/ ------------------------------------------------------------------------ ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-10 4:05 ` Michael Feldman @ 1995-03-13 4:55 ` Fraser Wilson 1995-03-15 15:19 ` Theodore Dennison 0 siblings, 1 reply; 28+ messages in thread From: Fraser Wilson @ 1995-03-13 4:55 UTC (permalink / raw) I nearly cried when mfeldman@seas.gwu.edu (Michael Feldman) explained: >Ada compilers are not easy. Best to reuse something, especially if it >is free. It's true they're not easy. But writing an Ada compiler is a great way to learn how compilers work. I started one after a compiler course in 1988, and I still pop back to it every now and then to test ideas. It was written from scratch, and while it's no longer Ada, it contains overloading, inheritence, C-ish expression syntax, packages, strong typing, exceptions, blah blah blah etc etc. And even if it's ultimately a useless endeavour, it was fun. Fraser. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Writing a Mac Ada compiler 1995-03-13 4:55 ` Fraser Wilson @ 1995-03-15 15:19 ` Theodore Dennison 0 siblings, 0 replies; 28+ messages in thread From: Theodore Dennison @ 1995-03-15 15:19 UTC (permalink / raw) Fraser Wilson <raser@zoom.jtec.com.au> wrote: > I nearly cried when mfeldman@seas.gwu.edu (Michael Feldman) explained: > > >Ada compilers are not easy. Best to reuse something, especially if it > >is free. > > It's true they're not easy. But writing an Ada compiler is a great > way to learn how compilers work. > .. > > And even if it's ultimately a useless endeavour, it was fun. I don't think we meant to imply that it was "useless". Personally, I'm a firm believer that learning is never a waste. Its just that trying to craft a complete implementation of Ada single-handedly in one's spare time is practicly a hopeless task. The image that springs to mind is that of the old man in Indiana in the seventies who was building his own turnpike (by himself). Sure, you'll learn a lot, you'll just never finish it. I would like to suggest that, for learning purposes, a smaller language would be more suitable. This way, you are more likely to get around to building a code generator (to go with your parser and lexical analyser). Pascal and C would probably be good choices. Oberon would also be a good choice, as a book (Written by Nicklaus Wirth) is avaiable on building compilers that uses Oberon as an example. The complete source to Oberon is gone over in detail during the course of the text. Of course, if its really fame and glory you are after, porting GNAT would be the better choice. :-) T.E.D. ^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~1995-03-19 15:25 UTC | newest] Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1995-03-06 22:09 Writing a Mac Ada compiler Mike White 1995-03-07 2:04 ` Arthur Evans Jr 1995-03-07 18:32 ` Mike White 1995-03-07 21:31 ` Mark Johannes 1995-03-08 17:39 ` Mike White 1995-03-09 8:16 ` RonaldS60 1995-03-12 23:51 ` Vladimir Vukicevic 1995-03-17 23:04 ` Need complex Math Package James M. (Mike) Hill 575-6632 msgid MHIL 1995-03-19 0:24 ` Henry Baker 1995-03-19 15:25 ` Robert Dewar 1995-03-11 19:45 ` Writing a Mac Ada compiler Gary McKee 1995-03-12 21:13 ` Mike White 1995-03-09 0:32 ` Robert Dewar 1995-03-09 10:46 ` Richard Kenner 1995-03-09 13:42 ` Arthur Evans Jr 1995-03-10 6:25 ` Vladimir Vukicevic 1995-03-10 14:17 ` Arthur Evans Jr 1995-03-10 15:30 ` Richard Kenner 1995-03-09 19:25 ` Mike White 1995-03-07 18:37 ` David Weller 1995-03-07 13:46 ` Theodore E. Dennison 1995-03-07 17:17 ` Laurent Gasser 1995-03-08 15:57 ` Robert Dewar 1995-03-08 1:08 ` Robert Dewar 1995-03-08 2:09 ` Tucker Taft 1995-03-10 4:05 ` Michael Feldman 1995-03-13 4:55 ` Fraser Wilson 1995-03-15 15:19 ` Theodore Dennison
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox