Monday, December 3, 2012

TouchDevelop: A touch-first IDE for the Web created with TypeScript

The TouchDevelop is a novel, touch-first IDE originally written as a Windows Phone 7 app using C# and XAML. The TouchDevelop lets you create WP7, Win8 and Web-apps directly on your phone, tablet, or desktop.

The TouchDevelop team was frustrated by the lack of compile-time checking trying to build the JavaScript version, both for Win8 and the Web. They were very excited to be one of the early adopters of TypeScript, a typed superset of JavaScript that compiles to idiomatic JavaScript.

Watch this video where one of the creators of Nemerle language M. Moskal explains the using of the TypeScript during the development of the TouchDevelop project.

M. Moskal also told that TypeScript team is very busy creating generics. The TouchDevelop is probably the first large-scale Web app written in TypeScript language. You can download the TouchDevelop here.

Sunday, October 7, 2012

TypeScript is a language for industrial Web applications

TypeScript is a language for application-scale JavaScript development. It combines type checking, static analysis, explicit interfaces into a single language and compiler.

By building on JavaScript, TypeScript keeps you close to the runtime you’re targeting while adding only the syntactic sugar necessary to support large applications and large teams.

Importantly, TypeScript enables great tooling experiences for JavaScript development. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. You can use it in any browser, any host and any OS.

TypeScript offers optional type annotations, open source under the Apache 2.0 license, explicit interfaces, module exports. There is limited type inference. It works with JQuery library.

TypeScript extends the syntax of JavaScript. So any JavaScript program is a TypeScript program. New syntax features (classes, interfaces, modules) is used in accordance with ECMAScript 6. ECMAScript 6 is the next version of standard JavaScript.

TypeScript's development was led by Anders Hejlsberg. He developed TypeScript with Luke Hoban, Steve Lucco. Hejlsberg has a long history of developing practical, mainstream programming languages. He was the man behind Turbo Pascal, Delphi and C#. In 1996, Hejlsberg left Borland and joined Microsoft. He received the 2001 Dr. Dobb's Excellence in Programming Award. He also got a Technical Recognition Award for Outstanding Technical Achievement for a work on the C# language.

Next I'll show you how to debug TypeScript programs. You need to download and install the TypeScript editor plugin for VS 2012.

Create HTML Application with TypeScript in VS 2012.

Add TypeScript files.

To generate source map files change the MSBuild target that builds TypeScript files in your project file. You will find a target called "BeforeBuild" that is calling the compiler at "$(PROGRAMFILES)\Microsoft SDKs\TypeScript\\tsc".
Change it for "$(PROGRAMFILES)\Microsoft SDKs\TypeScript\\tsc "-sourcemap"..."

You need to download and install the Canary Chrome web browser from Google web site and add it to the VS 2012.

You have to enable source maps in the Canary Chrome.

Run your apllication. It will be opened in the Canary Chrome. Set up a break point in your ts file (Sources tab ).

Press F5 to run your page in the Canary Chrome.

Sunday, September 9, 2012

The Database as a Value

Rich Hickey is known as the inventor of the Clojure programming language. You can watch the interview of Brian Beckman with Rich Hickey to dig into the details of this very interesting language.

Over the past couple of years Rich has been putting his ways to work on data programmability. The result is a new type of database, Datomic. Datomic is a database of flexible, time-based facts, supporting queries and joins, with elastic scalability, and ACID transactions. It is implemented in Clojure.

Here is the recording of Rich's talk on a new approach to database design.

Tuesday, July 10, 2012


This book was written by Philip J. Guo. It chronicles his six years of working towards a Ph.D. in computer science at Stanford University from 2006 to 2012.

A diverse variety of people can benefit from reading it, including:

_ undergraduates who might be interested in pursuing a Ph.D.;

_ current Ph.D. students who are seeking guidance or inspiration;

_ professors who want to better understand Ph.D. students;

_ employers who hire and manage people with Ph.D. degrees;

_ professionals working in any creative or competitive field where self-driven initiative is crucial;

_ educated adults (or precocious kids) who are curious about how academic research is produced.

Sunday, June 17, 2012

Nemerle language (part 3) article

I finished translation of Nemerle language (part 3) article. You can find the first and the second part of the article here and here.

This article opens a series devoted to teaching the Nemerle programming language. Existing articles about this language assume the programmer’s familiarity with the Microsoft .NET framework and the C# programming language. On the other hand, this series is targeted at people familiar with neither one nor the other and could be used for teaching programming as such. People new to programming might require assistance of someone more experienced.

Monday, March 19, 2012

Memory management in C++ syntax directed editor

The "buddy system" has been implemented in C++ syntax directed editor using C language (To enlarge the text of the program click on it).

The size of reserved blocks is limited to 1, 2, 4, 8, 16 bytes, … that is a power of two. If the requested block size is not a power of two then the next higher power of 2 is chosen and extra unused space is allocated.

Let the size of the memory pool will be 2**n.
We keep separate lists of available blocks of each size 2**k, 0 <= k <= n. When a block of 2**k bytes is desired, and if nothing of this size is available, a larger available block is split into two equal parts; ultimately, a block of the right size 2**k will appear.

When one block splits into two (each of which is half as large as the original), these two blocks are called buddies. Later when both buddies are available again, they coalesce back into a single block.

The practical value of the method is determined by the possibility to calculate the address of the buddy. For example, the buddy of the block of size 2 beginning in binary location 100 is a block starting in binary location 110.
For block with size 2**k and the address x there will be the buddy with the address:
x+2**k if x mod 2**(k+1) = 0
x-2**k if x mod 2**(k+1) = 2**k
See the text of the program for details. First of all you execute the following code.

// Give segments of RAM
if( GiveSegments() == -1 ){PostQuitMessage(0);return FALSE;}
else InitSegments();

After that, call “GiveRAM” or “FreeRam” functions to allocate or free the blocks of memory. At the end of your program call “FreeSegments” function.