4 ms·
An interesting recent example of successful rewrite was moving the Go compiler from C to Go. They wrote a transpiler from the (very disciplined) C code to Go, a
by dilap 10y ago
An interesting recent example of successful rewrite was moving the Go compiler from C to Go. They wrote a transpiler from the (very disciplined) C code to Go, and then have been slowly idiomaticifying the code since.
- bostik 10y agoYou have to realise the scope and context: the Go compiler rewrite was done by people who were: * working on the codebase full time * intimately familiar with the quirks * relying on the transpiling to be mostly automated IMO as far as rewrites go, that's a pretty tall order. I'm personally contemplating a rewrite of an old project (mostly due to GTK having gone downhill in past years), and harbour no misconceptions about the scale of the effort. It's only about 10k lines of python, across two different projects, but if it takes me less than 2 months (of active spare time work), I will be very much surprised.
- dilap 10y agoOh, totally. Very much agree. Out of curiosity, what's the app, and what UI toolkit would you port to? (And would you stick with python?)
- bostik 10y agoThe app is my old online poker tracker, written with pygtk. I am tempted to move to Qt instead, and for a number of reasons will probably try Go instead. 1) As much as I have traditionally disliked Go's dependency management, with the vendoring support it can be made reasonable 2) I never got python's threading to work properly, which made the UI unresponsive when dealing with database operations; and threading in python is a hack anyway 3) I believe (cough hubris!) that I can simplify the internals by further splitting the architecture One of the best ideas I ever had was to forego all attempts at subprocess management and just go for DBus and its process autolauncher instead. I mean, have you ever tried to make a fork/exec work from within GTK software without causing X hiccups?
- dilap 10y agoCool stuff. I think the UI library story is still pretty raw, but I've done several backend applications in Go, and I'm pretty much in love. It's a very well-engineered language with a strong appreciation for real-world practicalities.