Giter Club home page Giter Club logo

servo's Introduction

Servo

Servo is a simple interpreted scripting language with syntax similar to JavaScript. The language was designed to build simple HTTP APIs with a builtin 'app' object with an API similar to Express.js.

This language was built following the book Writing an Interpreter in Go by Thorsten Ball.

Installation

go install servo

Usage

REPL

run the command servo

Scripts

run the command servo path/to/file.sv

Docker

I have no official image up yet. Build your own image from the Dockerfile in this repository.

Documentation

None made so far

TODO List

  • Comments using #
  • Single quotes for strings
  • String infix operators
  • Integer/Boolean infix operators
  • Fix comment parsing so quotes and special characters work
  • Fix string parsing to include the single quote
  • Fix string parsing to escape the special characters like \n \t etc.
  • Add import keyword to import specific identifier objects from a file
  • Get null working
  • Bitwise operators >>, <<, |, &, &^
  • Automatic semicolon insertion
  • Increment/Decremnt by operators += , -= , *= , =
  • Power operator ^
  • Implement floats
  • Add simple classes with fields and methods and inheritance
  • Rename structs/interfaces/functions to their proper names (Expression vs Statement etc.) so everything is consistent
  • Add instanceof operator for classes, e.g. fooInstance instanceof FooClass
  • Implement bytes
    • Syntax: b{'|"}hello world{'|"} or b{"|'}h{"|'}
    • Like strings they can be concatontated with the + operator like b'h' + b'i' = b'hi'
    • Both a single byte and a byte buffer, e.g. b'hi' = [b'h', b'i']
  • Rewrite lexer/parser to use runes
  • Multiline Comments /* */
  • String escaping e.g. \\b or "\"hello\""
  • Hex digits e.g. 0xfff
  • Wrapper for Go's HTTP functions
    • Routing string parser
    • Route function
    • Route middleware
    • Static files
    • Forms
  • Templates
  • Documentation and examples
  • Dot notation for hashes
  • Add line and column location to tokens (for better debugging)
  • Add for/while loops
  • Add try/catch
  • Add import './file.svo' as file syntax to import
  • Add import func from './example.svo' as function syntax to import
  • Change import so it builds the AST during the parsing stage rather than evaluation
  • Change array index expression to accept colons like arr[1:3] for a slice of the array
  • Add a standard library that can be imported into any file.
    • Basic support
    • Standard lib files can be imported by itself (aka import map from 'Array';) and without extension
    • Any other files have to be a relative path or absolute path to the file to import (aka import func from './module.svo';) and must have the file extension

servo's People

Contributors

jumballaya avatar

Stargazers

Joe Jack avatar

Watchers

James Cloos avatar  avatar

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.