gc VS exception-handling

Compare gc vs exception-handling and see what are their differences.

gc

Branch of the spec repo scoped to discussion of GC integration in WebAssembly (by WebAssembly)

exception-handling

Proposal to add exception handling to WebAssembly (by WebAssembly)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
gc exception-handling
43 7
927 144
1.5% 2.1%
9.3 6.8
8 days ago 5 days ago
WebAssembly WebAssembly
GNU General Public License v3.0 or later 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.

gc

Posts with mentions or reviews of gc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-03.
  • Bring garbage collected programming languages efficiently to WebAssembly
    16 projects | news.ycombinator.com | 3 Nov 2023
    It may take some time for WasmGC to be usable by .NET. Based on the discussions the first version of WasmGC does not have a good way to handle a few .NET specific scenarios, and said scenarios are "post-post-mvp". [0]

    My concern, of course, is that there is not much incentive for those features to be added if .NET is the only platform that needs them... at that point having a form of 'include' (to where a specific GC version can just be cached and loaded by another WASM assembly) would be more useful, despite the pain it would create.

    [0] - https://github.com/WebAssembly/gc/issues/77

  • WasmGC – Compile and run GC languages such as Kotlin, Java in Chrome browser
    4 projects | news.ycombinator.com | 2 Nov 2023
    Yes, that's definitely true: a single GC will not be optimal for everything, or even possible. Atm interior pointers are not supported at all, for example, but they are on the roadmap for later:

    https://github.com/WebAssembly/gc/blob/main/proposals/gc/Pos...

    What launched now is enough WasmGC to support a big and useful set of languages (Java, Kotlin, Dart, OCaml, Scheme), but a lot more work will be required here!

  • Learn WebAssembly by writing small programs
    7 projects | news.ycombinator.com | 5 Sep 2023
    GC proposal is from 2018: https://github.com/WebAssembly/proposals/issues/16 and there’s code: https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...

    Seems like an awefully long time for progress to be made, given all the possibilities it would unlock.

  • The state of modern Web development and perspectives on improvements
    5 projects | dev.to | 24 Aug 2023
    First is the size. Writing a server-side and client-side program is possible with Rust, and the resulting WASM package will be small enough. At the same time, Microsoft Blazor converts C# code to WASM, but the client delivery has to include the reduced .NET runtime, taking several megabytes for a script. The same is true for GoLang, even with an attempt to reduce the runtime delivery in TinyGo WASM. Developers want to work with their favorite languages, whether it is Java, Kotlin, Dart, C#, F#, Swift, Ruby, Python, C, C++, GoLang, or Rust. These languages produce groups of runtimes. For example, JVM and .NET have many common parts, Ruby and Python are dynamically interpreted at runtime, and all mentioned depend on automatic garbage collection. For smaller WASM packages, browser vendors can include extended runtime implementations, for example, by delivering a general garbage collector as part of WASM. Garbage collection support by WASM is currently in progress: WASM GC, .NET WASM Notes.
  • Douglas Crockford: “We should stop using JavaScript”
    6 projects | news.ycombinator.com | 12 Jun 2023
    My understanding is that the main limitation is technical. WASM doens't do GC or the host system calling conventions and cannot interact directly with object from Javascript because of this. However, this is being worked[0] on and will be solved eventually. Even without this the performance overhead of bridging to JS is low enough that WASM frameworks can beat out React.

    0: https://github.com/WebAssembly/gc/blob/main/proposals/gc/Ove...

  • Question: WasmGC and state shared with JS with Kotlin/wasm or Multiplatform?
    1 project | /r/Kotlin | 12 May 2023
    I’ve just watched a video on YouTube from Google I/O 2023 on Flutter for the web. Kevin Moore explains that Flutter can compile to Wasm, but now that GC support has been added to the standard and WasmGC is supported in Chromium and Firefox, I’m quite intrigued.
  • Will implementing garbage collection in WebAssembly speed up Blazor?
    1 project | /r/Blazor | 5 Apr 2023
    I have found the main thread about using WebAssembly GC in C#: https://github.com/WebAssembly/gc/issues/77. If I understand it correctly, it is not possible to use the current prototype version of GC in C#.
  • GC Extension for WebAssembly
    1 project | news.ycombinator.com | 11 Mar 2023
  • Blazor United - When it ships it would be the most glorious way to do web with .NET
    5 projects | /r/programming | 25 Jan 2023
    The .net team has given their notes on it, the concern is more on the memory layout from what I remember. Though it may be possible still. The runtime would likely still ship some gc code, but only a subset for cases not supported by the wasm gc itself and a few more for interfacing with the gc service, which overall should still result on smaller payloads compared to current sizes.
  • Kernel-WASM: Sandboxed kernel mode WebAssembly runtime for Linux
    4 projects | news.ycombinator.com | 20 Jan 2023
    I assume that's one of the parts of the work done at https://github.com/WebAssembly/gc - not happening any soon yet, but it'll eventually be done.

