Comment by kjksf

Comment by kjksf 6 months ago

8 replies

As opposed to?

Today, if I was starting from scratch, I would try zig or odin or maybe even Go.

But SumatraPDF started 15 years. There was nothing but C++. And a much different C++ that C++ of today.

Plus, while my own code is over 100k lines, external C / C++ libraries are multiple of that so (easy) integration with C / C++ code is a must.

mdaniel 6 months ago

I didn't know how to correctly package my comment as not criticizing, and that's half of why I opened with "is outstanding software." I genuinely believe that, I'm deeply grateful for you releasing SumatraPDF into the world, and it makes my life better. Truly, I am thankful

I hear you about "back in my day," but since as best I can tell it's just your project (that is, not a whole team of 50 engineers who have to collaborate on the codebase) so you are the audience being done a disservice by continuing to battle a language that hates you

As for the interop, yes, since the 70s any language that can't call into a C library is probably DoA but that list isn't the empty set, as you pointed out with the ones you've actually considered. I'd even suspect if you tried Golang it may even bring SumatraPDF to other platforms which would be another huge benefit to your users

  • kjksf 6 months ago

    Don't worry about being nice, 15 years doing open source develops a thick skin.

    But you didn't respond: which language should I use?

    Go didn't exist when I started SumatraPDF.

    And while I write pretty much everything else in Go and love the productivity, it wouldn't be a good fit.

    A big reason people like Sumatra is that it's fast and small. 10 MB (of which majority are fonts embedded in the binary) and not 100MB+ of other apps.

    Go's "hello world" is 10 MB.

    Plus abysmal (on Windows) interop with C / C++ code.

    And the reason SumatraPDF is unportable to mac / linux is not the language but the fact that I use all the Windows API I can for the UI.

    Any cross-platform UI solution pretty much require using tens of megabytes of someone else's reimplementation of all the UI widgets (Qt, GTK, Flutter) or re-implementing a smaller subset of UI using less code.

    • sitzkrieg 6 months ago

      sumatrapdf not being cross platform is a great feature, maximizing the use of intended platform. win32api is great. thank you for that

      • nashashmi 6 months ago

        Yes, I now seem to enjoy win32api as it is very snappy, compared to the hell that other cross platform solutions are introducing.

    • nashashmi 6 months ago

      I would have recommended Go but if it increases file size, please don't. Anyways, it is very fast and quick so keep it the way it is. I can't find a reason to change it.

      It can even do comments. But I would like to see more comment tools, especially measurement tools.

      And since you are using Windows, do you think it would be worthwhile to add Windows OCR?

  • CyberDildonics 6 months ago

    being done a disservice by continuing to battle a language that hates you

    I think you should learn basic modern C++ before making judgements like this.

    While you are upset about it the rest of the world is just using basic data structures, looping through them, never dealing with garbage collection and enjoying fast and light software that can run on any hardware.

    A lot of people could get by with $100 computers if all software was written like sumatraPDF.

  • mhd 6 months ago

    > I'd even suspect if you tried Golang it may even bring SumatraPDF to other platforms which would be another huge benefit to your users

    Probably by using a cross-platform toolkit written in C++.