# HG changeset patch
# User Christian Urban a?{28}a{28}
and match it, say, against the string
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
(that is 28 a
s), you will soon notice that your CPU usage goes to 100%. In fact,
Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself:
- catastrophic.py (Python version) and
- catastrophic.rb
- (Ruby version). Here is a similar problem in Java: catastrophic.java
+ catastrophic.py (Python version) and
+ catastrophic.rb
+ (Ruby version). Here is a similar problem in Java: catastrophic.java
@@ -101,7 +101,7 @@
On a rainy afternoon, I implemented
- this
+ this
regular expression matcher in Scala. It is not as fast as the official one in Scala, but
it can match up to 11,000 a
s in less than 5 seconds without raising any exception
(remember Python and Ruby both need nearly 30 seconds to process 28(!) a
s, and Scala's
@@ -183,7 +183,7 @@
paper
(also described here).
My code, written in Scala, of this compiler is
- here.
+ here.
The compiler can deal with simple programs involving natural numbers, such
as Fibonacci numbers or factorial (but it can be easily extended - that is not the point).
-Time-stamp: <- 2017-09-26 11:16:35 by Christian Urban> +Time-stamp: <- 2017-09-26 20:52:25 by Christian Urban> [Validate this page.]