Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMove to a more appropriate language #89
Comments
Minoru
added
the
refactoring
label
Dec 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Regarding current build system challenges, did You consider using CMake or Meson? |
This comment has been minimized.
This comment has been minimized.
polyzen
commented
Dec 27, 2017
|
I often play with the idea of rewriting this in Rust (though lack the chops to do so) ^^. Was toying with rewrite names just yesterday, and @gnubeest bested me with "oxynews". |
This comment has been minimized.
This comment has been minimized.
ForNeVeR
commented
Dec 27, 2017
|
You should also take into a consideration that you'll need to interoperate with your existing code, i.e. cheap interop with your C++ code will be required. I doubt that it'll be possible to rewrite any project in a new language at once, so you'll need a gradual approach when old and new code will coexist in the project for some time. |
This comment has been minimized.
This comment has been minimized.
ForNeVeR
commented
Dec 27, 2017
•
|
Also, I have some complaints about your arguments in the section "Why rewrite". It looks like two of your arguments are directed not to the language itself, but to the ecosystem: you have complaints about your current build system and (lack of?) package management system. And, guess what, there're modern open-source build systems and package management systems for C++ (I won't advertise any of them here, but I could give an advice if you need). And the first argument ("too low-level") isn't about the language, it's about your code. C++ allows to write high-level applications, it's just the current newsboat code base is written in a low-level manner. I think that with such an argument set, any rewrite will solve the stated problems, even if you're rewriting the program in the same language. And, possibly, that approach will be the most appropriate one, because it won't create any interoperability troubles and will allow to port the code to the new base gradually. Note: I'm not telling whether you should or should not rewrite the project in another language, I'm just commenting on your arguments. |
This comment has been minimized.
This comment has been minimized.
|
@carno, I did try CMake, see #14 for results. I'll add this to the top post. I never heard about Meson, thanks for mentioning it. Its design goals seem very fitting, but I'm put off by dependency on Python. Newsboat used to depend on Perl, which led to some complaints from people who tried to cross-compile it. I'm pretty sure Python will get us the same. But I'll try it out the next time I get fed up with status quo :) |
This comment has been minimized.
This comment has been minimized.
|
@polyzen, I myself am considering only gradual rewrite that doesn't change the name. Newsboat contains quite a number of little gnarly details, I'd rather port them than try to recreate them from ground up. OTOH, if you do start a rewrite, I might just steal some code from you (license permitting)… Looks like it's in my best interests not to dissuade you :D |
This comment has been minimized.
This comment has been minimized.
|
@ForNeVeR, good point re C++ interop—I'll mention it explicitly in the requirements list. Thanks! "Why rewrite" is indeed quite weak, mainly because I don't see a single core problem. As I said, it's a death by a thousand cuts. Re build systems: apart from CMake, I also looked at waf, which didn't impress me at all. IIRC it didn't offer much improvement over Makefiles, so I gave up without even pushing the code to the repo. Anything else I should try (not counting Meson that's been mentioned above)? I think I'll do some research on package managers now. I've heard of Conan, but I never tried it. I'm a bit put off by necessity to choose, though. With more modern languages, I just get a package manager and can be sure any dependency can be installed through it; not so with C++, apparently. I admit that's more of an emotion than a rational response :) Re "C++ allows to write high-level applications", in short I want a language that not just allows, but also helps. I'm using boyscout rule to gradually drag the code towards more high-level C++, but it's too slow to my taste. It's 2017 and we're still using C++11 because that's what majority of compilers support. We could probably move to C++14 already, but it was a minor release from my POV, so no hurry. A lot of useful stuff isn't even in C++17, so won't become available till 2020. And then it'll be what, 3 to 5 years to get the compilers? So by 2023-2025, I probably will be able to use cutting-edge technologies like modules and such. But I'll still have to be aware of weak typing, still put my signatures in both .h and .cpp, and so on. And then some things will never be fixed because the Committee doesn't like to break existing code. I am just re-evaluating how relevant this stance is to me. |
This comment has been minimized.
This comment has been minimized.
Minoru
referenced this issue
Jun 25, 2018
Merged
Extract feed handling from controller into FeedHandler #216
This comment has been minimized.
This comment has been minimized.
|
I agree with points of @ForNeVeR.
I disagree, but I think I know what you mean by writing so. It feels kind of low-level in some parts of the code, yes, but it doesn't have to be like that. I saw programs written in C that read like some 'high' level language and you didn't feel encumbered by lack of abstractions (built into language) at all. I believe that it comes more from programming skill level (and I don't mean by saying so that I have achieved some high level!) and experience rather than by chosen language. Yes, C++ allows you to fiddle with bits, but it also allows you to build many high-level concepts (generating some problems in the process, for which it is hated by many). That's why it's sometimes called "a flexible shotgun".
It's not a language problem per se, but I understand that it is a strong point of concern for you as a maintainer. I'm a little scared by Makefiles myself, but on the other hand they are venerable in the UNIX world and many people had to fight with them (for a long time), so they are pretty stable and many people can offer a hand. For an open-source project I guess it's not so bad. I also have to say that I don't believe in silver bullets, and the package managers from the languages you mentioned probably have problems on their own (and maybe they are a moving target in terms of rules/stability). The bright side might be that they have more active/welcoming community that can offer help. As for the languages you mentioned, I wouldn't be able to help in any of them.
I sadly don't know it yet. It's definitely on my to-meet list, but not now, and even if, I don't think I will be able to express myself freely in it for some time. I think you will probably loose most of C++ devs (maybe even start from scratch?), but I don't know how about attracting new ones interested in Haskell? Hard to tell. Change of programming paradigm seems like a big deal to me. On the other hand, you seem pretty in love with it, and your happiness as a maintainer should be a top priority for all of us. :)
I haven't tried it. I didn't jump on the "rewrite World in Rust" bandwagon (yet). It's just my opinion, but it also seem to come with a specific political baggage. This can paradoxically broaden the contribution range.
Interesting language, also want to try it out, but I have the same problems as with Haskell. Most of the folks writing in it are developing some kind of "servlets", I don't know how it is like in utility apps. I would like to say that there is a D programming language which seemed interesting, but I don't think it has any big-player backup like the others do, so contribution factor will probably be very low (in the near future). Mentioning it more for the love for the concepts than anything else. Rewriting is a big deal that can kill a project. I would vote for refactoring the most offending (in terms of code cleanliness/libraries used) parts of Newsboat and put it in C++ 11/14 range which is pretty nice in terms of standard library. The more code is easier to maintain/extend, the more fun it is to work on it (IMO), which can lead to more contributions and easier development. |
This comment has been minimized.
This comment has been minimized.
|
Thank you, @kmws! I've heard of D before, but haven't tried it yet. I'll mull over your technical points for a while, but there's one thing I want to point out right now:
That would be true if I wanted to be the sole developer, but I don't. So it would be nice if more people were happy, and thus felt motivated to contribute. |
This comment has been minimized.
This comment has been minimized.
|
I've had a few conversations about this with people both inside and outside of the community, and finally realized that the crux of the problem isn't C++, it's me. In short, I'm quite fed up with C++, and don't want to deal with this frustration both at work and at home. Since it's much easier to change a hobby project than a commercial product, I'm changing Newsboat instead of the thing I'm building at work. Switching jobs is out of the question right now. Why do I feel entitled to rewrite the whole project in a new language just because I can't deal with the current one? Actually, I don't. I just truly believe this is the most reasonable choice I can make. My thinking is outlined below. "Problem solved" means I don't have to deal with C++ anymore, and I as a user have a newsreader I enjoy using.
I can't count on 1.I. Thus, I'm left with the choice between 1.II.b (burn out then rewrite) and 2 (rewrite and maybe get negative feedback), of which the second seem the most reasonable. Where does this leave all the current contributors? I would prefer to keep working with each and every one of you, but I understand not everyone wants to pick up a new language. I'm truly sorry to exclude you so, but I just can't continue with C++. Getting back to the technical side of things: I skimmed first few chapters of "The D Programming Language" by Alexandrescu and just googled around a bit. I have to admit C++ interop tempted me, and the language overall didn't seem too off-putting. I disagreed with not enforcing curly braces after I chose Rust. I will be opening more refactoring issues to further modularize our current codebase, and in time, also issues for rewriting parts in Rust. |
Minoru
closed this
Jul 25, 2018
This comment has been minimized.
This comment has been minimized.
|
A hard decision for you, for sure. As I stated above, if you're not happy as a maintainer, you will just burn out sooner or later resulting in badness for all of us. On the other hand, that's a sad decision for me, because I can't join this boat (:-)) and contribute further, though I will surely be using Newsboat in the meantime, because it's just cool. |
This comment has been minimized.
This comment has been minimized.
|
Thanks!
Well, if you're into refactoring and figuring out other's code, there's still plenty of work to do. Documentation needs attention, too—it has been gradually extended for years, and might benefit from restructuring and streamlining. You're still welcome! Edit: LOL, accidentally added a reaction to my own comment instead of yours. |
This comment has been minimized.
This comment has been minimized.
bartlibert
commented
Aug 7, 2018
|
Hmm, might be a reason to start learning rust as I have meant to for quite a while :) (Not that I'll have a lot of time to contribute huge chunks of code I guess) |
This comment has been minimized.
This comment has been minimized.
|
I vote for Haskell, if only because it's the only language out of the three that I actually know |
This comment has been minimized.
This comment has been minimized.
kpcyrd
commented
Sep 24, 2018
|
This thread was linked here: https://groups.google.com/forum/#!topic/newsboat/y3cylBEiDhI Are there any other resources, like a meta thread for the port? For example a discussion how the transition phase would look like, especially if a release is published during that time. I'm involved with rust on debian so I might be able to help with some of the issues. |
Minoru commentedDec 26, 2017
•
edited
This is a thought that's been popping up in my mind time and again. I seem to forget half my arguments by the time I think of this again, so let me write this down and let's discuss it.
This is not a plan, and I definitely don't want to rewrite anything until I understood the limitations behind a few of the big problems that Newsboat faces: long startup, memory consumption, and how keys work.
Why rewrite
For Newsboat, I think C++ is a death by a thousand cuts:
Why not rewrite
Picking a language
Most requirements for a replacement language obviously and directly follow from "Why rewrite" points, so I won't list them here. Additionally, I would like that language to:
Haskell
Been toying with it for, um, 7 years now.
Pros:
Cons:
Rust
I read "The Rust Programming Book", contributed to coreutils, wrote a small project.
Pros:
Cons:
Go
Wrote a simple short program about a year ago.
Pros:
Cons: