<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: vfuncs &#8211; functional coding with array &#8216;verbs&#8217; in C</title>
	<atom:link href="http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/</link>
	<description>gords thoughts on quant, math &#38; software creation</description>
	<lastBuildDate>Fri, 16 Oct 2009 02:13:44 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: obiettivoefficacia</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-46</link>
		<dc:creator>obiettivoefficacia</dc:creator>
		<pubDate>Fri, 03 Oct 2008 10:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-46</guid>
		<description>thak&#039;s!

very interesting</description>
		<content:encoded><![CDATA[<p>thak&#8217;s!</p>
<p>very interesting</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: quantblog</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-39</link>
		<dc:creator>quantblog</dc:creator>
		<pubDate>Thu, 25 Sep 2008 09:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-39</guid>
		<description>hmm.. C macros are powerful no doubt about it.  I could have used C++ templates or C macros to achieve some functional style things in C.. but that was not this particular experiment...  

Using terse names is a personal thing.. it can make a lot of sense for the domain.  I might find it hard to remember someone elses short abbreviations, but use my own easily.  I know of another excellent db implementation that used names like v4x v4r v4c.  it looked unreadable at first, but if your working on it everyday its a great time saver.  KDB naming style is another example...  For most of my own programming 4-7 letter names seem to be good mnemonics.  

vfuncs is a experiment to get some of the abilities of dedicated functional languages, without resorting to too many tricks...thats why I ruled out macros.. you can do magic with them for sure.   

I&#039;m not too religious about it...   I agree K Q of KDB+ are very focussed and suit the job very well... my experiment is to see if one can get some percentage of the same power from C.  Im still doing the experiment...

Q is somewhat a verbose version of K, which makes it easier for people who may come from an SQL background for example. My verbs are vlonger still but_not_this_long or MicrosoftVerboselyLong.

I guess I&#039;m still impressed by C as a language - just having function pointers is very powerful.  But certainly I&#039;m not sure yet how I would do curring  and closures in C without macros... maybe theres a nice way to do it.</description>
		<content:encoded><![CDATA[<p>hmm.. C macros are powerful no doubt about it.  I could have used C++ templates or C macros to achieve some functional style things in C.. but that was not this particular experiment&#8230;  </p>
<p>Using terse names is a personal thing.. it can make a lot of sense for the domain.  I might find it hard to remember someone elses short abbreviations, but use my own easily.  I know of another excellent db implementation that used names like v4x v4r v4c.  it looked unreadable at first, but if your working on it everyday its a great time saver.  KDB naming style is another example&#8230;  For most of my own programming 4-7 letter names seem to be good mnemonics.  </p>
<p>vfuncs is a experiment to get some of the abilities of dedicated functional languages, without resorting to too many tricks&#8230;thats why I ruled out macros.. you can do magic with them for sure.   </p>
<p>I&#8217;m not too religious about it&#8230;   I agree K Q of KDB+ are very focussed and suit the job very well&#8230; my experiment is to see if one can get some percentage of the same power from C.  Im still doing the experiment&#8230;</p>
<p>Q is somewhat a verbose version of K, which makes it easier for people who may come from an SQL background for example. My verbs are vlonger still but_not_this_long or MicrosoftVerboselyLong.</p>
<p>I guess I&#8217;m still impressed by C as a language &#8211; just having function pointers is very powerful.  But certainly I&#8217;m not sure yet how I would do curring  and closures in C without macros&#8230; maybe theres a nice way to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Attila</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-38</link>
		<dc:creator>Attila</dc:creator>
		<pubDate>Thu, 25 Sep 2008 07:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-38</guid>
		<description>Which one do you find hard to remember? I think they are very carefully chosen. 

kdb+/k/q are about - at least for me - the absolutely minimal set of features one needs to achieve the desired result... For example C&#039;s simple text substitution macros are enough to write code close to the spirit of APL/K. And that is why kdb+ does not have macros : you don&#039;t need it (however beautiful they are ) - and I don&#039;t want to be ignorant - but what remarkable software did it make possible?</description>
		<content:encoded><![CDATA[<p>Which one do you find hard to remember? I think they are very carefully chosen. </p>
<p>kdb+/k/q are about &#8211; at least for me &#8211; the absolutely minimal set of features one needs to achieve the desired result&#8230; For example C&#8217;s simple text substitution macros are enough to write code close to the spirit of APL/K. And that is why kdb+ does not have macros : you don&#8217;t need it (however beautiful they are ) &#8211; and I don&#8217;t want to be ignorant &#8211; but what remarkable software did it make possible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: quantblog</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-37</link>
		<dc:creator>quantblog</dc:creator>
		<pubDate>Wed, 24 Sep 2008 21:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-37</guid>
		<description>Now thats literate programming taken to an extreme :]

Great link - the odbc implementation first defines its own DSL-like terse language, then proceeds to implement an ODBC driver effectively in that K-like DSL.

Id find it a bit hard to remember all the abbreviations - but some seem quite natural like E and F for different precision reals...

I particularly like Arthur&#039;s incantation defining the variant type - 
&lt;code&gt;typedef struct k0
  {I r;H t,u;union{G g;H h;I i;J j;E e;F f;S s;struct k0*k;struct{I n;G G0[1];};};}*K;&lt;/code&gt;


As a self imposed constraint of my own experiment, I avoided macros,but I did notice MIN() MAX() and _count_of(array) creeping into my code.  I&#039;m a big fan of macros in lisp - they just seem more a part of the language.

I happily admit that &quot;DO(n)&quot; is more readable than
&lt;code&gt;  int i;
  for (i=0;i&lt;n;i++) ...&lt;/code&gt;
which appears a lot in my vfuncs implementation</description>
		<content:encoded><![CDATA[<p>Now thats literate programming taken to an extreme :]</p>
<p>Great link &#8211; the odbc implementation first defines its own DSL-like terse language, then proceeds to implement an ODBC driver effectively in that K-like DSL.</p>
<p>Id find it a bit hard to remember all the abbreviations &#8211; but some seem quite natural like E and F for different precision reals&#8230;</p>
<p>I particularly like Arthur&#8217;s incantation defining the variant type &#8211;<br />
<code>typedef struct k0<br />
  {I r;H t,u;union{G g;H h;I i;J j;E e;F f;S s;struct k0*k;struct{I n;G G0[1];};};}*K;</code></p>
<p>As a self imposed constraint of my own experiment, I avoided macros,but I did notice MIN() MAX() and _count_of(array) creeping into my code.  I&#8217;m a big fan of macros in lisp &#8211; they just seem more a part of the language.</p>
<p>I happily admit that &#8220;DO(n)&#8221; is more readable than<br />
<code>  int i;<br />
  for (i=0;i&lt;n;i++) ...</code><br />
which appears a lot in my vfuncs implementation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Attila</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-36</link>
		<dc:creator>Attila</dc:creator>
		<pubDate>Wed, 24 Sep 2008 20:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-36</guid>
		<description>&gt;Theres definitely something about APL, J, K and other functional languages that helps you think about the problem, rather than managing indices.
Definitely it is much more important that most would think - and they would argue against it based on the cost of maintanance... 
Although APL/J/K has it much more &#039;naturally&#039; (beautifully?) than other functional languages (even Mathematica - which is quite a different beast though) 
Check out Ken Iverson&#039;s Turing Award lecture http://elliscave.com/APL_J/tool.pdf (you can find some connecting articles as well)

You can write C much closer to the simplicity/brilliance of K, for example http://www.kx.com/q/c/c/odbc.c and http://www.kx.com/q/c/c/k.h</description>
		<content:encoded><![CDATA[<p>&gt;Theres definitely something about APL, J, K and other functional languages that helps you think about the problem, rather than managing indices.<br />
Definitely it is much more important that most would think &#8211; and they would argue against it based on the cost of maintanance&#8230;<br />
Although APL/J/K has it much more &#8216;naturally&#8217; (beautifully?) than other functional languages (even Mathematica &#8211; which is quite a different beast though)<br />
Check out Ken Iverson&#8217;s Turing Award lecture <a href="http://elliscave.com/APL_J/tool.pdf" rel="nofollow">http://elliscave.com/APL_J/tool.pdf</a> (you can find some connecting articles as well)</p>
<p>You can write C much closer to the simplicity/brilliance of K, for example <a href="http://www.kx.com/q/c/c/odbc.c" rel="nofollow">http://www.kx.com/q/c/c/odbc.c</a> and <a href="http://www.kx.com/q/c/c/k.h" rel="nofollow">http://www.kx.com/q/c/c/k.h</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: quantblog</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-35</link>
		<dc:creator>quantblog</dc:creator>
		<pubDate>Wed, 24 Sep 2008 14:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-35</guid>
		<description>Ryan, 

thanks... I should have the vfuncs code on sourceforge soon [I think it takes them a couple days to vet projects]

brainyoga,

grazias, I didn&#039;t know about smartarrays, seems like there are several good commercial offerings out there now...although K seems to have an edge. Interesting to see smartarrays has grown up with APL.  Theres definitely something about APL, J, K and other functional languages that helps you think about the problem, rather than managing indices. 


Both with K and the C code, it is nice to see small executables again, in this day and age.  That may be a minor reason performance is fairly good.

fyi. Ive implemented a general sliding window primitive and am using that to do a digital filter... it seems to filter data at over 5million a sec.  I intend to reuse the same primitive for a convolution - which is pretty similar logically, as one of the series is reversed and travels left over the data [ http://en.wikipedia.org/wiki/Convolution has nice pics] 

[ off topic, I found an old but digestible intro on map / reduce at Joel On Software here - 
  http://www.joelonsoftware.com/items/2006/08/01.html.  Its a very mild segway into lisp.  
This recent article on Map Reduce in Hadoop might be more hip for Java afficionados - 
  http://www.javaworld.com/javaworld/jw-09-2008/jw-09-hadoop.html  ]

cheers</description>
		<content:encoded><![CDATA[<p>Ryan, </p>
<p>thanks&#8230; I should have the vfuncs code on sourceforge soon [I think it takes them a couple days to vet projects]</p>
<p>brainyoga,</p>
<p>grazias, I didn&#8217;t know about smartarrays, seems like there are several good commercial offerings out there now&#8230;although K seems to have an edge. Interesting to see smartarrays has grown up with APL.  Theres definitely something about APL, J, K and other functional languages that helps you think about the problem, rather than managing indices. </p>
<p>Both with K and the C code, it is nice to see small executables again, in this day and age.  That may be a minor reason performance is fairly good.</p>
<p>fyi. Ive implemented a general sliding window primitive and am using that to do a digital filter&#8230; it seems to filter data at over 5million a sec.  I intend to reuse the same primitive for a convolution &#8211; which is pretty similar logically, as one of the series is reversed and travels left over the data [ <a href="http://en.wikipedia.org/wiki/Convolution" rel="nofollow">http://en.wikipedia.org/wiki/Convolution</a> has nice pics] </p>
<p>[ off topic, I found an old but digestible intro on map / reduce at Joel On Software here -<br />
  <a href="http://www.joelonsoftware.com/items/2006/08/01.html" rel="nofollow">http://www.joelonsoftware.com/items/2006/08/01.html</a>.  Its a very mild segway into lisp.<br />
This recent article on Map Reduce in Hadoop might be more hip for Java afficionados -<br />
  <a href="http://www.javaworld.com/javaworld/jw-09-2008/jw-09-hadoop.html" rel="nofollow">http://www.javaworld.com/javaworld/jw-09-2008/jw-09-hadoop.html</a>  ]</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-34</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 24 Sep 2008 12:55:19 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-34</guid>
		<description>Neat article! Seeing radically different ways of using the same language is very interesting. Looking forward to the source code! :)</description>
		<content:encoded><![CDATA[<p>Neat article! Seeing radically different ways of using the same language is very interesting. Looking forward to the source code! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brainyoga</title>
		<link>http://quantblog.wordpress.com/2008/09/24/vfuncs-functional-coding-with-array-verbs-in-c/#comment-31</link>
		<dc:creator>brainyoga</dc:creator>
		<pubDate>Wed, 24 Sep 2008 05:53:10 +0000</pubDate>
		<guid isPermaLink="false">http://quantblog.wordpress.com/?p=64#comment-31</guid>
		<description>You might find

http://www.smartarrays.com

interesting</description>
		<content:encoded><![CDATA[<p>You might find</p>
<p><a href="http://www.smartarrays.com" rel="nofollow">http://www.smartarrays.com</a></p>
<p>interesting</p>
]]></content:encoded>
	</item>
</channel>
</rss>