exception-handling

Posts with mentions or reviews of exception-handling. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-03.
  • Bring garbage collected programming languages efficiently to WebAssembly
    16 projects | news.ycombinator.com | 3 Nov 2023
    Interesting article, thanks!

    Notes on the issues mentioned there:

    * The need for a manual shadow stack: This is fixed in WasmGC (in the same way it works in JS, as the link mentions).

    * Lack of try-catch: This is fixed by the Wasm exception handling proposal, which has already shipped in browsers, https://github.com/WebAssembly/exception-handling/blob/main/...

    * Null checks: Mostly fixed by WasmGC. The spec defines non-nullable local types, and VMs can use the techniques the article mentions to optimize them using signals (Wizard does, for example).

    * Class initialization: This is a difficult problem, as the article says. J2Wasm and Binaryen are working to optimize it through static analysis at the toolchain level. Here is a recent PR I wrote that makes progress there: https://github.com/WebAssembly/binaryen/pull/6061

    * The vtable overhead issue the article mentions may be a problem. I'm not aware of good measurements on it, through. There are some ideas on post-MVP solutions for method dispatch that might help, but nothing concrete yet.

    * Checks for null and trapping: There has been discussion of variants on the GC instructions that throw instead of trap. Measurements, however, have not shown it to be a big problem atm, so it is low priority.

    The author is right that stack walking, signals, and memory control are important areas that could help here.

    Overall with WasmGC and exceptions we are in a pretty good place for Java as emitted by J2Wasm today: it is usually faster than J2CL which compiles Java to JavaScript. But there is definitely room for improvement.

  • In the latest demo with Dart, WebAssembly and GC in Chrome how was the Exception Handling solved?
    1 project | /r/dartlang | 1 Feb 2023
    It uses https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md which is actually supported by all major browsers already.
  • 'The best thing we can do today to JavaScript is to retire it,' says JSON creator Douglas Crockford
    6 projects | /r/javascript | 5 Aug 2022
    Yep, you're right. It's also more than just the DOM, it's web APIs in general, such as fetch, audio, webgl/webgpu, etc. WASM still needs GC, exceptions, and WASI to be able to fully interop with any host without any of the current limitations. This'll take a few years. I'm looking forward to the future in which I will be shipping WASM-only web apps to my users.
  • WebAssembly Everywhere
    4 projects | /r/programming | 25 Jun 2022
    Its a part of the wasm plan to support gc https://github.com/WebAssembly/gc exceptions https://github.com/WebAssembly/exception-handling
  • What's New in Node.js 17
    3 projects | dev.to | 17 Nov 2021
    As of Node.js 17, the v8 JavaScript engine has been updated to v9.5. The changes in this release are primarily aimed at expanding internationalization for dates and calendars as well as for the output of time zones. It also implements the WebAssembly Exception Handling proposal, designed to reduce overhead compared to current JavaScript-based workarounds.
  • WebContainers: Run Node.js natively in the browser
    11 projects | news.ycombinator.com | 20 May 2021
  • Google admits Kubernetes container tech is too complex
    8 projects | news.ycombinator.com | 25 Feb 2021
    Agreed, although at some point in a not very far feature most of those missing features will resolved. So in my mind is just a matter of time. The Wasm Community group is doing an awesome work on that :)

    Here are a few examples of what needs move forward in Wasm:

    * [1] Wasm Exceptions Handling: Right now Wasm is missing a way to handle exceptions natively (C++ programs can only compile to Wasm using the asyncify or longjmp/setjmp tricks via Js try/catch)

    * [2] Wasm GC: Wasm Binary files are quite big (specially in interpreted languages). This is partially caused by the GC being included in the Binary itself. The GC proposal will solve this while also providing faster execution.

    * [3] Wasm 64-bit Memory: currently Wasm can only operate with 32-bit data. In some contexts you may want you operate with more than 4GB of memory (for example, when operating over terabytes of data). The 64-bit memory proposal will solve that.

    [1]: https://github.com/WebAssembly/exception-handling

What are some alternatives?

When comparing gc and exception-handling you can also consider the following projects:

dotnet-webgl-sample - .NET + WebAssembly + WebGL = 💖

Uno Platform - Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.

ASP.NET Core - ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.

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

wasm3 - 🚀 A fast WebAssembly interpreter and the most universal WASM runtime

simd - Branch of the spec repo scoped to discussion of SIMD in WebAssembly

schism - A self-hosting Scheme to WebAssembly compiler

Mono - Mono open source ECMA CLI, C# and .NET implementation.

Dokku - A docker-powered PaaS that helps you build and manage the lifecycle of applications

v86 - x86 PC emulator and x86-to-wasm JIT, running in the browser

webcontainer-core - Dev environments. In your web app.