Tag Archives: Client Side

Simplify the data layer in your client-side applications.


via orbitjs/orbit.js · GitHub.

Orbit is a standalone library for coordinating access to data sources and keeping their contents synchronized.

Orbit provides a foundation for building advanced features in client-side applications such as offline operation, maintenance and synchronization of local caches, undo / redo stacks and ad hoc editing contexts.

Orbit relies heavily on promises, events and low-level transforms.

Video: Hybrid server/client Haskell web apps


Haskell is well known for its strong, static type system. Javascript, by contrast, is a dynamic, weakly typed language. While they share some functional features, the two languages are quite different. But when we write a web app with a Haskell backend, these worlds inevitably collide. How do we bridge these two worlds?

In this talk, we’ll cover some of the common techniques, including Haskell to JS compilers and well defined cross-language APIs. We’ll also describe ways in which we can keep the benefits of strong typing, even when interacting with code that ignores types entirely.

Haskell Tutorial: An Introduction to Client-Side Applications


Click to Read

Haskell is magic and it is not as difficult to program as you may think. You can be productive very early if you use a high-level library for your domain problem.

There are two programming levels in industrial Haskell: one in which programmers create Embedded Domain Specific Languages (EDSLs), and one in which programmers simply use the EDSLs without much concern about what is below. A mature and efficient development ecosystem needs both levels; you shouldn’t need to know about compiler theory to use a compiler.

This tutorial assumes that you have no knowledge of Haskell, but you are interested. You are probably following a basic course like learn you a Haskell, but you have no time and you need to be able to develop browser applications from the beginning.

There have been exciting developments recently regarding using Haskell in the browser thanks to some Haskell-to-JavaScript compilers like fay, ghcjs and haste. The elm project is a functional language, developed in Haskell, that compiles to JavaScript.

So there is a lot of interest and effort put into using Haskell for the client side. Browser programming is probably the easiest and most casual way to enter the world of Haskell, and one of the most promising ways to enter into the industry. A program running in the browser can be distributed and executed in any place and on any device, without the need for anything else. A Haskell development environment that runs on the web is immediately accessible to anyone.

There are also a lot of programmers investing many hours of effort trying to overcome the main problems of client-side development:

  • How to avoid the explosive complexity of the callback programming model.
  • How to easily create dynamic layouts by taming the HTML DOM tree.
  • How to overcome the dynamic typing of the JavaScript language that makes decent-size projects very hard to develop and maintain.

Haskell has a lot to contribute these issues. For example, the Haskell type system is the best tool for debugging, integration and factorization.

Integration and factorization in Haskell is like plugging connectors into appliances: you know that if the socket does not accept the plug, it is not in the right place or you need an adapter.

Writing Haskell is like sculpting in stone. Once the program compiles, it works; especially if the program is coded in a high-level EDSL.

When it comes to callback hell, the user can program imperative statements; Haskell will generate callbacks under the hood. That is what the hplayground library does. It also manages form inputs and events within this imperative-like style.

These events can perform modifications on the HTML DOM using a high-level library that makes writing new DOM elements on the fly as easy as writing plain HTML code. This is the work done by the perch library.

In this tutorial, we will use the Haste compiler plus some libraries that bring a high-level EDSL for the creation of client-side web applications. We will illustrate how to do it by creating a personal finance application.

The complete code and application is running at http://tryplayg.herokuapp.com/try/mybudget.hs/edit

Clientside Validation


Click to Read: This module adds clientside validation (aka “Ajax form validation”) for all forms and webforms usingjquery.validate. The included jquery.validate.js file is patched because we needed to be able to hide empty messages.

You’ve played with realtime XMPP and JSON, let’s do it properly


First I was afraid, I was petrified
Kept thinking I could never live without realtime interaction client-side.
But then I spent so many nights thinking how XML did me wrong.
And I grew strong, and JSON helped me get along
And so you’re back with no name-space
I just walked in to find no silos here ‘cause its all de-cen-tral-ized
I shouldn’t used that custom format
XMPP and JSON is the key
If I’d known for just one second interoperability wouldn’t bother me.

Client Side MVC and The Gosh Darn Back Button