7 ms·
WelsonJS: Build a Windows app on the Windows built-in JavaScript engine
- h335ian 2y agoDespite being down on all the extras, I wanna reiterate - I do think this is a cool project and I dig that HTAs are still around.
- rvnx 2y agoQuite amazing solution. From the .hta file you can see it was inspired by VBScript (whose most popular software is ILOVEYOU I guess). It looks like the ultimate hack, but why not ? It's very creative and the intention is good as well: TypeScript/JavaScript is a very popular language. Though C#.NET is great as well. It could make sense in the very long-term that Microsoft themselves explore this possibility. Ultimately "TypeScript.NET or JavaScript.NET"
- h335ian 2y agoThis stuff pre-dates .NET and quite honestly I think that’s what m$ was going for in those early days. VBScript was pretty annoying and dealing with COM objects sucked badly. Back in the day we’d build in a local VB interop with JavaScript so we could make system calls and interact with native Windows stuffs. This predates JSON so at the time we’d use XmlHttpRpc to talk to remote/hosted services. I’ll double down on the urge to drop TypeScript. That pile of nonsense came from the classic OOP folks - “But where are my TYPEs!? How do I know what type that variable is!?” (first the Java/C++ folks then the .NET folks “solved” the brain fuzz around functional programming and dynamic types by giving you TypeScript) Having been out of the m$ ecosystem for some time, I’m kinda surprised HTAs are still around, I’m guessing to avoid breaking things. Once .NET started taking off - I always assumed that would replace the VBScript side of things and let you build proper, elegant system interfaces for your JavaScript app. I really imagined the goal was to drop Windows forms/object controls - but I always imagined BATTLES at m$ over being able to create Windows “apps” that didn’t conform to native UI controls, couldn’t be controlled through Windows theming engines, etc. kinduva brand control battle. I always imagined some team going “NOOO, just build a web app, you’re breaking all the UI rules!!!”
- mynameisvlad 2y ago> “But where are my TYPEs!? How do I know what type that variable is!?” Someone clearly hasn’t worked in any sort of sizable code base. Come back when you are writing something spanning hundreds of JS files and where it takes you three times the time to verify that any small change isn’t a typo or wrong type off from a runtime error. TS heavily speeds up the development cycle by bringing an entire class of errors from runtime to compile time and that has nothing to do with OO and inheritance. Simply put, TS is an infinitely better and safer language to develop in and it took the web world by storm for a reason. People didn’t decide to switch en masse for shits and giggles and you should realize that just because you have a different view does not mean that everyone else around you is wrong. > m$ Seriously? It’s 2024, and we’re all adults. This does nothing but water down your point.
- karpour 2y agoLook up WinJS sometime! It was a really neat idea that MS sadly abandoned.
- h335ian 2y ago+1 - that was a really cool idea that I really was hopeful would take off.
- _boffin_ 2y agoWhat about just straight jscript?
- h335ian 2y agoBeen doing this since 1999. The only thing novel I see here is the transpilers - but you know… you don’t need that. You can build HTAs with native JavaScript, CSS and HTML - and with a little VBScript mixin, directly work with Windows libs. Back in ‘99 and early 00’s I was delivering “thin-client” control panels & management tools for server farms, sensitive accounting data, among a variety of other things. It was (and likely still is) a great way to provide a web interface as a desktop app for scenarios where exposing the management interface to the open web is undesirable. Nifty project, but IMHO the world is better off using native JavaScript without all the BS that comes with TypeScript, etc. JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.
- throwaway173920 2y agoI think you are conflating ES6 classes with TypeScript.
- h335ian 2y agoStatic/strong typing is not necessary in JS. Yes, ES6 brings the OOPiness
- mynameisvlad 2y agoThat’s just like your opinion, man. Just because you think that doesn’t mean it’s true. The sheer fact that TS has overtaken JS for the majority of web development says enough.
- deleted 2y ago[deleted]
- bdcravens 2y ago> TS has overtaken JS for the majority of web development Has it? Or is that "just like your opinion, man"? Any citation? There's some sources that say it's more popular based on things like social mentions, etc, but that's a vanity metric. Perhaps the statement is true if you mean "web development" to be a very limited scope (like SPA using a build step), but I'm not even sure that's true then.
- cdaringe 2y agoI saw a partial example, but not clear instructions on how to bootstrap a project. Did I miss it in the README? Or should it be obvious to me if I have some XYZ experience?
- gnh1201 2y agoI have updated the README with the details on this. Thank you. :)
- withinrafael 2y agoBefore anyone gets the wild idea to use this, beware HTAs, VBScript, etc. are slated for removal from Windows around 2027.
- mappu 2y agoHTAs are tied to MSHTML.dll (the old IE renderer) and WSH/CScript is tied to the old, slow IE javascript engine, right? I would expect this to have very limited compatibility, and even with the transpiling, very limited performance. Or is it possible for this to somehow use Chakra, or Edge's V8 engine?
- gnh1201 2y agoYes, the Chakra mode is also built-in. This is because Chakra (not ChakraCore) is an engine embedded in Windows. However, it has not been thoroughly tested.