Path: alphanet.ch!imp.ch!news.uni-stuttgart.de!news.belwue.de!news.ipc.uni-tuebingen.de!seicom.de!xlink.net!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!zip.eecs.umich.edu!panix!cmcl2!yale.edu!yale!laplace!nathan From: nathan@laplace.csb.yale.edu Newsgroups: comp.sys.next.announce Subject: NEXTSTEP-Languages-FAQ Followup-To: comp.sys.next.misc Date: 6 Mar 1995 08:39:08 GMT Organization: Yale University, Department of Computer Science, New Haven, CT Lines: 461 Approved: nathan@laplace.csb.yale.edu Expires: Fri, 7 Apr 1995 00:00:00 GMT Message-ID: <3jehnc$c4k@babyblue.cs.yale.edu> Reply-To: nathan@laplace.csb.yale.edu NNTP-Posting-Host: laplace.csb.yale.edu Summary: Frequently Asked Questions about NEXTSTEP and NeXT machines. Originator: nathan@laplace Archive-name: NEXTSTEP-Languages-FAQ Last-modified: Mon Mar 6 03:03:59 EST 1995 Version: 3.1 These FAQs are under significant construction, and may well change form and content over the next weeks. These FAQs focus on various aspects of OpenStep, NEXTSTEP, and NeXT machines. The FAQs are kept on-line at several ftp sites, including: cs.orst.edu sonata.cc.purdue.edu Many FAQs, including these, are available (www, ftp, email) on the archive site rtfm.mit.edu in the directory pub/usenet/news.answers. The name under which this FAQ is archived appears in the Archive-nameline above. Within each section each question will be preceded by a "Subject:" field, allowing news readers to break up the file into separate questions. Each question has its own unique number. Items that appear within sections are not in any particular order, and get added and removed over time. Questions marked with a "+" are new to this issue, and questions with changes since the last issue are marked by a "!". Submissions, corrections, comments, input, etc., should be directed to Nathan Janette . Some important NEXTSTEP & OpenStep Information WWW sites: NeXT, Inc. http://www.next.com/ NeXTanswers http://www.next.com/NeXTanswers/ Stepwise NEXTSTEP/OpenStep Information Server http://digifix.digifix.com/ TABLE OF CONTENTS: ------------------ E1. What Fortran compilers are available for NEXTSTEP? E2. What Lisps are there for NEXTSTEP? E3. What Pascal compilers are available for NEXTSTEP? E4. What should I know about c++ shipped with NEXTSTEP? E5. What Ada compilers are available for NEXTSTEP? E6. Is Perl available for NEXTSTEP? E7. Where can I get gawk? E8. Where can I get Eiffel? ____________________________________________________________________________ Subject: E1. What Fortran compilers are available for NEXTSTEP? There is a fortran to c translator called f2c available via anonymous ftp from the archives. Check the sources directory. Absoft FORTRAN 77 Object Oriented FORTRAN compiler; fully compatible w/ NEXTSTEP's Interface Builder toolkit, allows programmers to add a GUI to any FORTRAN program. They have a screen oriented source level debugger designed by and for FORTRAN programmers, and IMSL FORTRAN Libraries. They have versions for NEXTSTEP/m68k and NEXTSTEP/FIP. 313-853-0050 Numerical Algorithms Group (NAG) FORTRAN 90 for NeXT Modern Fortran fully compliant with ISO/IEC 1539:1991 and ANSI X3.198-1991 standards. (708) 971-2337 OASYS OASYS Native Compilers, OASYS Optimizing 680x0 Cross Compilers, OASYS Optimizing 88000 Cross Compilers (C, C++, Fortran, Pascal available for each) Highly optimized Fortran, Pascal., C and C++ compilers and cross compilers. 617-862-2002. Diab Data (415) 571-1700 ____________________________________________________________________________ Subject: E2. What Lisps are there for NEXTSTEP? Scheme is available from: altdorf.ai.mit.edu. Schematik is a front-end to MIT Scheme for NEXTSTEP; it comes complete with MIT Scheme, so that installing it is in fact also the simplest way to install MIT Scheme. It is available from: ftp.gac.edu ftp.informatik.uni-muenchen.de (European users). There is also a commercial Scheme implementation that supposedly conforms to an IEEE Scheme standard. Cadence Research Systems 812-333-9269 Xlisp is available from bikini.cis.ufl.edu. Changes To make it work with NEXTSTEP: in unixstuf.c: #define BSD in function init_tty: declare extern char xltoplevel() in function read_keybd: change char buf[1] to char buf[100] change sizeof(buf) to sizeof(char) AKCL is available from: sonata.cc.purdue.edu. [bvrotney@ads.com (Bill Vrotney)] adds: But you can actually get a later version from: rascal.ics.utexas.edu pub/NeXT-akcl-1-615.tar.Z Scheme->C Compiler is available from sonata.cc.purdue.edu and gatekeeper.dec.com. ACL (allegro common lisp) used to be bundled with 1.0, now it is available directly from: Franz Inc. 1995 University Avenue Berkeley, CA 94704 Voice: (510) 548-3600, FAX: (510) 548-8252 email info@franz.com. ____________________________________________________________________________ Subject: E3. What Pascal compilers are available for NEXTSTEP? uvapc/NeXT is an ISO standard Pascal compiler developed by the University of Virginia's Academic Computing Center and the Department of Computer Science. uvapc/NeXT passes the ISO standard Pascal validation suite. The compiler is written in C and has been ported to several other Unix platforms. uvapc/NeXT can generate the necessary information so that the GNU source-level symbolic debugger, gdb, can be used (see Caveats below). It also supports obtaining gprof type profiles. Contact is: Mr. Jack Davidson University of Virginia Department of Computer Science, Thornton Hall Charlottesville CA 22903 (804) 982-2209 (804) 982-2214 FAX jwd@virginia.edu p2c, David Gillespie's Pascal to C translator, can be obtained from: csvax.cs.caltech.edu: pub/p2c-1.20.tar.Z. It translates many dialects of Pascal including Turbo, VAX, Sun/Berkeley. But there is a very serious problem in that %g and %lg are used to read reals in the translated code, and these formats are not supported by NeXT in scanf. Gillespie maintains that this is a bug in NeXT's compiler. A fix is to make the following change in funcs.c: [Old code] case TK_REAL: if (var->val.type == tp_longreal) ex = makeexpr_string("%lg"); else ex = makeexpr_string("%g"); break; [New code] case TK_REAL: if (var->val.type == tp_longreal) ex = makeexpr_string("%lf"); else ex = makeexpr_string("%f"); break; Here is a very disturbing example. %lg gives garbage, and %lf even gives garbage when it follows %lg: ariel% more test.c main() { double x, y, z; scanf("%lf%lg%lf%*[^\n]", &x, &y, &z); getchar(); printf("% .5E % .5E % .5E\n", x, y, z); } ariel% cc test.c ariel% a.out 3.14 3.14 3.14 3.14000E+00 6.36599E-314 1.40000E-01 ariel% ____________________________________________________________________________ Subject: E4. What should I know about c++ shipped with NEXTSTEP? Two things to note about the cc++ on NeXT. Any C include files have to be specified as below: extern "C" { #include #include #include #include } This tells that the code is C, so you won't have problems with the standard libraries thinking your program is Objective C. Also the /usr/include/stdio.h in line 75 has a variable "new" that conflicts with a g++ keyword. You can redefine it using #define new __new__ #include "stdio.h" #undef new After the above two fixes, g++ programs that do not use the g++ class library (and therefore do not need libg++ to be available) work. [From: sanguish@digifix.com] The currently available lib g++ is on ftp.next.com [From: Magnus Nordborg ] The cc++ shipped with NEXTSTEP 3.0 is a modified version of gcc-1.93. As shipped, 3.0 does not have the standard C++ headers and library functions (like iostream.h). It is therefore of no use as a C++ compiler (unless you want to write your own i/o routines, etc). There are basically two things you can do to remedy the situation. 1.) Get libg++-1.39.0 and build it using cc++ (some patches are needed, see below). 2.) Get the latest version of gcc and libg++ and build them. They (gcc-2.3.3 and libg++-2.3 that is) compile without problems (you need GNU make and bison, plus at least 40 MB of disk space to build gcc). The second alternative is clearly preferable in that you get a more stable C++ compiler that support "recent" additions to C++. This makes it much more likely that you will be able to use packages from other sources, etc There are two disadvantages: gcc takes up more than 10 MB of disk space, and the version of gdb that comes with 3.0 works less well with it. You should probably not get rid of cc even if you get gcc as the support for NeXT's Objective-C in gcc is not reliable. Here are the instructions for getting libg++-1.39.0: Create a folder, say /me/tmp. % mkdir tmp % cd tmp Get libg++-1.39.0.tar.Z via anonymous ftp from prep.ai.mit.edu from the directory pub/gnu. % ftp prep.ai.mit.edu ... Get NeXTmods-rls3.tar.Z via anonymous ftp from next242.ece.orst.edu from the directory pub. % ftp next242.ece.orst.edu ... Unpack the gnu stuff, and cd to the newly created directory. % zcat libg++-1.39.0.tar.Z | tar xf - % cd libg++-1.39.0 Unpack the mods file while in the newly created libg++-1.39.0 folder. % zcat ../NeXTmods-rls3.tar.Z | tar xf - Create /usr/gnu, and /usr/gnu/lib (writable by whoever is doing this). % mkdir /usr/gnu % mkdir /usr/gnu/lib Change Makefile line 32 to "PWD=/me/tmp/libg++-1.39.0" ^^^^^^^ may need changing Then % make src (takes a while--ignore the warnings) % make install-lib" (puts libg++.a in /usr/gnu/lib) % make install-include-files" (this puts the include files in /usr/gnu/lib/g++-include) % make tests" (this takes rather a lot of disk space). There are differences from the expected output, most likely due to finite precision effects. Make a test program, x.cc, containing: #include main() { cout << " Hello world!\n"; } Compile it. % cc++ -I/usr/gnu/lib/g++-include -O x.cc -L/usr/gnu/lib -lg++ Run it. % a.out It should print Hello world! ____________________________________________________________________________ Subject: E5. What Ada compilers are available for NEXTSTEP? Meridian Software offers a NEXTSTEP Ada compiler. Meridian Software Voice: (800)221-2522 FAX: (714)727-3583 Get adaed. It works like a real ada, with libraries, etc. Gopher/archie gives four pages of locations, but cs.nyu.edu is home base. There seem to be pc and amiga versions as well as unix. cs.nyu.edu:/pub/adaed/Adaed-1.11.0a.tar.Z ____________________________________________________________________________ Subject: E6. Is Perl available for NEXTSTEP? Take most of the features of C, csh, awk, and add a sprinkling from sed, and you get Perl. Practical Extraction & Reporting Language. Perl is very much of a kitchen sink language, in that it has almost all the features of everything. This results in it being easy to write programs in perl (because all your favorite constructs are there) but difficult to read perl. (Because other people have used their favorite constructs, not yours) Perl's strength is in scripting. Anything that would take more than 20 lines in a csh script is a candidate. Anything that isn't a straight pass through, chew on each line, program for awk is a candidate. Current version: 4.036 Perl is available from: jpl-devvax.jpl.nasa.gov (128.148.1.143) tut.cis.ohio-state.edu (128.146.8.60) uunet.uu.net (192.48.96.2) While Perl does come with a 70 page man-book, an easier way to learn the language is from "Programming Perl" Larry Wall & Randal Schwartz. O'Reilly & Associates 632 Petaluma Ave Sebastopol CA 95472 Voice: 800-998-9938 Voice: (707) 829-0515 nuts@ora.com [From: "Randal L. Schwartz" ] Or, my new book, "Learning Perl". Much better for beginners. ____________________________________________________________________________ Subject: E7. Where can I get gawk? Gawk, as with all FSF GNU software is available in source form from: prep.ai.mit.edu Gawk is the Gnu version of Awk. Like most of the other GNU programs Gawk has more features than does awk. Further unlike the wretched man page for awk that comes with NEXTSTEP, Gawk comes with a 140 page manual/tutorial. Gawk is a text processing language. In this respect it is similar to sed. However Gawk adds to sed conditional execution (if) subroutines, and the ability to execute a block of instructions before and after the file itself is processed. gawk is not the only public-code awk. Mawk version 1.1, published through comp.sources.reviewed in February, 1992, by Mike Brennan , should be mentioned as an alternative. References for Gawk/awk: Sed & Awk, Dale Dougherty, O'Reilly & Associates The Awk Programming Language Alfred V. Aho, Brian W. Kernighan, & Peter J. Weinberger Addison-Wesley Publishing Co. ISBN 0-201-07981-X ____________________________________________________________________________ Subject: E8. Where can I get Eiffel? A port of the Eiffel language and development environment is available for NEXTSTEP. The company is: Interactive Software Engineering, Inc. Voice: (805)685-1006 FAX: (805)685-6869 eiffel@eiffel.com The port is for Eiffel version 2.3 and includes their standard class libraries as well as some additional NeXT-specific classes and facilities for integration with the Interface Builder. A free eiffel-like language called Sather is available via ftp from icsi-ftp.berkeley.edu ____________________________________________________________________________ Editor: nathan@laplace.csb.yale.edu -- Nathan Janette Systems Manager, Axel T. Brönger Lab Internet: nathan@laplace.csb.yale.edu