Showing posts with label golang. Show all posts
Showing posts with label golang. Show all posts

Wednesday, April 12, 2017

Interesting programming links of the week

By Vasudev Ram


I've been seeing a good number of interesting posts about programming topics lately, on various forums, particularly HN, so I thought of sharing them here (both for my readers and for myself to look up again later). Here are some selected posts or threads that I think are interesting to programmers:

Electron is flash for the desktop (2016) (josephg.com)

Web Development in Go (inburke.com)

Ask HN: Will Rust ever become a mainstream systems programming language?

Computer Programming Using GNU Smalltalk (2009) (canol.info)

Ask HN: What would you use to make cross-platform desktop application?

The reference D compiler is now open source (dlang.org)

The Power of Prolog (metalevel.at)

I also commented on some of the threads.

Enjoy.

- Vasudev Ram - Online Python training and consulting

Get updates (via Gumroad) on my forthcoming apps and content.

Jump to posts: Python * DLang * xtopdf

Subscribe to my blog by email

My ActiveState Code recipes

Follow me on: LinkedIn * Twitter

Are you a blogger with some traffic? Get Convertkit:

Email marketing for professional bloggers



Friday, August 5, 2016

The D Language Playground site

By Vasudev Ram


The D language playground site:


is a web site (created somewhat recently, IIRC), where you can write or paste in a chunk of D code into a text box, click Run, and it will run it on their server, and send back the results to be displayed. It also has a tour of the language, and you can go from one example to another, and just run, or modify and run, each of them. So the same site serves both as an online sandbox to experiment with D language snippets, and as an interactive tutorial for D. In both these ways it is similar to the Go language playground/tour site. Either or both are worth checking out, if you are interested in those languages.

- Vasudev Ram - Online Python training and consulting




My Python posts     Subscribe to my blog by email

My ActiveState recipes



Monday, August 1, 2016

Video: C++, Rust, D and Go: Panel at LangNext '14

By Vasudev Ram

I recently came across this video of a panel discussion (in 2014) on modern systems programming languages. Yes, I know the term is controversial. Andrei and Rob say something about it. See the video.

The languages discussed are: C++, D, Go and Rust, by a panel at LangNext '14.

The panel consisted of key team members from the teams working on those languages:

- Bjarne Stroustrup for C++
- Andrei Alexandrescu for D
- Rob Pike for Go
- Niko Matsakis for Rust

