design VS V8

Compare design vs V8 and see what are their differences.

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
design V8
32 55
11,336 22,595
0.2% 0.9%
3.4 9.8
about 2 months ago 5 days ago
C++
Apache License 2.0 GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

design

Posts with mentions or reviews of design. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-18.
  • WASM Instructions
    13 projects | news.ycombinator.com | 18 Feb 2024
    I should add, however, that the unmentioned elephant in the room is V8 JIT (TurboFan), which simply doesn't handle irreducible control flow. While there are some valid theoretical arguments around the current arrangement in Wasm, looking at the history of the associated discussions makes it pretty obvious that having V8 support Wasm and generate fast code similar to what it can do for asm.js was an overriding concern in many cases. And Google straight up said that if Wasm has ICF, they will not bother supporting such cases, so it will be done by a much slower fallback:

    https://github.com/WebAssembly/design/issues/796#issuecommen...

    AFAIK no other Wasm implementation has the same constraint - the rest generally tend to desugar everything to jumps and then proceed from there. So this is, at least to some extent, yet another case of a large company effectively forcing an open standard to be more convenient for them specifically.

  • Supercharge Web AI Model Testing: WebGPU, WebGL, and Headless Chrome
    2 projects | news.ycombinator.com | 16 Jan 2024
    https://github.com/WebAssembly/design/issues/1397

    > Currently allocating more than ~300MB of memory is not reliable on Chrome on Android without resorting to Chrome-specific workarounds, nor in Safari on iOS.

    That's about allocating CPU memory but the GPU memory situation is similar.

  • Build your own WebAssembly Compiler
    3 projects | news.ycombinator.com | 3 Dec 2023
    As far as I can tell (5 minutes of internet research) this was to allow easier compilation to JavaScript as a fallback in the days when WASM wasn't widely supported.

    "Please add goto" issue has been open since 2016:

    https://github.com/WebAssembly/design/issues/796

    Most interesting comment:

    > The upcoming Go 1.11 release will have experimental support for WebAssembly. This will include full support for all of Go's features, including goroutines, channels, etc. However, the performance of the generated WebAssembly is currently not that good.

    > This is mainly because of the missing goto instruction. Without the goto instruction we had to resort to using a toplevel loop and jump table in every function. Using the relooper algorithm is not an option for us, because when switching between goroutines we need to be able to resume execution at different points of a function. The relooper can not help with this, only a goto instruction can.

    > It is awesome that WebAssembly got to the point where it can support a language like Go. But to be truly the assembly of the web, WebAssembly should be equally powerful as other assembly languages. Go has an advanced compiler which is able to emit very efficient assembly for a number of other platforms. This is why I would like to argue that it is mainly a limitation of WebAssembly and not of the Go compiler that it is not possible to also use this compiler to emit efficient assembly for the web.

    ^ https://github.com/WebAssembly/design/issues/796#issuecommen...

  • Flawless – Durable execution engine for Rust
    7 projects | news.ycombinator.com | 25 Oct 2023
    When I implemented a WASM compiler, the only source of float-based non-determinism I found was in the exact byte representation of NaN. Floating point math is deterministic. See https://webassembly.org/docs/faq/#why-is-there-no-fast-math-... and https://github.com/WebAssembly/design/blob/main/Nondetermini....
  • Requiem for a Stringref
    4 projects | news.ycombinator.com | 19 Oct 2023
    > To work with GC, you need some way to track if the GC'd object is accessible in WASM itself.

    I've never heard of a GC with that kind of API. Usually any native code that holds a GC reference would either mark that reference as a root explicitly (eg. https://github.com/WebAssembly/design/issues/1459) or ensure that it can be traced from a parent object. Either way, this should prevent collection of the object. I agree that explicitly checking whether a GC'd object has been freed would not make any sense.

    > The reason why you probably need a custom string type is so you can actually embed string literals without relying on interop with the environment.

    WASM already has ways of embedding flat string data. This can be materialized into GC/heap objects at module startup. This must happen in some form anyway, as all GC-able objects must be registered with the GC upon creation, for them to be discoverable as candidates for collection.

    Overall I still don't understand the issue. There is so much prior art for these patterns in native extensions for Python, PHP, Ruby, etc.

  • The Tug-of-War over Server-Side WebAssembly
    12 projects | news.ycombinator.com | 24 Mar 2023
    Giving you a buffer that grows is the allocation approach I am talking about. This is not how your OS works. Your OS itself works with an allocator that does a pretty good job making sure that your memory ends up not fragmented. Because WASM is in between, the OS is not in control of the memory, and instead the browser is. The browser implementation of "bring your own allocator" is cute but realistically just a waste of time for everybody who wants to deploy a wasm app because whatever allocator you bring is crippled by the overarching allocator of the browser messing everything up.

    It seems like the vendors are recognizing this though, with firefox now having a discard function aparently!

    https://github.com/WebAssembly/design/issues/1397

  • How do Rust WebAssembly apps free unused memory?
    5 projects | /r/rust | 26 Feb 2023
    But researching it a bit I found this issue, so it clearly seems to be a problem for a bunch of people out there. And apparently both V8 and Spidermonkey have already addressed this quite recently, see this issue.
    5 projects | /r/rust | 26 Feb 2023
    Reading through this issue, at least for Unity, it seemed like a chicken-egg problem.
    5 projects | /r/rust | 26 Feb 2023
  • Hello World In Web Assembly
    4 projects | dev.to | 12 Feb 2023

V8

