Personal tools

Yhc web service

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Started)
(Part 1)
Line 5: Line 5:
 
==Purpose==
 
==Purpose==
   
[[Yhc]] Web Service is a web-based tool to use Yhc's [[Yhc/Javascript|Javascript back end]] without installation of any additional software on user's computer. Only a [http://www.w3.org standards]-compilant web browser is needed. The service allows to submit some [[Haskell]] source code for compilation into Javascript, and generates a [http://www.w3.org/MarkUp xhtml] page which is temporarily stored. A link is provided to load the generated page into user's web browser. In general, Yhc web service's user interface is similar to one of a [http://hpaste.org pastebin].
+
[[Yhc]] Web Service is a web-based tool to use Yhc's [[Yhc/Javascript|Javascript back end]] without installation of any additional software on user's computer. Only a [http://www.w3.org standards]-compilant web browser is needed. The service allows to submit some [[Haskell]] source code for compilation into Javascript, and generates a [http://www.w3.org/MarkUp xhtml1] page which is temporarily stored. A link is provided to load the generated page into user's web browser. In general, Yhc web service's user interface is similar to one of a [http://hpaste.org pastebin].
  +
  +
==Hosting==
  +
  +
The service is currently available at the following URL: http://www.golubovsky.org:5984/static/yhcws/MainGUI.html
   
 
==Technical overview==
 
==Technical overview==
  +
  +
Yhc Web Service is built around [http://couchdb.com/CouchDB/CouchDBWeb.nsf/Home?OpenForm CouchDB] which itself is written in [http://www.erlang.org Erlang]. CouchDB uses [http://www.json.org JSON] as encoding for queries and responses. A special daemon regularly polls the [http://www.couchdbwiki.com/index.php?title=HTTP_Db_API database] for updates. If a new Haskell source is submitted for compilation as a new [http://www.couchdbwiki.com/index.php?title=HTTP_Doc_API document], the daemon extracts it from the database, and invokes Yhc to transform it along with modules imported into linked [[Yhc/API/Core|Yhc Core]]. Next, [[Yhc/Javascript|Javascript Backend]] is invoked, to convert the linked Core into Javascript. Finally, using the XHTML template (user-supplied or standard), a Web page is built. Output from the compiler and other programs called during compilation is also collected. Results of compilation are stored in the database as [http://www.couchdbwiki.com/index.php?title=HTTP_Doc_API#Attachments attachments] to the document which contains the submitted Haskell source.
  +
  +
The Service runs under Linux inside a 32-bit virtual machine which is an instance of [http://kvm.qumranet.com/kvmwiki KVM] on a 64-bit Linux host administered by [http://code.google.com/p/kvmadm/ KVMADM]. Since CouchDB currently lacks any access control to its databases, [http://www.squid-cache.org/ Squid] is used as reverse proxy with proper [http://www.squid-cache.org/Versions/v2/2.6/cfgman/acl.html access control] settings.
   
 
==Users guide==
 
==Users guide==

Revision as of 02:09, 8 March 2008

Contents

Part of Yhc

(Download)

Yhc Web Service

1 Purpose

Yhc Web Service is a web-based tool to use Yhc's Javascript back end without installation of any additional software on user's computer. Only a standards-compilant web browser is needed. The service allows to submit some Haskell source code for compilation into Javascript, and generates a xhtml1 page which is temporarily stored. A link is provided to load the generated page into user's web browser. In general, Yhc web service's user interface is similar to one of a pastebin.

2 Hosting

The service is currently available at the following URL: http://www.golubovsky.org:5984/static/yhcws/MainGUI.html

3 Technical overview

Yhc Web Service is built around CouchDB which itself is written in Erlang. CouchDB uses JSON as encoding for queries and responses. A special daemon regularly polls the database for updates. If a new Haskell source is submitted for compilation as a new document, the daemon extracts it from the database, and invokes Yhc to transform it along with modules imported into linked Yhc Core. Next, Javascript Backend is invoked, to convert the linked Core into Javascript. Finally, using the XHTML template (user-supplied or standard), a Web page is built. Output from the compiler and other programs called during compilation is also collected. Results of compilation are stored in the database as attachments to the document which contains the submitted Haskell source.

The Service runs under Linux inside a 32-bit virtual machine which is an instance of KVM on a 64-bit Linux host administered by KVMADM. Since CouchDB currently lacks any access control to its databases, Squid is used as reverse proxy with proper access control settings.

4 Users guide