Personal tools

Haskell in web browser

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Preface)
 
(Basics)
Line 9: Line 9:
 
The idea of such conversion has been around for a while <''insert citations''>, and [[Yhc/Javascript|Yhc Javascript backend]] is its practical implementation. Use of functional languages for client-side Web programming is a relatively new phenomenon, and hopefully this Tutorial along with the [http://www.golubovsky.org:5984/static/yhcws/MainGUI.html Service online] will attract more attention and subsequently programmers resources into this area.
 
The idea of such conversion has been around for a while <''insert citations''>, and [[Yhc/Javascript|Yhc Javascript backend]] is its practical implementation. Use of functional languages for client-side Web programming is a relatively new phenomenon, and hopefully this Tutorial along with the [http://www.golubovsky.org:5984/static/yhcws/MainGUI.html Service online] will attract more attention and subsequently programmers resources into this area.
   
==Browser programming basics==
+
==Basics of programming for web browser==
  +
  +
The most widespread (and natively interpreted by most existing Web browsers) language for client-side Web programming is Javascript. Several APIs are exposed by browser to Javascript programs, such as [http://www.w3.org/DOM/ Document Object Model (DOM)], [http://www.w3.org/Style/CSS/ Cascading Style Sheets (CSS)], and [http://www.w3.org/TR/XMLHttpRequest/ XML HTTP Request] to name a few. In order for a Haskell program to communicate with browser using these APIs, proper language bindings were created. The subsections of this section discuss approaches and methods used to create those bindings. Although direct use fo these bindings may not even be needed in most cases, it is useful to have understanding of how things work at this level. Please note though, that this Tutorial does not focus on the specifics of DOM/CSS/XMLHTTP programming per se; it contains information how to ''use'' these interfaces in a Haskell program. For details please refer to the original sources at [http://www.w3.org Web Consortium]. Also, [http://www.w3schools.com/ W3 Schools] website contains very useful information and practical excercises.
  +
 
===DOM===
 
===DOM===
 
===Threads===
 
===Threads===
  +
===XML HTTP===
 
==Haskell web toolkit==
 
==Haskell web toolkit==

Revision as of 02:31, 14 March 2008

Contents

Haskell in web browser
A Tutorial

1 Preface

This tutorial is written in connection with launch of the experimental Yhc Web Service, an online tool to explore the possibilities of Haskell use as a language to program client part (that is, running in a browser) of Web applications by the means of conversion of Haskell source to Javascript.

The idea of such conversion has been around for a while <insert citations>, and Yhc Javascript backend is its practical implementation. Use of functional languages for client-side Web programming is a relatively new phenomenon, and hopefully this Tutorial along with the Service online will attract more attention and subsequently programmers resources into this area.

2 Basics of programming for web browser

The most widespread (and natively interpreted by most existing Web browsers) language for client-side Web programming is Javascript. Several APIs are exposed by browser to Javascript programs, such as Document Object Model (DOM), Cascading Style Sheets (CSS), and XML HTTP Request to name a few. In order for a Haskell program to communicate with browser using these APIs, proper language bindings were created. The subsections of this section discuss approaches and methods used to create those bindings. Although direct use fo these bindings may not even be needed in most cases, it is useful to have understanding of how things work at this level. Please note though, that this Tutorial does not focus on the specifics of DOM/CSS/XMLHTTP programming per se; it contains information how to use these interfaces in a Haskell program. For details please refer to the original sources at Web Consortium. Also, W3 Schools website contains very useful information and practical excercises.

2.1 DOM

2.2 Threads

2.3 XML HTTP

3 Haskell web toolkit