Nova is a new JavaScript and WebAssembly engine built in Rust, focusing on performance, reliability, and embedability. It aims to provide a fast and secure runtime for server-side JavaScript applications, including serverless functions and edge computing, as well as non-browser environments like game development or IoT devices. Nova supports JavaScript modules, asynchronous programming, and standard Web APIs. It also boasts a small footprint, making it suitable for resource-constrained environments. The project is open-source and still under active development, with a focus on expanding its feature set and improving compatibility with existing JavaScript ecosystems.
Nathan Reed successfully ran a scaled-down version of the GPT-2 language model entirely within a web browser using WebGL shaders. By leveraging the parallel processing power of the GPU, he achieved impressive performance, generating text at a reasonable speed without any server-side computation. This involved creatively encoding model parameters as textures and implementing the transformer architecture's intricate operations using custom shader code, demonstrating the potential of WebGL for complex computations beyond traditional graphics rendering. The project highlights the power and flexibility of shader programming for tasks beyond its typical domain, offering a fascinating glimpse into using readily available hardware for machine learning inference.
HN commenters largely praised the author's approach to running GPT-2 in WebGL shaders, admiring the ingenuity and "hacky" nature of the project. Several highlighted the clever use of texture memory for storing model weights and intermediate activations. Some questioned the practical applications, given performance limitations, but acknowledged the educational value and potential for other, less demanding models. A few commenters discussed WebGL's suitability for this type of computation, with some suggesting WebGPU as a more appropriate future direction. There was also discussion around optimizing the implementation further, including using half-precision floats and different texture formats. A few users shared their own experiences and resources related to shader programming and on-device inference.
The blog post details the author's successful porting of both Terraria and Celeste to WebAssembly using a custom C# runtime built upon Mono. This allows both games to run directly within a web browser without plugins or installation. The author highlights the challenges encountered, particularly with handling graphics and input, and explains the solutions implemented, such as utilizing SDL2 and Emscripten. While performance isn't yet perfect, particularly with Terraria's more complex world generation, both games are demonstrably playable in the browser, showcasing the potential of WebAssembly for running demanding applications.
HN users discussed the technical challenges and successes of porting games to WebAssembly. Several commenters praised the developer's work, particularly the performance achieved with Celeste, noting it felt native. Some discussed the complexities of handling game inputs, audio, and file system access within the browser environment. A few users expressed interest in the potential of WASM for game development, seeing it as a viable platform for distributing and playing games without installations. Others shared their experiences with similar projects and offered suggestions for optimization. The legality of distributing ROMs online was also briefly touched upon.
NLnet Labs introduces Roto, a compiled scripting language designed specifically for extending Rust applications. Aiming to bridge the gap between embedded scripting (with languages like Lua) and native Rust extensions, Roto offers performance closer to native code while maintaining the flexibility and rapid iteration of a scripting language. It compiles to native code via LLVM, leverages Rust's type system and memory safety, and allows seamless interoperability with existing Rust code. Roto is still under active development but shows promise as a performant and safe way to script and extend Rust programs.
HN commenters discuss Roto's potential, particularly for embedded systems and scenarios requiring quick iteration. Some express interest in its ability to potentially replace Lua while offering better performance and tighter Rust integration. Concerns arise about Roto's early stage of development and limited documentation. Several commenters question its practical advantages over existing scripting solutions or using Rust directly, particularly given the existence of similar projects. Others raise points about garbage collection, debugging, and the trade-offs between scripting and compiled languages. Finally, some discuss the difficulty of achieving the "holy grail" of a truly performant, easy-to-use scripting language embedded within a systems language.
Deno, the JavaScript/TypeScript runtime, is actively addressing recent community concerns regarding its perceived decline. The blog post refutes the narrative of Deno's "demise," highlighting continued development, a growing user base, and successful integration in production environments at companies like Slack and Netlify. While acknowledging a shift in focus away from the Deno Deploy serverless platform towards improving the core runtime, the team emphasizes their commitment to the long-term vision of Deno and its potential for simplifying JavaScript development. They are actively working on performance enhancements, improved documentation, and expanding compatibility, demonstrating their ongoing dedication to the project's growth and stability.
Hacker News users discuss Deno's blog post addressing concerns about its perceived decline. Several commenters express skepticism about Deno's claimed growth, questioning the metrics used and highlighting the lack of significant real-world adoption. Some users point to the continued dominance of Node.js and the difficulty of displacing an established ecosystem. Others mention Deno's fresh approach to security and its potential for specific use cases, but acknowledge it hasn't achieved mainstream success. A few users express interest in trying Deno for smaller projects, but overall the sentiment leans towards cautious observation rather than enthusiastic endorsement. The discussion reflects a wait-and-see attitude regarding Deno's future.
WebAssembly 2.0 is a significant upgrade to the WebAssembly platform, enhancing its capabilities while maintaining backwards compatibility. This version introduces several key features like fixed-width SIMD for improved performance in multimedia and computational tasks, bulk memory operations for efficient data manipulation, and relaxed SIMD to offer portability across diverse hardware. Additionally, reference types enable direct manipulation of JavaScript objects and other WebAssembly modules, fostering better integration with existing web technologies. These advancements, along with improved exception handling and enhanced thread control, further solidify WebAssembly's position as a powerful and versatile technology for web development and beyond.
Hacker News users discussed the potential impact and features of WASM 2.0. Several commenters expressed excitement about improved performance, particularly regarding garbage collection and interface types, hoping it would pave the way for wider adoption, including GUI applications and better integration with existing languages. Some discussed the complexity of the specification and the challenges of implementation. A recurring theme was the desire for simplified integration with JavaScript and the browser DOM, a key factor in WASM's broader usability. There were also inquiries and discussions about specific technical aspects like tail calls, exceptions, and memory management. Some users expressed caution, wanting to see real-world performance improvements before getting too enthusiastic.
This blog post details the author's successful experiment running Clojure code in a web browser using WebAssembly (WASM) compiled via GraalVM Native Image. The process involves using SCI, the self-hosted Clojure interpreter, to create a native image ahead-of-time (AOT) that can be further compiled to WASM. The post highlights several key steps, including preparing a minimal Clojure project, utilizing GraalVM's native-image
tool with necessary configuration for WASM, and finally embedding the resulting WASM file in a simple HTML page for browser execution. The author showcases a basic "Hello, World!" example and briefly touches on potential benefits like performance improvements, albeit acknowledging the current limitations and experimental nature of the approach.
Hacker News users discussed the challenges and potential benefits of running Clojure in WASM using GraalVM. Several commenters pointed out the substantial resulting file sizes, questioning the practicality for web applications. Performance concerns were also raised, particularly regarding startup time. Some suggested exploring alternative approaches like using smaller ClojureScript compilers or different WASM runtimes. Others expressed excitement about the possibilities, mentioning potential applications in serverless functions and plugin systems. One commenter highlighted the contrast between the "write once, run anywhere" promise of Java (which GraalVM leverages) and the current state of browser compatibility issues. The overall sentiment leaned towards cautious optimism, acknowledging the technical hurdles while recognizing the potential of Clojure in the WASM ecosystem.
Faasta is a self-hosted serverless platform written in Rust that allows you to run WebAssembly (WASM) functions compiled with the wasi-http
ABI. It aims to provide a lightweight and efficient way to deploy serverless functions locally or on your own infrastructure. Faasta manages the lifecycle of these WASM modules, handling scaling and routing requests. It offers a simple CLI for managing functions and integrates with tools like HashiCorp Nomad for orchestration. Essentially, Faasta lets you run WASM as serverless functions similarly to cloud providers, but within your own controlled environment.
Hacker News users generally expressed interest in Faasta, praising its use of Rust and WASM/WASI for serverless functions. Several commenters appreciated its self-hosted nature and the potential cost savings compared to cloud providers. Some questioned the performance characteristics and cold start times, particularly in comparison to existing serverless offerings. Others pointed out the relative complexity compared to simpler container-based solutions, and the need for more robust observability features. A few commenters offered suggestions for improvements, including integrating with existing service meshes and providing examples for different use cases. The overall sentiment was positive, with many eager to see how the project evolves.
The blog post details a creative misuse of DuckDB-WASM, compiling SQL queries within a web browser to generate 3D-like graphics. By leveraging DuckDB's ability to generate large datasets and then encoding coordinate and color information into a custom string format, the author renders these strings as voxels within a JavaScript-based 3D viewer. While not true 3D graphics rendering in the traditional sense, the approach demonstrates the surprising flexibility of DuckDB and its potential for unconventional applications beyond standard data analysis. Essentially, the SQL queries define the shape and colors of the "voxels," which are then assembled and displayed by the JavaScript frontend.
Hacker News users generally found the DuckDB-WASM 3D rendering hack clever and amusing. Several commenters praised the ingenuity and highlighted the unexpected versatility of DuckDB. Some expressed skepticism about practical applications, questioning performance and limitations compared to dedicated graphics libraries. A few users discussed potential optimizations, including leveraging SIMD and Web Workers. There was also a short thread discussing the broader implications of using databases for unconventional tasks, with some arguing it showcased the power of declarative programming. Finally, some commenters shared similar "hacks" they'd performed with SQL in the past, reinforcing the idea that SQL can be used in surprisingly flexible ways.
This blog post explores different strategies for memory allocation within WebAssembly modules, particularly focusing on the trade-offs between using the built-in malloc
(provided by wasm-libc
) and implementing a custom allocator. It highlights the performance overhead of wasm-libc
's malloc
due to its generality and thread safety features. The author presents a leaner, custom bump allocator as a more performant alternative for single-threaded scenarios, showcasing its implementation and integration with a linear memory. Finally, it discusses the option of delegating allocation to JavaScript and the potential complexities involved in managing memory across the WebAssembly/JavaScript boundary.
Hacker News users discussed the implications of WebAssembly's lack of built-in allocator, focusing on the challenges and opportunities it presents. Several commenters highlighted the performance benefits of using a custom allocator tailored to the specific application, rather than relying on a general-purpose one. The discussion touched on various allocation strategies, including linear allocation, arena allocation, and using allocators from the host environment. Some users expressed concern about the added complexity for developers, while others saw it as a positive feature allowing for greater control and optimization. The possibility of standardizing certain allocator interfaces within WebAssembly was also brought up, though acknowledged as a complex undertaking. Some commenters shared their experiences with custom allocators in WebAssembly, mentioning reduced binary sizes and improved performance as key advantages.
JSLinux is a PC emulator written in JavaScript. It allows you to run a Linux distribution, or other operating systems like Windows 2000, entirely within a web browser. Fabrice Bellard, the creator, has implemented several different emulated architectures including x86, ARM, and RISC-V, showcasing the versatility of the project. The site provides several pre-built virtual machines to try, offering various Linux distributions with different desktop environments and even a minimal version of Windows 2000. It demonstrates a remarkable feat of engineering, bringing relatively complex operating systems to the web without the need for plugins or extensions.
Hacker News users discuss Fabrice Bellard's JSLinux, mostly praising its technical brilliance. Several commenters express amazement at running Linux in a browser, highlighting its use of a compiled-to-JavaScript PC emulator. Some discuss potential applications, including education and preserving older software. A few point out limitations, like performance and the inability to access local filesystems easily, and some reminisce about similar projects like v86. The conversation also touches on the legality of distributing copyrighted BIOS images within such an emulator.
The cg_clif
project has made significant progress in compiling Rust to C, achieving a 95.9% pass rate on the Rust test suite. This compiler leverages Cranelift as a backend and utilizes a custom ABI for passing Rust data structures. Notably, it's now functional on more unusual platforms like wasm32-wasi
and thumbv6m-none-eabi
(for embedded ARM devices). While performance isn't a primary focus currently, basic functionality and compatibility are progressing rapidly, demonstrating the potential for compiling Rust to a portable C representation.
Hacker News users discussed the impressive 95.9% test pass rate of the Rust-to-C compiler, particularly its ability to target unusual platforms like the Sega Saturn and Sony PlayStation. Some expressed skepticism about the practical applications, questioning the performance implications and debugging challenges of such a complex transpilation process. Others highlighted the potential benefits for code reuse and portability, enabling Rust code to run on legacy or resource-constrained systems. The project's novelty and ambition were generally praised, with several commenters expressing interest in the developer's approach and future developments. Some also debated the suitability of "compiler" versus "transpiler" to describe the project. There was also discussion around specific technical aspects, like memory management and the handling of Rust's borrow checker within the C output.
SpacetimeDB is a globally distributed, relational database designed for building massively multiplayer online (MMO) games and other real-time, collaborative applications. It leverages a deterministic state machine replicated across all connected clients, ensuring consistent data across all users. The database uses WebAssembly modules for stored procedures and application logic, providing a sandboxed and performant execution environment. Developers can interact with SpacetimeDB using familiar SQL queries and transactions, simplifying the development process. The platform aims to eliminate the need for separate databases, application servers, and networking solutions, streamlining backend infrastructure for real-time applications.
Hacker News users discussed SpacetimeDB, a globally distributed, relational database with strong consistency and built-in WebAssembly smart contracts. Several commenters expressed excitement about the project, praising its novel approach and potential for various applications, particularly gaming. Some questioned the practicality of strong consistency in a distributed database and raised concerns about performance, scalability, and the complexity introduced by WebAssembly. Others were skeptical of the claimed ease of use and the maturity of the technology, emphasizing the difficulty of achieving genuine strong consistency. There was a discussion around the choice of WebAssembly, with some suggesting alternatives like Lua. A few commenters requested clarification on specific technical aspects, like data modeling and conflict resolution, and how SpacetimeDB compares to existing solutions. Overall, the comments reflected a mixture of intrigue and cautious optimism, with many acknowledging the ambitious nature of the project.
mem-isolate
is a Rust crate designed to execute potentially unsafe code within isolated memory compartments. It leverages Linux's memfd_create
system call to create anonymous memory mappings, allowing developers to run untrusted code within these confined regions, limiting the potential damage from vulnerabilities or exploits. This sandboxing approach helps mitigate security risks by restricting access to the main process's memory, effectively preventing malicious code from affecting the wider system. The crate offers a simple API for setting up and managing these isolated execution environments, providing a more secure way to interact with external or potentially compromised code.
Hacker News users discussed the practicality and security implications of the mem-isolate
crate. Several commenters expressed skepticism about its ability to truly isolate unsafe code, particularly in complex scenarios involving system calls and shared resources. Concerns were raised about the performance overhead and the potential for subtle bugs in the isolation mechanism itself. The discussion also touched on the challenges of securely managing memory in Rust and the trade-offs between safety and performance. Some users suggested alternative approaches, such as using WebAssembly or language-level sandboxing. Overall, the comments reflected a cautious optimism about the project but acknowledged the difficulty of achieving complete isolation in a practical and efficient manner.
This blog post details the author's experience building a fast, in-browser analytics tool using DuckDB compiled to WebAssembly (Wasm), Apache Arrow for data transfer, and web workers for parallel processing. The post highlights the performance benefits of this combination, allowing for efficient querying of large datasets directly within the browser without server-side processing. By leveraging DuckDB's analytical capabilities within the browser, the application provides a responsive and interactive user experience for data exploration. The author also discusses the challenges encountered and solutions implemented, such as handling large data transfers between the main thread and the web worker using Arrow, ultimately achieving significant performance gains compared to traditional JavaScript-based solutions.
HN commenters generally praised the approach of using DuckDB, Arrow, and web workers for in-browser analytics. Several highlighted the potential of this combination for powerful client-side data processing and visualization, particularly for large datasets. Some pointed out that this method shifts the burden of computation to the client, potentially saving server costs and improving privacy. A few commenters offered alternative solutions or discussed the limitations of the current implementation, including browser compatibility and memory management. The performance benefits and ease of use compared to JavaScript solutions were recurring themes, with one commenter specifically mentioning its usefulness for interactive dashboards.
This post outlines a vision for first-class WebAssembly support in Swift, enabling developers to compile Swift code directly to Wasm for use in web browsers and other Wasm environments. The proposal emphasizes seamless integration with existing JavaScript ecosystems, allowing bidirectional communication between Swift and JavaScript code. It also aims for near-native performance by leveraging Wasm's capabilities, and proposes tools and workflows to simplify the development process, such as automatic generation of JavaScript bindings for Swift code. The ultimate goal is to empower Swift developers to build high-performance web applications and leverage the growing Wasm ecosystem, while maintaining Swift's core values of safety, performance, and expressiveness.
Hacker News users discussed the potential and challenges of Swift for WebAssembly. Some expressed excitement about the prospect of using Swift for frontend development, highlighting its performance and type safety as advantages over JavaScript. Others were more cautious, pointing to the existing maturity of JavaScript and its ecosystem, and questioning whether Swift could gain significant traction. Concerns were raised about the size of Swift compiled output and the integration with existing JavaScript libraries and frameworks. The potential for full-stack Swift development and server-side applications with WebAssembly was also mentioned as a motivating factor. Several users suggested that prioritizing the developer experience and tooling would be crucial for adoption.
A JavaScript-based Transputer emulator has been developed and is performant enough for practical use. It emulates a T425 Transputer, including its 32-bit processor, on-chip RAM, and link interfaces for connecting multiple virtual Transputers. The emulator aims for accuracy and speed, leveraging WebAssembly and other optimizations. While still under development, it can already run various programs, offering a readily accessible way to explore and experiment with this parallel computing architecture within a web browser. The project's website provides interactive demos and source code.
Hacker News users discussed the surprising speed and cleverness of a JavaScript-based Transputer emulator. Several praised the author's ingenuity in optimizing the emulator, making it performant enough for practical uses like running old Transputer demos. Some commenters reminisced about their past experiences with Transputers, highlighting their unique architecture and the challenges of parallel programming. Others expressed interest in exploring the emulator further, with suggestions for potential applications like running old games or educational purposes. A few users discussed the technical aspects of the emulator, including the use of Web Workers and the limitations of JavaScript for emulating parallel architectures. The overall sentiment was positive, with many impressed by the project's technical achievement and nostalgic value.
BrowserCraft allows you to play a near-complete version of Minecraft Classic (specifically version 0.0.23a_01) directly in your web browser, thanks to the CheerpJ Java to JavaScript/WebAssembly compiler. It requires no installation or plugins, boasting full multiplayer support and even the ability to connect to existing Java Minecraft Classic servers. While aiming for feature parity with the original client, some differences exist, notably enhanced performance in certain areas and potential discrepancies in rendering. The project is open-source and actively being developed, welcoming community contributions.
HN commenters express excitement and curiosity about the technical implementation of a Java Minecraft clone running in the browser. Several discuss the clever use of CheerpJ, a Java-to-WebAssembly compiler, noting its surprisingly good performance and suitability for CPU-bound tasks like Minecraft's game logic. Some commenters raise concerns about performance bottlenecks, particularly related to rendering and garbage collection, while others offer potential optimizations. The project's open-source nature and availability on GitHub are praised, with some expressing interest in contributing. A few commenters reminisce about similar projects in the past, comparing their performance and approaches. The overall sentiment is positive, with the project viewed as an impressive technical feat and a promising demonstration of WebAssembly's capabilities.
Retro Boy is a simple Game Boy emulator written in Rust and compiled to WebAssembly, allowing it to run directly in a web browser. It features a basic but functional graphical user interface and supports sound, offering a playable experience for a selection of ROMs. While not aiming for perfect accuracy or advanced features, it focuses on clean code and serves as a learning project showcasing Rust and WebAssembly for emulation.
Hacker News users generally praised the Retro Boy emulator for its clean Rust implementation and WebAssembly deployment. Several commenters appreciated the project's simplicity and educational value, seeing it as a good starting point for learning emulator development or Rust. Some discussed performance aspects of WebAssembly and the challenges of accurate emulation. A few users compared it favorably to other Game Boy emulators and highlighted the benefits of Rust's safety features for this type of project. Others pointed out the clever use of a single match
statement in the CPU emulation code. The developer's engagement in the comments, answering questions and acknowledging feedback, was also positively received.
This blog post details the author's process of creating a Checkers game using Rust and compiling it to WebAssembly (WASM) for play in a web browser. The author highlights the benefits of using Rust, such as performance and memory safety, and the relative ease of targeting WASM. They describe key implementation aspects, including game logic, board representation, and user interface interaction using the Yew framework. The post also covers setting up the Rust and WASM build environment, and optimizing the WASM module size for faster loading. The final result is a playable checkers game embedded directly in the webpage, demonstrating the practicality of Rust and WASM for web development.
HN commenters generally praised the clean and performant implementation of Checkers in Rust and WASM. Several lauded the clear code and the educational value of the project, finding it a good example of Rust and WASM usage. Some discussed performance considerations, including the choice of using a 1D array for the board representation, suggesting a 2D array might offer better readability despite potentially slightly reduced performance. A few comments touched on potential enhancements, like adding an AI opponent or allowing undo/redo functionality. There was also minor discussion around alternative approaches to game development with Rust/WASM and other languages.
This blog post demonstrates a Retrieval Augmented Generation (RAG) pipeline running entirely within a web browser. It uses Kuzu-WASM, a WebAssembly build of the Kuzu graph database, to store and query a knowledge graph, and WebLLM, a library for running large language models (LLMs) client-side. The demo allows users to query the graph using natural language, with Kuzu translating the query into its native query language and retrieving relevant information. This retrieved context is then fed to a local LLM (currently, a quantized version of Flan-T5), which generates a natural language response. This in-browser approach offers potential benefits in terms of privacy, reduced latency, and offline functionality, enabling new possibilities for interactive and personalized AI applications.
HN commenters generally expressed excitement about the potential of in-browser graph RAG, praising the demo's responsiveness and the possibilities it opens up for privacy-preserving, local AI applications. Several users questioned the performance and scalability with larger datasets, highlighting the current limitations of WASM and browser storage. Some suggested potential applications, like analyzing personal knowledge graphs or interacting with codebases. Concerns were raised about the security implications of running LLMs client-side, and the challenge of keeping WASM binaries up-to-date. The closed-source nature of KuzuDB also prompted discussion, with some advocating for open-source alternatives. Several commenters expressed interest in trying the demo and exploring its capabilities further.
Wokwi now offers a web-based simulator for developing and debugging embedded Rust programs. This online tool allows users to write, build, and run Rust code targeted for various microcontrollers, including the AVR ATmega328P (like the Arduino Uno) and RP2040 (Raspberry Pi Pico), directly in the browser. The simulator features peripherals like LEDs, buttons, serial output, and an integrated logic analyzer, enabling interactive hardware simulation without requiring physical hardware. Code can be compiled and flashed to the virtual microcontroller, and the simulator provides a debugging environment for stepping through code and inspecting variables. This simplifies the embedded Rust development process, making it more accessible for learning and experimentation.
HN commenters generally expressed enthusiasm for Wokwi's online embedded Rust simulator. Several praised its ease of use and accessibility, noting it lowers the barrier to entry for embedded development. Some highlighted the educational benefits, particularly for those new to Rust or embedded systems. A few pointed out the limitations of simulation compared to real hardware, but acknowledged the simulator's value for initial development and testing. The discussion also touched on potential improvements, including support for more microcontrollers and peripherals, as well as integration with other tools. Some users shared their positive experiences using Wokwi for specific projects, further reinforcing its practical usefulness.
Porting an OpenGL game to WebAssembly using Emscripten, while theoretically straightforward, presented several unexpected challenges. The author encountered issues with texture formats, particularly compressed textures like DXT, necessitating conversion to browser-compatible formats. Shader code required adjustments due to WebGL's stricter validation and lack of certain extensions. Performance bottlenecks emerged from excessive JavaScript calls and inefficient data transfer between JavaScript and WASM. The author ultimately achieved acceptable performance by minimizing JavaScript interaction, utilizing efficient memory management techniques like shared array buffers, and employing WebGL-specific optimizations. Key takeaways include thoroughly testing across browsers, understanding WebGL's limitations compared to OpenGL, and prioritizing efficient data handling between JavaScript and WASM.
Commenters on Hacker News largely praised the author's clear writing and the helpfulness of the article for those considering similar WebGL/WebAssembly projects. Several pointed out the challenges inherent in porting OpenGL code, especially around shader precision differences and the complexities of memory management between JavaScript and C++. One commenter highlighted the benefit of using Emscripten's WebGL bindings for easier texture handling. Others discussed the performance implications of various approaches, including using WebGPU instead of WebGL, and the potential advantages of libraries like glium for abstracting away some of the lower-level details. A few users also shared their own experiences with similar porting projects, offering additional tips and insights. Overall, the comments section provides a valuable supplement to the article, reinforcing its key points and expanding on the practical considerations for OpenGL to WebAssembly porting.
MichiganTypeScript is a proof-of-concept project demonstrating a WebAssembly runtime implemented entirely within TypeScript's type system. It doesn't actually execute WebAssembly code, but instead uses advanced type-level programming techniques to simulate its execution. By representing WebAssembly instructions and memory as types, and leveraging TypeScript's type inference and checking capabilities, the project can statically verify the behavior of a given WebAssembly program. This effectively transforms TypeScript's type checker into an interpreter, showcasing the power and flexibility of its type system, albeit in a non-practical, purely theoretical manner.
Hacker News users discussed the cleverness of using TypeScript's type system for computation, with several expressing fascination and calling it "amazing" or "brilliant." Some debated the practical applications, acknowledging its limitations while appreciating it as a demonstration of the type system's power. Concerns were raised about debugging complexity and the impracticality for larger programs. Others drew parallels to other Turing-complete type systems and pondered the potential for generating optimized WASM code from such TypeScript code. A few commenters pointed out the project's connection to the "ts-sql" project and speculated about leveraging similar techniques for compile-time query validation and optimization. Several users also highlighted the educational value of the project, showcasing the unexpected capabilities of TypeScript's type system.
This YouTube video demonstrates running a playable version of DOOM within a TypeScript type definition. By cleverly exploiting the TypeScript compiler's type system, particularly recursive types and conditional type inference, the creator encodes the game's logic and data, including map layout, enemy behavior, and rendering. The "game" runs entirely within the type checker, with output rendered as a string that visually represents the game state. This showcases the surprising computational power and complexity achievable within TypeScript's type system, though it's obviously not a practical way to develop games. Instead, it serves as a fascinating exploration of the boundaries of what can be accomplished with type-level programming.
HN users were generally impressed with the technical feat of running DOOM in a TypeScript type. Several pointed out the absurdity and impracticality of the project, with one user calling it "peak type abuse." Discussion touched on the Turing completeness of TypeScript's type system, its potential misuse, and the implications for performance. Some wondered about practical applications, while others simply appreciated it as a clever demonstration of the language's capabilities. A few users questioned the definition of "running" in this context, arguing that it was more of a simulation than actual execution. There was some debate about the video's explanation clarity and a call for a blog post with a more thorough breakdown.
Chicory is a new WebAssembly runtime built specifically for the Java Virtual Machine (JVM). It aims to bring the performance and portability benefits of Wasm to JVM environments by allowing developers to seamlessly execute Wasm modules directly within their Java applications. Chicory achieves this through a combination of ahead-of-time (AOT) compilation to native code via GraalVM Native Image and a runtime library implemented in Java. This approach allows for efficient interoperability between Java code and Wasm modules, potentially opening up new possibilities for leveraging Wasm's growing ecosystem within established Java systems.
Hacker News users discussed Chicory's potential, limitations, and context within the WebAssembly ecosystem. Some expressed excitement about its JVM integration, seeing it as a valuable tool for leveraging existing Java libraries and infrastructure within WebAssembly applications. Others raised concerns about performance, particularly regarding garbage collection and its suitability for computationally intensive tasks. Comparisons were made to other WebAssembly runtimes like Wasmtime and Wasmer, with discussion around the trade-offs between performance, portability, and features. Several comments questioned the practical benefits of running WebAssembly within the JVM, particularly given the existing rich Java ecosystem. There was also skepticism about WebAssembly's overall adoption and its role in the broader software landscape.
The author is developing a Scheme implementation in async Rust to explore the synergy between the two. They believe Rust's robust tooling, performance, and memory safety, combined with its burgeoning async ecosystem, provide an ideal foundation for a modern Lisp dialect. Async capabilities offer exciting potential for concurrent Scheme programming, especially with features like lightweight tasks and channels. The project aims to leverage Rust's strengths while preserving the elegance and flexibility of Scheme, potentially offering a compelling alternative for both Lisp enthusiasts and Rust developers interested in functional programming.
HN commenters generally expressed interest in the project, finding the combination of Scheme and async Rust intriguing. Several questioned the choice of Rust for performance reasons, arguing that garbage collection makes it a poor fit for truly high-performance async workloads, and suggesting alternatives like C, C++, or even Zig. Some suggested exploring other approaches within the Rust ecosystem, like using a different garbage collector or a stack-allocated scheme. Others praised the project's focus on developer experience and the potential of combining Scheme's expressiveness with Rust's safety features. A few commenters also discussed the challenges of integrating garbage collection with async runtimes and the potential trade-offs involved. The author's responses clarified some of the design choices and acknowledged the performance concerns, indicating they're open to exploring different strategies.
Ruby on Rails applications can now run directly in web browsers thanks to WebAssembly. This is achieved using a new project called "Spreetail/wunderbar-wasm", which compiles Ruby and Rails to WASM using a custom-built toolchain. This allows developers to build full-stack Rails apps that execute client-side, offering potential performance benefits for certain applications by reducing server roundtrips. The WASM approach allows for offline functionality and removes the need for separate frontend and backend deployments. While still experimental, this technology opens up new possibilities for building web applications with Ruby on Rails.
Hacker News commenters expressed skepticism about the practicality of running Ruby on Rails in the browser via WebAssembly. Concerns focused on performance, particularly startup time and overall speed, doubting it would be suitable for production applications. Some suggested alternative approaches for achieving similar functionality, like using a server-rendered backend with a JavaScript frontend framework. Others questioned the use cases, wondering if the complexity was worth the effort compared to established approaches. Several commenters pointed to the large size of the Wasm bundle as a major drawback. A few expressed cautious optimism, acknowledging the technical achievement while remaining unsure of its real-world applicability. Finally, some highlighted the potential benefits for specific niches, such as online code editors or interactive tutorials.
The Fly.io blog post "We Were Wrong About GPUs" admits their initial prediction that smaller, cheaper GPUs would dominate the serverless GPU market was incorrect. Demand has overwhelmingly shifted towards larger, more powerful GPUs, driven by increasingly complex AI workloads like large language models and generative AI. Customers prioritize performance and fast iteration over cost savings, willing to pay a premium for the ability to train and run these models efficiently. This has led Fly.io to adjust their strategy, focusing on providing access to higher-end GPUs and optimizing their platform for these demanding use cases.
HN commenters largely agreed with the author's premise that the difficulty of utilizing GPUs effectively often outweighs their potential benefits for many applications. Several shared personal experiences echoing the article's points about complex tooling, debugging challenges, and ultimately reverting to CPU-based solutions for simplicity and cost-effectiveness. Some pointed out that specific niches, like machine learning and scientific computing, heavily benefit from GPUs, while others highlighted the potential of simpler GPU programming models like CUDA and WebGPU to improve accessibility. A few commenters offered alternative perspectives, suggesting that managed services or serverless GPU offerings could mitigate some of the complexity issues raised. Others noted the importance of right-sizing GPU instances and warned against prematurely optimizing for GPUs. Finally, there was some discussion around the rising popularity of ARM-based processors and their potential to offer a competitive alternative for certain workloads.
Go 1.21 introduces a new mechanism for building more modular and extensible WebAssembly applications. Previously, interacting with JavaScript from Go WASM required compiling all the code into a single, large WASM module. Now, developers can compile Go functions as individual WASM modules and dynamically import and export them using JavaScript's standard module loading system. This allows for creating smaller initial downloads, lazy-loading functionalities, and sharing Go-defined APIs with JavaScript, facilitating the development of more complex and dynamic web applications. This also enables developers to build extensions for existing WASM applications written in other languages, fostering a more interconnected and collaborative WASM ecosystem.
HN commenters generally expressed excitement about Go's new Wasm capabilities, particularly the ability to import and export functions, enabling more dynamic and extensible Wasm applications. Several highlighted the potential for creating plugins and modules with Go, simplifying development and deployment compared to current WebAssembly workflows. Some discussed the implications for server-side Wasm and potential performance benefits. A few users raised questions about garbage collection and memory management with this new functionality, and another thread explored comparisons to JavaScript's module system and the potential for better tooling around Wasm. Some expressed concerns about whether it's better to use Go or Rust for Wasm development, and there was an insightful dialogue comparing wasmexport
with previous approaches.
Summary of Comments ( 19 )
https://news.ycombinator.com/item?id=44126264
HN commenters generally expressed interest in Nova, particularly its Rust implementation and potential performance benefits. Some questioned the practical need for yet another JavaScript engine, especially given the maturity of existing options like V8. Others were curious about specific implementation details, like garbage collection and WebAssembly support. A few pointed out the inherent challenges in competing with established engines, but acknowledged the value of exploring alternative approaches and the potential for niche applications where Nova's unique features might be advantageous. Several users expressed excitement about its potential for integration into other Rust projects. The potential for smaller binary sizes and faster startup times compared to V8 was also highlighted as a potential advantage.
The Hacker News post for "Nova: A JavaScript and WebAssembly engine written in Rust" has several comments discussing various aspects of the project.
Some users express excitement about a new JavaScript engine written in Rust, seeing it as a positive development. They praise the potential performance benefits and memory safety that Rust can bring to such a project. One user specifically mentions being interested in the potential for Servo’s concurrency model to be implemented, potentially leading to impressive parallelization capabilities.
There's a discussion regarding the feasibility and challenges of creating a JavaScript engine from scratch. Several users point out the immense undertaking involved in fully supporting the JavaScript specification and achieving competitive performance with established engines like V8. Concerns about garbage collection implementation and the potential for subtle bugs also surface. However, some counter that starting anew allows for leveraging modern design principles and potentially avoiding legacy baggage.
The conversation also delves into the motivations behind building a new engine, with speculation about whether it aims to address specific niches or explore novel architectural ideas. Some suggest potential use cases like embedded systems, server-side JavaScript, or specialized applications where existing engines might not be ideal.
Performance comparisons with existing engines are a recurring theme. Users express curiosity about benchmarks and real-world performance metrics. While acknowledging it's early days for the project, they emphasize the importance of demonstrating tangible performance advantages to justify adopting a new engine.
There's a brief discussion on the project's licensing, specifically the use of the MIT license, which is seen as permissive and conducive to wider adoption.
A few comments touch upon the broader landscape of JavaScript engines, mentioning other projects like QuickJS and highlighting the challenges faced by alternative engines in gaining widespread traction.
Finally, some users share their personal experiences with Rust and WebAssembly, expressing optimism about the project's prospects given the strengths of these technologies.
Overall, the comments reflect a cautious but optimistic outlook on Nova. While acknowledging the significant challenges involved in building a successful JavaScript engine, commenters are intrigued by the potential of a Rust-based implementation and eager to see how the project evolves.