Posts with mentions or reviews of V8. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-21.
  • Boehm Garbage Collector
    9 projects | news.ycombinator.com | 21 Jan 2024
    https://chromium.googlesource.com/v8/v8.git/+/HEAD/include/c...

    Due to the nature of web engine workloads migrating objects to being GC'd isn't performance negative (as most people would expect). With care it can often end up performance positive.

    There are a few tricks that Oilpan can apply. Concurrent tracing helps a lot (e.g. instead of incrementing/decrementing refs, you can trace on a different thread), in addition when destructing objects, the destructors typically become trivial meaning the object can just be dropped from memory. Both these free up main thread time. (The tradeoff with concurrent tracing is that you need atomic barriers when assigning pointers which needs care).

    This is on top of the safey improvements you gain from being GC'd vs. smart pointers, etc.

    One major tradeoff that UAF bugs become more difficult to fix, as you are just accessing objects which "should" be dead.

  • The Everything NPM Package
    2 projects | news.ycombinator.com | 6 Jan 2024
    > If that standard library would be written in JS, a new browser (or rather a new JS engine being a part of the browser) could just use some existing implementation

    That sounds great, but I'm doubtful of the simplicity behind this approach.

    If my understanding is correct, v8 has transitioned to C++[0] and Torque[1] code to implement the standard library, as opposed to running hard-coded JavaScript on setting up a new context.

    I suspect this decision was made as a performance optimization, as there would obviously be a non-zero cost to parsing arbitrary JavaScript. Therefore, I doubt a JavaScript-based standard library would be an acceptable solution here.

    [0]: https://github.com/v8/v8/tree/main/src/runtime

  • C++23: Removing garbage collection support
    3 projects | news.ycombinator.com | 1 Nov 2023
    C++ lets you write anything you can imagine, and the language features and standard library often facilitate that. The committee espouses the view that they want to provide many "zero [runtime] cost," abstractions. Anybody can contribute to the language, although the committee process is often slow and can be political, each release the surface area and capability of the language gets larger.

    I believe Hazard Pointers are slated for C++26, and these will add a form "free later, but not quite garbage collection" to the language. There was a talk this year about using hazard pointers to implement a much faster std::shared_ptr.

    It's a language with incredible depth because so many different paradigms have been implemented in it, but also has many pitfalls for new and old users because there are many different ways of solving the same problem.

    I feel that in C++, more than any other language, you need to know the actual implementation under the hood to use it effectively. This means knowing not just what the language specifies, but can occaissionally require knowing what GCC or Clang generate on your particular hardware.

    Many garbage collected languages are written in or have parts of their implementations in C++. See JS (https://github.com/v8/v8)and Java GC (https://github.com/openjdk/jdk/tree/36de19d4622e38b6c00644b0...)

    I am not an expert on Java (or C++), so if someone knows better or can add more please correct me.

  • Abstract Syntax Trees and Practical Applications in JavaScript
    13 projects | dev.to | 21 Oct 2023
    Remember that we earlier established that every source gets parsed into an AST at some point before it gets compiled or interpreted. For example, platforms like Nodejs and chromium-based browsers use Gooogle's V8 engine behind the scenes to run JavaScript and of course, some AST parsing is always involved before the interpreter kicks in. I looked V8's source and I discovered it uses its own internal parser to achieve this.
  • Notes: Advanced Node.js Concepts by Stephen Grider
    5 projects | dev.to | 19 Aug 2023
    In the source code of the Node.js opensource project, lib folder contains JavaScript code, mostly wrappers over C++ and function definitions. On the contrary, src folder contains C++ implementations of the functions, which pulls dependencies from the V8 project, the libuv project, the zlib project, the llhttp project, and many more - which are all placed at the deps folder.
  • What does the code look like for built-in functions?
    2 projects | /r/learnjavascript | 13 Jun 2023
    Here is the implementation of of Array. prototype.map in V8. It's written in a language called Torque which appears to be a special language just for the v8 engine.
    2 projects | /r/learnjavascript | 13 Jun 2023
  • is there any resource for JavaScript that explain what kind of logic statement behind each function and why it's give this output and only accept this input etc... ?
    2 projects | /r/learnprogramming | 12 Oct 2022
    It sounds like you want to know how JavaScript is implemented in the browser. The thing is, there is no universal implementation for JavaScript. JavaScript defines a specification that must be adhered to, and then each browser vendor can implement it in whatever way they see fit, as long as it does the specified things. For example (and I'm not saying this is the case) it's entirely possible for Chrome to implement Array.sort() using merge sort, while Firefox implements it as quick sort. You can try to find the source code for the implementation in a certain browser, but that will not be universal. I imagine you can find out how it works in Chrome somewhere in https://chromium.googlesource.com/v8/v8.git, though I'm not sure exactly where.
  • Minimize Heap Allocations in Node.js
    4 projects | news.ycombinator.com | 28 Sep 2022
  • [AskJS] Who first used the term "spread operator" re spread syntax ...?
    3 projects | /r/javascript | 18 Sep 2022
    chrome v8 commits referring to spread operator one of them: https://github.com/v8/v8/commit/93b3397e52d3faf38059718de335027e57b9690d

What are some alternatives?

When comparing design and V8 you can also consider the following projects:

Duktape - Duktape - embeddable Javascript engine with a focus on portability and compact footprint

ChakraCore - ChakraCore is an open source Javascript engine with a C API. [Moved to: https://github.com/chakra-core/ChakraCore]

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.

V7 - Embedded JavaScript engine for C/C++

ChaiScript - Embedded Scripting Language Designed for C++

Cython - The most widely used Python to C compiler

Flutter - Flutter makes it easy and fast to build beautiful apps for mobile and beyond

SWIG - SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

Wren - The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

sol2 - Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:

libffi - A portable foreign-function interface library.

v8pp - Bind C++ functions and classes into V8 JavaScript engine