Comments on: CLR Hegemony http://www.weaselhat.com/2006/12/04/clr/ Wed, 10 Jan 2007 15:50:25 +0000 hourly 1 https://wordpress.org/?v=6.3.2 By: Michael Greenberg http://www.weaselhat.com/2006/12/04/clr/comment-page-1/#comment-31 Wed, 10 Jan 2007 15:50:25 +0000 http://www.weaselhat.com/2006/12/04/clr/#comment-31 Differences in low-level expressivity between languages — e.g. block expressions in Ruby don’t exist in Python, hygenic macros in Scheme — are important, you’re right. I’m not sure how big of a difference there is between Python and C#. In any case, I wrote about discovering (about myself) after Jim Miller’s talk that these features are valuable to me, but are in general relegated to corner cases. I realized that I was underestimating the homogeneity of big APIs, particularly GUI libraries. And if this is the case, we’ve been ‘forced’ to use them for a long time — since before C#, before even Java.

While you might miss and/or or not use apply/map/fold/unfold in C#, that may have more to do with idiom than Sapir-Whorf expressibility. There’s a simple translation in either direction from and/or/if chains to ?: chains. (In fact, in your example the two have the same number of tokens!) C#’s delegate system supports map fully and cleanly, e.g. this generalized implementation. Granted, there’s some ugliness, but it’s all local management. Outside of the function, you just have map.

I felt as you seem to: there was “something out there bothering me”, but I wasn’t sure what. After a few days of introspection, what bothered me was that I couldn’t come up with a real example of an important style difference. It was discomforting for me to discover that my opinions. based on ‘principles’ and ‘theory’, are really just that — my opinions.

]]>
By: Joshua Volz http://www.weaselhat.com/2006/12/04/clr/comment-page-1/#comment-30 Wed, 10 Jan 2007 03:43:06 +0000 http://www.weaselhat.com/2006/12/04/clr/#comment-30 I am not sure if this is what you meant, but as I read this I thought about the “Ruby way” and the “Python way” of doing things. Yes, they are both dynamic, powerful languages with meta programming options, but some things that are clearly kosher in Ruby, aren’t in Python. I thought you might be trying to get at something similar with C# and Python. There are lots of things that you would do in C# that you wouldn’t in Python, and vice versa. The map function is a good example. I wouldn’t use the equivalent of map w/ lambda in C#, but I might in Python.

This comes down to the language effecting the way you think. The Sapir-Whorf theory (not sure if this is the correct spelling) hypothesizes that the language you speak effects what ideas you are capable of expressing. Nowhere is this more evident than in programming languages. I specific example would be something like the use of “and-or” constructs as a ternary operator in Python (test and success or failure vs. test ? success : failure). Because “and” and “or” return the values of their sub-expressions instead of returning a boolean value their might be a mismatch between Python and C#. That’s the best example I can come up with off the top of my head. It does seem as though there is something out there bothering me, but I can’t put my finger on it.

]]>
By: Adam Langley http://www.weaselhat.com/2006/12/04/clr/comment-page-1/#comment-29 Wed, 10 Jan 2007 02:08:56 +0000 http://www.weaselhat.com/2006/12/04/clr/#comment-29 The link to Flapjax is broken; it’s missing a ‘j’

]]>
By: Michael Greenberg http://www.weaselhat.com/2006/12/04/clr/comment-page-1/#comment-22 Tue, 12 Dec 2006 15:16:53 +0000 http://www.weaselhat.com/2006/12/04/clr/#comment-22 I agree the question was vague, and I think you’re right. The problem with Python was Python; data-binding support should be built on top, and so forth.

Taking the CLR as a high-level machine, it has TCO and typing (that is, if you give types at a call node, you don’t have to worry about run-time checking). It’s more than sufficient as a compilation target for functional and other weird languages. The question I’d now ask — a question for us, not for Jim Miller — is: why do we want that free ride? While the CLR already gives so many guarantees (and optimizations), do they also need to write the hard parts of our compilers for us? A good Erlang implementation does its own optimizations to make lightweight processes work…why can’t we, on the CLR?

]]>
By: leo http://www.weaselhat.com/2006/12/04/clr/comment-page-1/#comment-21 Tue, 12 Dec 2006 04:51:25 +0000 http://www.weaselhat.com/2006/12/04/clr/#comment-21 Your question sounded vague to me – as you said, Miller opened by saying something along the lines of they prioritized features based on general style: object oriented (a must), procedural (fuzzy water), functional (what is necessary). It is unclear what you meant by style; your Python example is a problem with Python, not the CLR. For Erlang, as one person that doesn’t use it to another, I think we see another view of style: does the CLR support optimizations resultant from certain mantras, eg, light weight processes with no shared memory. The answer there would be: OO (fast method look ups and static vs instance fields), procedural (mutation? jmp instructions? I have no idea what this means), and functional (1st class / HOFs with TCO I presume) styles.

After the talk, I did do the wankerish thing and asked about data binding support in the CLR. He gave the exact answer you would expect: it is unneccessary, because it can be otherwise easily encoded with little overhead, so they didn’t bother. Several MS products have constraint based or dynamic properties, so this was an explicit decision with performance honestly factored in. The same exact approach taken by Macromedia in their data binding implementation.

]]>