Personal tools

Yhc web service

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Part 1)
(Tech overview)
Line 15: Line 15:
 
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.
 
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.
+
The service runs a slightly modified version of [http://searchpath.org/ SearchPath] to chase imports across the Internet. This removes the limitation on the number of modules compiled simultaneously, while only one Haskell module may be submitted via user interface.
  +
  +
The Service runs under Linux inside a 32-bit virtual machine which is an instance of [http://kvm.qumranet.com/kvmwiki KVM] administered by [http://code.google.com/p/kvmadm/ KVMADM] on a 64-bit Linux host. 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:48, 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 a slightly modified version of SearchPath to chase imports across the Internet. This removes the limitation on the number of modules compiled simultaneously, while only one Haskell module may be submitted via user interface.

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

4 Users guide