Giter Site home page Giter Site logo

opencollective / goby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goby-lang/goby

1.0 5.0 1.0 605 KB

Goby (Rooby) is a new object oriented language written in Go aim at developing microservice efficiently.

Home Page: https://goby-lang.github.io/goby/

License: MIT License

Makefile 0.10% Go 99.57% Shell 0.11% Ruby 0.22%

goby's Introduction

goby (rooby)

Join the chat at https://gitter.im/rooby-lang/Lobby

Build Status Code Climate GoDoc Go Report Card codecov BCH compliance Readme Score

Goby is a Ruby-like object oriented language written in Go. And it's not a new Ruby implementation. Instead, it should be a language that help developer create api server or microservice efficiently.

It will have Ruby's syntax (I'll try to support all common syntaxes) but without most of Ruby's meta-programming magic to make the VM simple. It will also have built in http library that is built upon Go's efficient http package. And I'm planning to do more optimization by using goroutine directly.

Supporting Goby by sending your first PR!

Or support by donation

Support via Gratipay

(We'll release first beta version in August, please checkout this issue for what features goby will support.)

Questions

A lot people have questions about goby since it's a new language and you may get confused by the way I describe it (sorry for that ๐Ÿ˜ข). Here's a list of frequently asked questions.

Supported features

  • Can be compiled into bytecode (with .gbbc extension)
  • Can evaluate bytecode directly
  • Everything is object
  • Support comment
  • Object and Class
    • Top level main object
    • Constructor
    • Support class methods
    • Support inheritance
    • Support instance variable
    • Support self
  • Module
  • Namespace
  • Variables
    • Constant
    • Local variable
    • Instance variable
  • Method
    • Support evaluation with arguments
    • Support evaluation without arguments
    • Support evaluation with block (closure)
  • BuiltIn Data Types (All of them are classes ๐Ÿ˜€)
    • Class
    • Integer
    • String
    • Boolean
    • nil
    • Hash
    • Array
  • Flow control
    • If statement
    • while statement
  • Import other files
    • require_relative
  • IO
    • puts
    • ARGV

(You can open an issue for any feature request)

Something different from Ruby

Method call syntax

For now, all method call needs to use parentheses to wrap their arguments. Including methods like require, include which we normally won't do this.

It'll look like:

require("foo")

class Bar
  include(Foo)
end

There's two reason for this:

I want to make Goby's syntax more consistent than Ruby

In Ruby you can write most of things in many different ways, and that can cause some confusion so we need style guide(s) to tell programmers write code consistently.

But in some programming languages like go, the syntax is very limited which in sometimes is very verbose, but this also makes program more easy to understand and maintain.

This requires a parser generator

Since our parser is handcrafted, supporting this feature would be hard and can easily cause bugs on some edge cases.

Although we definitely will replace current parser with a parser generator, this is not our top priority now.

If you have any thought on this, please join our discussion in this issue. We would love to hear some user's feedback ๐Ÿ˜

Install

  1. You must have Golang installed
  2. You must have set $GOPATH
  3. Add your $GOPATH/bin into $PATH
  4. Run following command
$ go get github.com/goby-lang/goby

Usage

Execute goby file using VM

(might see errors on sample-6 since vm hasn't support block yet)

$ goby ./samples/sample-1.gb
#=> 16

Compile goby code

$ goby -c ./samples/sample-1.gb

You'll see sample-1.gbbc in ./samples

Execute bytecode

$ goby ./samples/sample-1.gbbc

Try it!

See sample directory for sample code snippets

$ goby ./samples/sample-1.gb
$ goby ./samples/sample-2.gb
$ goby .....

API Documentation

Check out our API Documentation.

There is still a lot of document to add. Feel free to contribute following this guide.

Development & Contribute

See the guideline.

Note: Before sending PR, you should perform make test on the root directory of the project to perform all tests (go test works only against goby.go file and will be incomplete for the test).

TODO & WIP

Checkout this issue for what we will work on before first release.

Also see huboard

References

I can't build this project without these resources, and I highly recommend you to check them out if you're interested in building your own languages:

Maintainers

  • @st0012
  • @janczer
  • @adlerhsieh

goby's People

Contributors

st0012 avatar janczer avatar adlerhsieh avatar appleboy avatar sumlare avatar adelcambre avatar d6o avatar hachi8833 avatar gitter-badger avatar weichiachang avatar

Stargazers

Felipe Monteiro avatar

Watchers

Philippe Modard avatar James Cloos avatar Arnaud Benard avatar Aseem Sood avatar  avatar

Forkers

bhanditz

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.