Skip to content

šŸ“ Blog

Golo - Little 3

Ok folks ! First, I hope you didn’t missed the release of Golo.

I hoped to publish some article on the D-day but my daughter had an unplanned trip to hospital.
She’s fine now, I spent some time watching her sleeping.

So, this won’t be a huge post but still hope to introduce you to the coming plans.

What I really like with new languages is that everything has to be discovered.
It is often a moment where you can both use fresh eyes on your way of coding and learn a lot on various topics. Come on, you know what kind of topics…
Those you already should have dug into.
Use this new language as a good reason !

Everyone will choose his own topics.
Philippe CharriĆØre started to digg what Play! framework looks like behind the scene and decided to write his own vision with Golo. (if you don’t understand french, ask him some translation ;) )

But in my case, I first choose to see the internals of a Http server.
Yes, a simple Http server. Something like com.sun.net.httpserver
I will post here the step of what I had to try.

In the meantime, if you already jumped on Golo board, you can have a look to n’Golo aka nano.Golo.
This place will be a sharing space for all Golo users, newbie, seasoned, curious, my mom… ;)
See you soon…

Golo - Little 2

The D-day is coming for Golo and be sure to attend Julien’s talk at Devoxx !

In the meantime, here is a new piece of Golo.

module little.experiment2_1

import java.lang

function functionWithCase = |inputParameter| {
  case {
      when inputParameter == "This value" { println("this value spotted") }
      otherwise { println("otherwise was the answer") }
  }
}

function main = |args| {
  functionWithCase("This value")
  functionWithCase("not something to handle")
}

This illustrate the use of the Golo case word.
As you can see, the case expression is quite simple:
each when is based on a conditionnal expression that will allow the specified code to be executed.

It’s that simple !

But simple doesn’t mean powerless !
Golo allows you to write when conditions with several variables that may have different possible types.
Just look below:

module little.experiment2_2

import java.lang

function otherValue = { println("This value was numeric") }

function functionWithCase = |inputParameter, secondParameter| {
  case {
      when inputParameter == "This value" { println("this value spotted") }
      when secondParameter == "second" { println("second value") }
      when inputParameter == 42 { otherValue() }
      when (inputParameter == "first") and (secondParameter == "second too") { println("both") }
      otherwise { println("otherwise was the answer") }
  }
}

function main = |args| {
  functionWithCase("This value", "second")
  functionWithCase(42, "second")
  functionWithCase("not something to handle", "")
  functionWithCase("first", "second too")
}

That’s it for today folks !
Of course, feel free to contact me and ask question questions.
All comments are welcome here too.

See you when Golo is out ;)

Golo - Little 1

I think it’s time to start some Golo experiment.

Of course, everyone wanted the mandatory HelloWorld.
But hey, that’s a blog called ā€œLittle Experimentā€ ;)
(at least it was at the writing time in)

Ok, ok, the HelloWorld is available at Golo website, and as a present to my fellow readers, here is a copy here ;)

module hello.World

function main = |args| {
  println("Hello world!")
}

Save this to a helloworld.golo file.
To be sure, if your Golo environment is properly setup, all you have to do is: 12

> gologolo helloworld.golo
Hello world!

The interesting Golo things here are:

  • the Golo code is placed in a module (names separated with dots)
  • you can execute a Golo module if there’s a main function
  • you see how to define a function
  • gologolo is the tool that compile then execute your code. You can use goloc to compile and later golo to run it.

But you know what ?
If you have a ticket to Devoxx, don’t miss Julien’s talk there !

Golo

Back to the main purpose of this blog: a new dynamic langage is coming !
Its name: Golo !

The first release is in a close future and all you get on the official website is basic information.
Hopefully, Julien Ponge, father of Golo, has started to speak during public talks.

The first one took place February 7th at the Lava Jug.
You may have a look to the slides and video (in French this time).

The second one took place yesterday, March 19th, at the Lyon Jug.

The next step will be at the Devoxx France event, during a dedicated Tool in Action session.

All we can hope is a release at that time ;)