News for hackers. Stuff that matters.
Re:Teach Yourself Programming in Ten Years (1998) by Hendrikto on Sunday June 06, 2021 @06:53AM (#27412207)
JS isn‘t a general purpose language, even though is has been shoehorned to be one.
Re:Teach Yourself Programming in Ten Years (1998) by ravenstine on Sunday June 06, 2021 @10:25AM (#27413385)
What does that even mean? I've pretty much gotten away with using JS for just about everything for the last 4 years. The evolution of a language to make it compete with other languages isn't necessarily "shoehorning". Am I not a true developer because I like JS and haven't found a need to write code in something like Rust?

EDIT: Do you mean that it lacks certain features without a runtime like Node or the browser? For instance, it doesn't have a language construct for opening files like Python or Ruby. If so, I don't think that's a good argument.

Re:Teach Yourself Programming in Ten Years (1998) by JrProgrammer on Sunday June 06, 2021 @07:03AM (#27412252)
I would say it is. It didn't start as one but over the decades it sure has become a general purpose language.

I can't find a domain where JS wouldn't fit the description. While it may be a bad fit for certain problems, it can still be done.

Re:Teach Yourself Programming in Ten Years (1998) by dgfitz on Sunday June 06, 2021 @11:22AM (#27413776)
Safety-critical controller for manned or unmanned aircraft, ground vehicles, etc. High frequency trading. Tiny embedded devices. System libraries.

I’m sure I could come up with more. JavaScript is a tool, just like c, go, rust, python, lisps, etc. I’m going to give you the benefit of the doubt and hope you just didn’t consider all of these other domains when you made this comment.

Cheers!

Re:Teach Yourself Programming in Ten Years (1998) by JrProgrammer on Thursday June 10, 2021 @09:38AM (#27460596)
The domains you listed are not really disproving my point. I'm certain that programs could be made in JavaScript for these domains but, like I said in my first comment, it's probably a bad fit.

For example: Espruino is a platform for embedded JavaScript.

I just think about it this way: Just because you wouldn't doesn't mean you couldn't

Re:Teach Yourself Programming in Ten Years (1998) by wongarsu on Sunday June 06, 2021 @10:10AM (#27413276)
JS is incredibly versatile, though I would agree that that's mostly JavaScript being equally bad in nearly every domain :)

I wonder how much of the horizontal scaling trend is driven by JavaScript's horrible threading story.

Re:Teach Yourself Programming in Ten Years (1998) by runarberg on Sunday June 06, 2021 @10:08AM (#27413260)
You might be confusing the JavaScript programming language and the browser runtime.

The former is a general purpose programing language that favors prototypical object oriented programing paradigm but supports multiple other paradigms such as imperative and functional.

The latter uses the JavaScript language and adds on a bunch of specific APIs (such as the DOM) for specific purposes. This includes APIs for DOM manipulation, playing audio, validating inputs, parsing forms, handling key presses, etc.

Re:Teach Yourself Programming in Ten Years (1998) by freedomben on Sunday June 06, 2021 @01:00PM (#27414462)
I'd be curious to hear some examples where JS doesn't fit as a general purpose language. In my arrogance I suspect it would be hard to give examples that don't also disqualify other scripting langs like python and ruby. Perhaps you don't consider those to be general purpose either?
Re:Teach Yourself Programming in Ten Years (1998) by Hendrikto on Sunday June 06, 2021 @02:56PM (#27415355)
For example, without something like Node, you cannot even open a file. I consider this a very basic requirement for being "general purpose".
Re:Teach Yourself Programming in Ten Years (1998) by freedomben on Tuesday June 08, 2021 @11:08AM (#27436187)
it sounds to me like you're talking about a particular implementation (the browser) not the language itself. The browser intentionally has that limitation. The language itself has no problem with it.
Re:Teach Yourself Programming in Ten Years (1998) by quickthrower2 on Sunday June 06, 2021 @07:01AM (#27412245)
Yes I mean JS with node