Skip to content
This repository has been archived by the owner on Aug 19, 2019. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mseddon committed Jan 2, 2019
0 parents commit c338599
Show file tree
Hide file tree
Showing 14 changed files with 6,152 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
www/bundle.js
www/bundle.js.gz
www/bundle.js.map
doc
build
.vscode
*~
.idea
www/glTF-Sample-Models
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Prototype REPL interface for Calva.

## Description

This repo contains a prototype HTML5 REPL control, currently supporting syntax highlighting, selection, keyboard navigation and clipboard support.

Ultimately it is intended to be a general presentation stream REPL interactor, in the vein of CLIM, Symbolics Open Genera and the earlier MIT CONS and CADR, with a modern twist. It is not directly tied to any language, so eventually it should be portable to any language you fancy, including ECMAScript.

## Presentation What?

You can think of a *presentation stream* as a stream much like stdout/stdin, but supporting rich user interface controls. Not only can you push text through it, you can push *any* data through it, and custom controls that react to that data are created inline to display and edit it. If you have ever used `Mathematica` or `Gorilla REPL`, you have an idea how this works.

## Purpose

Calva doesn't currently support a dedicated REPL display, but uses the builtin VSCode terminal. With exciting new features in Clojure 1.10, such as `datafy` and `nav`, it is now possible to build rich inspectors in Clojure
in the vein of [CLIM](http://web.archive.org/web/20120707045546/http://www.mikemac.com:80/mikemac/clim/cover.html).

Sadly, VSCode's editor does not support rich HTML embedded in a `vscode.TextDocument`, but the abilty to display interactive graphs, tables, etc. at the REPL is too tempting to pass by. Fortunately VSCode *does* support `WebView`, which allows us to have an embedded html view.

Thus, this project was born. It is still rather an experiment- since we are an isolated web page within vscode,
we literally need to re-build a syntax highlighting editor, undo/redo support etc from the ground up.

Currently what we have is a simple console control, but by layering atop this, more shininess can be added.

## Goals

* A reusable (not tied to VSCode/Calva) html REPL.
* High performance
* Auto indent
* Paredit
* Completions
* Customizable presentation types

## Trying it out

The build is fairly trivial, horay.

clone this repository, and from within the directory:

`$ npm i`

`$ npm run dev`

Now point your browser at `http://localhost:8080` and type away. The REPL is not yet connected, it is effectively a dumb terminal with syntax highlighting for now.
13 changes: 13 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*Smart update the selection-
* do not change any lines that don't need to be.
*mouse selection
*Delete range on insert.
*clipboard handler
*insertString cursor positioning on paste is wrong
undo <<<
-----------------------------------------
proper re-startable lexer again...

match-parens

auto-indent
1 change: 1 addition & 0 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"],
"watch": ["src/server"],
"exec": "npm start",
"ext": "ts"
}
Loading

0 comments on commit c338599

Please sign in to comment.