<https://github.com/StefanSalewski/RBR>

That router project was the most important reason in 2014 for leaving Ruby and 
searching for another compiled and statically typed language. The router itself 
needs at least a delaunay triangulation and a reliable convexHullOfDisk 
implementation, and used initially also a fibonacci priority queue with 
decrese_key() function. And for an EDA tool to using that router a GUI is 
necessary of course.

Well now after nearly 7 years I finally managed to convert the core module with 
the rubberband routing from Ruby to Nim. Took me less than 200 hours for the 2k 
lines of Ruby code, which is faster than expected. The Nim code size is not 
much larger, and looks not worse than the Ruby code. Static typing makes all 
much cleaner. Speed with Nim is much larger of course.

Porting was really not that hard: I did all the conversions manually. First I 
converted very carefully to make it compile and partly work. Then I fixed a few 
bugs. Then I compared one more the Nim and Ruby code very carefully. And 
finally I had to find an ugly and difficult bug, which resulted from the fact 
that the Ruby code used the BOOST fibonacci queue for the dijstra routing, 
while we now use the heapqueue without decrese_key() operation and so have to 
record and check distances for each node carefully.

Well 200 hours for 2k Ruby code is fast for me, but it may sound slow to you: 
But note that we now use different libs with different API for delaunay, hull 
and priority queue. And after 7 years the own code looks partly strange as 
foreign code :-)

Reply via email to