tag:blogger.com,1999:blog-88704586779069296992016-11-07T02:32:13.557-08:00Henry Luo's Blog on CandleAbout <a href="http://www.candlescript.org/">Candle App Platform</a> and related XML technologies. Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-8870458677906929699.post-19754801705244834002011-12-08T09:01:00.001-08:002011-12-08T09:09:53.778-08:00What is Pure ComputationIn this post, I&#39;ll respond to the comments and feedback to my <a href="http://candleapp.blogspot.com/2011/12/2-misconcepts-about-functional.html">recent blog</a> on 2 misconcepts about functional programming.<br><br>I write the original blog because I found it funny that languages like XQuery and XSLT, which I feel so &#39;functional&#39;, is not actually referentially transparent.  Yet monadic I/O as implemented in Haskell, which I feel so &#39;procedural&#39; 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&#39;s not acceptable.<br><br><a href="http://candleapp.blogspot.com/2011/12/what-is-pure-computation.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com5tag:blogger.com,1999:blog-8870458677906929699.post-2029124656429650082011-12-06T22:44:00.001-08:002011-12-06T23:19:13.613-08:00Candle's Procedural DesignIn the <a href="http://candleapp.blogspot.com/2011/12/2-misconcepts-about-functional.html">previous blog</a>, I&#39;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&#39;s nothing evil about them.  There&#39;s no impurity in a program if it allows desirable side-effects.<br><br>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&#39;m going to talk about the procedural design in <a href="http://candlescript.org/">Candle</a>, and how it compares to similar designs in languages, like Haskell, Erlang and Clojure.<br><a href="http://candleapp.blogspot.com/2011/12/candles-procedural-design.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com1tag:blogger.com,1999:blog-8870458677906929699.post-52248793755078447392011-12-05T20:48:00.001-08:002011-12-08T09:11:25.268-08:002 Misconcepts About Functional Programming (relating to context and monad)It&#39;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 <a href="http://perlmonks.org/?node_id=450922">Perl</a>, <a href="http://enfranchisedmind.com/blog/posts/scala-not-functional/">Scala</a>, <a href="http://james-iry.blogspot.com/2009/05/erlang-is-not-functional.html">Erlang</a>, <a href="http://stackoverflow.com/questions/159797/is-ruby-a-functional-language">Ruby</a>, <a href="http://stackoverflow.com/questions/3962604/is-javascript-a-functional-programming-language">JavaScript</a> and <a href="http://stackoverflow.com/questions/1017621/why-isnt-python-very-good-for-functional-programming">Python</a>.  <a href="http://candlescript.org/">Candle</a> is no exception.  Candle&#39;s last release <a href="http://lambda-the-ultimate.org/node/4327">announcement</a> 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&#39;d like to talk about 2 misconcepts about functional programming.  The first misconcept is that <span style="font-weight: bold;">dynamic scope variables are not functional</span>.  The second misconcept is that <span style="font-weight: bold;">monads are functional</span>.  I know the following writing is going to kick up the dust, but it is better than we settle without thorough thinking.<br><a href="http://candleapp.blogspot.com/2011/12/2-misconcepts-about-functional.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com7tag:blogger.com,1999:blog-8870458677906929699.post-57500526335325317162011-11-21T06:05:00.001-08:002011-11-21T06:25:55.843-08:00The Examples Speak For ThemselvesIn the previous two blogs, I&#39;ve talked about the <a href="http://candleapp.blogspot.com/2011/11/who-needs-xml.html">problems of XML</a> and how <a href="http://www.candlescript.org/doc/candle-markup-reference.htm">Candle Markup</a> <a href="http://candleapp.blogspot.com/2011/11/markup-notation-better-then-ever.html">addresses these problems</a>.  In this blog, I&#39;ll show you how Candle Markup can effectively express different kinds of structured data.  <span class="maintext" style="font-style: italic;"><span class="firstword">&quot;A</span>good example is the best sermon.&quot; </span>So I&#39;ll let the examples speak for themselves.<br><a href="http://candleapp.blogspot.com/2011/11/examples-speak-for-themselves.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com9tag:blogger.com,1999:blog-8870458677906929699.post-78457869875586161322011-11-20T05:43:00.001-08:002011-11-21T06:57:04.295-08:00A Markup Notation Better Then EverIn the <a href="http://candleapp.blogspot.com/2011/11/who-needs-xml.html">previous blog article</a>, 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.<br><br>Among the people who are rethinking XML, James Clark has suggested <a href="http://blog.jclark.com/2010/12/microxml.html">3 approaches</a>: <span style="font-style: italic;">XML 2.0, XML.next, MicroXML</span>, which pus forward a solid framework to start with.  Candle is definitely <span style="font-weight: bold;">along the XML.next line</span>.  Candle is not compatible with XML; it actually goes beyond XML to unify markup data model with object data model.<br><br>In this blog, I&#39;ll explain in more details on how <a href="http://www.candlescript.org/doc/candle-markup-reference.htm">Candle Markup</a> (especially with the new object notation) addresses many problems of XML, and how it compares with other formats like JSON and YAML.<br><a href="http://candleapp.blogspot.com/2011/11/markup-notation-better-then-ever.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com0tag:blogger.com,1999:blog-8870458677906929699.post-41085966463154204262011-11-18T06:38:00.001-08:002011-11-20T05:56:47.893-08:00Who needs XML?<a href="http://4.bp.blogspot.com/-IL01zXIVQYM/TsZuFnXYMZI/AAAAAAAAACY/FyyfEry9R7I/s1600/xml-sinking-ship.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-IL01zXIVQYM/TsZuFnXYMZI/AAAAAAAAACY/FyyfEry9R7I/s1600/xml-sinking-ship.png"></a>With the latest beta release, <a href="http://www.candlescript.org/">Candle</a> introduces several new features to its <a href="http://www.candlescript.org/doc/candle-markup-reference.htm">markup format</a>, including a new object notation and a new clean namespace syntax.  With this release, I believe Candle Markup to be one of the best <span style="font-weight: bold;">general data-exchange format</span>.<br><br>Before I talk specifically about Candle&#39;s Markup format, let&#39;s look at the existing general data-exchange formats.  The most well known formats are XML and JSON.  We&#39;ve seen many hot debates on which one is better.  I&#39;m not going to restart the holy war here.  I&#39;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: <span style="font-style: italic;">why do we need a general data-exchange format?  what purposes should it server?  what characteristics should it have?</span>Once you&#39;ve got your answers, you can read on to see if yours reconcile with mine.<br><a href="http://candleapp.blogspot.com/2011/11/who-needs-xml.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com0tag:blogger.com,1999:blog-8870458677906929699.post-83486769127829380882011-08-08T05:48:00.000-07:002011-08-08T06:39:33.041-07:00Towards the Grand UnificationToday&#39;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 <b>latest web apps</b>.  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&#39;t it great if we just need to speak one &quot;universal language&quot;?<br><a href="http://candleapp.blogspot.com/2011/08/towards-grand-unification.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com2tag:blogger.com,1999:blog-8870458677906929699.post-50252559489893075462011-07-27T03:02:00.000-07:002011-07-27T03:14:35.384-07:00Why I invented Candle (II)In the <a href="http://candleapp.blogspot.com/2011/06/why-i-invented-candle-i.html">previous article</a>, I talked about the motivation of inventing <a href="http://www.candlescript.org/">Candle</a> from the perspective of a markup-data processing language.  In this article, I&#39;ll continue the discussion from the perspective of a general-purpose programming language.<br><a href="http://candleapp.blogspot.com/2011/07/why-i-invented-candle-ii.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com0tag:blogger.com,1999:blog-8870458677906929699.post-7918038961727293682011-06-24T07:36:00.000-07:002011-08-29T01:13:46.147-07:00Why I Invented Candle (I)The very first idea of inventing a new programming language hit upon me more than 10 years ago.  At that time, I was still in the university, and I was trying to build a web forum for my peer scholars.  I was using Perl.  The pain in using Perl drove me to invent a better language that treats markup as built-in data type.  Initially I was trying to mix XML with Java, which I considered to be the best markup and programming languages in the world.  Then came XSLT and XQuery, which changed my design of the new language fundamentally.<br><a href="http://candleapp.blogspot.com/2011/06/why-i-invented-candle-i.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com6tag:blogger.com,1999:blog-8870458677906929699.post-49427484124658380882010-12-09T23:58:00.001-08:002010-12-10T00:23:05.731-08:00Porting Candle to MinGW and CodeLiteThanks to <a href="http://codelite.org/">CodeLite</a>, porting <a href="http://www.candlescript.org/">Candle</a> source code to <a href="http://www.mingw.org/">MingGW</a> was much simpler than I thought.<br><br>As I wrote previously, finding the right C/C++ IDE (other than VC Express) was not easy for me, and my last settlement was with Eclipse CDT.  So porting <a href="http://www.candlescript.org/">Candle</a> source code to other compiler and IDE on Windows, like MinGW, was not of high priority for me.<br><br>I was googling for something (I don&#39;t remember what it is) and one of the result page recommended CodeLite, and triggered me to give CodeLite a trial.<br><a href="http://candleapp.blogspot.com/2010/12/porting-candle-to-mingw-and-codelite.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com0tag:blogger.com,1999:blog-8870458677906929699.post-53315482452315535562010-12-08T17:25:00.000-08:002011-09-20T23:25:33.849-07:00Porting Candle to LinuxMy experience of porting <a href="http://www.candlescript.org/">Candle</a> from Windows to Linux is really like riding roller coaster, with up and downs, surprises and shocks, screamings and desperations all along the way.  With over 100,000 lines of Candle source code, and with no previous experience of C development on Linux, the journey was really not for faint-hearted.  The most difficult part was actually getting used to the C/C++ tool chain on Linux.  I&#39;m probably too much spoiled by Visual C/C++.<br><br><a href="http://candleapp.blogspot.com/2010/12/porting-candle-to-linux.html#more">Read more »</a>Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com5tag:blogger.com,1999:blog-8870458677906929699.post-39782687685126940012010-07-28T22:46:00.000-07:002010-11-23T06:46:16.885-08:00Hello World!<a href="http://1.bp.blogspot.com/_8SnJf-O4wzY/TOvTdl6gHYI/AAAAAAAAAAM/QJy1r2xIL08/s1600/candle2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_8SnJf-O4wzY/TOvTdl6gHYI/AAAAAAAAAAM/QJy1r2xIL08/s1600/candle2.jpg" /></a>This is my <b>first post</b>!  More are coming soon!Henry Luohttp://www.blogger.com/profile/10128725727996307107noreply@blogger.com0