(that's by language name in alphabetical order :)

Here is the video embedded below, and a link to it in case the embed does not work for you (sometimes happens).



I have only watched part of it so far (it is somewhat long), but found it interesting.

You can also download it with youtube-dl (written in Python, BTW) or some other video downloading tool, for watching offline. It's about 1.34 GB in size, so plan accordingly.

- Enjoy.

- Vasudev Ram - Online Python training and consulting
Follow me on Gumroad for product updates:



My Python posts     Subscribe to my blog by email

My ActiveState recipes



Sunday, March 29, 2015

Video: The Roots of Go (the 45 year old language): Talk at GopherCon India 2015

By Vasudev Ram



Saw this via Baishampayan Ghose's Twitter account (@ghoseb).

It is a video of a talk he gave, titled The Roots of Go, at GopherCon India 2015.

I only watched part of the video (so far) but it seems good.

I may update this post with more comments after watching the video completely.


The video is also embedded below.



- Vasudev Ram - Online Python training and programming

Dancing Bison Enterprises

Signup to hear about new software or info products that I create.

Posts about Python  Posts about xtopdf

Contact Page

Friday, January 3, 2014

Use WebSockets and Python for web-based system monitoring

By Vasudev Ram

I got to know about websocketd recently, via a reply to this question I posted on Hacker News: Ask HN: What are you using Go for?

websocketd is "a small command-line tool that will wrap an existing command-line interface program, and allow it to be accessed via a WebSocket". It's written in Go, by Joe Walnes.

He describes websocketd as "Like inetd, but for WebSockets. Turn any application that uses STDIN/STDOUT into a WebSocket server.".

The websocketd README goes on to say:

[ WebSocket-capable applications can now be built very easily. As long as you can write an executable program that reads STDIN and writes to STDOUT, you can build a WebSocket server. Do it in Python, Ruby, Perl, Bash, .NET, C, Go, PHP, Java, Clojure, Scala, Groovy, Expect, Awk, VBScript, Haskell, Lua, R, whatever! No networking libraries necessary. ]

Websocket topic on Wikipedia

So I wrote a small Python program to try out websocketd. It uses the psutil module to get disk space info (total, used, and free) from the system.

(I had blogged about psutil earlier, here:

psutil, Python tool to get process info and more.)

Here is the code:
# psutil_disk_usage.py

import string
from time import sleep
import psutil

print "Disk Space (MB)".rjust(46)
print " ".rjust(25) + "Total".rjust(10) + "Used".rjust(10) + "Free".rjust(10)  
for i in range(5):
    du = psutil.disk_usage('/')
    print str(i + 1).rjust(25) + str(du.total/1024/1024).rjust(10) + str(du.used/1024/1024).rjust(10) + str(du.free/1024/1024).rjust(10)  
    sleep(2)

When this program is run directly at the prompt, with the command:

python psutil_disk_usage.py

, it gives this output:
Disk Space (MB)
                             Total      Used      Free
                       1     99899     91309      8590
                       2     99899     91309      8590
                       3     99899     91309      8590
                       4     99899     91309      8590
                       5     99899     91309      8590
Running this program under the control of websocketd, with the command:

websocketd --port=8080 python psutil_disk_usage.py

, causes the output of the program to go to the browser that is listening on port 8080 (see below *).

You have to:

set PYTHONUNBUFFERED=true

at the command line first, for it to work as a WebSocket server; it works fine as a plain command-line program, without that setting.

See this StackOverflow question.

(*) You also have to write a WebSocket client, i.e. an HTML page with JavaScript, that the server can connect to, and send data to. The JavaScript code listens for a connection and then reads the data sent by the server and displays it on the web page.

In my next post, I'll show the JavaScript WebSocket client, which is a modified version of an example on the websocketd page.

- Vasudev Ram - Dancing Bison Enterprises

Contact Page

Vitamins & Supplements







Friday, September 20, 2013

Golang getting QML GUI support?

Watch "QML support for the Go language" on YouTube

Seen via this post by Gustavo Niemeyer whose work I have blogged about before:

https://plus.google.com/app/basic/stream/z13cu5ow3qecj5ccs22lztxjrzjwxt5yk04

This could be pretty cool and useful if it worked out. You could write GUI apps in Go. I saw a small bit of the video and some GUI things in Go are working.

Posted from mobile, please excuse typos and brevity.

Monday, June 10, 2013

Brian Kernighan uses Python


By Vasudev Ram

This is from the site usesthis.com, a.k.a The Setup :-), which has many interviews of well-known computer (and maybe other) people, about their hardware and software setups (and nowadays device setups too, of course). I've read quite a few of those interviews in the past, and they can be interesting.

Brian Kernighan uses Python. Cool ... [1] [2]

Brian Kernighan page (at Bell Labs)
Brian Kernighan page (at Princeton University)

[1] For those who don't know of Kernighan, he was, at Bell Labs, one of the top contributors to Unix and C (from early on, and for a long time), and is the co-author of the classic computer books "The C Programming Language" (with Dennis Ritchie), also abbreviated as K&R, and "The Unix Programming Environment" (with Rob Pike), abbreviated as K&P. Rob Pike has been working on the Go language for the last few years.

[2] I saw the usesthis.com article about Kernighan via this Reddit thread, which also has some interesting comments.

And I almost forgot to mention, Kernighan also co-invented Awk :-)

I was fortunate to get to read those two books (K&R and K&P) early on in my career. In fact, I should probably say "those four books" or "those six books" :-) because I read them at least twice or thrice. They had a big influence on me, and benefited me a lot in my work over the years, possibly more than any other computer books I've read, before or since then.

- Vasudev Ram - Dancing Bison Enterprises

Saturday, June 1, 2013

Video: Fireside chat, Go team at Google I/O 2013

Watch "Google I/O 2013 - Fireside Chat with the Go Team" on YouTube

Watched some of it. Audio not very good (on mobile) but can still hear a good amount. Probably better on desktop.

Wednesday, May 29, 2013

Unix-like pipes in Go, from labix.org

pipe - Unix-like pipelines for Go

Looks interesting.

This pipe Go package, by Gustavo Niemeyer of labix.org, allows you to programmatically set up and run a pipeline of processes in Go, and to get the pipe's standard output and standard error, either combined, or separately.

The page has some examples of creating pipelines using the package.

The approach he uses is more like the original Unix pipes concept:

http://en.wikipedia.org/wiki/Pipeline_(Unix)

in that it creates pipelines out of multiple processes, whereas the approach I took with my Python pipe_controller module was different: instead of multiple processes, I used multiple Python functions in a single process:

http://www.google.com/?q=jugad2+pipe_controller

(See the first few hits from the above search for pipe_controller.)

I recently came across some interesting work by Gustavo and others, involving porting Canonical's Juju devops tool from Python to Go.

