Friday, November 15, 2013

10+ things that you can do with MFlow and you can't with your Web framework

  1. Create test, integrate and install your logic without concern for layout. Edit your forms, widgets, style and content at run time.
  2. Convert your application from single page to multiple page and back with little code modifications
  3. Make forms that change their questions depending on your answers.
  4. Make a cascade menu with dynamic options programmatically in a single procedure
  5. Make an element of a page to refresh itself by adding a single statement
  6. Make an element to push its content with a simple modifier
  7. Press back as many times as you like by default
  8. Write a payment flow with some pages and seamlessly drop it whenever you need it
  9. Write an active page element with his own server code, JS, CSS in a single procedure and seamlessly drop it whenever you need it
  10. Write your routes and control logic as in a console application. No spaguetty callback code
  11. Transparently store and retrieve session data for as long as you wish
  12. Make all of this without writing a single line of javaScript code. Although you can add it.
  13. Make all of this in a type safe way. If your app compiles, it works.
  14. Make (almost) all of this work with or without javascript activated.
  15. Make all of this in an architecture that is horizontally scalable (although not implemented such scalabiltiy yet)


Quick Start : Basics for understanding and using MFlow
Quick Start 2 : how to modify an application to add dynamic effects: implicit ajax, push etc.

MFlow site:  http://mflowdemo.herokuapp.com

Monday, November 11, 2013

Learning from the Haskell compiler

Haskell programming is naturally one level of abstraction above other languages either functional or not. It is not the functional paradigm. It is the type inference and, specially, the category theoretical grounds in which the language is based, for which functional and imperative paradigms are particular cases.

The extra level of abstraction means that you are one level up in the tree of possibilities. For example, you can define the very meaning of a sequence of statements in a Monad Instance. That, in other languages is fixed.

That means that you have a extra level of things to learn and explore. For example I created a DSL for web applications time ago and still I´m learning my own language. Sometimes my programs type check, but they do not perform what I was expecting, But it does other interesting thing. The code was a product of my own misunderstanding or my lack of concentration, but the type checker say: its valid, let´s run it. Then I check it again and voila, when I examine the program I discover a new usage of the same elements I defined that I never though previously possible.

Sometimes the error messages tell me new instances of things that I would never though about. Some of them seem crazy, but after a second though, I find that is not as crazy as it seems but, sometimes I´m not willing to accept yet another extra level of abstraction that my compiler is suggesting as result of an error.

For beginners this flood of information is confusing,as well as for expert programmers they just want their job done, but thanks in part to this interaction I´m here talking about abstract web combinators when what I initially needed from Haskell was the fsstest way to see "hello world" in a web browser.

Saturday, November 02, 2013

More composable elements for single page development: witerate and dField

witerate,  is a new primitive that permits to iterate the presentation of data and/or input fields and widgets within an web page that does not change. The placeholders are created with dField.  Both are widget modifiers: The latter gets a widget and create a placeholder in the page that is updated via ajax. The content of the update is the rendering of the widget at each iteration. The former gets a widget which contains dField elements and permit the iteration. Whenever a link or a form within the witerate widget is activated, the result is the placeholders filled with the new  html content.  This content can be data, a input field, a link or a widget. No navigation happens.

This permits even faster updates than autoRefresh.  since the latter refresh the whole widget and it does not permits modifications of the layout at runtime. When edTemplate or template is used on top of witerate, the result is editable at runtime, and the span placeholders generated, that are updated via ajax can be relocated within the layout of the template.

Additionally, contrary to some javascript frameworks, the pages generated with this mechanism are searchable by web crawlers.

This example below, taken from the runtime templates example, shows how template, witerate and dField work together. The example iterates the presentation of a list of results fby displaying four of them each time. The list can be navigated forward and backward. (see the example  running and the full source code here).


These are two pages of the example with the templates beind edited at runtime. The first present results and the second is an input form managed the same way. Since the pages are not refreshed, this permits very fast input and presentation of results.


The full post explaining everything is here:

http://mflowdemo.herokuapp.com/noscript/wiki/singlepage.html






See the page and the full source code here