Show HN: Compiling C in the browser using WebAssembly

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • xcc

    Standalone C compiler/assembler/linker/libc for x86-64/aarch64/riscv64/wasm

    Check out https://github.com/tyfkda/xcc, I've only used the native backend, but it's small and fast.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • emception

    Run Emscripten in the browser

    See: emception

    https://github.com/jprendes/emception

  • webassembly.sh

    Open-source and installable PWA terminal powered by WebAssembly, WAPM, and Wasmer-JS 🖥

    The old https://webassembly.sh/ came a long way (and maybe also https://wasmer.sh/ but not sure).

    All you need is a virtual filesystem of some sort, a way to download, a way to upload, an editor, a compiler, and a VT100 JS library. We already have WASI for the rest.

    If the JS is too undesired, then perhaps go the old framebuffer graphics mode (e.g. a region of the WASM memory that is interpreted as an ASCII screen, or maybe even as a full bitmap buffer). Then JavaScript side just needs to forward keyboard/mouse into memory and that screen region out of memory.

  • x86-64-playground

    An online assembly editor and debugger for the x86-64 architecture

    Absolutely! You can even run clang in wasm targeting x86_64, and then emulate the resulting program using the blink x86_64 emulator.

    I'm working on something similar, where students can compile intel assembly and run it client-side: https://github.com/robalb/x86-64-playground

  • xeus-cling

    Jupyter kernel for the C++ programming language

    Cling (the interactive C++ interpreter) should also compile to WASM.

    There's a xeus-cling Jupyter kernel, which supports interactive C++ in notebooks: https://github.com/jupyter-xeus/xeus-cling

    There's not yet a JupyterLite (WASM) kernel for C or C++.

  • Theta

    θ A statically typed, functional programming language that compiles to WebAssembly

    This is true. In Theta (https://github.com/ThetaLang/Theta) this is exactly what we do -- no need for more than one pass for the WASM codegen.

  • wasm-fizzbuzz

    WebAssembly from Scratch: From FizzBuzz to DooM.

    The framebuffer idea is used in this wasm doom port: https://github.com/diekmann/wasm-fizzbuzz/tree/main/doom

    WASIX already does all the other stuff you mentioned, including in the browser. The one thing it's missing is GUI, mainly because there's no standard GUI interface in POSIX.

  • webvm

    Virtual Machine for the Web

    GCC? That's easy! :-) What about a complete system? https://webvm.io

    Shameless plug: we are hosting a WebVM Hackathon next week (11-14 October) over Discord. For more information: https://cheerpx.io/hackathon

  • exa-kernel

    EXA Kernel

  • STC

    A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers. (by stclib)

    I went down a rabbithole and wow.

    Found a comment from the author of https://github.com/stclib/STC apparently and then came across this example:

    https://stackoverflow.com/a/76887723

    int coro_a(struct a* g)

  • p2p-webtransport

    Interface to create and manage QUIC streams

    The spec is inactive, afaik, no implementations. Got it backwards, pardon, p2p-webtransport. https://github.com/w3c/p2p-webtransport

    I don't know why it's fallen off, to be honest, or what was raised against it. Highly desireable to a lot of p2p folk, a very promising webrtc datatransport replacement.

  • emception

    😱 Emscripten, but it's in your browser (by emception)

    It’s sadly a bit more of a proof of concept than a hackable project. The docker build in the readme did work last time I tried, and there is a demo site at https://jprendes.github.io/emception/, but I’ve failed to modify it in the past to do other things

    There is a fork at https://github.com/emception/emception that is trying to make it more production ready, but it looks like that may have stalled

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • WASM Is the New CGI

    7 projects | news.ycombinator.com | 10 Oct 2024
  • PyScript: An open source platform for Python in the browser

    14 projects | news.ycombinator.com | 16 Aug 2024
  • Waxolotl – a small language that compiles to WebAssembly text format

    3 projects | news.ycombinator.com | 18 May 2024
  • Parquet-WASM: Rust-based WebAssembly bindings to read and write Parquet data

    5 projects | news.ycombinator.com | 22 Apr 2024
  • Prettier $20k Bounty was Claimed

    16 projects | news.ycombinator.com | 27 Nov 2023

Did you konow that C++ is
the 6th most popular programming language
based on number of metions?