Turtles all the way down and the CLR (or JVM)
Avi makes some comments here about the differences between scripting languages and “real” languages. His main point is that real languages (or maybe their VM’s) are fast enough to be extended in themselves. Now while I think I understand his underlying point - which is to attempt to clarify why smalltalk rocks (which it does) - I’m not sure I agree with his analysis.
As far as I’m aware - there’s no C required to run ruby on rails applications1. Rails is 100% ruby - aka Ruby extended in Ruby. It might be that thats not the kind of extension he’s talking about - and in fact it’s not - he gives a Ruby example of the problem he’s talking about - creating a custom array subclass. Here’s an example of his code in C#.
public class MyArray : Array {} //error CS0644: 'MyArray' cannot derive from special class 'System.Array'
- You can’t extend C# (or Java) in the way he’s trying to in Ruby.
- You can’t add methods to java.lang.Object or System.Object - although extension methods in C# 3.0 will let you add behaviour - but not state.
- You can’t modify the language syntax, add keywords etc… (no macro like features) the way you can in LISP or smalltalk.
Conclusion: C#/Java (well - the JVM/CLR) are not turtles all the way down. In fact - Ruby is more deep turtle wise than C# or Java (ruby supports modules/mixins which are somewhat like extension methods in C# 3.0).
Update: Ayende likes what Avi says - looks like we might not agree on this.
- I’m aware mongrel - a http server which is used for serving rails apps - has pieces written in C. This is equivalent to IIS for ASP.NET apps (and webrick == casinni - the VS.NET built in webserver vs Ruby’s pure Ruby webserver). [↩]
2 Comments