Tag Archives: JavaScript

Fun with FunScript

FunScript is a compiler or better a transpiler, which converts F# code into JavaScript code.
I have not tried it much since the last couple of days and I’m really amazed how well it works.

I had really good expierences creating D3 charts but I wasn’t shure how well it works with AngularJS, with all his dependency mechanisms and “magic” behind the scenes.
So I thought I give it a try!

I came up with this DSL like syntax:

The DSL code looks like this (mainly it wraps the kinda ugly generated code):

It is still a bit clunky to use (mainly to get angular’s dependency injection to work) and it is far from completed, but at least a simple controller works!

The downsides of using FunScript to generate JavaScript code is the additional code generation step, it generates more verbose code than writing similar code in JavaScript and the debugging is chunky (but that’s a problem nearly every transpiler has). I don’t know of a source map file for the generated code, but maybe I’m missing something.

On the other side you can use this nice functional and composable code in places where I never thought it is possible to get it to work!

The sample project can be found here.

Advertisements
Tagged , , , ,

HTML5 Boilerplate

HTML5 Boilerplate

Dabei handelt es sich um ein Best Practices Template für HTML5.

Beinhaltet unter Anderem:

  • HTML-Vorlage
  • CSS
    •  Style-Resettierung
    • viele weitere Formatvorlagen, z.B. für den Druck, oder mobile Geräte
  • JavaScript
    • inklusive Modernizr und jQuery
    • enthält einen interessanten Ansatz, wie eigene Scripts eingebunden werden können
  • Webserver Konfiguration
    • z.B. für die empfohlene Konfiguration der Expire Header
    • IIS web.config ist zwar nicht im Projekt enthalten, ist aber in der Doku verlinkt
  • Minification-Projekt
  • Ausführliche Dokumentation zu ALLEN vorgenommenen Anpassungen

Genial ist wirklich die zugehörige Dokumentation, da sie jede Menge Tipps und Ideen enthält. Hab dadurch wirklich eine Menge zu HTML5 gelernt!

Tagged , , , ,