Essentially the same html/css rendering of Firefox or Chromium, still able to access the www, but with javascript fully removed for another language that can be interpreted - like python or lua. Is this feasible?

top 42 comments

sorted by: hot top controversial new old
[–] 10 points 2 months ago (3 children)

there were plans for multiple scripting languages for the web, hence the type="javascript" attribute on the <script> tag. the thing that became javascript was originally more like a lisp, but netscape wanted to cash in on the popularity of java applets so they made the language look more java-y.

the bones are there, there's just no sense in implementing it in mainstream browsers now.

  • source
  • hideshow 3 child comments
  • [–] 5 points 2 months ago (2 children)

    Microsoft had a Visual Basic variant (VBScript) in IE that got some attention back in the 90s; it's probably just as well that JS won instead of that...

    In modern webdev type="module" is used to indicate an ES6 module and type="importmap" to include a JSON table of paths to modules. Still basically JS, but the parameter is still used in a meaningful way.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 15 points 2 months ago* (4 children)
  • [–] 6 points 2 months ago

    It still suffers from not having access to the DOM and other APIs the browser supplies. That's being worked on, I believe.

    Without that, you still need a JavaScript layer in-between at the very least. At that point, you're not gaining much from running in WASM.

  • source
  • parent
  • [–] [S] 2 points 2 months ago (2 children)

    Doesn't a browser need to have javascript enabled to even run WASM? That beats the entire point of getting rid of js

  • source
  • parent
  • hideshow 2 child comments
  • [–] 7 points 2 months ago

    we used to have java applets and clientside perl a long time ago iirc

  • source
  • [–] 20 points 2 months ago (2 children)

    Yes, and we moved away from that because of Macromedia Flash having more security holes then colanders

  • source
  • hideshow 2 child comments
  • [–] [S] 5 points 2 months ago (1 child)

    But that was something that had to be installed on the system and integrated into the browser, not quite what i'm asking as it wasn't an alternative browser per se

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 2 months ago

    But that was something that had to be installed on the system

    That was only initially true, by the end of its life it was a default component in some major browsers. Such as chrome and internet explorer.

    And prior to that it frequently came preinstalled by the manufacturer.

    But with all that said, I suspect we've missed the intent of the previous comment. To illustrate that none of the alternative means to run code in a web browser has worked out.

    And with that said due to market momentum (like how so many apps are electron based) I would expect JavaScript to outlive C++ haha.

  • source
  • parent
  • [–] 10 points 2 months ago (3 children)

    Sure but then you are basically creating an alternate web which is incompatible with the current one. Your browser wouldn't be able to load any js based sites and current browsers would not be able to load your python/lua based sites.

  • source
  • hideshow 3 child comments
  • [–] 5 points 2 months ago (1 child)

    Your browser wouldn't be able to load any js based sites

    You could make a browser capable of loading both, and I think it already happened. The problem is, that a browser supporting more languages than necessary, was never successful enough to get mass adoption and on the internet you need mass adoption to survive.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 10 points 2 months ago (1 child)

    The network effect makes this unlikely to take off. But in theory it's possible, and I suppose somebody probably has created/will create one as a hobby project/prototype that a small number of people will use.

  • source
  • hideshow 1 child comment
  • [–] 7 points 2 months ago (2 children)

    yes, but there's no demand for it

  • source
  • hideshow 2 child comments
  • [–] 2 points 2 months ago (1 child)

    https://pyscript.net/

    PyScript is an open source platform for Python in the browser.

  • source
  • hideshow 1 child comment
  • [–] 2 points 2 months ago

    I remember a browser that uses lua instead of javascript. Was kinda interesting.

  • source
  • [–] 1 point 2 months ago (1 child)
  • [+] 1 point 2 months ago (1 child)
  • [–] 1 point 2 months ago

    Yeah, but i would prefer it without any scripting.

  • source
  • [–] 1 point 2 months ago

    ASP is still a thing, just about.

  • source
  • [–] 1 point 2 months ago (1 child)

    Microsoft tried it with internet explorer. It supported VB Script as an alternative to JS. Alongside their ActiveX.

  • source
  • hideshow 1 child comment
  • [–] 1 point 2 months ago

    Not if Gooogl says no.

  • source
  • [–] 1 point 2 months ago (8 children)

    Arguably typescript fits, it is converted to JS for runtime, but the developer writes TS. You theoretically could transpile python or lua to JS, no idea if it exists yet though.

    Otherwise WASM would be the main contender, dunno if lua or python can compile to wasm, but lots of languages can.

  • source
  • hideshow 8 child comments
  • [–] 2 points 2 months ago (7 children)

    Typescript doesn't run on the browser. But I'm pretty sure we will see native typescript soon. At this point, TS is practically the industry standard for developing serious JavaScript.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 1 point 2 months ago (6 children)

    I dunno, I don't see the benefit to native TS in the browser. For compatibility, all sites will continue to serve JS, so what does TS gain anyone? And there is no performance benefit, maybe a performance hit given none of the type validation can happen until all of the scripts have downloaded, so execution can't begin until that has happened?

    I could be way off on this though, I'm not a webdev :/

  • source
  • parent
  • hideshow 6 child comments
  • [–] 2 points 2 months ago (5 children)

    Type assertion in runtime would be really useful

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 2 months ago (4 children)

    Can you even get runtime type assertions in TS? Isnt it all at compile time?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 2 months ago (3 children)

    That's my point... You'd need native TS support for that

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 2 months ago (2 children)

    I don't think I understand. Native TS does the type checking at compile time right? Not run time? Or would the compile happen in the browser?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 2 months ago (1 child)

    Browser-native TS would run directly on the browser without compiling.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 2 months ago

    At least in the node.js native TS implementation, they strip the types and don't do checks, so you don't get runtime type checks:

    Node.js does not type check your code when it runs TypeScript files. Use the TypeScript compiler separately if you want to catch type-related errors:

    https://nodejs.org/learn/typescript/run-natively

    I think, but I'm no expert, but in order to have type checking you need to have some kind of compilation check? You cant just start interpreting and hope to work things out on the fly?

  • source
  • parent