4 ms·
> My opinion, and my experience, has demonstrated that once you understand the domain, a re-write in any language (including the original) is going to result in
by true_religion 10y ago
> My opinion, and my experience, has demonstrated that once you understand the domain, a re-write in any language (including the original) is going to result in an improvement of similar magnitude.
I have this software that I've been rewriting since I was in university---so about 16 years of rewrites give or take.
Every time I pick up a new language, I rewrite it in the new language. It's an image gallery with bells and whistles, talking to databases, and video conversion. It's not totally trivial.
What can I tell you [1]?
My Java version that I wrote as a 2nd year student was the fastest overall for the next 8 years. Rewrites in Smalltalk, PHP, and Ruby were all worse by many orders of magnitudes. The Haskel rewrite actually made it perform worse [2]. Architecturally they were 'better', but that's only API expression.
The only time I've gotten a 'win' is when I replaced the core database technology (moved from Postgres to Elasticsearch), replaced caching tech (moved from Redis in App-layer to Redis in Nginx) and with Elixir (like Java its fast enough that there's no need for caching).
Elixir has a lot of built in tools and libraries that make handling concurrency a breeze. To give an analogy, it's like working with Lua in Nginx---it feels like you are writing your application right inside of the webservers event loop.
[1] Disclaimer: I am a language hipster, and Elixir is the last language I tried.
[2] Haskel and I do not get along. Odd really. I get along with other functional languages.
- falcolas 10y agoHave you tried re-writing the Java version again with a modern version of Java, and with other lessons learned? Just curious. That said, cool set of experiments, and IMO a great way to learn new languages.
- yetihehe 10y agoI'm currently writing a java server after working on an erlang server and I miss erlang daily. "Concurrent" libraries like vert.x feel just odd with their callbacks although lambdas made this a little less awkward.
- true_religion 10y agoNo, I haven't done that but it is a great idea since the language has really gone through improvements. It'd be interesting too see how well the PHP version does now adays. It was written in 2007, PHP 5.1, and the main issue back then was memory consumption when handling multiple processes. I've heard PHP 8 is much better in that respect, with lower amounts of memory used in name brand applications like Worpdress.
- wry_discontent 10y agoDo you use it for something? Even if not, I love this idea for learning new toolsets.
- true_religion 10y ago> Do you use it for something? Nope, I just fell in love with a class project and expanded it greatly. If you decide to go this route, I'd suggest picking an old class project too. Class projects are pretty much cut down to whatever a student can build within 2 months, taking into account that their time is split 5 different ways and they are inexperienced in the language. It's the perfect amount of depth so you're not writing a toy project, but you are also not overwhelmed and consider this a real "side project" or 2nd job. If you want something smaller---do a chat app. They're dead simple, and will teach you the network stack of whatever language you are using. Add some bells and whistles like image sharing to make it like Yahoo 2.0, and you'll have something fairly meaty.