V8
Duktape
Our great sponsors
V8 | Duktape | |
---|---|---|
40 | 3 | |
19,519 | 5,240 | |
1.0% | - | |
10.0 | 7.9 | |
about 2 months ago | 2 days ago | |
C++ | JavaScript | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
V8
- CVE-2022-1096 Chrome Exploit in the Wild - 99.0.4844.84 for Windows, Mac and Linux address it also Edge 99.0.1150.55
-
Chrome 0day is being exploited now for CVE-2022-1096; update immediately
Looks like these are the two commits, based on the issue number:
https://github.com/v8/v8/commit/0981e91a4f8692af337e2588562a...
https://github.com/v8/v8/commit/a2cae2180a7a6d64ccdede44d730...
Although there could be others.
-
Inline Assembly Language. What is that?
https://github.com/v8/v8/blob/master/src/objects/dictionary.h https://wiki.cdot.senecacollege.ca/wiki/Inline_Assembly_Language https://en.cppreference.com/w/c/language/asm https://en.wikipedia.org/wiki/Inline_assembler https://stackoverflow.com/questions/2268562/what-are-intrinsics https://www.codeproject.com/Articles/15971/Using-Inline-Assembly-in-C-C https://stackoverflow.com/questions/48518225/what-are-intrinsic-types-in-javascript https://stackoverflow.com/questions/12168575/executing-generated-assembler-inline
-
MoarVM may compete with JVM and .Net in a decade.
Many of the languages with much faster implementations and quicker development have literal millions of dollars paying for their progress. I mean, look at the list of authors for V8. That's tens (if not hundreds) of billions of tech heavy weights contributing. Java was painfully slow for the longest time, even with all the money and promotion that Sun put behind it.
-
HTML comments work in JavaScript too
Source:
https://github.com/v8/v8/blob/main/src/parsing/scanner.cc#L3...
And also this nice article
"The scanner chooses a specific scanner method or token based on a maximum lookahead of 4 characters, the longest ambiguous sequence of characters in JavaScript"
-
Where is Array.prototype.flat in v8 source? No array-flat.tq in src/builtins
From what I understand, builtins are coded with v8 torque language in .tq files. However in src/builtins, there is no array-flat.tq file. Then where is it implemented?
-
What parsing techniques do you use to support a good language server?
It must be a fairly large echo chamber since it has room for Clang, GCC, V8, OpenJDK, Roslyn, etc. (The Zend parser for PHP seems to use some flavor of YACC, but given PHP, I don't know if that strengthens or weakens my point.)
- [AskJS] What is the library that javascript uses underneath for async/await?
- When calling built in functions, is it possible to see their code?
-
How to manage files in an OOP project?
I agree with this, what you may do is pick a large and successful open source c++ project and mimick their structure. Here's the link to Google's V8 javascript engine (core of nodejs/Google chrome js engine) and my logic going forward would be "if it's good enough for a large company and a massive open source community it's probably good enough for me too" https://github.com/v8/v8
Duktape
-
Optimizations Enabled by -ffast-Math
Fast math optimizations can break code like this by breaking isNaN.
I was porting a C++ project to a certain platform - and that platform enabled a -ffast-math equivalent by default in Release (but not Debug) builds! This broke duktape, a JS engine said project embedded, in some nasty and subtle ways. Instead of storing a number/pointer/??? (8 bytes) + type tag (4? bytes) for each dynamically typed JS value, duktape can bit-pack values into a single 8 byte "double" value by storing object/string handles as NaN values - this isn't an uncommon trick for dynamically typed scripting stuff:
https://github.com/svaarala/duktape/blob/c3722054ea4a4e50f48...
Naturally, the -ffast-math equivalent broke isNaN checks, which caused random object/string handles to be mistakenly reinterpreted as "numbers" - but only in Release builds, for this one particular platform, in one rarely taken branch, so neither QA nor CI caught it, leading to hours of manufacturing a repro case, stepping through an absurd amount of code, and then finally looking at the default build rules and facepalming.
Cursing the platform vendor under my breath, I overrode the defaults to align with the defaults of every other config x platform combination we already had: no fast math. If you want those optimizations, use SSE-friendly NaN-avoiding intrinsics - or, if you must use the compiler flags, ensure you do so consistently across build configs and platforms, perhaps limited to a few TUs or modules if possible. This allows you to have a chance at using your Debug builds to debug the resulting "optimizations".
-
Can C++ and JS be used together?
Sure. For example, DukTape is an implementation of Javascript designed to be embedded in other projects. Google's V8 Javascript engine (used in Chrome), can also be embedded, see Node.Js for example.
-
[AskJS] Do you use JavaScript on Microcontrollers? Which engine / interpreter?
- Duktape (4.8k stars)
What are some alternatives?
Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
ChakraCore - ChakraCore is an open source Javascript engine with a C API. [Moved to: https://github.com/chakra-core/ChakraCore]
quickjs - Public repository of the QuickJS Javascript Engine. Pull requests are not accepted. Use the mailing list to submit patches.
jerryscript - Ultra-lightweight JavaScript engine for the Internet of Things.
ChaiScript - Embedded Scripting Language Designed for C++
Cython - The most widely used Python to C compiler
V7 - Embedded JavaScript engine for C/C++
Wren - The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.
SWIG - SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.