7 ms·
Honestly, can we just stop writing java-script. Even better remove java-script from webpages. Oh wait that boat sailed a while ago. That aside I don't see what
by anfilt 8y ago
Honestly, can we just stop writing java-script. Even better remove java-script from webpages. Oh wait that boat sailed a while ago.
That aside I don't see what's the problem is with cross compiling to an other language. Other than if your writing a compiler why not compile to machine code. Honestly, I think code generators are better than macros.
- gnode 8y ago> Honestly, can we just stop writing java-script. Even better remove java-script from webpages. > Other than if your writing a compiler why not compile to machine code This is essentially the idea with WebAssembly. But, for web applications you need security and platform independence, so it's not actual machine code.
- Aardwolf 8y agoWhich method do you propose instead for people to run interactive applications?
- pjmlp 8y agoInternet protocols and native applications. Let the browser be a document viewer. Failing that, finalize Web Assembly's design to the point that the browser is just yet another general purpose VM. WebIDL then defines the APIs accessible to any language that gets compiled into Web Assembly.
- gear54rus 8y ago> general purpose VM With unblockable banners, uninspectable unmodifiable code and other garbage. The current state of affairs is just perfect balance, webassembly can seriously hurt the user if it ever gets good-enough direct access to DOM.
- pjmlp 8y agoI fail to see how that is any different from minified JS.
- gear54rus 8y agoChrome provides excellent facilities for unminifying and debugging scripts, it's not even close to bytecode
- Klathmon 8y agoAnd WASM has a human readable text form that is just as readable as unminified js.
- gear54rus 8y agoHow so? Its code will still be closer to ASM instructions, minifed js is closer to decompiled Jar (haven't personally seen one, maybe I'm wrong here). It doesn't even mangle every identifier so every now and then you get set back on track of what the code does by the occasional Array#filter or something
- pjmlp 8y agoThere is this myth that only bytecodes are fully reversible to source code and ASM is safe. It is only a matter of having the right tools at hand. https://www.hopperapp.com/ https://www.hopperapp.com/ https://www.hex-rays.com/products/ida/ https://www.hex-rays.com/products/ida/ Code might not be 1:1 mappable to original source code, but it is in any case reversible to an higher level description, specially nowadays that re-writable code is no longer allowed due to security exploits. https://webassembly.studio/ https://webassembly.studio/
- TomMarius 8y agoWASM has (will have) exactly the same capabilities as JS (including asm.js that already has DOM access) has.
- gear54rus 8y agowell, cue unblockable banners then...
- Aardwolf 8y ago> native application My issue with those is, they are less sandboxed than JS is. Why would I want to put one-off things all over my disk and system? While I'm willing to install native applications from the package manager for big things I really need, I do not want to do so for simple one-off interactive things, so I really like that I can just do such things in the browser without installing them. Things like simple games, mathematical demonstrations, ... I think the value of sandboxed self contained interactive apps that can do graphics, input, sound, that run from a link, is tremendous to humanity. Of course on the opposite side, one problem is the usage of so much JS for simple articles of text and photos. Those would be more pleasant to read if they were just text and photos and nothing more.
- pjmlp 8y agoEver heard of UWP, iOS, Android, snap, Flatpak, QubeOS ....?
- Aardwolf 8y agoOn Android/iOS you install apps, which is the same as what I meant above by installing. QubeOS: heard of it. It's multiple isolated linuxes together essentially. Do you really think one wants to install software on QubeOS to view a mathematical demonstration or a simple game from the web? The issue is simply the effort of installing vs just opening link and viewing it. I don't know UWP, snap or Flatpak. Do they allow you to open a link and run something interactive immediately without installation? If so, great. We need something that allows you to open a link and have something interesting running immediately. Again, it's sad that this same interactivity is also invading simple textual articles that should be just simple plain text, but that is a problem of those articles, not of the existance of JS.
- pjmlp 8y agoYou don't necessarily need to install apps on modern Android, ever heard of instant apps?
- 8y ago
- pjc50 8y ago> native applications That would require deploying on at least five wildly incompatible native platforms, and break when they change architecture. The web is not so much an integration layer as the no-mans-land of the platform lockin wars; it's a space that doesn't "belong" to any one platform owner, which is both its great benefit and great disadvantage.
- pjmlp 8y agoThat problem has already been solved. My C++, JavaScript, Python, Java, .NET code doesn't care which OS it runs on, and the parts that do are very small modules.
- pjc50 8y agoSo none of it has any GUI?
- adrianN 8y agoCross-platform GUI toolkits were a thing before the HTML-everything craze.
- pjc50 8y agoYes, and they are always slightly second-class citizens, although QT comes closest. Using a cross-platform toolkit is inevitably not quite the same as a native app on every platform - because you're not targeting the native API but a limited subset via a shim layer. If it was easy, we'd be seeing a lot more apps available with Windows/Android/Linux/iOS native ports.
- cupofjoakim 8y agoThe web still needs interactivity. Whilst JS might not be the best thing, what would you recommend? Interactive UI isn't an easy beast to tackle regardless of language.
- aaaaaaaaaab 8y ago>The web still needs interactivity. [citation needed]
- tedeh 8y agoHow can you do online shopping if you can't interact with the web page? Everyone forced to send an email when they want to buy?
- tannhaeuser 8y agoI'm not advocating it (nor am I against it for that matter) but generic shopping cart modules have for a long time supported adding to the cart via URLs. It's quite a practical design as you just store a shopping cart URL with your product catalog data/page, and was kind of the starting point for "web services" and the composable web (until SOAP and REST ruined it with dogma wrt what you should and shouldn't do).
- AnIdiotOnTheNet 8y agoWe had online stores even before JavaScript existed. All you need are cookies and form submission. Actually, as mentioned in another post, you don't even really need cookies.
- m90 8y agoWe had stores even before online stores existed. All you needed is to go there.
- pjmlp 8y agoBy using form submission like in the good old Web 1.0 days.
- vertline3 8y agoI enjoy writing JS, so no, I won't stop.
- raxxorrax 8y agoSeriously. The hate for JS is strong, but I don't really see why. Use typescript if you want, but I don't really see the issue. There are funny things related to implicit type conversion and some rules produce funny and unintuitive outcomes. These conversion can be very handy on the other sides. "Math.min() > Math.max()" and they are damn right that this is true!
- tobr 8y agoDespite personally enjoying JavaScript, I can see why someone might heavily dislike it. Like the fact that it is/has long been the only choice, and that so many of the problems with the modern web have come about through JS.
- spdionis 8y ago> Seriously. The hate for PHP is strong, but I don't really see why. > Just use PHP 7! There are funny things related to implicit type conversion and some rules produce funny and unintuitive outcomes. These conversion can be very handy on the other sides. > "PHP_INT_MIN < PHP_INT_MAX" and they are damn right that this is true! Feeling the perception difference?
- Klathmon 8y agoI always felt the same about PHP. It gets a lot of shit because some of the oldest parts have some weird function names or parameter order, but outside of that it's a fantastic language, especially if you stick with php ~5.5 and newer. It's fast, it has a nice package system, and the pepole behind the language are making it better, faster, and more feature complete every day, with standards bodies which includes the biggest players in the space. IMO languages like Go could learn a thing or 2 from PHP about how to stop worrying about the "best possible choice" and just start giving the language the tools that developers can use to solve real problems.