Monday, November 26. 2012Two-tonne Witch computer gets a rebootVia BBC ----- The machine cranked through the boring calculations atomic scientists once had to do
Kevin Murrell who discovered the computer explains how it was brought back to life The world's oldest original working digital computer is going on display at The National Museum of Computing in Buckinghamshire. The Witch, as the machine is known, has been restored to clattering and flashing life in a three-year effort. In its heyday in the 1950s the machine was the workhorse of the UK's atomic energy research programme. A happy accident led to its discovery in a municipal storeroom where it had languished for 15 years. Cleaning upThe machine will make its official public debut at a special ceremony at The National Museum of Computing (TNMOC) in Bletchley Park on 20 November. Attending the unveiling will be some of its creators as well as staff that used it and students who cut their programming teeth on the machine. Design and construction work on the machine began in 1949 and it was built to aid scientists working at the UK's Atomic Energy Research Establishment at Harwell in Oxfordshire. The 2.5 tonne machine was created to ease the burden on scientists by doing electronically the calculations that previously were done using adding machines. The machine first ran in 1951 and was known as the Harwell Dekatron - so named for the valves it used as a memory store. Although slow - the machine took up to 10 seconds to multiply two numbers - it proved very reliable and often cranked up 80 hours of running time in a week. By 1957 the machine was being outstripped by faster, smaller computers and it was handed over to the Wolverhampton and Staffordshire Technical College (more recently Wolverhampton University) where it was used to teach programming and began to be called the Witch (Wolverhampton Instrument for Teaching Computation from Harwell). In 1973 it was donated to Birmingham's Museum of Science and Industry and was on show for 24 years until 1997 when the museum closed and the machine was dismantled and put into storage. By chance Kevin Murrell, one of the TNMOC's trustees, spotted the control panel of the Witch in a photograph taken by another computer conservationist who had been in the municipal store seeking components for a different machine. Mr Murrell said that as a "geeky teenager" he had regularly seen the Witch during many trips to the museum and instantly recognised its parts in the background of the photograph. On subsequent trips to the storage facility the various parts of the Witch were found, retrieved and then taken to the museum at Bletchley where restoration began. The restoration effort was led by conservationist Delwyn Holroyd who said it was "pretty dirty" when the machine first arrived at Bletchley. Remarkably, he said, it had not suffered too much physical damage and the restoration team has been at pains to replace as little as possible. The vast majority of the parts on the machine, including its 480 relays and 828 Dekatron tubes, are entirely original, he said. Said Mr Murrell: "It's important for us to have a machine like this back in working order as it gives us an understanding of the state of technology in the late 1940s in Britain."
A Few New Things Coming To JavaScriptVia Addy Osmani -----
I believe the day-to-day practice of writing JavaScript is going to change dramatically for the better when ECMAScript.next arrives. The coming year is going to be an exciting time for developers as features proposed or finalised for the next versions of the language start to become more widely available. In this post, I will review some of the features I'm personally looking forward to landing and being used in 2013 and beyond.
ES.next implementation statusBe sure to look at Juriy Zaytsev's ECMAScript 6 compatibility table, Mozilla's ES6 status page as well as the bleeding edge versions of modern browsers (e.g Chrome Canary, Firefox Aurora) to find out what ES.next features are available to play with right now. In Canary, remember that to enable all of the latest JavaScript experiments you should navigate to Alternatively, many ES.next features can be experimented with using Google's Traceur transpiler (useful unit tests with examples here) and there are shims available for other features via projects such as ES6-Shim and Harmony Collections. Finally, in Node.js (V8), the ModulesWe're
used to separating our code into manageable blocks of functionality. In
ES.next, A module is a unit of code contained within a
A module instance is a module which has been evaluated, is linked to other modules or has lexically encapsulated data. An example of a module instance is:
An
Modules Revisiting the export example above, we can now selectively choose what we wish to We can just import
We can import
Earlier,
we mentioned the concept of a Module Loader API. The module loader
allows us to dynamically load in scripts for consumption. Similar to
Whilst
the above example seems fairly trivial to use, the Loader API is there
to provide a way to load modules in controlled contexts and actually
supports a number of different configuration options. What about classes?I'm not going to be covering ES.next classes in this post in more, but for those wondering how they relate to modules, Alex Russell has previously shared a pretty readable example of how the two fit in – it's not at all about turning JavaScript into Java. Classes in ES.next are there to provide a declarative surface for the semantics we're used to (e.g functions, prototypes) so that developer intent is expressed instead of the underlying imperative mechanics. Here's some ES.next code for defining a widget:
Followed by today's de-sugared approach that ignores the semantic improvements brought by ES.next modules over the module pattern and instead emphasises our reliance of function variants:
All the ES.next version does it makes the code more easy to read. What Where do these modules fit in with AMD?If anything, the landscape for modularization and loading of code on the front-end has seen a wealth of hacks, abuse and experimentation, but we've been able to get by so far. Are ES.next modules a step in
the right direction? Perhaps. My own take on them is that reading their
specs is one thing and actually using them is another. Playing with the
newer module syntax in Harmonizr, Require HM and Traceur,
you actually get used to the syntax and semantics very quickly – it
feels like using a cleaner module pattern but with access to native
loader API for any dynamic module loading required at runtime. That
said, the syntax might feel a little too much like Python for some
peoples tastes (e.g the I'm part of the camp that believe if there's functionality developers are using broadly enough (e.g better modules), the platform (i.e the browser) should be trying to offer some of this natively and I'm not alone in feeling this way. James Burke, who was instrumental in bringing us AMD and RequireJS has previously said:
James has however questioned whether ES.next modules are a sufficient solution. He covered some more of his thoughts on ES.next modules back in June in ES6 Modules: Suggestions for improvement and later in Why not AMD? for anyone interested in reading more about how these modules fit in with RequireJS and AMD. Isaac Schlueter has also previously written up thoughts on where ES6 modules fall short that are worth noting. Try them out yourself using some of the options below and see what you think. Use it todayObject.observe()The idea behind Property observing is behaviour we commonly find in JavaScript MVC frameworks at at the moment and is an important component of data-binding, found in solutions like AngularJS and Ember. This is a fundamentally important addition to JS as it could both offer performance improvements over a framework's custom implementations and allow easier observation of plain native objects.
Availability: Object.observe will be available in Chrome Canary behind the "Enable Experimental JS APIs" flag. If you don't feel like getting that setup, you can also checkout this video by Rafael Weinstein discussing the proposal. Use it today
Default Parameter ValuesDefault
parameter values allow us to initialize parameters if they are not
explicitly supplied. This means that we no longer have to write The syntax is modified by allowing an (optional) initialiser after the parameter names:
Only trailing parameters may have default values:
Availability: FF18 Block ScopingBlock scoping introduces new declaration forms for defining variables scoped to a single block. This includes:
Using
Maps and setsMapsMany of you will already be familiar with the concept of maps as we've been using plain JavaScript objects as them for quite some time. Maps allow us to map a value to a unique key such that we can retrieve the value using the key without the pains of prototype-based inheritance. With the Maps
Availability: FF18 Use it todaySetsAs Nicholas has pointed out before, sets won't be new to developers coming from Ruby or Python, but it's a feature thats been missing from JavaScript. Data of any type can be stored in a set, although values can be set only once. They are an effective means of creating ordered list of values that cannot contain duplicates.
One possible use for sets is reducing the complexity of filtering operations. e.g:
This results in O(n) for filtering uniques in an array. Almost all methods of array unique with objects are O(n^2) (credit goes to Brandon Benvie for this suggestion). Availability: Firefox 18, Chrome 24+ Use it todayProxiesThe Proxy API will allow us to create objects whose properties may be computed at run-time dynamically. It will also support hooking into other objects for tasks such as logging or auditing.
Also checkout Zakas' Stack implementation using ES6 proxies experiment. Availability: FF18, Chrome 24 WeakMapsWeakMaps help developers avoid memory leaks by holding references to their properties weakly, meaning that if a WeakMap is the only object with a reference to another object, the garbage collector may collect the referenced object. This behavior differs from all variable references in ES5. A key property of Weak Maps is the inability to enumerate their keys.
So again, the main difference between WeakMaps and Maps is that WeakMaps are not enumerable. Use it todayAPI improvementsObject.isIntroduces a function for comparison called
Availability: Chrome 24+ Use it todayArray.from
Converting any Array-Like objects:
The following examples illustrate common DOM use cases:
Use it todayConclusionsES.next is shaping up to potentially include solutions for what many of us consider are missing from JavaScript at the moment. Whilst ES6 is targeting a 2013 spec release, browsers are already implementing individual features and it's only a matter of time before their availability is widespread. In the meantime, we can use (some) modern browsers, transpilers, shims and in some cases custom builds to experiment with features before ES6 is fully here. For more examples and up to date information, feel free to checkout the TC39 Codex Wiki (which was a great reference when putting together this post) maintained by Dave Herman and others. It contains summaries of all features currently being targeted for the next version of JavaScript. Exciting times are most definitely ahead.
(Page 1 of 1, totaling 2 entries)
|
QuicksearchPopular Entries
CategoriesShow tagged entriesSyndicate This BlogCalendarBlog Administration |