6 ms·
Why the heck Javascript?
by decafbad 8y ago
Why the heck Javascript?
- ilrwbwrkhv 8y agocoz its the best language for prototyping and learning
- supakeen 8y agoThere are many languages that are very popular for prototyping and learning what makes JavaScript the best?
- ilrwbwrkhv 8y agofor one its available in any browser console... there is no setup per se.
- ilrwbwrkhv 8y agoalso for better or for worse... the javascript ecosystem is amazingly wide... from brain as in this example to p5js for creative programming etc... i think we can agree that no other language and ecosystem has that much breadth and reach...
- king_magic 8y agoIt really, really super isn’t. It’s a Frankenstein mashup of programming insanity that never should have come into being in the first place, much less become the de facto language of the web.
- colordrops 8y agoAny particular reasons or is this just based on what you heard 10 years ago?
- aaaaaaaaaab 8y agoFrom the top of my head: - `this` - the whole prototypal inheritance thing - class inheritance bolted on top of prototypal inheritance - arrow functions vs `function` functions
- cwackerfuss 8y agoBut none of that is going to affect our ability to do machine learning work with JavaScript
- kkarakk 8y agodoesn't it affect complexity on an exponential scale though? codebases aren't paragons of perfection when even 2 devs are working on them
- deleted 8y ago[deleted]
- ilrwbwrkhv 8y agoit actually isnt a mashup... if u look at the data types... they are some of the simplest... the apis might be a bit weird... i agree
- kukabynd 8y agoSo, what language is not an insanity?
- mathgeek 8y agoWhy not? It's one of the most widely known languages among developers in many disciplines, which removes a barrier to learning the concepts. Someone who just wants to familiarize themselves with basic implementations could do so in any language if their goal doesn't include shipping production-quality code. There's also the added bonus that the concepts taught here are already covered by courses in other languages, so anyone is free to use those as well.
- SquareWheel 8y agoWhy not? It's extremely popular, fast and portable.
- hombre_fatal 8y agoAlso, it's hard to beat the browser for creating a quick visualization/UI for your code. Especially for an online course like this. I think we're at a point where you'd have to justify why you didn't use Javascript for a learning course.
- zawerf 8y agoOne very practical reason is to save on computation costs. GPU servers are not cheap and if you're going to run on CPU anyway, you might as well run it locally on the user's browser. Some demos such as real time object detection isn't possible at all if you had to pay roundtrip server latency (not to mention the complexity of streaming video to and from your server): https://github.com/ModelDepot/tfjs-yolo-tiny https://github.com/ModelDepot/tfjs-yolo-tiny And a lot of web demos such https://affinelayer.com/pixsrv/ https://affinelayer.com/pixsrv/ I don't believe will be up for such a long time if the author had to pay ongoing server costs.
- dahfizz 8y agoAre you under the impression that js is the only language that can run locally?
- itslennysfault 8y agoin a client's web browser... yeah.
- dahfizz 8y agoWell there is web assembly, but why is running in a web browser a requirement for creating a neural network anyway?
- kkarakk 8y agoso you can offset server costs to the client which usually means bloated laggy apps until someone comes along and figures out an optimised way of doing things, for eg react.js vs phonegap's comparative shitshow
- karmasimida 8y agoThere is NO save on computation cost. CPU is slow for NN whatever language you are using. OP has a point, if I want to learn PRACTICAL front end programming, I will choose javascript, not Python. Same for Neural networks, just switch the place.
- axel180 8y agoUsage: Javascript is everywhere and can be learned quickly. Speed: GPU can easily be tapped into inside Javascript with projects like GPU.js, which brain.js uses.
- reiinakano 8y agoCause you can do things like this https://magenta.tensorflow.org/blog/2018/12/20/style-transfer-js/ https://magenta.tensorflow.org/blog/2018/12/20/style-transfe...
- mattlondon 8y agoPersonally I've found that Python - or perhaps more Numpy et al - are impenetrable for a learner. I am sure the data structures that are used in Python + Numpy et al are powerful and well-suited for the task, but as a learner coming to this with minimal knowledge trying to ALSO learn the idiosyncrasies and weirdness (IMHO) of how Numpy does things and the weirdness (IMHO) of how Numpy even names things (e.g. in decades of programming, the term "shape" for an array was new on me) was an extra burden. Doing the same thing in Javascript with good old-fashioned arrays using good old-fashioned terminology clears the fog and makes things simpler for people who are not already fluent in numpy's data structures and terminology Javascript is - in my view - the equivalent of a "business english" of programming, i.e. even if you aren't fluent, its syntax and terminology is familiar to C/C++/Java/C#/Golang/ObjectiveC/Perl/etc that most people will at least be able to understand what is going on in the same way that business people who might not be fluent in English will at least be able to understand and basically communicate with each other even if they perhaps will not be writing Sonnets. Python feels like a niche language that developed in isolation and is only readable to people who have actually gone out of their way to learn it.
- kkarakk 8y agoshape makes sense if you think of arrays in terms of linear algebra concepts(which you should if you're working with ML concepts imo)