News for hackers. Stuff that matters.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by userbinator on Thursday December 19, 2019 @02:38AM (#21832815)
Notice the binary size of the app is only 64KiB.

In the demoscene this would be a disqualification as it's 676 bytes over the limit, but in this case I'll overlook it because of the sheer awesomeness of what you've done (and I'm sure trimming off 676 bytes wouldn't be too difficult ;-)

More seriously, this is an excellent proof-of-concept that a Slack client does not need to use hundreds of MB of RAM and consume most of a modern CPU core to provide its basic functionality. I'm a long-time Win32 programmer who started in the tail-end of the Win16 days and one of the things I've wanted to write if I had the time and need was a Win32 native Slack client, to show that it can be done with far less resources, but you've gone even further with Win16. Win32 has native TLS support (via SChannel library, not well-documented but examples exist) and you'd be able to even use it practically (32-bit applications will run on all current versions of Windows, both 32 and 64-bit.)

Note that C89 only prevents declarations of variables in the middle of a scope; you can simply create an inner scope with new variable declarations at its start. Like so...

    case WM_PAINT: {
      PAINTSTRUCT ps;
      HDC hdc = BeginPaint(hwnd, &ps);
      ...
    }
Another small tip: if you make it a dialog-based application, you won't have to bother with WM_PAINT and drawing text yourself --- you can just make the "statusText" and "settingsText" edit controls, and use SetWindowText (or SetDlgItemText) to set their content. They will paint themselves automatically just like the listboxes that you used for the chat contents and userlist. At least you'll save some of those 676 bytes that way...
Re:Building a new Windows 3.1 app in 2019: A Slack Client by bluedino on Thursday December 19, 2019 @08:03AM (#21834517)
It's kind of silly compare a bare bones get/post to an entire app. This reminds me of my attempts to write an IRC client in an evening.

Creating a native Windows app to mimic the Electron Slack client would not be a trivial task.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by shaan7 on Thursday December 19, 2019 @08:33AM (#21834710)
His point is that this bare bones get/post app in Electron will be much, much "larger".
Re:Building a new Windows 3.1 app in 2019: A Slack Client by harshitaneja on Thursday December 19, 2019 @08:47AM (#21834825)
And that is why it would foolish for them to post a barebones slack client in electron. But they don't publish that. They have published a full featured client that is cross platform. I am not a fan of electron and would very much prefer a desktop app. But we are finally seeing emergence of desktop applications from major players for Linux because of electron. It's not ideal but so wasn't the previous solution.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by xg15 on Thursday December 19, 2019 @03:48PM (#21839093)
> But we are finally seeing emergence of desktop applications from major players for Linux because of electron.

In my experience, Electron applications seldomly follow the UI conventions of the host OS or offer much in terms of integration.

If the desktop app is really just the web site in a locked-down browser, then what benefits does this offer to just the normal web page?

Re:Building a new Windows 3.1 app in 2019: A Slack Client by therealdrag0 on Thursday December 19, 2019 @05:34PM (#21839981)
I like the conceptual separation. I like alt-tabbing to "Slack" not "Chrome". It also doesn't have any of the header bar so the electron app has more UX control, including access to OS level window menu options. Also it can do things that you can't do inside the browser. E.g., I've seen electron apps that come with other background processes. I also think it performs better in terms of versioning/caching resources. So an electron app could be just a web-site, but they often are much more.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by neop1x on Friday December 20, 2019 @11:36AM (#21845360)
That's true but some of that could already be implemented in browsers itself. E.g. web page could request to be in a separate window with different icon and ask for OS-wide api permissions. Now we have to run several fully-featured browser (Elecron) instances, not sharing system libraries, under different versions. This reminds me "write once, run everywhere" Java with bundled binary JREs because of incompatibilities between vendors... But there is some progress - for example IBKR TWS client can't play sounds as it was linked with an old libavformat.so which I no longer have in the system. Browsers have most of libs statically linked.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by CivBase on Thursday December 19, 2019 @11:26PM (#21841706)
Web pages are constrained by the functionality made available to them by the browser - which is (purposely) very limited. Electron apps run on a native JavaScript interpreter (NodeJS) and have full access to the OS.

As far as UI inconsitencies go, most libraries I have used for native apps (Qt, Swing, Tk, etc) also do not feature UI elements that are consistent with the OS. Many developers simply can't afford to support multiple UIs just because they subjectively look a bit better.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by yellowapple on Friday December 20, 2019 @04:15PM (#21847433)
> most libraries I have used for native apps (Qt, Swing, Tk, etc) also do not feature UI elements that are consistent with the OS

Huh? Okay, maybe Swing doesn't support native-looking widgets (I have less experience with it), but I can personally attest that Qt and Tk (or more precisely Ttk) apps nowadays use a platform-native look-and-feel on Windows, macOS, and Linux alike, by default (i.e. with zero effort on the part of the app developer). It might not be absolutely pixel perfect, but it's way closer than an Electron app.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by Snetry on Thursday December 19, 2019 @08:58AM (#21834898)
Existing frameworks like Qt or GTK could also be used for a Cross-Platform solution

And just because it's electron doesn't mean it's inherently Cross-Platform look at discord for example It took too long for a initial desktop client to be released and then it ha issues with things like screen sharing not working as expected

Re:Building a new Windows 3.1 app in 2019: A Slack Client by tjpnz on Thursday December 19, 2019 @09:19AM (#21835072)
>Existing frameworks like Qt or GTK could also be used for a Cross-Platform solution

They could but finding engineers with that kind of experience would be harder and cost a lot more. Far easier to retrain web frontend engineers.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by mileycyrusXOXO on Thursday December 19, 2019 @12:06PM (#21836777)
It isn't like Qt is some bizarre arcane wizardry. You give a web developer a few days and they can productively be contributing to a Qt app.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by sdegutis on Thursday December 19, 2019 @12:19PM (#21836930)
Yeah but then the dev has to investigate how to solve certain patterns in Qt's ways which they already know how to solve in the web frameworks, and just like with natural languages, sometimes there are no straightforward ports for concepts, and it requires a ton of extra work that you couldn't foresee until getting halfway through the whole project. Adopting new tech is not without serious costs and risks. Also, no GUI framework I've ever seen has figured out a decent composability solution nearly as well done as the DOM, for better or worse. Not to mention the gigantic web ecosystem that just works in Electron.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by xg15 on Thursday December 19, 2019 @03:42PM (#21839036)
Sorry, but if the way forward really is that every desktop application of the future has to ship with a full copy of Chrome, come with all the bloat and baggage of the web platform and continue its questionable UI conventions - all just because companies are too cheap to offer some training - then I really don't see how that is a desirable future.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by ldh on Sunday December 22, 2019 @11:30AM (#21858047)
Electron is bad enough from a user perspective, but it's downright horrible to see how it's instilled a rather defeatist approach in front-end developers.

"But I already know Javascript, it's too hard to figure out something else"

Re:Building a new Windows 3.1 app in 2019: A Slack Client by jcelerier on Monday December 23, 2019 @06:16AM (#21862925)
> But we are finally seeing emergence of desktop applications from major players for Linux because of electron

It's not like Maya, Steam, Chrome, Firefox, Skype, Adobe Reader, Houdini, DaVinci, Nuke, TeamViewer, Blender... haven't been working on Linux for ages (or more recently Bitwig, Reaper...). And conversely it's not like every Electron app has a linux build.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by core-questions on Friday December 20, 2019 @12:11AM (#21841855)
Most likely, the real solution here is to make a very highly performance tuned Electron for Wayland, and make it possible for multiple Electron apps to share at least some part of the footprint of that runtime.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by whateveracct on Thursday December 19, 2019 @01:07PM (#21837480)
Fixed costs vs variable costs. That fixed cost of Electron does come with some sizable benefits, so if you don't take advantage of them ofc Electron will just be bloat.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by bdcravens on Thursday December 19, 2019 @11:41AM (#21836456)
I think you could get pretty far without Electron. While a closer Slack experience would require some HTML rendering (VS languages have had an embeddable web view for a long time), alot of the formatting could be native (probably have to do some parsing) as could things like file uploads, image display, etc.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by tomjen3 on Thursday December 19, 2019 @02:55AM (#21832892)
I can't help but agree with you. Honestly I think it went to hell when we decided that it was acceptable to call an electron app native, but that may have been a symptom, not a cause.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by zanderz on Thursday December 19, 2019 @10:55AM (#21835965)
Some years ago I worked on a very popular Windows desktop C++ program that had to stay small and backwards compatible, which meant only Win32 APIs and homemade libraries. Designers by the dozens would be hired, then get fed up with these limitations and quit, complaining that they wanted to have the freedom to make UIs in HTML and CSS, and that users are used to interacting with Web UIs so everything should look like that.

Later, at a different job, the UI was Electron based, but designers no longer worked in HTML, they used some other tools and it had become the job of engineers to write the HTML and CSS to match.

These trends seem to be driven partly by conventional wisdom about the lowest common denominator among young people in the workforce, e.g. javascript and html are so much easier, let's build everything on those, and next thing you know those have become a given and the next crop of kids will use something new on top of that. Or maybe something like QT will win and native code will become a first class citizen again with secondary support inside browsers via WebAssembly?

Re:Building a new Windows 3.1 app in 2019: A Slack Client by userbinator on Thursday December 19, 2019 @04:43PM (#21839638)
Some years ago I worked on a very popular Windows desktop C++ program that had to stay small and backwards compatible, which meant only Win32 APIs and homemade libraries.

That's funny, because it's exactly the type of job I'd love doing --- and I have been working on stuff like that (native code, mostly Win32, with some hardware/drivers/embedded stuff) for a long time; if you haven't guessed already, I try to stay very far away from the web stuff, even though I know HTML/CSS/JS and can use it if needed.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by tomjen3 on Thursday December 19, 2019 @04:45PM (#21839656)
I mean I am not a fan of C++ (though I don't hate it either), and I love how easy and well libraries for e.g Python works together and how easy they are to find and install, but I don't think it is necessary to go all the way to native code -- Java/Kotlin on the JVM performs pretty well (and you can always outsource the heavy parts to C).
Re:Building a new Windows 3.1 app in 2019: A Slack Client by DaiPlusPlus on Thursday December 19, 2019 @04:09AM (#21833239)
Before Electron people had the arguments about bloated apps when it came to WPF and Qt. And Java apps, like WPF (and most Qt apps I’ve used lately) lacks true integration with native OS widgets so as a user I get an uncanny-valley feeling.

At least with Electron you’re essentially forced to style everything - and ever since Windows 8 (or Windows Vista) Microsoft has been actively uglifying native widgets.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by tomjen3 on Thursday December 19, 2019 @04:41PM (#21839627)
I did consider Java as I was writing it, but at the same time Java is actually pretty fast, but there is no doubt that it doesn't use native components most of the time (there is a gnome toolkit bindings for Java, so it is possible).

Still Java feels speedy, I think because it is compiled and doesn't need wacked workarounds like not having non-floating point numbers.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by DaiPlusPlus on Thursday December 19, 2019 @06:19PM (#21840306)
I’ve never seen Java running on Windows 3.x - how long did they maintain it for? Or did it use Win32S?

Update: ah, Microsoft released their own port in 1997: https://www.cnet.com/news/ie-gets-java-for-windows-3-1/ - I wonder how long they maintained that for.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by jcelerier on Thursday December 19, 2019 @11:02AM (#21836057)
> Before Electron people had the arguments about bloated apps when it came to WPF and Qt.

which is funny when you see that Qt runs on microcontrollers now.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by AdrianB1 on Thursday December 19, 2019 @04:13AM (#21833255)
There is no direct correlation between the size of an executable (64kb) and the size of the RAM usage (can be hundreds of MB). I could not find any information about the total memory usage of the application, is it described anywhere?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by amiga-workbench on Thursday December 19, 2019 @04:45AM (#21833410)
Its running on a ThinkPad 390e, 64mb as standard, and tops out at 256mb, so there is your upper bound.

Even at an absolute worst case it still beats the pants off Slack.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by yeokm1 on Thursday December 19, 2019 @04:54AM (#21833450)
You are correct. My 390E has 384MB of RAM but only 256MB is accessible by Win 3.1.

An earlier blog post shows this http://yeokhengmeng.com/2016/09/windows-for-workgroups-3-11-...

Re:Building a new Windows 3.1 app in 2019: A Slack Client by StavrosK on Thursday December 19, 2019 @05:27AM (#21833592)
And is probably quite a bit faster, too.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by cwyers on Thursday December 19, 2019 @11:15AM (#21836189)
It's also lacking so many features as to be unusable.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by yeokm1 on Thursday December 19, 2019 @04:56AM (#21833459)
Win 3.1 apps can also access memory in 64K segments which I only use 1 to hold the humongous HTTP+JSON reply from Slack.

Wikipedia says "However, no single process can use more than 16 MB.". Not sure where is the source of that though.

https://en.wikipedia.org/wiki/Windows_3.1x

Re:Building a new Windows 3.1 app in 2019: A Slack Client by tinus_hn on Thursday December 19, 2019 @07:02AM (#21834124)
https://en.m.wikipedia.org/wiki/Protected_mode

It’s a limitation from the 286 Protected Mode.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by stevefan1999 on Thursday December 19, 2019 @03:55AM (#21833187)
It feels a lot closer to write for MCUs if you write for 16-bit programs nowadays. The only difference is that MCUs are much more barebone and so less managed, but the constraints set by hardware however is the most distinctive common spot.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by DaiPlusPlus on Thursday December 19, 2019 @04:05AM (#21833222)
MCU?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by markus92 on Thursday December 19, 2019 @04:13AM (#21833254)
Microcontroller unit.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by stevefan1999 on Thursday December 19, 2019 @04:38AM (#21833368)
Think MCUs are of the kinds like Arduino and microBit. There are also SBCs where bigger and more power hungry devices like Raspberry Pi belongs to.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by that_jojo on Thursday December 19, 2019 @09:09AM (#21834986)
Super late, but the term MCU refers to the actual chip -- analogous to SoC for the main chip on a raspi.

You don't call the raspi an SoC, and it's debatable that you'd call a prototyping platform like Arduino an MCU. The MCU is the main Atmel AVR, Microchip PIC, or similar part that drives such a board.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by yeokm1 on Thursday December 19, 2019 @04:17AM (#21833276)
Hey thanks for the tips. Let me adjust the blog post to mention this point
Re:Building a new Windows 3.1 app in 2019: A Slack Client by rvanmil on Thursday December 19, 2019 @03:00AM (#21832914)
> More seriously, this is an excellent proof-of-concept that a Slack client does not need to use hundreds of MB of RAM and consume most of a modern CPU core to provide its basic functionality.

If you’re so sure that this is possible, then where is the Electron competitor which allows us to build cross platform applications like this, with the same levels of productivity and a consistent and decent user interface? No one needs to be convinced that a native Slack client for each platform would be much better, I wish they would build those clients. The problem is most companies can’t reasonably justify the costs of building multiple native clients when a single cross platform one is good enough.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by benibela on Thursday December 19, 2019 @06:12AM (#21833850)
There is Delphi and Lazarus as open-source clone of it

Lazarus can use the Windows API on Windows, gtk/qt on Linux, and carbon/cocoa on Mac.

There is also a custom drawn mode that draws the GUI directly rather than using platform apis. That also runs on Android, but it not maintained anymore, so only up to Android 5 or something

Delphi is supposed to run on Android and iOS.

And Delphi 1 ran on Windows 3.1, so you could have used the same GUI since then

Re:Building a new Windows 3.1 app in 2019: A Slack Client by noonespecial on Thursday December 19, 2019 @08:33AM (#21834714)
There is Delphi and Lazarus as open-source clone of it

Shhh! Ixnay on the Lazarusay. If people find out, I'll lose my magical secret weapon for blasting out little windows gui apps.

Seriously though, if you ever find yourself needing a few buttons on a windows desktop that do simple things, Lazarus is amazing for whipping that up in a few minutes and still looking professional.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by AnIdiotOnTheNet on Thursday December 19, 2019 @09:08AM (#21834973)
Agreed. I'm not a huge fan of Pascal, but it's better than JS and Lazarus makes knocking up a simple GUI trivially easy.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by benibela on Thursday December 19, 2019 @05:06PM (#21839778)
Nah, when people find out it is Pascal, they run away. Can't type begin and end, such words are just too long
Re:Building a new Windows 3.1 app in 2019: A Slack Client by bonzini on Thursday December 19, 2019 @03:06AM (#21832937)
Qt and to some extent GTK+ come close. GTK+ can be programmed in Vala which is a fine language that transpiles to C and supports idioms such as asynchronous programming.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by Const-me on Thursday December 19, 2019 @04:51AM (#21833438)
> Qt and to some extent GTK+ come close

Both are C++: developers are more expensive to hire, and stuff takes more time to develop and debug. I'm proficient in C++ (programming for living since 2000), but I wouldn't pick the language for 2D GUIs in 2019.

> GTK+ can be programmed in Vala

Picking a non-mainstream languages is risky. Harder to find developers. Way more likely to find bugs in the toolchain and these can easily cost weeks to fix.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by bonzini on Thursday December 19, 2019 @05:41AM (#21833681)
You can also write GTK+ in JavaScript for that matter, or Python. Vala is a very underrated language though and it should be very easy for a good JavaScript programmer to pick it up.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by Snetry on Thursday December 19, 2019 @09:03AM (#21834931)
Enough languages have bindings for GTK or Qt to make it viable
Re:Building a new Windows 3.1 app in 2019: A Slack Client by otabdeveloper2 on Thursday December 19, 2019 @01:36PM (#21837766)
> Both are C++: developers are more expensive to hire, and stuff takes more time to develop and debug.

Have you seen the state of Javascript 'ecosystem' and job market?? Both statements are false.

The real reason is that C++ toolkits don't have platform and device independence. HTML and CSS are really good and powerful design tools, especially compared to composing raw pixels like you'd (essentially) be forced to do with Qt and GTK.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by ahartmetz on Friday December 20, 2019 @08:27AM (#21843938)
The ignorance in this thread is rather concerning.

Let me correct: GTK+ is not C++, it's C. Qt is very cross-platform: it supports about 10 platforms, including Linux, Windows, and macOS. You are not doing anything close to compositing raw pixels in Qt or GTK+. They have layout managers that are specifically made for typical application UIs, and they have lots of ready-made widgets. Qt also has QML, which is a declarative UI descriptions language kind of like HTML/CSS but much more productive because (gasp) it's actually designed from the ground up for applications, not websites.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by kleiba on Thursday December 19, 2019 @07:36AM (#21834320)
but I wouldn't pick the language for 2D GUIs in 2019

Which one would you recommend?

Re:Building a new Windows 3.1 app in 2019: A Slack Client by Const-me on Thursday December 19, 2019 @10:46AM (#21835862)
I mostly program for Windows and use C# for the GUI.

Cross-platform story is complicated, though. I have good experience creating a custom GUI framework for embedded Linux: drm/kms, gles, NanoVG, [DllImport], everything on top is custom C# code in .NET core 2.2. But that approach is not for everyone. I only needed 10-15 screens with simple GUI on them, it’s a 5” touchscreen with no other user-facing devices. Creating more advanced UX this way would consume too much time.

There’re Avalonia and Xamarin. Didn’t used them at that time because I needed full-screen GUI for a single-application Linux, without any desktop environments or user mode OS components. For desktops and especially mobile apps they might work OK.

It’s unpopular opinion here, but I think Electron is not that bad for GUI, esp. when writing TypeScript instead of JS. I think it’s similar story to Unity3D or PHP: low entry barrier attracted inexperienced programmers, then the whole ecosystem is judged based on the output of these inexperienced people.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by kleiba on Saturday December 21, 2019 @04:20PM (#21853425)
Great reply, thanks very much!
Re:Building a new Windows 3.1 app in 2019: A Slack Client by marton78 on Thursday December 19, 2019 @03:20AM (#21833006)
That's cross platform for Windows, Mac and Linux, but what about Web, Android and iOS?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by shakna on Thursday December 19, 2019 @03:39AM (#21833099)
Ignoring that you probably _don't_ want the same interface across all of those...

Qt, as well as Windows, macOS and Linux actually can do Android [0] and iOS [1], and Web is halfway there [2].

[0] https://doc.qt.io/qt-5/android.html

[1] https://doc.qt.io/qt-5/ios.html

[2] https://wiki.qt.io/Qt_for_WebAssembly

Re:Building a new Windows 3.1 app in 2019: A Slack Client by danShumway on Thursday December 19, 2019 @11:00AM (#21836027)
I just want to step in quick to advocate. Please do not use Qt for the web. Their web export tools aren't just unfinished, they're actively hostile to web paradigms. The finished product doesn't render to the DOM, it's completely screenreader inaccessible, it overrides browser preferences. In a lot of ways, Qt on the web is even worse than Flash was.

You know all of the arguments against Electron that people trot out about how it's not real native, and it doesn't follow the right UX conventions or paradigms? Qt on the web is exactly like Electron on native, except way worse and without any sign that it's going to improve, because fundamentally Qt is structured around the idea that it should be able to spit out a binary blob of pixels instead of hooking into web-native primitives like the DOM.

Look into something that's showing more promise, like .NET and Razor. The Rust community is also doing some good work here, although I don't know that they have any UI frameworks that are mature enough to be reliable in an enterprise setting.

These aren't true cross-platform efforts yet, since they're still forcing you to think about HTML. But if I was going to bet on any project ending up with a real cross-platform solution that felt good on the web, some kind of export option from an Open Source Windows Forms or similar is probably what I would bet on. Either Microsoft or (possibly) the Rust community are the two parties that I think are most likely to end up producing a true native UI toolkit that can actually export to the web in a usable, acceptable way.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by leadingthenet on Thursday December 19, 2019 @03:58AM (#21833194)
That's exactly what your users don't want you to do!
Re:Building a new Windows 3.1 app in 2019: A Slack Client by tjoff on Thursday December 19, 2019 @03:27AM (#21833041)
You do not want the same UI on desktop and mobile.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by mmariani on Thursday December 19, 2019 @04:45AM (#21833409)
Beeware [0] does it too, natively in python. The architecture and code base are very nice as well. [1]

[0] http://www.beeware.org [1] https://dan.yeaw.me/posts/gui-widget-for-beeware/

Re:Building a new Windows 3.1 app in 2019: A Slack Client by Kipters on Thursday December 19, 2019 @03:47AM (#21833146)
Xamarin and Uno Platform
Re:Building a new Windows 3.1 app in 2019: A Slack Client by codedokode on Thursday December 19, 2019 @03:21AM (#21833009)
Windows 3.1 apps are somewhat cross-platform because they can be run with Wine on Linux.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by YokoZar on Thursday December 19, 2019 @05:35AM (#21833650)
It's even better: 64-bit Windows doesn't support 16-bit Win 3.1 apps anymore, but you can still run them via Wine on the Linux subsystem.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by AnIdiotOnTheNet on Thursday December 19, 2019 @09:11AM (#21834999)
It should be noted that WineVDM[0] will allow you to run 16-bit Windows applications on Windows without the Linux subsystem.

[0] https://github.com/otya128/winevdm

It would have been relatively straightforward for Microsoft to support 16-bit on 64-bit, but they decided not to. I can't help but feel that that is just more evidence that whoever is running Windows development these days hates everything that used to make it a good desktop.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by muststopmyths on Thursday December 19, 2019 @11:44AM (#21836494)
64-bit Windows has never supported 16-bit. This has nothing to do with "whoever is running Windows development these days"

Back when 64-bit Windows came out (with XP and Server 20003), the adoption was pretty small since most applications were not 64-bit and did not need 64-bit address spaces. Microsoft saw the opportunity to kill at least one backward compatibility burden by not even trying to support 16-bit for x64. They figured, rightly, that by the time x64 became widespread, 16-bit would be obsolete.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by AnIdiotOnTheNet on Thursday December 19, 2019 @11:50AM (#21836588)
> 64-bit Windows has never supported 16-bit.

Don't believe I said otherwise.

> This has nothing to do with "whoever is running Windows development these days"

> Microsoft saw the opportunity to kill at least one backward compatibility burden by not even trying to support 16-bit for x64.

These two statements are at odds. Microsoft used to take compatibility extremely seriously. It would have been relatively trivial to allow 16-bit applications to run, and obviously there is desire to do so since WineVDM exists, they just arbitrarily decided not to.

I suspect this is because they've become infected with developers who use Linux a lot and think nothing of breaking compatibility every release, let alone in cases like this.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by jdsully on Thursday December 19, 2019 @01:01PM (#21837417)
Virtual 8086 mode was gone, but they could have just emulated it. The real reason 16-bit apps don't run is Microsoft didn't think it was worth the effort.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by efreak on Thursday December 19, 2019 @12:58PM (#21837387)
Wasn't 64-bit windows 2k/64 itanium-based, not x86-based? If so it would have required supporting existing binaries compiled for a different architecture. My understanding is that the only 16-bit support in 64-bit windows is a few specific loaders for things like 16-bit installers (please correct me if I'm wrong)
Re:Building a new Windows 3.1 app in 2019: A Slack Client by muststopmyths on Thursday December 19, 2019 @06:54PM (#21840508)
Yes, the initial 64-bit OS was IA64 and that was the perfect excuse to dump NTVDM, instead of trying to do a W16OW64 or something of that sort. x64 XP and 2003 further solidified that decision because they were "professional" SKUs and Microsoft could dictate that they didn't care about DOS/Win16 for the "new" platform.

It didn't exactly run 16-bit installers. https://devblogs.microsoft.com/oldnewthing/20131031-00/?p=27...

Re:Building a new Windows 3.1 app in 2019: A Slack Client by gdxhyrd on Thursday December 19, 2019 @04:58AM (#21833468)
Indeed. This point is usually missed. You can even run Windows apps in BSD and macOS.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by j88439h84 on Thursday December 19, 2019 @03:30AM (#21833052)
It's Beeware. https://beeware.org/

> Write your apps in Python and release them on iOS, Android, Windows, MacOS, Linux, Web, and tvOS using rich, native user interfaces. Multiple apps, one codebase, with a fully native user experience on every platform.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by gattilorenz on Thursday December 19, 2019 @05:31AM (#21833624)
This sounds great, but it seems there's no out-of-the-box support for a rich text textbox?

I have a python script that I want to deploy as self-contained app for windows and osx with a gui. Finding a framework that works, is decent to use, doesn't need hundreds of MBs of dependencies, and has rich text support is...not easy.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by zoom6628 on Thursday December 19, 2019 @06:32AM (#21833967)
Have a look at nuitka for compiling your script to a binary.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by gattilorenz on Thursday December 19, 2019 @10:51AM (#21835925)
Thanks, I'll try it! I was using pyinstaller atm.

I'm still trying to figure out if there's a GUI that supports different text with mixed colors and features out of the box, and that's not horribly broken in OS X

Re:Building a new Windows 3.1 app in 2019: A Slack Client by bluedino on Thursday December 19, 2019 @07:59AM (#21834490)
In the old days, you would just go on AOL's Windows programming section, find a shareware rich text control, and use that.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by gattilorenz on Thursday December 19, 2019 @10:49AM (#21835902)
In the old days, I would do it in Delphi and have the controls already in my toolbox :)

I was actually thinking of giving it a go, but the idea of a Python backend and a Delphi frontend is as attractive as recoding everything in ASM.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by scarface74 on Thursday December 19, 2019 @07:01AM (#21834121)
Yes, because Slack is one man shop that can’t afford to hire one or two Windows, Mac, and Linux developers.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by archi42 on Thursday December 19, 2019 @07:44AM (#21834385)
Actually, s/Slack/Tidal/ if you want to add insult to injury. Electron app for Windows and Mac (but well, nice features overall). However, no Linux build.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by kelnos on Thursday December 19, 2019 @07:57AM (#21834466)
Slack does have (very-long-time-beta) Linux build[0], though I personally prefer to just use Slack through my browser instead of suffering through an Electron app.

[0] https://slack.com/downloads/linux

Re:Building a new Windows 3.1 app in 2019: A Slack Client by folmar on Thursday December 19, 2019 @04:51PM (#21839694)
The web version work also well in Firefox, so you don't need to give all your RAM.

Slack calls don't work reliably in Chrome/Electron on linux anyway, so no loss here.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by artificial on Thursday December 19, 2019 @09:22AM (#21835106)
Here’s a free lightweight native Mac client (with dark mode oooOooo) https://www.sblack.online/
Re:Building a new Windows 3.1 app in 2019: A Slack Client by itronitron on Thursday December 19, 2019 @04:01AM (#21833207)
What are your criteria for something being an Electron competitor?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by rvanmil on Thursday December 19, 2019 @07:52AM (#21834444)
It was more or less a rethorical question (I guess that’s why I’m being downvoted), because there is no competitor. If there was, then Electron wouldn’t be so extremely popular in the first place, and we’d see a lot more popular apps made with all the tools mentioned in the other replies to my post.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by itronitron on Thursday December 19, 2019 @09:22AM (#21835098)
Thanks, I'm assuming there is some core application capability that people are getting from Electron. In terms of 'write once run anywhere' Java has that covered but doesn't offer a means to spec UIs with HTML/CSS, so if that is the deal killer then it would be nice if Java added that capability for applications.

Edit >> looks like JavaFX WebView is a thing now, plus the jxbrowser embeds chromium in a Java App... not sure of the performance of either of these implementations

Re:Building a new Windows 3.1 app in 2019: A Slack Client by clarry on Thursday December 19, 2019 @01:23PM (#21837653)
> 'write once run anywhere'

That's the biggest lie ever, with these newfangled "cross-platform" solutions.

I want to watch the guy who has to sit down and port electron to a platform it doesn't run on yet. It's just a few lines of code, right?

Java had the same problem, everyone who ran Linux in early 2000s remembers. It's still not something I would want to port, but at least it runs on more systems ootb than electron.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by BubRoss on Thursday December 19, 2019 @08:23AM (#21834635)
You are being downvoted because the idea that electron is the only way to get cross platform GUIs is absurd and comes from inexperience and a lack of research. FLTK, Juce and Qt are just some of the options for creating cross platform UIs that end up being much smaller and MUCH faster than electron. Electron is popular because people learn javascript and don't want to learn C++. I can't completely fault this mentality for toy programs, but at some point the false sweeping statements get pretty old.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by laurent123456 on Thursday December 19, 2019 @09:17AM (#21835062)
It's weird to assume that developers who use Electron do so because they are ignorant, incompetent and lazy.

The truth is, everybody knows about Qt, GTK and so on, and everybody knows Electron is heavy but you have to be realistic. As a company do you want to spend that much money hiring a ton of C++ developers over a much longer period of time, or do you go for the solution which, while not ideal, allows you to develop a cross platform app in a much shorter time?

These days many people run Electron apps without even knowing it, showing that it's an ok solution.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by BubRoss on Thursday December 19, 2019 @10:26AM (#21835658)
> It's weird to assume that developers who use Electron do so because they are ignorant, incompetent and lazy.

I don't think I said all that

> As a company do you want to spend that much money hiring a ton of C++ developers over a much longer period of time,

This I think is a big assumption. Making a GUI isn't really that difficult. Most of the time in a program doesn't go into making the actual UI. I never hear someone who is experienced in making UIs say that electron saves them so much time, it is always people assuming it takes an army of C++ people to do what one person can do with electron, which is bizarre, especially over the course of something that is more than a prototype.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by laurent123456 on Thursday December 19, 2019 @10:55AM (#21835975)
> I don't think I said all that

Kind of: "inexperience", "lack of research", "don't want to learn C++"

> Making a GUI isn't really that difficult.

Also a big assumption, especially for cross-platform GUIs.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by BubRoss on Thursday December 19, 2019 @02:52PM (#21838542)
If you don't know the difference between "inexperience and a lack of research" and "ignorant, incompetent and lazy" then I don't know what to tell you. It seems like you are hallucinating some sort of persecution.

It is not a big assumption, I've done it many times. What is it that you think electron gives you that cross platform GUIs don't have? Making the actual UI is usually pretty trivial, it isn't even logic, just data through function calls.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by rvanmil on Thursday December 19, 2019 @08:46AM (#21834823)
> toy programs

> false sweeping statements

OK.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by BubRoss on Thursday December 19, 2019 @09:15AM (#21835046)
I think misunderstood what I said - I can understand not learning C++ for toy programs, but at some point making thousands of users use an electron program is pretty silly.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by shaan7 on Thursday December 19, 2019 @08:39AM (#21834766)
You do realize that one thing can be more popular but still have competition, right?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by rvanmil on Thursday December 19, 2019 @08:43AM (#21834799)
Sure, I’m just saying there is a huge gap and other tools, even though they technically work, haven’t proven to be good enough to become as widely adopted as Electron.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by asjw on Thursday December 19, 2019 @04:12AM (#21833250)
Redlang