r/learnjavascript • • 2d ago

Advanced javascript?

So i am a student whom enjoys making various small projects in free time with few languages but i have been wondering, as i have used javascript to make few static websites, and programs since it was very interesting to try and as javascript has a lot of built in functions and elements that allow various ways to solve problems, is there a way to make desktop applications using javascript and how precisely? Please explain, even a hint would be useful

10 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/SoMuchMango 1d ago

It's not part of JavaScript. It's part of browser or node API.

Standard library and language features are most lacking part of JavaScript.

No type checking, no tuples, no multithreading.

What do you mean by emulators?

3

u/fckueve_ 1d ago

https://www.youtube.com/watch?v=fTBwD3sb5mw&t=7s

Here is a tutorial, on how do do virtual machine in javascript, emulate a specific processor architecture, and compile c-like language, all in javascript.

What is not part of javascript? The question is: "s there a way to make desktop applications using javascript".

Yes, you can do react in electron for example. I know Electron is not a part of javascript, but javascript is a part of electron, so you can easly do a desktop app using javascript, via electron.

Multithreading is a bit more complicated. You techncly have webWorkers, but those kind of sucks. But javascript is not single-threaded. It's single thead **execution**, but V8 for example uses multiplethreads to manage event-loop.

3

u/SoMuchMango 1d ago edited 1d ago

Electron is an correct answer for the question. This is the way to do desktop apps in JS.

I'm saying that JavaScript as a language is lacking of many quality of life features. There are languages with better set of features. Web platform gives a tons of great APIs, but language itself is very poor, not limiting what you can do with it... More like lacking many features like type checking, pattern matching, range looping. You can live without that, but it is worth to check what other languages have.

People are writing emulators in JS as a learning exercise. Everything can be written in any programming language if you don't target highest quality.

1

u/Jasedesu 1d ago

Better 'quality of life' is always 'more expensive'. You still need to be able to work with basic tools and no comfort blankets if you want to say you know JavaScript. Learning without the nice to have things will ultimately give you a better understanding of the language and an appreciation of what the nice to have things do for you. We should not deprive beginners of an important part of the learning process.