Giter Club home page Giter Club logo

tiny-interpreter's Introduction

tiny-interpreter

INFO: currently only lexing is implemented, you shouldn't use this language ๐Ÿ’€

Learning and applying concepts from the building compilers class in go (building an interpreter (soph) for my own programming language, teolang). The interpreter does not use any external dependencies.

Setup and running

requires git and go

git clone https://github.com/xNaCly/tiny-interpreter.git
# this will start the repl:
go run .

Building

git clone https://github.com/xNaCly/tiny-interpreter.git
# this will start the repl:
go build -o soph

Interpreter

The interpreter supports a sophisticated scripting language called the teolang (file ending *.teo)

Operating modes

REPL

To run the interpreter in read eval print line mode, simply invoke it by calling the built binary or following the steps above and running it using go run ..

File mode

To feed the interpreter a file to execute, simply call the interpreter with the file to run as an argument:

soph file.teo

Command line arguments

Help

To view the help invoke the interpreter with either the -h or the --help flag:

soph -h
soph --help
go run . -h
go run . -help

This readme will probably not be as up to date as the above command. Run the executable and take a look at the help output for more info.

Examples

Take a look at the *.teo files in the /examples directory. To run an example, run the following command:

sophia hello_world.teo

tiny-interpreter's People

Contributors

xnacly avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

layanohateyou

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.