Giter Club home page Giter Club logo

borax's Introduction

Borax

B interpreter.

B was developed at Bell Labs by Ken Thompson and Dennis M. Ritchie. The target application was system software for minicomputers.

Supports

  • Bitwise complement operator ~
  • break; statement performs the equivalent of a goto out of nearest switch or while statement.
  • Automatic vector declarations use square brackets to indicate size.
  • Vectors declared with size N actually hold N+1 words. The bonus 1 word of space can be ignored or not. In particular vect[N] is not an error.
  • Octal numeric constants may include 8s and 9s, i.e. 09 = 011.

Example

main() {
  extrn printf, getchar, time, exit;
  auto timev[2];

  printf("What is my task...*n");
  printf("o - print Hello World*n");
  printf("t - print system time*n");
  printf("x - exit immediately*n");
  printf("> ");

  switch getchar() {
    case 'o':
      printf("Hello World!*n");
      goto done;
    case 't':
      time(timev);
      printf("The system time is (%d,%d)*n", timev[0], timev[1]);
      goto done;
    case 'x':
      printf("As you wish--");
      exit();
      goto done;
  }

  done: printf("End of Program*n");
}

References

  • Users' Reference to B (1972) by Ken Thompson
  • Bell Laboratories Computing Science Technical Report #8: The Programming Language B (1973) (Brian Kernighan, Steve Johnson)

borax's People

Contributors

evanrinehart avatar

Watchers

 avatar

borax's Issues

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.