Skip to content

Commit

Permalink
Wheeler v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
built committed Jul 29, 2011
1 parent c09c8e5 commit 162678e
Show file tree
Hide file tree
Showing 32 changed files with 1,319 additions and 818 deletions.
22 changes: 19 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
What's going on here?
---------------------
This is the Wheeler programming language. It is probably different from other languages you've seen.

There is a REPL that is handy for playing with the language. Just run ./bigwheel

Wheeler doesn't have much implemented yet but you can do some simple things in the REPL such as printing strings and adding numbers. Try it!
Wheeler doesn't have much implemented yet but you can do some simple things in the REPL such as printing strings or experimenting with transitions (one of the core language features).

There is also an interpreter that you can execute from the commandline like so: ./wheeler
There is also an interpreter that you can execute from the command line like so: ./wheeler

Wheeler is currently built on top of Python 2.5 and also runs well in 2.6. Python 3 hasn't been tested but may be.

Requirements
------------
* Python 2.7
* the AssociativeTools library https://github.com/built/AssociativeTools


How do I run this?
------------------
You'll need to have the Associative Tools library in your PYTHONPATH.

After that just type ./bigwheel and you should see the Wheeler prompt.


Feedback
------------------
I've love your feedback, ideas, and contributions. matt-at-youell-dot-com or @built on twitter.
11 changes: 0 additions & 11 deletions Readme.txt

This file was deleted.

52 changes: 0 additions & 52 deletions bigwheel

This file was deleted.

1 change: 1 addition & 0 deletions bigwheel
48 changes: 39 additions & 9 deletions bigwheel.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
#!/usr/bin/env python
from category import Category
from category.stdout import printer
import fileinput
import sys
from interpreter.tools import parse
from interpreter.tools import parse, evaluate
from common import *
import os

def load_prelude():

for line in open( os.path.dirname(os.path.abspath(__file__)) + "/prelude.w", "r"):
line = line.strip()
# Comment stripper. Fragile!
line = line[:line.find('#')] if '#' in line else line

# Ignore blank lines
if line:
evaluate( parse(line, ROOT), ROOT )

exiting = False

print "%s\nType 'exit' to quit." % VERSION
print "%s\nType 'exit', 'quit', or 'q' to quit." % VERSION

exit_commands = ('exit', 'quit', 'q')
clear_command = ('clear',)
help_command = ('help',)

help_text = """Commands:
'exit', 'quit', or 'q' to end session
'clear' to clear screen"""

load_prelude()

while not exiting:

line = raw_input(">> ").strip()
command = line.lower() # The line may be a REPL command.

if command in exit_commands:
exiting = True
break
Expand All @@ -29,14 +46,27 @@
continue

if command in ('help',):
print """Type 'exit' or 'quit' to end session or 'clear' to clear screen"""
print help_text
continue

if command in ('reset',):
ROOT = Category("*")
ROOT.add(ROOT)
load_prelude()
print "* was reset"
continue



# Ignore blank lines
if line:
result = parse(line, ROOT).evaluate()
if result.contents.keys():
print result.contents.keys()[0]
relations_before = len(ROOT.terms)
evaluate( parse(line, ROOT), ROOT )
relations_after = len(ROOT.terms)
# print "%i relations created. Current total: %i" % ( (relations_after - relations_before), relations_after)
# print "%i patterns now exist." % len(ROOT.comprehend("pattern"))

# CategoryInspector(ROOT).dump_to_file("bigwheel.dot")
# CategoryInspector(ROOT).dump_to_file_especial("bigwheel.dot")



Expand Down
12 changes: 0 additions & 12 deletions buid.sh

This file was deleted.

Loading

0 comments on commit 162678e

Please sign in to comment.