Why use Google V8

I do not understand. I am a C / C ++ programmer, what is the possible use of V8 for me? There are several examples and tutorials, and they all lack a being - I don’t want to use another library to just add a couple of numbers or print something in the console window. My question is: is there any real benefit to this technology, and if so, will there be a scenario? Also, can I make the GUI part this way?

Help is appreciated.

+4
source share
5 answers

V8 is Google's Open Source JavaScript Engine

Thus, the whole point is the ability to write code in JavaScript and run it pretty quickly (for an interpreted dynamic language). Google Chrome, written in C ++, uses it for internal scripts - not only for regular web page scripts, but also for extension code. Let's consider this as a "real use."

So, if your application needs scripts, V8 may be useful to you (JS is not an ideal language, but quite decent). As for the GUI, you first need to associate the GUI components with JS, there are no built-in user interface components (like Tk in TCL).

+5
source

One real use of v8 is node.js. I hope it will be good enough

+4
source

Google V8 is a JavaScript engine.

I really do not think this is what you are looking for.

+1
source

V8 is a JavaScript engine. The most common use for this is to allow users of your software to write scripts in a simpler language than what was written on your software (in your case, C ++).

This is the same approach for Matlab, AutoCad, Microsoft Office, etc.

If you are writing a commercial application, you can open some APIs and allow another developer to create add-ons for their applications without requiring them to know C / C ++.

+1
source

How about this for real use : you can use javascript as a tool for debugging or testing - add the javascript console to the application and bind the commands of your GUI application to javascript functions, you can test your UI application using javascript scripts. Thus, you will reduce the amount of manual testing - manual testing would only have to verify that the correct command was excluded due to user action.

You can do GUI in javascript just like Qt is used in Python and other scripting languages ​​(see PyQt and QtRuby, PerlQt, etc.). In order to create bindings for V8, you can check this

0
source

Source: https://habr.com/ru/post/1332805/


All Articles