Thursday, December 8, 2011

What is Pure Computation

In this post, I'll respond to the comments and feedback to my recent blog on 2 misconcepts about functional programming.

I write the original blog because I found it funny that languages like XQuery and XSLT, which I feel so 'functional', is not actually referentially transparent. Yet monadic I/O as implemented in Haskell, which I feel so 'procedural' is referentially transparent. So my intension in the blog was to come up with something that can better depict the computation model of XQuery and XSLT. My approach was to keep the concept of RT, but stretch the concept of functional programming. From the feedback, I can see that people think that's not acceptable.

Tuesday, December 6, 2011

Candle's Procedural Design

In the previous blog, I've shared my thoughts about functional programming. Sometimes it looks like to me that procedural programmers are side-effect addicted, whereas functional programmers tend to have side-effect phobia. Hard-core functional programmers tend to spread the feelings that side-effects are evil. Yes, if the side-effects are unnecessary, then they should be eliminated by all means. But if the side-effects are desirable (by requirements), then there's nothing evil about them. There's no impurity in a program if it allows desirable side-effects.

Everyone agrees that side-effects should be controlled and carried out in a structured manner. The question is how. I think the Holy Grail of current programming language design is to find the best way to mix procedural programming with functional programming. In the following blog, I'm going to talk about the procedural design in Candle, and how it compares to similar designs in languages, like Haskell, Erlang and Clojure.

Monday, December 5, 2011

2 Misconcepts About Functional Programming (relating to context and monad)

It's interesting that almost every old and new language that claims to have some functional support has to go through the trial of its purity, like Perl, Scala, Erlang, Ruby, JavaScript and Python. Candle is no exception. Candle's last release announcement to LtU triggered some interesting discussion about whether the functional features in Candle are pure. I finally have sometime to share more about my thoughts on this issue. I'd like to talk about 2 misconcepts about functional programming. The first misconcept is that dynamic scope variables are not functional. The second misconcept is that monads are functional. I know the following writing is going to kick up the dust, but it is better than we settle without thorough thinking.

Monday, November 21, 2011

The Examples Speak For Themselves

In the previous two blogs, I've talked about the problems of XML and how Candle Markup addresses these problems. In this blog, I'll show you how Candle Markup can effectively express different kinds of structured data. "A good example is the best sermon." So I'll let the examples speak for themselves.

Sunday, November 20, 2011

A Markup Notation Better Then Ever

In the previous blog article, I talked about general data-exchange format and some of the problems of XML. The original design that constrained XML to just a general syntactic format caused great headache to people building advanced processing capabilities on top of XML.

Among the people who are rethinking XML, James Clark has suggested 3 approaches: XML 2.0,, MicroXML, which pus forward a solid framework to start with. Candle is definitely along the line. Candle is not compatible with XML; it actually goes beyond XML to unify markup data model with object data model.

In this blog, I'll explain in more details on how Candle Markup (especially with the new object notation) addresses many problems of XML, and how it compares with other formats like JSON and YAML.

Friday, November 18, 2011

Who needs XML?

With the latest beta release, Candle introduces several new features to its markup format, including a new object notation and a new clean namespace syntax. With this release, I believe Candle Markup to be one of the best general data-exchange format.

Before I talk specifically about Candle's Markup format, let's look at the existing general data-exchange formats. The most well known formats are XML and JSON. We've seen many hot debates on which one is better. I'm not going to restart the holy war here. I'll try to get you out of the tit-for-tat comparison of JSON against XML, and let your look the problem from a more fundamental perspective. You can ask yourself a few questions: why do we need a general data-exchange format? what purposes should it server? what characteristics should it have? Once you've got your answers, you can read on to see if yours reconcile with mine.

Monday, August 8, 2011

Towards the Grand Unification

Today's programming world is quite different from 20 years ago, when C/C++ was still the dominant language(s), and we just need to learn one language(s) to do all our work. Today, there are 3 major paradigms of applications: the oldest command line apps, the desktop GUI apps and the latest web apps. The last one is quite different from the other two as it utilizes many DSLs (domain specific languages). These DSLs made us more expressive, but also gave us all the headaches of a multi-lingual speaker. Isn't it great if we just need to speak one "universal language"?