Go vs Javascript. What to write IoT projects

 3r3198. 3r3-31. Which programming language is best for your IoT project? The answer to this question is ambiguous and subjective. There are several aspects to consider when considering this issue: the objectives, goals and needs of your project. An important role is also played by your personal preferences, availability and capabilities of qualified developers. 3r3186.  3r3198. 3r3186.  3r3198. Go vs Javascript. What to write IoT projects 3r3186.  3r3198. 3r3186.  3r3198. There is an opinion that developed by Google language Golang , can eventually push jаvascript (or, better, Node.js) out of the realm of IoT applications. Can a gopher win in this battle? Let's take a closer look at both Golang and JS, their advantages and disadvantages for IoT solutions. GoDoc and code analysis - Race Detector; 3r3104.  3r3198.
built-in testing tool (if you have ever tried to choose a framework for testing a project in jаvascript, you understand the benefits); 3r3104.  3r3198.
serious approach to parallel programming using 3-3399. Data Race Detector
; 3r3104.  3r3198.
a unified style guide for all that needs to be followed, in contrast to the multitude of tools and paradigms in jаvascript (they are known to paralyze a team when it is time to decide on structure, conventions, testing libraries, etc.) 3r?104.  3r3198.
3r3186.  3r3198. 3r3184. Compare by individual criteria:
3r3186.  3r3198. 3r3113. 3r3186.  3r3198. 3r3186.  3r3198. Both jаvascript and Go seem well suited for IoT projects. Therefore, let's compare the functionality of Node.js and Go to determine the winner. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Maturity. 3r3179. Being relatively young, Go is a rather mature language, besides, it was initially positioned as stable and backward compatible. As for Node.js, it has a version of LTS (Long Time Support, long-term support), as well as the latest version, which has a changing API, and an extensive community that supports the platform. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Performance. 3r3179. . In real-world conditions, network interactions and interactions with the Go and Node.js database show equal results. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Parallelism. 3r3179. Here, Go definitely wins: it uses light threads - goroutines, and Node.js inherits the jаvascript event-handling mechanism, which has its drawbacks. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Learning curve. 3r3179. Thanks to jаvascript, according to a recent survey, Node.js has become one of the fastest growing development languages. The reason for this is simple learning, extensive documentation and a large open community. Go is also quite easy to learn. The PW Engine survey showed that most developers consider it very intuitive, and this is a big plus if the company needs to introduce new employees into the work process as soon as possible. So, here is a draw too. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Error processing. 3r3179. Here opinions differ. Go uses explicit error checking, as opposed to the implicit trycatch. due to this, error checks become larger, but they are clearer, as they are closer to the place of their occurrence and are aimed at identifying problems in a particular place, in the second version of Go they promise to add a checkhandle. Node.js uses the trycatch principle, common to many languages, and having certain limitations. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Frontend and backend. 3r3179. Go is aimed at developing parallel services, so it is great for the server side. And although Go has frameworks for building web applications, such as Beego and gopherjs, it’s much more convenient to create a modern user interface with jаvascript. Moreover, based on the fact that JS dominates at the frontend, it is easier to maintain both the backend and the frontend in the same language - jаvascript 3r3186.  3r3198. The choice of developers. There is no doubt: jаvascript remains at the top because it has long been incorporated into the workflow of developers around the world. Of course, Go entered the top 20 most popular technologies, but, unfortunately, it is still far from jаvascript in terms of popularity. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Sync /Async IO (synchronous /asynchronous I /O). 3r3179. Node.js is famous for its non-blocking I /O model, which makes it easy and efficient in terms of resources. But it also has flaws, such as endless callbacks in the code and strange stack traces. On the other hand, Go, using its scheduler, recommends that developers use synchronous operations, relying on various tools provided by the OS, to increase efficiency and reduce blocking resources. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Work on devices. 3r3179. With the package manager, NPM Node.js can be effectively used as a programming environment on single-board devices, such as Raspberry Pi, Iskra Js or BeagleBone Black . NPM contains about 80 open source packages for Arduino controllers, 3r3172. Intel IoT Edison
, Raspberry Pi and more than 30 packages for various devices and Bluetooth sensors. As for Go, it fits well with the Raspberry Pi boards, as it launches the complete Linux build. However, low-power IoT devices, such as Arduino, cannot work with the Go binary code. That is why the Gobot framework was created. It supports multiple platforms, Bluetooth LE devices and even the NeuroSky interface. 3r3186.  3r3198. 3r3186.  3r3198. 3r3178. Libraries. 3r3179. By the number of jаvascript libraries, of course, it still bypasses its opponent, but in certain areas, for example, in mathematics, Go has written more powerful tools for working with complex mathematics and data analysis. 3r3186.  3r3198. 3r3186.  3r3198. 3r3184. Conclusion 3r3185. 3r3186.  3r3198. Golang is a compiled multi-threaded programming language that allows you to create entire systems of connected controllers, and work efficiently with databases. jаvascript is ideal for asynchronous operations that require low response times. Now these two languages ​​are far from interchangeable. jаvascript remains the most popular language in the world, including specifically on the Internet of things. He firmly holds his position and is unlikely to give way to Golang in the near future. However, thanks to its innovative and robust approach, Go has very bright prospects to lead the top IoT development technologies. 3r3194. 3r3198. 3r3198. 3r3191. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r3192. 3r3198. 3r3194. 3r3198. 3r3198. 3r3198. 3r3198.
+ 0 -

Add comment