Phillip Trelford's Array

POKE 36879,255

Getting Go

Go is a programming language developed at Google, loosely based on C, adding garbage collection and built-in concurrency primitives (goroutines).

I’ve looked at Go briefly in the past, at a Strangeloop workshop in 2012 and later reading An Introduction to Programming in Go, but until now not really done anything with it.

Go Cover

Recently I’ve been hearing some positive things about Go, so I thought I’d give it a go this evening on a simple task: downloading and unzipping a Nuget package.

Some language highlights:

  • Extensive libraries of functions with good documentation
  • Named and anonymous functions
  • Multiple return values from functions
  • No semi-colons required
  • No class inheritance hierarchies
  • Easy cleanup with the defer statement

Go is easy to install (an msi in Windows) and I found Notepad and the command line compiler sufficient to complete the tasks.

Task 1: List Nuget package versions

Nuget has a web API that returns the available versions of a specified package as a JSON array.

This task was pretty easy using Go’s http and json libraries:


Task 2: Download a Nuget package (zip) file

Again the http package made light work of this task:


Task 3: Download and Unzip a Nuget package

Yet again I simply needed to import a package this time the zip package:


Summary

For the Nuget download task, Go was easy to pick up and quite pleasant; syntax-wise it felt a little lighter than C#, but in the bigger scheme of things was still a way off the lightness that comes with F# and OCaml's type inference. That said, if I had to choose between C# and Go, then I'd be tempted to give Go another go.

Introducing FunSharp

FunSharp is a new cross-platform open source graphics library, based on Small Basic’s library, with a typed API crafted for the sharp languages, F# and C#.

Drawing graphics is quick and easy:

GraphicsWindow.FillEllipse(10,10,300,300)

And when you ask FunSharp to draw graphics it will just go and open a window to view it for you:

Purple_Circle

FunSharp provides similar functionality to Python’s PyGame, used for developing games, and Processing used for visual art.

You can call FunSharp immediately from the F# REPL or build full-blown applications using F# and C#.

It’s an ideal library for beginners or anyone who just wants  to get stuff on the screen quickly.

With this in mind FunSharp works seamlessly on Raspberry Pi, Linux and Windows.

Getting Started

If you haven’t already, you’ll need to install F# on your machine, follow these instructions:

  • Linux (for Raspbian follow the Debian instructions)
  • Windows (install Xamarin Studio or Visual Studio)

Get the FunSharp source from GitHub using Clone or Download Zip, then load the FunSharp solution into MonoDevelop or Visual Studio and starting playing with the samples.

Notes:

  • FunSharp is built on Mono’s cross platform graphics libraries Xwt and Gtk# libraries which must be referenced.
  • currently apps must run in 32-bit mode.

Turtles

FunSharp has a Turtle module, which can be used to make fun shapes:

Turtle.X <- 150.
Turtle.Y <- 150.
for i in 0..5..200 do
   Turtle.Move(i)
   Turtle.Turn(90)

Renders:

Turtle_Example

Games

FunSharp can be used to make games quickly and easily. I’ve ported several games written for Small Basic requiring only minor modifications:

Asteroids

Have fun!

Developer Conferences on a Shoestring

Over the years the number of developer conferences seems to have multiplied so much so that there seems to be one on every day of the week. But many of the big name developer conferences charge north of 1000GBP/EUR/USD to attend their spectacles. So why would you attend a developer conference and can it be done on a shoestring?

Why attend?

Recently Ryan Riley asked that very question on Twitter:


There were some great responses:





Seems like there some great reasons why you'd attend.

Where does your money go?

Most speakers don’t charge to talk at an event, although many events will cover their travel and accomodation. Costs wise this leaves hiring a venue, refreshments, organization and advertising.

Unfortunately the balance sheets of most big name events are less than transparent, although Greg Young may be about to change that:


Can I do it on a shoestring?

As well as charging for tickets, many conferences receive money from sponsorship. For some conferences this, along with the sterling efforts of volunteers, covers some or all of the cost. Others offer great early bird discounts for those who book well in advance, meaning you can go to a conference without breaking the bank.

Here’s a selection of keenly priced events I’ll be attending over the next half year or so:

Conference Location Date Cost
Functional Kats Dublin, Ireland 12 Sep 25EUR
DDD East Anglia Cambridge, UK 26 Sep FREE
Bristech Conference Bristol, UK 15 Oct 50GBP
CodeMesh London, UK 3-4 Nov 499GBP
Build Stuff Lithuania 18-22 Nov 420EUR
F# Tutorials London, UK 7-8 Dec 195GBP (early bird)
nor(DEV):con Norwich, UK 25-27 Feb ‘16 55GBP (early bird)

 

Do you have any reasonably priced conferences you’d like to share?