Comments on: About JRuby and CPython http://laurentszyster.be/blog/jruby-vs-cpython/ Python on Peers Tue, 07 Feb 2012 14:13:14 +0000 http://wordpress.org/?v=1.5.1.3 by: jpersson http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6318 Thu, 09 Nov 2006 21:22:58 +0000 http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6318 The complexity of a language's syntax does matter. As Eric Raymond once wrote, "Robustness is the child of transparency and simplicity". Do you for example think it's a coincidence that Perl 6 is still not ready for production after six years of development? I also argue that it's much more likely that a bug has crept into Ruby than Python, due to the increased syntactic and semantic complexity. Still I think an increased complexity may be justified to move things forward, but in the Ruby case I really cannot see what major benefits it has brought us in comparison with Python. But that's my opinion and there's not need to "arm-wrestle", as you put it. > Java has a more complicated syntax, certainly, but it also supports syntactic structures not found in either Python or C. I'm curious about the "syntactic structures" that you think Java supports, but which Python cannot handle. Could you please exemplify? Regards //Jan Persson The complexity of a language’s syntax does matter. As Eric Raymond once wrote, “Robustness is the child of transparency and simplicity”. Do you for example think it’s a coincidence that Perl 6 is still not ready for production after six years of development? I also argue that it’s much more likely that a bug has crept into Ruby than Python, due to the increased syntactic and semantic complexity.

Still I think an increased complexity may be justified to move things forward, but in the Ruby case I really cannot see what major benefits it has brought us in comparison with Python. But that’s my opinion and there’s not need to “arm-wrestle”, as you put it.

> Java has a more complicated syntax, certainly, but it also supports syntactic structures not found in either Python or C.

I’m curious about the “syntactic structures” that you think Java supports, but which Python cannot handle. Could you please exemplify?

Regards
//Jan Persson

]]>
by: Laurent Szyster http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6314 Tue, 07 Nov 2006 22:02:07 +0000 http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6314 Hi Charles, I see that the language war daemon never sleeps ;-) >The complexity of a language’s syntax has practically nothing to do with how efficiently it can be executed. Hahum! How yes it does and there are plenty benchmarks around: http://shootout.alioth.debian.org/ to assert that all languages are not created equal in performances. Pure Jython code for instance is reputed to run more than twice slower than CPython. Yet the author of Jython managed to make IronPython run twice as fast than CPython. So, between the CRL and the JVM implementations of Python there's a performance ratio of 1 to 5! And the reason for that lays in Java's design choices and implementation process. Java is stuck forever in between to levels of abstraction, somewhere between Modula 2 and VisualBasic, between compilers and interpreters. Adding a garbage collector to C++ was a good idea, using a byte-code VM also, but forking a new OS, a new GUI or a new sprintf and announcing Java Chips by the year 2000, that was ... a scam. By the way, many developers still cannot apply sprintf in Java, because 1.5 is not yet considered the stable VM in many production environment. >You may prefer C and Python. I prefer Java and Ruby. We’re both right…and arm-wrestling over whose language is better designed accomplishes exactly nothing. You're right here, and that's why, besides rambling and ranting I also write code when there's a itch I feel to scratch. Sometimes in java too: https://developer.berlios.de/projects/less4j/ If you are interested, I suggest you take a look at the Test.java class, it comes with a speed comparison between Jython's implementation of SHA1 and the one provided by your JRE (ymmv). Guess what? Software written by perfectionnists without deadlines has a unique quality when it comes to performances: perfection runs faster. Regards, Hi Charles,

I see that the language war daemon never sleeps ;-)

>The complexity of a language’s syntax has practically nothing to do with how efficiently it can be executed.

Hahum!

How yes it does and there are plenty benchmarks around:

http://shootout.alioth.debian.org/

to assert that all languages are not created equal in performances.

Pure Jython code for instance is reputed to run more than twice slower than CPython. Yet the author of Jython managed to make IronPython run twice as fast than CPython. So, between the CRL and the JVM implementations of Python there’s a performance ratio of 1 to 5!

