Is a web browser using another scripting language feasible?

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?

30 points · 43 comments · view on lemmy.world

43 Comments

slazer2au@lemmy.world · 21 pts · 5d (2 replies)

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

ICastFist@programming.dev · 5 pts · 5d (1 reply)

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

Toes@ani.social · 3 pts · 4d

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.

breadsmasher@lemmy.world · 16 pts · 5d (4 replies)

WebAssembly? https://en.wikipedia.org/wiki/WebAssembly?wprov=sfti1

it isn’t specifically interpreted though

draco_aeneus@mander.xyz · 6 pts · 5d

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.

ICastFist@programming.dev · 2 pts · 5d (2 replies)

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

breadsmasher@lemmy.world · 3 pts · 5d

yeah, correct. I had misunderstood what you were specifically asking for.

Axolotl_cpp@feddit.it · 1 pts · 3d

I think they are trying to fix that

nimpnin@sopuli.xyz · 13 pts · 5d (1 reply)

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.

ICastFist@programming.dev · -1 pts · 5d

I'm aware and not really worried about that

GatesMcBalmer@lemmy.world · 11 pts · 5d (3 replies)

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.

ICastFist@programming.dev · 5 pts · 5d

I see that as mostly positive 😆

axh@lemmy.world · 5 pts · 5d (1 reply)

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.

GatesMcBalmer@lemmy.world · 2 pts · 4d

Yes but OP was specific

but with javascript fully removed

lime@feddit.nu · 11 pts · 5d (3 replies)

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.

e0qdk@reddthat.com · 6 pts · 5d (2 replies)

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.

lime@feddit.nu · 4 pts · 5d (1 reply)

i think they've even retired the original function of the attribute. sad.

e0qdk@reddthat.com · 2 pts · 5d

Personally, I think it's particularly stupid that you can't use it for GLSL shaders from external files...

hexagonwin@lemmy.today · 7 pts · 5d

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

Nemo@slrpnk.net · 7 pts · 5d (2 replies)

yes, but there's no demand for it

atro_city@fedia.io · 0 pts · 5d (1 reply)

Says Gooegl

fodor@lemmy.zip · 1 pts · 4d

Says many people. What problem are you solving? Do millions of people agree that it needs to be solved in this way? ... If you don't know, or they don't, then it's a no-go except for fun (which is fun).

fubarx@lemmy.world · 2 pts · 5d (1 reply)

https://pyscript.net/

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

ICastFist@programming.dev · 1 pts · 5d

Not quite what I'm asking, that's just python under a js wrapper - block javascript and none of that works.

Jankatarch@lemmy.world · 2 pts · 3d

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

reader@lemmy.zip · 1 pts · 5d (1 reply)
ICastFist@programming.dev · 1 pts · 5d

Interesting. Too bad it only supports HTML4. The ELinks fork doesn't mention whether it supports HTML5 (canvas and other more recent stuff), so I suppose it doesn't

CameronDev@programming.dev · 1 pts · 5d (8 replies)

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.

jol@discuss.tchncs.de · 2 pts · 3d (7 replies)

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.

CameronDev@programming.dev · 1 pts · 3d (6 replies)

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 :/

jol@discuss.tchncs.de · 2 pts · 3d (5 replies)

Type assertion in runtime would be really useful

CameronDev@programming.dev · 1 pts · 3d (4 replies)

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

jol@discuss.tchncs.de · 2 pts · 2d (3 replies)

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

CameronDev@programming.dev · 1 pts · 2d (2 replies)

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?

jol@discuss.tchncs.de · 2 pts · 2d

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

MonkderVierte@lemmy.zip · 1 pts · 3d

Yeah, but i would prefer it without any scripting.

atro_city@fedia.io · 1 pts · 5d

Not if Gooogl says no.

dracs@programming.dev · 1 pts · 5d (1 reply)

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

moldy_rice@piefed.keyboardvagabond.com · 0 pts · 5d

And now it's just chrome like almost all other web browsers

nixukty@lemmy.zip · 1 pts · 2d (1 reply)

based on your other replies, it looks like you want to be able to turn off JavaScript but still have a scripting language be able to run. I'm a little confused why you'd want that or what benefits that would bring.

ICastFist@programming.dev · 1 pts · 1d

The benefit is no javascript, but something that can run a different language, that's all.

LunarLoony@lemmy.sdf.org · 1 pts · 4d

ASP is still a thing, just about.