Node.js + Coffeescript = computing awesomeness

From the Node.js website:

“Node’s goal is to provide an easy way to build scalable network programs. In the “hello world” web server example above, many client connections can be handled concurrently. Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when a new connection is made, and then it goes to sleep. If someone new connects, then it executes the callback. Each connection is only a small heap allocation.

This is in contrast to today’s more common concurrency model where OS threads are employed. Thread-based networking is relatively inefficient and very difficult to use. See: this and this. Node will show much better memory efficiency under high-loads than systems which allocate 2mb thread stacks for each connection. Furthermore, users of Node are free from worries of dead-locking the process—there are no locks. Almost no function in Node directly performs I/O, so the process never blocks. Because nothing blocks, less-than-expert programmers are able to develop fast systems.”

I totally agree with the event machine, no-blocking approach, and that something like this was needed to improve the coding experience.

A few thoughts:

V8 Javascript is basically a compiled language: so we get binary speed with abstraction of Javascript

CoffeeScript is used which gives the clean and readable code replacing Javascript yet compiles through to machine code




Comments (2)

Guns and butter: we can’t have infinite amounts of both

In macroeconomics, the guns versus butter model is an example of a simple tradeoff problem. It demonstrates the relationship between a nation’s investment in defense and civilian goods. In this example, a nation has to choose between two options when spending its finite resources. It can buy either guns (invest in defense/military) or butter (invest in production of goods), or a combination of both. This can be seen as an analogy for choices between defense and civilian/domestic spending.

Under the gold standard, with LBJ and Nixon the US had to prioritize its fiscal policy to some degree. Failure to do so created inflation and triggered President Nixon’s decision to go off the gold standard and switch to fiat money.   This reduced the pressure to make cutbacks in either defense spending or domestic programs; in a sense it eliminated the need for budget prioritization.

Once the government didn’t have to decide between competing priorities it could have all the  guns and butter it wanted. So government and people forgot that government was about deciding between limited resources and instead thought the government was simply a dispenser of funds.   Now 40 years later people are wondering why there’s an inability to compromise? We forgot how.

Take a look at the FRB’s chart of Total Loans and Investments at All Commercial Banks (LOANINV) – FRED – St. Louis Fed:  this went exponential roughly the same time Nixon took the US off of the  gold standard.  Paul Volcker was able to crush inflation in the early 80’s with punitive interest rates; and global wage arbitrage (China) eliminated wage pressures.  However the US has now reached a point where debt issuance is problematic: prioritization of government spending is necessary.

What’s it going to be: guns or butter?

Leave a Comment

Oregon population growth 2010 – 2011 very slow

The PSU Population Research Center has released estimates that show the state’s population increased by 0.5% between 7-1-2010 and 7-1-2011.  The actual number is estimated at 19,515 persons.

There were only two counties that grew 1% or higher: Hood River and Washington.  Washington County is where Intel’s operations are located.

Why is growth slow?  The state’s age distribution means that natural increase is slow, and the housing crash and national economic crisis affected the state significantly.  State economic policy that leans toward luring large out of state companies to locate new facilities here is ineffective since business investment nationally has been slow.  Operations that do locate here tend to exit quickly when the relevant industry experiences a cyclical downturn.

A tax system that relies on income tax and property tax is probably a deterrent to retirees and small to medium business relocations.

Leave a Comment

Japan’s economic output trend

has not been good.  Recurring multi-quarter spates of negative GDP growth and industrial production indicate serious problems.

Leave a Comment

Brazil population distribution

This chart shows population density:
According to this article:

“The majority of Brazilians live within 300 kilometers of the coast, while the interior in the Amazon Basin is almost empty.  This historical pattern is little changed by recent movements into the interior.”

and this is a chart of historical population growth in Brazil:

The exponential increase in the 20th century is, of course, largely due to advances in modern medicine reducing infant mortality.

Leave a Comment

A look at the FRB balance sheet

Here is a simplified chart provided by this site:

Here’s a chart of what makes up the balance:

Finally, a chart of part of the other side of the equation which is money circulating:

The jump in M1 closely parallels the growth in the Fed balance sheet assets; if velocity of money picks up inflation is a big risk.

Leave a Comment

Outside the box

Leave a Comment

« Newer Posts · Older Posts »