And the reason for that lays in Java’s design choices and implementation process.

Java is stuck forever in between to levels of abstraction, somewhere between Modula 2 and VisualBasic, between compilers and interpreters. Adding a garbage collector to C++ was a good idea, using a byte-code VM also, but forking a new OS, a new GUI or a new sprintf and announcing Java Chips by the year 2000, that was … a scam.

By the way, many developers still cannot apply sprintf in Java, because 1.5 is not yet considered the stable VM in many production environment.

>You may prefer C and Python. I prefer Java and Ruby. We’re both right…and arm-wrestling over whose language is better designed accomplishes exactly nothing.

You’re right here, and that’s why, besides rambling and ranting I also write code when there’s a itch I feel to scratch. Sometimes in java too:

https://developer.berlios.de/projects/less4j/

If you are interested, I suggest you take a look at the Test.java class, it comes with a speed comparison between Jython’s implementation of SHA1 and the one provided by your JRE (ymmv).

Guess what?

Software written by perfectionnists without deadlines has a unique quality when it comes to performances: perfection runs faster.

Regards,

]]>
by: headius http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6313 Tue, 07 Nov 2006 21:23:52 +0000 http://laurentszyster.be/blog/jruby-vs-cpython/#comment-6313 The complexity of a language's syntax has practically nothing to do with how efficiently it can be executed. It does, however, have a tremendous impact on how people feel and perform while using that language. C and Python may have simpler syntaxes, but they're also designed to have a very specific feel. Python is intended to have one way of doing things and C is mostly a set of coarse-grained assembly language macros. They're both great languages in their domains, and both excellent choices if their respective designs suit your needs. Java has a more complicated syntax, certainly, but it also supports syntactic structures not found in either Python or C. If the problem you're trying to solve can make effective use of that syntax, then it's a win. If not, you don't use them. Ruby's syntax is perhaps the most complicated of the four, but primarily because of outlying "weird" syntax that are either little used or that address a very specific desire of the language users and designers. The vast bulk of Ruby is clustered in that center region which isn't much more complicated than C or Python, especially considering that it is a somewhat richer core syntax. In the end though, the syntax matters very little to the implementation of a language's interpreters or VMs. Ruby is a bitch to parse, that much is certain. But once parsed, there's no reason it can't perform as fast as any other dynamic language. Indeed, I believe compiled Ruby will not be that far off from compiled Java bytecode, and there are others who have had great success compiling Ruby into C code and constructs. The important thing here is having choice. You may prefer C and Python. I prefer Java and Ruby. We're both right...and arm-wrestling over whose language is better designed accomplishes exactly nothing. The complexity of a language’s syntax has practically nothing to do with how efficiently it can be executed. It does, however, have a tremendous impact on how people feel and perform while using that language.

C and Python may have simpler syntaxes, but they’re also designed to have a very specific feel. Python is intended to have one way of doing things and C is mostly a set of coarse-grained assembly language macros. They’re both great languages in their domains, and both excellent choices if their respective designs suit your needs.

Java has a more complicated syntax, certainly, but it also supports syntactic structures not found in either Python or C. If the problem you’re trying to solve can make effective use of that syntax, then it’s a win. If not, you don’t use them.

Ruby’s syntax is perhaps the most complicated of the four, but primarily because of outlying “weird” syntax that are either little used or that address a very specific desire of the language users and designers. The vast bulk of Ruby is clustered in that center region which isn’t much more complicated than C or Python, especially considering that it is a somewhat richer core syntax.

In the end though, the syntax matters very little to the implementation of a language’s interpreters or VMs. Ruby is a bitch to parse, that much is certain. But once parsed, there’s no reason it can’t perform as fast as any other dynamic language. Indeed, I believe compiled Ruby will not be that far off from compiled Java bytecode, and there are others who have had great success compiling Ruby into C code and constructs.

The important thing here is having choice. You may prefer C and Python. I prefer Java and Ruby. We’re both right…and arm-wrestling over whose language is better designed accomplishes exactly nothing.

]]>