Skip to content

Releases: goby-lang/goby

v0.1.13

26 Apr 06:21
Compare
Choose a tag to compare

This version contains many new APIs, bug fixes and internal refactorings.

Features

  • Array.new(args) - #832
  • Object#rand - #819
  • Object#sql? - #843
  • Class#define_method - #842
  • Object#define_singleton_method - #842
  • Multiple Float APIs - #664 (thanks to @SD10)
    • #abs
    • #cel
    • #floor
    • #round
    • #positive?
    • #negative?
    • #zero?

Library

  • Added before and after callback to Spec library - #835

Fixes

Breaking Changes

  • =~ is now deprecated. Please use String#match? instead. - #802

v0.1.12

16 Feb 06:36
Compare
Choose a tag to compare

This version contains 1 new API and fixes a few issues. The rest of the changes were for internal polishing.

Features

Bug Fixes

  • Fixed error message got swallowed issue - #811
  • Fixed object_id returning arbitrary number issue - #796

v0.1.11

13 Oct 09:56
Compare
Choose a tag to compare

Noticeable Changes

New APIs

API changes

  • Integer#time now returns an Enumerator - @st0012

Performance improvements

The overall performance is now 2x faster and object allocations and memory usage are reduced to half.

benchmarking e22beaebdea18ea8670d98d56f4e4f39eed444e8
benchmarking 587f1c8dadd5adec3c16642ae3133504682f4d5c
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
        ignoring go.mod;
        see 'go help modules'
x86_64-darwin18
benchmark                         old ns/op     new ns/op     delta
BenchmarkBasicMath/add-4          5650          3357          -40.58%
BenchmarkBasicMath/subtract-4     5592          2740          -51.00%
BenchmarkBasicMath/multiply-4     5687          2786          -51.01%
BenchmarkBasicMath/divide-4       5661          2757          -51.30%

benchmark                         old allocs     new allocs     delta
BenchmarkBasicMath/add-4          75             33             -56.00%
BenchmarkBasicMath/subtract-4     75             33             -56.00%
BenchmarkBasicMath/multiply-4     75             33             -56.00%
BenchmarkBasicMath/divide-4       75             33             -56.00%

benchmark                         old bytes     new bytes     delta
BenchmarkBasicMath/add-4          3152          1568          -50.25%
BenchmarkBasicMath/subtract-4     3152          1568          -50.25%
BenchmarkBasicMath/multiply-4     3152          1568          -50.25%
BenchmarkBasicMath/divide-4       3152          1568          -50.25%

Big thanks to @eliothedeman for the significant improvement 🎉

Other changes

There are a lot of refactoring/code reorganization/bug fixes in this version as well. They’re mainly done by @hachi8833, @ear7h and @saveriomiroddi

Version 0.1.10

07 Jul 07:06
Compare
Choose a tag to compare

Goby 0.1.10 release note

Performance Improvement

Compare to the first commit (d5f5fc) that introduces the benchmark

benchmarking d5f5fc591bdbd3cd8f35cfe4e753f977478eecf8
benchmarking e22beaebdea18ea8670d98d56f4e4f39eed444e8
x86_64-darwin17
benchmark                         old ns/op     new ns/op     delta
BenchmarkBasicMath/add-4          7178          5299          -26.18%
BenchmarkBasicMath/subtract-4     7185          5336          -25.73%
BenchmarkBasicMath/multiply-4     7185          5298          -26.26%
BenchmarkBasicMath/divide-4       7158          5292          -26.07%

benchmark                         old allocs     new allocs     delta
BenchmarkBasicMath/add-4          78             75             -3.85%
BenchmarkBasicMath/subtract-4     78             75             -3.85%
BenchmarkBasicMath/multiply-4     78             75             -3.85%
BenchmarkBasicMath/divide-4       78             75             -3.85%

benchmark                         old bytes     new bytes     delta
BenchmarkBasicMath/add-4          3792          3152          -16.88%
BenchmarkBasicMath/subtract-4     3792          3152          -16.88%
BenchmarkBasicMath/multiply-4     3792          3152          -16.88%
BenchmarkBasicMath/divide-4       3792          3152          -16.88%

Features

Classes

APIs

  • Object#respond_to? - #651
  • Integer#to_d - #649
  • Class#method_missing - #672
  • Class#inherits_method_missing - #676
  • Class#Constants - #686
  • Object#print - #694

