GithubHelp home page GithubHelp logo

silky / spl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drsam94/spl

0.0 3.0 0.0 241 KB

A Compiler for the Shakespeare Programming Language Written in Python. Compiles from SPL to C.

License: The Unlicense

C++ 1.19% Shell 0.42% Python 98.40%

spl's Introduction

Spl
===

Shakespeare Compiler written in Python, splc.py
This is a compiler from SPL to C that implements the majority of the Shakespeare programming
language invented by Kalle Hasselstrom and Jon Aslund, I take no credit for inventing the language.
This software is free to edit, use, or sell, but I wouldn't mind if you attached the following
copyright notice to any work that utilizes this project
(c) Sam Donow 2014-2015
[email protected]
[email protected].

This compiler implements most features of the Shakespeare Programming language described at
http://shakespearelang.sourceforge.net/report/shakespeare/

The following features have yet to be or may never be implemented:

- Stacks (because who needs data structures in Shakespeare, really?)
- multiple-word nouns in cases where using just the last word would generate any confusion

The following feature not in the original language spec is implemented but is a work in progress:

In the original language spec, goto statements take the form "let us proceed to scene III", "let us return to act I",
etc. As this is both awkward and non-Shakesperian, I have made it so that you can use the name of an act or scene (not case,
punctuation, or whitespace sensitive) in place of a this awkward structure. Therefore, if you had
Act I: The Forest.

Then the sentence "let us return to the forest" is equivalent to "let us return to act I".

Like standard gotos, you can not jump to a scene within an act other than the one you are currently in.

The following are planned features not in the original language spec that may be implemented in
later versions of this compiler

- Support for word replaces of functions: If the goal of Shakespeare is to make programs look like plays, then it
  is sub-optimal having to use words like "square root" all over the place, so I may add a way to define equivalent
  words for math functions in a text file.

To use spl, simply run

$ ./spl [Input File]
$ ./a.out

Or, if you would like, you can run

$ python2 splc.py [Input File] > [Output File]
$ gcc [Output File] -lm
$ ./a.out

The spl script should work in any bash terminal, on Windows, the explicit python method should work if you have
all of the right programs installed. I may at some time get around to writing a .bat script for Windows users.

Depenencies:
Python (2.X or 3.X)
gcc

spl's People

Contributors

drsam94 avatar kikithegecko avatar

Watchers

 avatar  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.