koa

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

README

koa

Build Status License Language Coverage Status

The project is inspired by the simplicity and the ivy-bitcoin.

The koa project is to create a high-level language that has more expressions than the bitcoin script and is simpler and easy to analyze than soldity(ethereum).

A more detailed explanation is given below.

Architecture

koa architecture

  • Lexer
  • Parser
  • Compiler
  • VM
Language Specification
Primitive Type
  • Integer

    It is expressed in int. Integer size is 64 bytes.

  • String

    It is expressed in string.

  • Boolean

    It is expressed in true or false.

Operators
  • Arithmetic

    We support +, -, *, /, % only for integer.

  • Comparison

    We support ==, !=, >, <, >=, <= for comparsion.

  • Logical

    We support &&, || for logical operation.

  • Prefix

    We support !, - for prefix operator.

Condition

It is expressed in if(){} or if(){}else{}.

Etc
  • return
  • \n : All statements should end in \n.
  • Assign : It is expressed in =.
Example Code
contract {
 func Sig(sig string){
   string pubkey = "fvfidBGruUYC+mTw7CusaCOQbBuZBiYduFgH8hRW97KLmHn0xzB1FV++KI7syo8qXGo8Un24WP40IT78XjKO"
   
   if checkSig(pubkey, sig){
     return true
   }
   return false
 }
}
Contribution

Contribution Guide CONTRIBUTION

License

Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE.

CLA Hub

To get started, sign the Contributor License Agreement.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(item int64) []byte

func Compile

func Compile(input string) (translate.Asm, abi.ABI, error)

func Execute

func Execute(rawByteCode []byte, function []byte, args []byte) ([]byte, error)

Types

This section is empty.

Directories

Path Synopsis
cmd
lex

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL