cdchoy / ppcc

A Powerpoint CPU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PPSuite

Presenting the future of software development: Powerpoint.

Uncommon Hacks Hackathon 2019 Submission. See the Devpost project here: https://devpost.com/software/ppcc. Awarded "Most Technically Impressive 2019"

Abstract

What if you could execute your C code in Powerpoint?

At Carnegie Mellon's 11th annual SIGBOVIK in 2017, Tom Wildenhain unveiled the Powerpoint Turing Machine (aka PPTXTM), a Turing Machine that could function entirely in Powerpoint. The implications? Groundbreaking. The usability? Lacking. To operate the PPTXTM, one needs to write executable punch cards; a technique made obsolete in the 1960s.

And so in 2019, we are proud to introduce the PPSuite, a collection of software engineered to greatly improve your Powerpoint programming experience.

  • PPCPU: a cpu built on Turing Machines that function entirely in Powerpoint. This includes 256 bytes of memory, 8 registers, an instruction code heap, and several Arithmetic Logic Units implemented on Turing Machines.

  • PPAPI: a collection of functions for interfacing with Powerpoint and our PPTXTMs

  • PPCC: a compiler that will convert a .c file to a .ppasm file, out own ASM format

  • PPEXE: an executor to handle read/writes as well as instruction decoding, loading, and execution. All meaningful computation and storage is still performed on PPCPU.

  • PPASM: our custom assembly language

Motivations

  • no one tried to stop us
  • good memes
  • we're trying to remove powerpoint from the App Store

The Team

Architecture

C -> ELVM -> PPASM -> PPEXE <-> PPAPI <-> PPCPU

We convert C language to PPASM, our custom assembly language for interfacing with PPCPU. To bridge these 2 languages, we utilized a personally modified version of the Esoteric Language Virtual Machine, ELVM, to produce PPASM. From here, PPEXE loads the instructions into PPCPU using PPAPI.

Next, we decode through the instructions using PPEXE, a Python executor that functions solely to make ordered calls to our PPAPI. PPAPI utilizes AutoHotKey to abstract out the human clicker required for manually executing our PPTXTM cycles.

Usage

To use our PPSuite, a user will need to write a C file, say foo.c, and then compile it to PPASM with:

$ python3 ppsuite/ppcc <some c file>

Next, open the PPCPU PowerPoint. Make sure your default screen is 1920x1080, or else the screen detection and autohotkey input won't work (TODO- detect resolution and auto adjust)

Next, run the program with

$ python3 ppsuite/ppexe <some .ppasm file>

Virtualization

Want to develop on the PPCPU but don't meet the dependency requirements? There's a virtual machine option in the PPAPI class that should be able to run a virtual PPCPU with basically no dependencies. It'll run everything on a PPCPU simulator instead of a real powerpoint. (We know it kinda defeats the purpose, but 2 second runtime makes testing significantly easier than a 5 minute one.)

To do so, you'll need to make a PPEXE object with the ppt specified as None. Then, you'll need to update the if __name__ == "__main__" section in ppexe.py. Then, you should be able to remove the win32* dependencies as well as anything to do with window management (just try removing stuff until it breaks).

TODO- make virtualization usage more streamlined

Challenges

  1. We had no a priori knowledge on how Turing Machines or Punch Cards actually worked...

  2. While it is theoretically possible to reduce all programming languages to Turing Machine language, it has been neither proven nor implemented. And so our initial plan to convert C -> Brainfuck -> Turing Machine -> PPTXTM Punch Cards, was immediately established as both nontrivial and night impossible given our time and resources. Thus, we aimed to produce a CPU that could execute all meaningful computation in Powerpoint rather than a C->PPTXTM compiler (formally known as PPCC).

  3. PPTXTM's tape length is unfortunately finite. In this implementation, we wrote all code to function on a Turing Machine with a relatively small 8 bits and 8 states. Since 1600+ animations are required to run this, and Since our tape was not long enough to support reading and writing, we utilized Python for reading and writing to our PPT memory/registers/tape.

Code Dependencies

  • Microsoft Powerpoint
  • Python 3.7
  • AutoHotKey
  • win32COM
  • 1920x1080 aspect ratio (we wish we were joking; all the input values are hardcoded to this size)

Acknowledgements

We'd like to thank Tom Wildenhain for their work in creating and distributing PPTXTM, Uncommon Hacks for hosting this Hackathon, and Microsoft for creating the omnipotent software, Powerpoint.

About

A Powerpoint CPU


Languages

Language:C 91.9%Language:C++ 4.0%Language:Makefile 1.2%Language:Python 0.9%Language:Assembly 0.5%Language:CMake 0.4%Language:Shell 0.3%Language:AutoHotkey 0.3%Language:Perl 0.3%Language:HTML 0.2%Language:Batchfile 0.1%Language:Ruby 0.1%Language:JavaScript 0.0%Language:Emacs Lisp 0.0%