Relevant links for the Juju port:

https://plus.google.com/app/basic/stream/z123eroqbu20sh5hi04cebzbpyzxznr4ru00k

https://groups.google.com/forum/m/#!topic/golang-nuts/jLnMsUbYwrQ

http://m.youtube.com/watch?v=kKQLhGZVN4A&desktop_uri=%2Fwatch%3Fv%3DkKQLhGZVN4A

https://lists.ubuntu.com/archives/juju-dev/2012-November/000281.html

Interestingly, IIRC, based on some stories that I read a while ago, the word juju is related to magic in some West  African language ...

http://en.m.wikipedia.org/wiki/Juju

And that may be why Juju scripts are called charms:

https://juju.ubuntu.com/

P.S. I wonder what Devops_Borat would have to say about Juju (and about Python and Go too :)

https://mobile.twitter.com/devops_borat

- Vasudev Ram
dancingbison.com

Tuesday, March 26, 2013

Go 1.1 release info

https://go.googlecode.com/hg/doc/go1.1.html

Interesting to see the list of changes and how they are keeping compatibility with Go 1.0. Also, the Go standard library seems to have many capabilities.

They say this release should improve the performance of many Go programs.

Wednesday, January 30, 2013

Go language can be deployed on dotCloud - experimental

Golang on dotCloud - January Hackday Project - dotCloud blog

Interestingly, this is by a guy who uses Python a good amount, apparently.

Go figure ...

http://news.ycombinator.com/item?id=5135054

- Vasudev Ram
www.dancingbison.com
Software consulting and training (***Python, Linux, databases, open source software)

Monday, January 7, 2013

Introduction to Go: Dr. Dobbs: a five-part series

Introduction to Go | Dr Dobb's

It is by Mark Summerfield, a software developer and trainer who has also written books on Qt and Python.

- vr
dancingbison.com

Thursday, January 3, 2013

Go is over three years old now

The Go Programming Language Blog: Go turns three

Happened earlier, saw it today.

The content of the post is interesting, including about who uses Go.

Also see my two recent posts about Go.

- Vasudev Ram
www.dancingbison.com

Wednesday, January 2, 2013

Comparison of Go vs. Python for a web server app

Go vs. Python for a simple web server

By the same author quoted in my previous post.

Having used Go a bit, I can confirm that a) Go code compiles really fast (tried by me only for small programs, but fast compilation is a design goal for Go, IIRC), and b) compiled Go app binaries are a bit large (*) (but that is probably at least partially due to static linking, which is a feature, a bug, or both, depending on how you look at it :-)

He mentions some pros and cons of both Go and Python.

(*) A simple hello world Go program compiles to a binary of ~1MB on Windows. Not tried it on Linux yet.

- Vasudev Ram
Python and open source consulting and training
www.dancingbison.com

Using Go to create web apps - post and threads

Thoughts on Go after writing 3 websites : programming

First saw it on Hacker News.

The above thread is on Reddit.

Interesting stuff.

Wednesday, December 19, 2012

Thursday, December 13, 2012

The Go Playground lets you enter and run Go code online

Go Playground

It even works some from my Android mobile's browser.

Can be useful to write and run snippets of code on  the go :-)

Also to run code from your desktop / laptop, whether or not you have Go installed locally. All you need is a reasonably modern browser and an Internet connection.

The Go Tour - tour.golang.org - also lets you do this, with the added benefit that you can modify their examples and then run them.

- Vasudev Ram
www.dancingbison.com

Thursday, October 18, 2012

goupx can shrink Go language binaries

By Vasudev Ram


I have been using the Go language lately, and noticed that the binaries it creates when you compile your source code can be large, since they statically link everything needed to run your Go program. (A simple Hello World program binary can be on the order of magnitude of 1 MB in size.)

(Some of the posts I checked say that Go supports dynamic linking via gccgo, a front-end to the gcc compiler. Not sure right now what the difference is between dynamic linking and dynamic loading (of libraries, as is done with C. Need to check.)

goupx is a possible solution to this issue. It seems to be based on UPX (Ultimate Packer for eXecutables), a utility for compressing executable files.

I had come across UPX some years ago, and tried it out a bit then. Today I again checked the UPX web site and was interested to see that it supports compressing executables for several platforms, including Linux, Mac OS X and others, not just Windows.

From the goupx site:

[ Resulting filesizes are typically 25% of the original go executable. Your mileage my vary. ]

goupx seen via this comment on proggit (part of a thread about learning Go).

- Vasudev Ram - Dancing Bison Enterprises


Friday, October 12, 2012