Eclipse Golo has been terminated

The Eclipse Golo project has been terminated.

The developers have moved on to other personal and professional priorities. Migrating the code base beyond Java 8 has turned out to be too complex due to the Java Platform Module System introduced with Java 9 and strong encapsulation constraints.

We would like to thank all contributors and participants over the years for their enthusiasm!

Thanks for the ride, it's been a fun one 🙏

Golo
— a lightweight dynamic language for the JVM.

back to the front page

 Now available: Golo 0-preview11

We are pleased to announce the release of Golo 0-preview11. This is the first release of 2014 following Golo 0-preview10 last December.

You can download a Golo 0-preview11 now with the following noteworthy changes:

What’s new?

Fallbacks methods for dynamic objects

Daniel contributed the support of fallback methods for dynamic objects. Here is an example snippet:

let obj = DynamicObject(): fallback(|this, method, args...| {
  return "Method: " + method + ", with args: " + args: asList(): join(" ")
})

println(obj: casperGetter())
println(obj: casperMethod("foo", "bar"))

As you can see, this can be used to provide a default behavior when a method is not defined in a dynamic object instance.

Lax imports

Lax imports widen the range of valid imports in Golo, as in:

import java.util
function foo = -> Arrays.asList(1, 2, 3)

or,

import java
function foo = -> util.Arrays.asList(1, 2, 3)

Previously, one would have had to use either of the following constructs:

import java.util.Arrays
function foo = -> Arrays.asList(1, 2, 3)

or,

import java.util.Arrays
function foo = -> asList(1, 2, 3)

New benchmarks

We rewrote our benchmarks using the OpenJDK JMH harness.

Benchmarking on the JVM/HotSpot is hard, especially as the virtual machine is doing lots of optimizations that can defeat the purpose of your benchmarks. JMH provides great support to mitigate these effects and get more meaningful results.

Struct members encapsulation

It is now possible to make some struct members private by prefixing them with _, as in:

struct Foo = { a, _b, c }

# (...)

let foo = Foo(1, 2, 3)

In this case, _b is a private struct member. This means that foo: _b() and foo: _b(666) are valid calls only if made from:

Any call to, say, foo: _b() from another module will yield a NoSuchMethodError exception.

Private struct members also have the following impact:

Go-style “objects”, simpler same-module struct augmentations

Struct members encapsulation offers a simple object mechanism for Golo that is very much like what the Google Go programming language offers. More precisely:

To make this more practical, we simplified same-module struct augmentations declarations. Previously, one had to to the following:

module Plop

struct Foo = { a, b, _c }

augment Plop.types.Foo {
  function whatever = |receiver, a, b| -> "Plop"
}

Now one can simply omit the full struct qualified name:

module Plop

struct Foo = { a, b, _c }

augment Foo {
  function whatever = |receiver, a, b| -> "Plop"
}

Asynchronous helpers with promises and futures

The new gololang.Async module provides helpers for composable futures and promises to support asynchronous programming model.

The API that we designed is orthogonal to the underlying execution strategy, so you may opt to execute some stream operations on the same thread, in a new thread, in a new executor task and so on.

You should consult the golodoc to learn more about the API, but here is some sample code to give you a feeling of how this works:

module samples.AsyncHelpers

import gololang.Async
import java.util.concurrent.TimeUnit
import java.util.concurrent.Executors

local function fib = |n| {
 if n <= 1 {
    return n
  } else {
    return fib(n - 1) + fib(n - 2)
  }
}

function main = |args| {

  let executor = newCachedThreadPool()
  println("Let's do some useless asynchronous operations...")

  var f = executor: enqueue({
    Thread.sleep(1000_L)
    return 666
  })
  f:
    onSet(|v| -> println(">>> #slow -> " + v)):
    onFail(|e| -> println(">>> #fail -> " + e))
  f:
    cancel(true)

  f = executor: enqueue({
    Thread.sleep(1000_L)
    return 666
  })
  f:
    onSet(|v| -> println(">>> #ok -> " + v)):
    onFail(|e| -> println(">>> #wtf? -> " + e))

  let fib_10 = promise()
  let fib_20 = promise()
  let fib_30 = promise()
  let fib_40 = promise()

  let futures = [
    fib_10: future(), fib_20: future(),
    fib_30: future(), fib_40: future()
  ]

  executor: submit(-> fib_10: set(fib(10)))
  executor: submit(-> fib_20: set(fib(20)))
  executor: submit(-> fib_30: set(fib(30)))
  executor: submit(-> fib_40: set(fib(40)))

  all(futures): onSet(|results| -> println(">>> Fibs: " + results))

  let truth = promise()
  truth:
    future():
    map(|v| -> "truth=" + v):
    onSet(|v| -> executor: submit(-> println(">>> (another thread) " + v))):
    onSet(|v| -> println(">>> (same thread) " + v))
  executor: submit({
    Thread.sleep(500_L)
    truth: set(42)
  })

  Thread.sleep(1000_L)
  executor: shutdown()
  executor: awaitTermination(2_L, SECONDS())
  println("Bye!")
}

textToFile fix

Philippe spotted a bug in the fileToText function implementation where files would not be truncated on overwrites.

In the best spirit of opensource, he also provided a fix.

In the community

Atom editor

GitHub is working on a new text editor called Atom, and Philippe did an awesome job in providing a support package for Golo:

Good job Philippe!

Philippe goes to Devoxx France (and so does Jeff, too!)

Philippe will do a talk at Devoxx France on Golo called “Golo, de la sucrette syntaxique pour vos applications Java”.

He will also take part in another talk on web framework performance with JVM wizard RĂ©mi Forax, Play! Framework specialist Nicolas Leroux and our Eclipse IDE guru Jeff Maury.

We wish you the best, mates!

LLVM hacking

Franck Verrot has been playing with a LLVM generation from Golo code:

Of course it’s an incomplete hack, but it highlights that Golo is hobbyist-friendly :-)

Eclipse IDE

Jeff is keeping the Eclipse IDE support up-to-date, give it a try!

Until next time…

comments powered by Disqus


Copyright © 2012 – 2018 INSA Lyon, CITI Laboratory and contributors.

Privacy Policy | Terms of Use | Copyright Agent | Eclipse Public License | Legal Resources