From: nathan@laplace.biology.yale.edu (Nathan F. Janette)
Subject: NeXT-FAQ.languages:  Questions about programming languages on the NeXT
Reply-To: nathan@laplace.biology.yale.edu
Organization: Yale University, Department of Computer Science, New Haven, CT
Date: Thu, 23 Jul 1992 21:49:05 GMT
Expires: Fri, 28 Aug 1992 00:00:00 GMT

NeXT-FAQ.languages:  Questions about programming languages on the NeXT


*** Subject: L1. What Fortran compilers are available for the NeXT?

There is a fortran to c translator called f2c available
via anonymous ftp from purdue in
/pub/next/2.0-release/binaries specifically for the
next. 

There is a commercially available fortran:

	Absoft (313) 853-0095
	Diab Data (415) 571-1700


*** Subject: L2. What Lisps are there for the NeXT?

Scheme is available from altdorf.ai.mit.edu.  A quick
tutorial on how to install it on the NeXTs is in the works. 
Schematik is a NeXT front end app available on the archive
servers.

Xlisp is available from bikini.cis.ufl.edu.  Changes
To make it work on the NeXT: 

	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.

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: L3. What Pascal compilers are available for the NeXT?

p2c, David Gillespie's Pascal to C translator, can be
obtained from csvax.cs.caltech.edu in
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% 

[this seems to be a good task for a compiler wizard to look
at... -pasc] 


*** Subject: L4. What should I know about c++ shipped with the NeXT?

cc++ shipped with the NeXT 2.0 is actually: NeXT Release
2.0 (v31.1) -- GNU version 1.36.4 (based on GCC 1.36)
libg++ is not provided, you need to compile it (GNU
software is available from prep.ai.mit.edu). 

Two things to note about the cc++ on NeXT.

Any C include files have to be specified as below:

	extern "C"
	{
	#include <libc.h>
	#include <stdio.h>
	#include <stdlib.h>
	#include <math.h>
	}

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. 


*** Subject: L5. What Ada compilers are available for the NeXT?

At NeXT Fed-Expo Meridian Software demonstrated a NeXT
Ada compiler. 

	Meridian Software
	Voice: (800)221-2522
	FAX: (714)727-3583


*** Subject: L6. Is Perl available for the NeXT?

Take most of the features of C, csh, awk, and add a
sprinking 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.035 

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-338-6887
	Voice: (707) 829-0515
	uunet!ora!nuts.


*** Subject: L7.  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 the
Next, 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 <brennan@boeing.com>, 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: L8.  Where can I get Eiffel?

A port of the Eiffel language and development
environment is available  for the NeXT. 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 Janette nathan@laplace.csb.yale.edu


--
Nathan Janette		"I'm a NeXTstep man,
Dept MB&B, Yale Univ	 I'm a NeXTcube guy"
New Haven, CT
nathan@laplace.biology.yale.edu (NeXT)

Newsgroups: comp.sys.next.announce