Skip to content
This repository

Go language #37

Closed
kless opened this Issue March 03, 2012 · 12 comments

5 participants

Jonas mg Caleb James DeLisle Liam Edwards-Playne sakkaku Richo Healey
Jonas mg
kless commented March 03, 2012

I write this one here because you have not a contact address.

This project could come to everybody if were used Go instead of C:

  • The code would compile in the main systems (linux, os x, windows, freebsd) and architectures (x86, x86-64, arm) without any change

  • It has a great library whose API has been frozen for Go 1

    http://weekly.golang.org/pkg/

  • Google is placing trust in Go by adding it to App Engine, Google Code search, and open-sourcing vitess, which it's the core of YouTube's new MySQL serving infrastructure.

    http://code.google.com/p/vitess/

Liam Edwards-Playne

Then again, it could come to everybody if we used the D language as well. The difference is, C is popular. It also is the foundation of most languages, so it's syntax is well known. However it's still a good idea, CJDNS isn't portable yet, which annoys me. It was programmed from the start as a linux project, and now is a perfect time to port it.

Just because it's in Go, doesn't mean it's any easier. Tunnels are the main problem on all platforms currently.

Jonas mg
kless commented March 04, 2012

There is a big difference between D and Go. Go is licensend under BSD, its sintaxis is simple and concise, and it has concurrency mechanisms.

Liam Edwards-Playne

@kless Would you be active in developing this? I researched a bit tonight, and golang looks really good, however tun/tap would be hard to implement.

Jonas mg
kless commented March 05, 2012

I'm very busy building a compiler from Go to JavaScript, GoScript, so I've no more time for another projects.

Anyway, the Go team has done a portable interface for network I/O so it could be used like base/inspiration since you can access to the source files:

http://weekly.golang.org/pkg/net/
http://weekly.golang.org/src/pkg/net/

And the best help that you can get is in its group where there are the Go's developers, contributors, and a lot of smart people. You have in mind that the Go's creators are very busy now with the next relese, Go 1, but I'm sure that there will somebody that can guide you.

There is also a guy that is working into interesting projects related to networking so he could guide you or maybe those projects could help you:

GoDCCP: implementation of the Datagram Congestion Control Protocol
GoNeedle: a system for punching reliable transport over UDP through NATs and Firewalls

Liam Edwards-Playne

@kless The main issue that I think would be had is porting the necessary memory allocation code. Golang has a very different implementation of types and interfaces. One plus is that they have garbage collection built in.

As a note, ioctl is cross platform in Golang, using syscall.Syscall(syscall.SYS_IOCTL,

Jonas mg
kless commented March 07, 2012

Go's run-time handles memory allocation and collection, stack handling, goroutines,channels, slices, maps, reflection, and more.

http://www.scribd.com/doc/32562156/The-Go-Programming-Language

Caleb James DeLisle
Owner

Closed because design decisions need to be discussed before an issue is created, you're invited to join the IRC channel and we can discuss porting the code to go.

A few statistics which you might want to know about before you decide to undertake a port:
cjdns contains 17,138 lines of C code.
nacl, the cryptography library which provides the encryption for cjdns contains 11,680 lines of C and 79,012 of assembly.

If you are still interested in porting, probably the best way to do it is to add bindings to your language so you can call cjdns code from your language then you can write the higher level parts in any language you choose.

Caleb James DeLisle cjdelisle closed this March 08, 2012
Jonas mg
kless commented March 09, 2012

Go has its own crypto. library built by Adam Langley (of Google Security Team).

Anyway, are you using NaCL to using Elliptic curve cryptography? You should have in mind the next:

sakkaku

The code would compile in the main systems (linux, os x, windows, freebsd) and architectures (x86, x86-64, arm) without any change

Go doesn't support tun/tap and equivalent services on windows. So you would still need to have architecture specific implementations. Probably about as much work would be needed in Go as in properly written C.

It has a great library whose API has been frozen for Go 1

And it is going to change dramatically (probably) when version 2 ships. Most programs will eventually be forced to upgrade due to lack of security/maintenance patches.

Google is placing trust in Go by adding it to App Engine, Google Code search, and open-sourcing vitess, which it's the core of YouTube's new MySQL serving infrastructure.

https://www.google.com/codesearch - Sadly, this service has been shut down. (please see the official blog post and the discussion for details.)

There is a big difference between D and Go. Go is licensend under BSD, its sintaxis is simple and concise, and it has concurrency mechanisms.

The syntax has nothing to do with anything. Unless you can magically port thousands of lines of C overnight and achieve at least expert level in Go with a flick of a thumb. Asking an existing project to swap to a different language probably wont go so well.

A better idea would be to write new implementation in Go while wrapping the existing C codebase until you replace portions of it (as mentioned by the original developer).

Jonas mg
kless commented March 09, 2012

It has a great library whose API has been frozen for Go 1

And it is going to change dramatically (probably) when version 2 ships. Most programs will
eventually be forced to upgrade due to lack of security/maintenance patches.

That is not true: http://blog.golang.org/2011/10/preview-of-go-version-1.html

"We want to be able to provide a stable base for people using Go. People should be able to write Go programs and expect that they will continue to compile and run without change, on a timescale of years. Similarly, people should be able to write books about Go, be able to say which version of Go the book is describing, and have that version number still be meaningful much later. None of these properties is true for Go today.

Go version 1 will be a stable language with stable libraries. Other than critical fixes, changes made to the library and packages for versions 1.1, 1.2 and so on may add functionality but will not break existing Go version 1 programs."

https://www.google.com/codesearch - Sadly, this service has been shut down. (please see the official blog post and the discussion for details.)

Google has shut down a lot of services so it isn't related to be built with Go. Anyway, Google is not the only company that is trusting in Go:
http://go-lang.cat-v.org/organizations-using-go

The syntax has nothing to do with anything.

Go is more than a simple sintaxis. Here you have an article very complete comparing several C-like languages:
http://www.syntax-k.de/projekte/go-review

Richo Healey
richo commented March 09, 2012

I'm confused as an observing 3rd party.. @kless are you actually just asking a project to rewrite in another language because it would suit you better?

Jonas mg
kless commented March 09, 2012

@richoH From my first comment: "The code would compile in the main systems (linux, os x, windows, freebsd) and architectures (x86, x86-64, arm) without any change"

It's true that you need to have architecture specific implementations but it will be lesser work than using C directly thanks to the library syscall which is cross-platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.