Seite wählen

NETWAYS Blog

Weekly Snap: Synergy, Braintower, TypeScript & Csync2

1-5 October started the month with tips on mouse and keyboard sharing, a new JavaScript language and a whole lot on monitoring.
Georg announced a new €599 deal on the Braintower SMS Gateway for Nagios and Icinga, while Lennart showed how to create a monitoring cluster with csync2.
Continuing on the monitoring theme, Eva counted 16 days to the OSMC 2012 with Michael Lübben’s presentation on SLA Reporting. She went on to arrange extra rooms for those who hoped to defy the ticket sell-out, and offer up the last few spots in the Icinga workshop.
Finally, Marcus recommended Synergy to share keyboard and mouse between multiple screens and Gunnar played with TypeScript, a new static JavaScript based language.

TypeScript: Statisch typisiertes Javascript

TypeScript ist eine auf JavaScript basierende neue Sprache, die von Microsoft entwickelt wurde. Neben der vollständigen Kompatibilität zu JavaScript bietet sie bereits jetzt einige interessante Features, die zukünftig im Rahmen des ECMAScript 6-Standards in JavaScript einfließen sollen: z.B. Klassen, Interfaces und Module:

class Greeter {
  greeting;
  constructor (message) {
    this.greeting = message;
  }
  greet() {
    return "Hello, " + this.greeting;
  }
}

(Beispiel leicht angepasst von www.typescriptlang.org.)
Außerdem sind Variablen in TypeScript optional typisierbar:

function greet(message : string) {
  alert(message);
}

Dies macht es IDEs einfacher, für Scripts Auto-Completion zu ermöglichen. Momentan wird dies nur von Visual Studio unterstützt, aber mit der Zeit sollten auch andere IDEs Unterstützung für TypeScript bieten.
TypeScript kann in allen Browsern verwendet werden, die JavaScript unterstützen. Dazu kann es entweder manuell mit dem TypeScript-Compiler („tsc“) zu JavaScript kompiliert werden oder zur Laufzeit per Einbindung einer JavaScript-Library, die dann clientseitig im Browser den TypeScript-Code kompiliert.
Eine Möglichkeit, TypeScript auszuprobieren gibt es auf der offiziellen Webseite unter http://www.typescriptlang.org/Playground.