Skip to content

Commit

Permalink
initial public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jayconrod committed Jul 6, 2014
0 parents commit b099a33
Show file tree
Hide file tree
Showing 140 changed files with 22,750 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2014, Jay Conrod. All rights reserved.

The Gypsum bootstrap compiler in the `compiler` directory is licensed
under the GNU General Public License v3, which can be found in
compiler/LICENSE.txt.

The CodeSwitch virtual machine in the `vm` directory is licensed under
a 3-clause BSD license, which can be found in vm/LICENSE.txt.

gypsum-mode.el is licensed under a 3-clause BSD license, which can be
found in tools/gypsum-mode.el itself.

Sample programs in the `examples` directory are under a Creative
Commons Zero (CC0) license. They should be considered to be in the
public domain with no restrictions.

Data files in the `common` directory are not expected to by
copyrightable. In case some jurisdiction considers them copyrightable,
they are also licensed under CC0 and are in the public domain with no
restrictions.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Introduction

Gypsum is an experimental new programming language. In the future, it
will be useful for developing high-performance desktop and web
applications and games.

Gypsum is a compiled, statically-typed, object-oriented language. Once
the compiler is more fully implemented, it will be functional as
well. The compiler generates bytecode for a virtual machine,
CodeSwitch. CodeSwitch currently provides basic interpretation and
memory management. Eventually, it will have an optimizing JIT compiler
and will be able to execute bytecode for other languages.

The syntax of Gypsum is inspired by Python and Scala. It is designed
to be simple, requiring less extraneous punctuation than most
languages. Here's how "hello world" is written:

```
def main =
print("Hello, world!\n")
```

You can find several simple programs in the `examples` directory.

# Projects

## Compiler

The Gypsum bootstrap compiler can be found in the `compiler`
directory. It is written in Python (2.7). Once the language is mostly
complete, the compiler will be rewritten in Gypsum.

To run the compiler:

```
cd compiler
./compiler program.gy -o program.csp
```

To test the compiler:

```
python -m unittest discover
```

## Virtual machine

The CodeSwitch virtual machine can be found in the `vm` directory. It
is intended to be minimal. Currently, it can load packages (.csp
files), manage memory (including a basic copying garbage collector),
and interpret bytecode (with a simple switch loop).

To build and test the VM:

```
cd vm
make -j
```

To run a package:

```
out/driver program.csp
```

## Other goodies

An experimental Emacs major mode for Gypsum is in
`tools/gypsum-mode.el`. It provides basic syntax highlighting.

To install, use `M-x package-install-file`, then add this to your `.emacs`:

```
(require 'gypsum-mode)
```

## Dependencies

* Python 2.7 is needed to run the compiler and to generate some files
needed for CodeSwitch.
* PyYAML is needed to parse some data files needed for the Gypsum
compiler and for CodeSwitch.
* G++ 4.8 or any other C++ compiler which supports C++11 is needed to
build CodeSwitch. Other binutils are assumed as well.
* GNU Make 3.81 is needed to build CodeSwitch.

Gypsum and CodeSwitch were developed and tested on Ubuntu 13.10. They
will hopefully work on other platforms with minimal modification, but
nothing else is supported right now.
Loading

0 comments on commit b099a33

Please sign in to comment.