The Ghost Programming Language
Ghost is a small, object-oriented, embeddable toy scripting language. While object-oriented, Ghost also supports procedural and functional programming styles as well.
Ghost is dynamically typed, runs by a tree-walking interpreter, and has automatic memory management thanks to its implementation through the Go programming language. Ghost’s implementation in Go has no dependencies.
Currently in active development. Not feature complete.
You will find robust, user friendly, and updated documentation on our website.
If you’re on mac, you may use
$ brew tap ghost-language/ghost $ brew install ghost-language/ghost/ghost
If you have Go installed, you may use
go install github.com/ghost-language/ghost
You may download the compiled binaries for your platform from our GitHub releases page.
- To build and execute Ghost, run
- To build Ghost, run
- To execute tests, run
$ git clone firstname.lastname@example.org:ghost-language/ghost.git $ cd ghost $ make Ghost (dev-nightly) Press Ctrl + C to exit >>
You can execute code written in Ghost in various ways using the CLI.
Ghost includes a simple REPL to write and execute Ghost code directly in your terminal. To enter the REPL environment, run
ghost on its own:
$ ghost Ghost (dev-nightly) Press Ctrl + C to exit >>
To execute a Ghost source file (
.ghost), pass either the relative or absolute path of the file to
ghost. The source file will be executed and then exit back to the terminal.
$ ghost examples/fibtc.ghost 9227465 $
Interactive mode allows you to execute a Ghost source file, and then immediately jump into a REPL session with the state of the source file still intact. To enter interactive mode, pass the
-i flag to
$ ghost -i examples/fibtc.ghost (executed in: 350.374µs) >> x 9227465 >>
Ghost is hosted and distributed through GitHub. We utilize GoReleaser to automate the release process. GoReleaser will build all the necessary binaries, publish the release and publish the brew tap formula. The following steps outline the process for maintainers of Ghost:
- Ensure you have a GitHub token with
repoaccess saved to your environment:
- Ensure the internal version reference is updated: “`go // version/version.go
var ( Version = “x.y.z” )
3. Create a new tag:
$ git tag -a vx.y.z -m “Release description” $ git push origin vx.y.z
4. Run GoReleaser:
$ goreleaser “`
Ghost is open-sourced software licensed under the MIT license. See the LICENSE file for complete details.