Fixes

  • Fixed some documentation mistakes
  • Fixed panic when a library file is not found on startup
  • Fixed #643
  • Fixed #679

Other changes

  • Moved db related code out of vm package

version 0.1.9

03 Apr 16:22
Compare
Choose a tag to compare

Features

Builtin Test Framework

Now you can use built-in test framework: spec to write specs for Goby program! For example:

require "spec"

Spec.describe Spec do
  describe "comparison" do
    describe "#to eq" do
      it "compares if two values are equal" do
        expect(1).to eq(1)
      end
    end

    describe "#not_to eq" do
      it "compares if two values are not equal" do
        expect(1).not_to eq(2)
      end
    end
  end

  describe "indentation" do
    it "indents four spaces" do
    end
    describe "nest another level" do
      it "indents six spaces" do
      end
    end
  end
end

And to run the spec, use goby test FILE_OR_DIRECTORY_PATH.
Then it will run the spec and print the output like:

Spec
  comparison
    #to eq
      it "compares if two values are equal"
    #not_to eq
      it "compares if two values are not equal"
  indentation
    it "indents four spaces"
    nest another level
      it "indents six spaces"

Support Descending Range

Thanks to @ear7h, this is a feature that does not exist in Ruby but now in Goby!
Take the following code as an example:

sum = 0
(2..-9).step(3) do |i|
  sum = sum + i
end
puts(sum)

In Ruby it returns 0 cause it does not support descending range.
But in Goby it will return -10 😁

New APIs

Fixes (thanks to @shes50103)

Fixes for sample app

11 Mar 16:23
Compare
Choose a tag to compare

The major fix is to make splat parameter returns an empty array instead of nil when no argument is passed.

def foo(*x)
  x
end

# before fix
foo #=> nil

# after fix
foo #=> []

version 0.1.8

04 Mar 15:46
Compare
Choose a tag to compare

Upgrade Go's version to 1.10

Features

Support String's range indexing

s = "Hello!"
puts(s[1..3]) #=> ell

Fixes

Testing

Add AST testing helpers

For example, to test

def add(x, y)
  x + y
end

We can now write it like:

firstStmt := program.FirstStmt().IsDefStmt(t)
firstStmt.ShouldHasName("add")
firstStmt.ShouldHasNormalParam("x")
firstStmt.ShouldHasNormalParam("y")

firstExpression := firstStmt.MethodBody().NthStmt(1).IsExpression(t)
infixExp := firstExpression.IsInfixExpression(t)
infixExp.ShouldHasOperator("+")
infixExp.TestableLeftExpression().IsIdentifier(t).ShouldHasName("x")
infixExp.TestableRightExpression().IsIdentifier(t).ShouldHasName("y")

Add Integration tests for simple server

See #604

Add t.Helper() to test helper functions

v0.1.7

30 Jan 03:44
Compare
Choose a tag to compare

v0.1.7 release note

New Keywords

  • get_block: let you retrieve a block as an object
  • break: break current loop or block execution

New APIs

  • Array#lazy
  • Array#to_enum
  • Object#raise
  • Range#lazy
  • Range#map
  • Range#to_enum

New Classes

  • LazyEnumerator
  • ArrayEnumerator
  • RangeEnumerator

Fixes

Deprecations

  • then keyword

v0.1.6

04 Dec 15:07
Compare
Choose a tag to compare

New BuiltIn Types

  • Float
  • GoMap
  • Decimal
  • MatchData
  • Regex

New Libraries

  • Concurrent::Array
  • Concurrent::Hash
  • Concurrent::RWLock

Syntax Change

  • Add _ for unused variable
  • Support float literal like 1.0
  • Support Keyword Argument (unstable)
  • Support Case expression
  • Prohibit capitalized method call like Foo()
  • Drop support of ++
  • Support += or -= syntactic sugars
  • Support ~= operator

Others

  • Stack Traces support (unstable)
  • A lot bug fixes (too many to list)

Version 0.1.3

18 Sep 04:39
Compare
Choose a tag to compare
  • File is now builtin class instead of standard library now
  • Added some new APIs to Array class
  • Added Object#send
  • Channel's performance should be improved due to upgrading Go to version 1.9
  • Fixed some edge case issues
  • Largely improve http library