Thanks to visit codestin.com
Credit goes to github.com

Skip to content

One typical algorithm, implemented in multiple languages on multiple time-sharing operating systems

Notifications You must be signed in to change notification settings

timereshared/project-tpk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Project TPK

The purpose of this repository is to collect

  • implementations of TPK, a typical algorithm, in many languages that ran on time-sharing operating systems.
  • compilation runs and listings for those programs, created by running them on emulated time-sharing systems.

Why?

  • Provide a single place where programs and listings can be seen for comparative purposes.
  • Often when trying to get old code to run on these systems (or to write new code) it is not clear how to compile them, get them to do I/O with the operating system etc. By demonstrating what needs to be done in a simple program this should make bootstrapping of other code easier to do.

What is the TPK algorithm?

Donald Knuth and Luis Trabb Pardo wrote a paper called The Early Development of Computer Languages in 1977 where they compared several pre-1957 programming languages. This paper is collected in A History of Computing in the Twentieth Century and Knuth's Selected Papers on Computer Languages

In order to provide a short example of code in each language they came up with a simple algorithm to do the following:

    read 11 numbers to an array
    for each x in in reverse order of the array
        calculate √|x| + 5x³
        print that number if ≤ 400, else print TOO LARGE

This is not supposed to be a particularly useful task, but in a short program demonstrates many typical language features like I/O, loops, arrays, functions and conditionals.

More information can be found at Wikipedia, and other sample implementations can be found at Rosetta Code.

Structure

Under programs/ you will find implementations of the algorithm sorted by programming language. Currently we have:

Under listings you will find compilation runs and output listings, sorted by operating system. Currently we have:

READMEs in each directory provide cross links between the two

License

All work here is under a CC0 license unless mentioned otherwise. In some cases I have adapted work from Rosetta Code or elsewhere: if so I will note that on the affected items.

Contributions

I plan to (slowly) fill this repo out with more example. I would also welcome contributions via pull requests for other high level languages or operating systems. The only rule is that code must run on a pre-1983 time-sharing operating system available through emulation.

About

One typical algorithm, implemented in multiple languages on multiple time-sharing operating systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published