Posts Tagged ‘programming

Recently I got a Chromebook, which has forced me to step up my search for a good web-based IDE. I only looked at the free-level capabilities, looking for something that would handle multiple projects and maximum flexibility. Here are my top three recommendations:

Koding provides a clean interface with a lot of flexibility. In particular, I like that they provide a full AWS virtual machine. This is particularly nice for those who want to do more than just code, but to design or experiment with an entire software stack. However, their interface is a little bit less like an IDE and more of just a terminal and editor connected to that virtual machine.

Cloud9 works more like a good IDE where you can set up a build and run tasks. But the build and run environments seem to work outside of your particular terminal environment, which makes their workflow different than it might be on other platforms.

Codeanywhere maybe be a good mix. For code editing it provides a little more than a text editor, and doesn’t want to control or own your project. You can actually keep your code external, and access it through (S)FTP, Google Drive, or Dropbox, and simply access it through code anywhere. But the still also give you a “DevBox” which is something like a VM.  Additionally, Codeanywhere provides mobile apps (which I haven’t tried).

I looked at other solutions (Codio, Codebox, Codenvy, PythonAnywhere, Nitrous) but excluded most of them because they didn’t allow me full control over my software stack.

The problem with all of these is that they can’t access code that you don’t have on the Internet, for example, code in your private Intranet only. For that I found that I could quickly install the open source Codebox IDE on my private Intranet server.

Over the last few years, Google has been working on their own pet programming language, called Go.  It is a high level language that is compiled to native binary code.  I took a quick look at Go to determine whether or not it would be good on an embedded system.

Advantages

It is very easy to build a cgo compiler that will cross compile to ARM.  If you are using ARM or x86 for your embedded system, you can have a program compiled and running on your system in just a few minutes.  If you are using another architecture, you may be out of readily available support, but not out of luck–the gccgo compiler may provide just what you need.

Go links everything statically.  This means that you never have to worry about getting all the run-time dynamically linked libraries at just the right version on your embedded system.

Go is a nice high-level language that doesn’t require an interpreter.  Interpreters can be big and slow, which isn’t ideal for an embedded system.

Disadvantages

Go binaries are big.  This is because everything is always statically linked.  Go binaries also contain a certain amount of run-time overhead like garbage collection.

Go was developed first for x86.  Support for other architectures have come after support for x86, so running Go on an ARM isn’t as well tested as running Go on an x86.

Go is new.  You don’t get years and years of experience with Go as you would with other languages like C++.  Additionally, you are less likely to find highly-experience Go programmers as you would with other more common langauges.

Conclusion

Because Go binaries are big, it makes it impractical to use Go on an embedded system except for in a few cases.  If you have lots and lots of storage on your embedded system, Go becomes more practical. If you are using Go to write a single monolithic program for your embedded system, the binary size overhead may be less of an issue.  If you want to write lots of small applications (which use dynamically linked libraries) than Go is not for you.

Because Go is new, it may not have seen as much testing as might be needed for critical embedded systems.  But if you need to quickly get a prototype working, Go might speed up development.  I would imagine that a large company might want to stay away from Go for now, but small startups who like to take risks might justify using Go to capture the big development rewards.

hAPI hAPI joy joy

Posted in Technicalon Jun 30, 2008

Dear Google,

Let me tell you why you are a winner in my book. Three letters, A-P-I. I think opening up your services through developer APIs is what gives Google an edge over your competitors. It is what makes Google more than just a web site. It makes Google a web service. Your latest efforts to make Google data more mashable is a good example of your continued efforts to support nice APIs.

Thank you for your efforts and keep up the good work.

atoi(getenv(“MYVAR”))

Posted in Technicalon May 28, 2008

These are mostly personal notes. I’m not sure if they will make sense to others.

I had a problem with a line of code like this:
int x = atoi(getenv("MYVAR"));

If this line was in daemon-ized code started at init level 2, it would segfault. (I’m not sure if these conditions are necessary, but those were my conditions).

getenv("UNKNOWN_VAR") == NULL
atoi(NULL) should == 0

But for some reason, things were segfaulting. I corrected the problem with:
if (getenv("MYVAR") == NULL) int x = 0;
else int x = atoi(getenv("MYVAR"));

I came across this line of code today, and while I don’t normally hate other people’s coding style, this one has something in it that really bothers me:

i = ((unsigned int)(crcAccum >> 24) ^ *dataBlkPtr++ ) & 0xff;

Cross post code

Posted in Technicalon Mar 1, 2006

I’ve implemented a method which will automatically take posts I make on blogger.com and publish them on this blog as well. I thought I would share the code I used to do this. If you were to use use this script, you would need to replace text in all caps with actual values.

My code makes use of the Blogger Class from Dented Reality. Use at your own risk and don’t blame me if it doesn’t work or screws up your blogs.
Read the rest of this entry »

Dining Philosphers Problem

Posted in Technicalon Oct 3, 2005

http://en.wikipedia.org/wiki/Dining_philosophers_problem

This should help with my CS 345 program.


Categories