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.
go install servo
run the command servo
run the command servo path/to/file.sv
I have no official image up yet. Build your own image from the Dockerfile in this repository.
None made so far
Comments using #Single quotes for stringsString infix operatorsInteger/Boolean infix operatorsFix comment parsing so quotes and special characters workFix string parsing to include the single quoteFix string parsing to escape the special characters like \n \t etc.Add import keyword to import specific identifier objects from a fileGet null workingBitwise operators >>, <<, |, &, &^Automatic semicolon insertionIncrement/Decremnt by operators += , -= , *= , =Power operator ^Implement floatsAdd simple classes with fields and methods and inheritanceRename structs/interfaces/functions to their proper names (Expression vs Statement etc.) so everything is consistentAdd instanceof operator for classes, e.g.fooInstance instanceof FooClass
- Implement bytes
- Syntax:
b{'|"}hello world{'|"}
orb{"|'}h{"|'}
- Like strings they can be concatontated with the
+
operator likeb'h' + b'i' = b'hi'
- Both a single byte and a byte buffer, e.g.
b'hi' = [b'h', b'i']
- Syntax:
- 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