Giter Club home page Giter Club logo

windows9x's Introduction

Windows9x

Windows9X is the operating system of future's past. What if Windows 98 could generate any application that you wanted on the fly? You enter the description of a program you want inside of the run dialog and the OS creates that for you on the fly. This is an experiemnt in end user programming and seeing what it could be like if an OS could write applications for you as you needed them.

filesystem.mp4

Getting started

Create a .env file with one of the following in the root directory:

ANTHROPIC_API_KEY=<your-anthropic-api-key>

or

OPENAI_API_KEY=<your-openai-api-key>
  1. Install bun
  2. Run bun install
  3. Run bun run dev
  4. Navigate to http://localhost:3000

How does this work?

When you enter a description of an application, an LLM is prompted to generate an HTML file that looks like a windows 98 application. This is done by injecting 98.css into the page as we stream in the result. This is rendered inside of an iframe that is rendered inside of a window.

In addition applications have access to a limited OS API that allows for saving/reading files, reading/writing from the registry, and prompting an LLM.

OS API

This is the api that applications have access to in case it helps with prompting:

declare global {
  // Chat lets you use an LLM to generate a response.
  var chat: (
    messages: { role: "user" | "assistant" | "system"; content: string }[]
  ) => Promise<string>;
  var registry: Registry;

  // If the application supports saving and opening files, register a callback to be called when the user saves/opens the file.
  // The format of the file is any plain text format that your application can read. If these are registered the OS will create
  // the file picker for you. The operating system will create the file menu for you.

  // The callback should return the new content of the file
  // Used like this:
  // registerOnSave(() => {
  //   return "new content";
  // });
  var registerOnSave: (callback: () => string) => void;

  // Register a callback to be called when the user opens the file
  // The callback should return the content of the file
  // Used like this:
  // registerOnOpen((content) => {
  //   console.log(content);
  // });
  var registerOnOpen: (callback: (content: string) => void) => void;
}

// Uses for the registry:
// - To store user settings
// - To store user data
// - To store user state
// - Interact with the operating system.
//
// If the key can be written by other apps, it should be prefixed with "public_"
interface Registry {
  get(key: string): Promise<any>;
  set(key: string, value: any): Promise<void>;
  delete(key: string): Promise<void>;
  listKeys(): Promise<string[]>;
}

Thanks

I want to thank the following people:

  • Scratch - Inspired me by getting Windows 98 to run inside of a VM inside of Websim.
  • Nate - Nate and I independently started building the same project. Nate gave me the idea of "chatting with the developer" to change the program.
  • Jordan - Make 98.css which is the basis that makes this look like Windows 98.

Demos

Here are a few examples of applications that can be created:

Everything in Windows9X is a file you can generate a program to generate another program

Everything.is.a.file.mp4

Here is an example of an application that is generated that in turn can generate websites.

windows_making_browser.mp4

Creating a natural language SQL prompter

sql.mp4

windows9x's People

Contributors

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