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.
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.
Maxima, a powerful computer algebra system (CAS), is now accessible directly in web browsers thanks to a project leveraging Embedded Common Lisp (ECL) compiled to WebAssembly (WasM). This allows users to perform complex symbolic computations, including algebra, calculus, and numerical analysis, without any local installation. The browser-based interface provides a REPL (read-eval-print loop) for interactive calculations and utilizes MathJax for displaying formatted mathematical expressions. This project makes Maxima's capabilities more readily available, eliminating the need for dedicated software or server-side setups.
Commenters on Hacker News express excitement about Maxima running in the browser via WASM and ECL. Several highlight the potential for educational uses and interactive symbolic computation in web environments. Some discuss the performance overhead of WASM and suggest improvements, like pre-compilation for faster startup. The ability to share computational documents easily and integrate with other web technologies is praised. A few users mention other similar projects, including one using ClojureScript and another involving a Python CAS in the browser. The general sentiment is positive, with commenters intrigued by the possibilities this opens up for accessibility and collaborative mathematical work. One commenter expresses interest in building symbolic computation directly into a browser rather than running it as a VM.
Summary of Comments ( 26 )
https://news.ycombinator.com/item?id=43761998
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.
The Hacker News post titled "Abusing DuckDB-WASM by making SQL draw 3D graphics (Sort Of)" generated a moderate amount of discussion, with a number of commenters expressing their amusement and fascination with the project.
Several commenters focused on the cleverness and unexpectedness of using SQL for graphical rendering, even if it's not practical. One described it as a "fun hack" and "peak software absurdity," highlighting the enjoyable, albeit unconventional, nature of the project. Another appreciated the technical ingenuity involved, calling it "madness" in a positive light. This sentiment was echoed by others who found the project amusing and appreciated the author's creativity.
Some commenters delved into the technical aspects, discussing the performance implications and limitations of such an approach. One commenter questioned the efficiency and wondered about the practical applications, while acknowledging the project's entertainment value. Another pointed out the inherent limitations of using SQL for graphics processing, suggesting that specialized tools are better suited for such tasks.
The potential educational value of the project was also highlighted. One commenter mentioned that it serves as a good example of how to transfer binary data to and from WebAssembly, a valuable skill for web developers.
A few commenters drew comparisons to other unconventional uses of SQL, such as generating music or solving complex mathematical problems. This reinforces the idea that SQL, while primarily designed for data management, can be used in surprisingly creative ways.
Overall, the comments reflect a general appreciation for the project's novelty and ingenuity, even if its practical applications are limited. The commenters acknowledge the impracticality of using SQL for 3D graphics but celebrate the creative exploration and technical demonstration involved.