Using templates in ATS to build webpages

27 views
Skip to first unread message

gmhwxi

unread,
Dec 26, 2016, 7:39:11 PM12/26/16
to ats-lang-users

These days I have been using ATS to build webpages.

I find that the so-called embeddable templates in ATS
can be very effective in saving effort and time when properly
used to facilitate code reuse. Here is an example:

http://www.cs.bu.edu/~hwxi/academic/courses/CS320/Spring17/

Say that you have built a webpage A. And you now want to build another
webpage B but you notice that B is kind of similar to A. Of course, you can
(and are mostly likely to) make a copy of A and then modify the copy into B.
The problem with this approach is the following obvious one:

If you later make changes to A, these changes do not automatically
propagate into B.

This is really the kind of problem addressed by embeddable templates.

I use templates to generate the layout (CSS) for a webpage. These templates
can be executed off-line or on-line.

I use templates to fill out a webpage. These templates are compiled into JS code,
which is executed when the webpage is loaded.

Code sharing based on embeddable templates naturally leads to a great deal of
effort and time saved on building webpages with similar structures.


Reply all
Reply to author
Forward
0 new messages