GithubHelp home page GithubHelp logo

dbremner / cupl Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 304 KB

Eric S. Raymond's implementation of the CUPL programming language with bug fixes

License: Other

Makefile 2.92% C 75.03% Lex 7.19% Yacc 12.86% Shell 2.00%

cupl's Introduction

			CUPL and CORC for UNIX
		by Eric S. Raymond <[email protected]>

This directory contains sources for cupl, a UNIX implementation of CUPL, the
Cornell University Programming Language.  It also interprets CORC, the 
Cornell Computing Language, the immediate ancestor of CUPL.

CUPL was an early (1966) teaching language implemented as a batch compiler on
the IBM/360 at Cornell University.  It was descended from an earlier (1962)
experimental language called CORC (CORnell Compiler), which was in turn derived
loosely from Algol-58 (not, as previously asserted here, PL/1).

CUPL has only one scalar type, a long floating-point real corresponding to C
double.  It supports vector and matrix aggregates, and has operations
specialized for matrix calculations.

CORC is a near-subset of CUPL.  There are some minor differences in keywords.
In CORC, the statement GO TO <block> is equivalent to CUPL's GO TO <block> END.

The cupl implementation is a Retrocomputing Museum project.  The
Retrocomputing Museum <http://www.catb.org/retro/retromuseum.html>
revives long-dead languages for the benefit of students and historians
of programming-language design.  CUPL was chosen as a representative
of a significant class of mid-1960s teaching languages.

Files:

			Documentation files

README			-- this file
cupl.doc		-- transcription of the original CUPL documentation
corc.doc		-- transcription of the original CORC documentation
cupl.xml		-- description and discussion of the language
cupl.spec		-- project history is in this RPM spec file

			Source files

Makefile		-- project makefile
cupl.y			-- the YACC grammar
cupl.l			-- the LEX lexical-analyzer description
cupl.h			-- fundamental types and defines 
tokdump.c		-- token-dumper code (used for debugging)
interpret.c		-- parse tree interpretation
execute.c		-- actual execution
monitor.c		-- runtime support
main.c			-- cupl's main sequence

			CUPL samples
(These are all the non-pathological program examples from the CUPL manual)

test/cubic.cupl		-- iterative solution to X**3 * 3*X + 1 = 0
test/fancyquad.cupl	-- third, fanciest version of quadratic solver
test/poly11.cupl	-- sum for k = 1 to 11 of k!x**k, plus 1
test/power.cupl		-- compute the sum as k goes from 1 to n of k!/x**k
test/prime.cupl		-- test a number for primality
test/quadratic.cupl	-- solve multiple quadratic equations
test/random.cupl	-- print 10 pseudo-random numbers
test/rise.cupl		-- compare iterated +, doubling, squaring, and *
test/simplequad.cupl	-- simplest version of quadratic equation solver
test/squares.cupl	-- print a table of squares
test/sum.cupl		-- compute sum of presented data

			CORC samples
(These are all the complete program examples from the CORC manual)

test/factorial.corc	-- compute the factorial function
test/powercorc.corc	-- compute the sum of a power series
test/quadcorc.corc	-- solve multiple quadratic equations
test/sumsquares.corc	-- compute sums of first n integers and squares
test/title.corc		-- illustate use of NOTE, TITLE, and WRITE

For each .cupl or .corc file, there is a corresponding test file used for
regression-testing of the interpreter.  The interpreter should pass
all these tests.

			Other test files
MAKEREGRESS		-- generate regression test loads for the front end
REGRESS			-- perform regression test on the front end

			Known problems and bugs:

* The code chrestomathy in the CUPL manual didn't include any matrix algebra
  examples.  Because of this, the matrix algebra facilities are incomplete. 
  ALLOCATE, INV and DET are not implemented.  Neither are subscript/slice
  references or assignments.  Nor are matrix WRITEs or READs. Nor are the
  implemented matrix facilities at all well-tested.

* For true verismilitude, a program listing should be output before results.
  This is trickier to do in C than it sounds; the lexer doesn't know about
  line boundaries.

* GOTO blabel END always goes to the end of the current PERFORM block, even
  if the label is that of an enclosing block.

* Because the cupl interpreter also interprets CORC, the CUPL keywords
  BEGIN, DEC, DECREASE, EQL, GEQ, GTR, INC, INCREASE, INT, LSS, NEQ, NOTE,
  REPEAT, TITLE, UNTIL, and $ are also reserved words in CORC.

Send comments, bug reports, and fixes to [email protected].  Also see my
home page at http://www.catb.org/~esr for updates and other related
resources.

cupl's People

Contributors

dbremner avatar eric-s-raymond avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.