Client side scripting using meta-programming
Client side scripting using meta-programming
bachelor thesis (DEFENDED)
![Document thumbnail](/bitstream/handle/20.500.11956/13016/thumbnail.png?sequence=7&isAllowed=y)
View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/13016Identifiers
Study Information System: 46584
Collections
- Kvalifikační práce [11266]
Author
Advisor
Referee
Mareš, Martin
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Programming
Department
Department of Software Engineering
Date of defense
11. 9. 2007
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
English
Grade
Excellent
Webové aplikace založené na principech souhrnně označovaných zkratkou "Ajax" se dnes stávají de-facto standardem, ale vývoj takovýchto aplikací je naneštěstí velmi náročný. Vývojáři musí čelit problémům, jako je nesourodost programovacích jazyků v různých vrstvách aplikace, omezené běhové prostředí v prohlížeči a chybějící integrace mezi serverovou a klientskou částí aplikace, které musí být psány jako dvě nezávislé části, ale obvykle tvoří jednu homogenní aplikaci. V této práci představujeme první projekt, který usiluje o řešení všech tří zmíněných problémů a současně umožňuje použití stávajících technologií jako je ASP.NET na straně serveru a JavaScript na straně klienta. Používáme jazyk F# pro psaní obou částí aplikace, což umožňuje vyvíjet klientskou část typově bezpečným způsobem s použitím části F# knihoven, dále umožňujeme propojení obou částí aplikace v jednom homogenním typu, který určuje logiku aplikace. Při spuštění je aplikace vykonávána různorodě, část pomocí JavaScriptu v prohlížeči a část jako nativní kód na serveru. K oddělení serverového a klientského kódu používáme monadický zápis jazyka F# a tím se toto rozlišení stává vlastností typového systému.
"Ajax" programming is becoming a de-facto standard for certain types of web applications, but unfortunately developing this kind of application is a difficult task. Developers have to deal with problems like a language impedance mismatch, limited execution runtime in web browser on the client-side and no integration between client and server-side parts that are developed as a two independent applications, but typically form a single and homogenous application. In this work we present the first project that deals with all three mentioned problems but which still integrates with existing web technologies such as ASP.NET on the server and JavaScript on the client. We use the F# language for writing both client and server-side part of the web application, which makes it possible to develop client-side code in a type-safe programming language using a subset of the F# library, and we provide a way to write both server-side and client-side code as a part of single homogeneous type defining the web page logic. The code is executed heterogeneously, part as JavaScript on the client, and part as native code on the server. Finally we use monadic syntax for the separation of client and server-side code, tracking this separation through the F# type system.