SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)

    Golang: Martini - An interesting framework for go

    Not sure how many of you have been looking into Go, but this is the first extension of the already stupid simple http interface in Go that I've liked so far.

    http://martini.codegangsta.io/

    If you have not seen Go yet, I recommend the following:

    http://www.youtube.com/watch?v=f6kdp27TYZs (51 minute introduction from one the the creators of Google's Go - Rob Pike)

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,198
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    Hm, most things I've read about Go online jump straight into the nitty gritty of it without giving a conceptual overview of where it fits into the coding landscape (such as how it compares with other languages, what the use case is for it, how it relates to the web etc.—at least in reasonably basic terms) and I've come away shrugging and not thinking it had any use for the web. Always interesting to me how people struggle with presentation issues like this.

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Off Topic:

    Hm, most things I've read about Go online jump straight into the nitty gritty of it without giving a conceptual overview of where it fits into the coding landscape (such as how it compares with other languages, what the use case is for it, how it relates to the web etc.—at least in reasonably basic terms) and I've come away shrugging and not thinking it had any use for the web. Always interesting to me how people struggle with presentation issues like this.
    How did you feel about Rob's presentation? Easy concurrent application development is the goal of Go right now. At 28:30 he goes into a simple example, but I think a better example for the web and this forum is probable a video the Andrew Gerrand did:

    http://www.youtube.com/watch?v=UgzIApJdLwY - Andrew focuses on the net/http package and builds a couple sample web projects, and walks you through everything

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,198
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    How did you feel about Rob's presentation?
    Over my head by a long way, but Andrew's certainly does give a clearer idea of it. Thanks for that.

  5. #5
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    Not sure how many of you have been looking into Go, but this is the first extension of the already stupid simple http interface in Go that I've liked so far.

    http://martini.codegangsta.io/

    If you have not seen Go yet, I recommend the following:

    http://www.youtube.com/watch?v=f6kdp27TYZs (51 minute introduction from one the the creators of Google's Go - Rob Pike)
    A couple of months ago I was impressed with the "Hello World" and the Moustache demonstration. I set up the Google account which worked fine. I created a link back to a couple of my sites which not only required email verification but also Google crawl treated the link as suspicious.

    I tried installing the source code on a couple of sites but Golang refused to work in each case.

    I think Golang is a good idea but far too techie for me at the moment, hopefully this will change
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  6. #6
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by John_Betong View Post
    A couple of months ago I was impressed with the "Hello World" and the Moustache demonstration. I set up the Google account which worked fine. I created a link back to a couple of my sites which not only required email verification but also Google crawl treated the link as suspicious.

    I tried installing the source code on a couple of sites but Golang refused to work in each case.

    I think Golang is a good idea but far too techie for me at the moment, hopefully this will change

    Can you elaborate on the google account? Google doesn't force you to join anything for this, it's open source, it just so happens that there's employees dedicated to working on it since it is benefiting Google.

    As for the code, Golang is a compiled language, like c or c++. Which means that there is not dropping it on your shared hosting provider. You have to have the ability to compile your applications, and run it from command line. This also means that you do not run it with something like apache, Golang would replace apache with its own built in, high performance http package, which is fully demonstrated in the second video.

    For quite a while I've been staring at Golang trying to fully comprehend it, knowing how much this language could empower my applications due to it's concurrent nature (think of c++ but MUCH easier). But I would just stare, dabble in a hello world app and never really understand it. Something just clicked for me a few months ago and I've been loving it since. One of the things I was afraid of was the "lack of documentation" because it is such a new language, theres not many examples on the web like there is PHP. While true, I finally learned how to navigate GoDoc (their documentation) which is incredibly detailed and useful.

  7. #7
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    Can you elaborate on the google account? Google doesn't force you to join anything for this, it's open source, it just so happens that there's employees dedicated to working on it since it is benefiting Google.

    As for the code, Golang is a compiled language, like c or c++. Which means that there is not dropping it on your shared hosting provider. You have to have the ability to compile your applications, and run it from command line. This also means that you do not run it with something like apache, Golang would replace apache with its own built in, high performance http package, which is fully demonstrated in the second video.

    For quite a while I've been staring at Golang trying to fully comprehend it, knowing how much this language could empower my applications due to it's concurrent nature (think of c++ but MUCH easier). But I would just stare, dabble in a hello world app and never really understand it. Something just clicked for me a few months ago and I've been loving it since. One of the things I was afraid of was the "lack of documentation" because it is such a new language, theres not many examples on the web like there is PHP. While true, I finally learned how to navigate GoDoc (their documentation) which is incredibly detailed and useful.
    Here is the screen-dump image of Googles "Warning: Suspected phishing site":

    phishing-johns-jokes.jpg


    >>> Can you elaborate on the Google account?
    I created the account about six months ago using this link:

    "https://appengine.google.com/" # Google GoLang App Engine

    >>> Which means that there is not dropping it on your shared hosting provider.
    My knowledge is limited as far as installing Golang on the VPS and will have to watch the videos again and also to ask the Host provider to make the installation.

    I studied C++ quite a few years ago, liked the cryptic and succinct language features which was the main attraction to Golang. I would like to start coding again using C and Golang seemed an ideal opportunity.

    I have sent a private message giving details of my attempt to get Golang working on my server which requires a Gmail login. If you do not a Gmail account I have a spare that may be used.
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  8. #8
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    John, it seems you are having rouble with Google app engine, not Go itself base on the PM you sent me. Golang does not require app engine to run, it can be compiled locally and run locally (even to develop windowed applications).

    Here is the Go website: http://golang.org/ where do you do need an account to download the software. You can skip the app engine part

  9. #9
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,835
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    John, it seems you are having trouble with Google app engine, not Go itself base on the PM you sent me. Golang does not require app engine to run, it can be compiled locally and run locally (even to develop windowed applications).

    Here is the Go website: http://golang.org/ where do you do need an account to download the software. You can skip the app engine part
    H Kyle,

    I installed Golang on my local Windows computer and ran through all the tutorials with no problem. Next task was to try and install Golang on one of my Apache sites and this is where I had the problems. The source code is still sat waiting to be installed.

    I used Google's App Engine, which also caters for Python, Java, Go and PHP. I managed to get the application running on Google's App Engine. I tried to link from my site to the Google's App Engine and the App Engine required an email verification. Also Google's crawl warned of a possible phishing site.

    That is the link that I sent in the message, did you try the link?

    As mentioned before I would like to use Golang and think that a concerted effort is required, I must allocate at least 5 hours and especially eliminate all telephone, email, forums, etc
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  10. #10
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Hi John,

    The problem here is that Go shouldnt be coupled with Apache, it should replace it. I plan on putting up a few introductory tutorials to the language, but in the mean time I recomend this video posted earlier: http://www.youtube.com/watch?v=UgzIApJdLwY

    I'm not sure I can help you out with your Google App Engine issues, but as I said, App Engine is NOT a requirement to deploy a Go web app. Nor is apache.

  11. #11
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Here is your generic hello world for a web application.

    Code Csharp:
    package main
     
    import (
         "fmt"
         "log"
         "net/http"
    )
     
    func rootHandler(w http.ResponseWriter, r *http.Request) {
         fmt.Fprint(w, "Hello, world!")
    }
     
    func main() {
         http.HandleFunc("/", rootHandler)
         log.Fatal(http.ListenAndServe(":8080", nil))
    }
    line #1 of main we register a route for the root directory of our site
    #2 of main is launching a web server on port 8080 and wrapping it with basic logging for errors

    Yup, several lines of code and your generating your mcuh more powerful web app. Python can also deploy a web server in about this many lines of code, however python does not have the same performance nor does it have the bread and butter of Go (channels and go routines for easy high concurrency applications).

    There is no placing this in apache or anythign like that. You compile this and run it from command line.

  12. #12
    SitePoint Addict Mal Curtis's Avatar
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    327
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I'm a big fan of Go and have part of a production system running on the Revel framework. I'm just about to tear that apart and replace it with Martini. It's a simple service and Martini feels like the perfect fit.

    One of the things I love about Go is that you can get incredible performance for cheap. We can spin up a heroku dyno and handle tens of thousands of requests / minute for simple redis interactions.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •