How can I run coding simulations from various languages in a browser?

0
16
Asked By CleverCoder123 On

I'm developing a small website where users can showcase their coding projects, allowing others to see interactive demos of their work. Currently, I'm using Pyodide to handle simple Python simulations, and the site also accommodates HTML demos. However, this setup isn't quite sufficient for larger projects, and I'm struggling to find a way to safely and reliably support additional programming languages without sacrificing too many features. I'm looking for suggestions on better approaches to integrate different programming languages into my site, ideally free and browser-based. Just to give some context, my current tech stack includes Next.js and Supabase. If you're interested, here's the link to the site, although it's still under development: [vibeshare.tech](http://vibeshare.tech). Any advice would be greatly appreciated!

2 Answers

Answered By DevDude45 On

I totally agree with TechieTom about Wasm being the way to go. Just a heads up though: while it's a versatile solution, you'll need to manage some trade-offs, particularly regarding performance. If you're looking to maintain many features, explore libraries and frameworks that support Wasm fully, but check their compatibility with the languages you want to implement. It might take some trial and error, but it's definitely worth considering!

Answered By TechieTom On

Using WebAssembly (Wasm) is a strong option for this kind of project. It allows you to run code from other languages in the browser, but keep in mind that performance might not be the best, especially for more complex applications. It's a little slow compared to native execution, but it gets the job done for many cases. You can actually run games like Doom with Wasm! Just be cautious about the library support, as some languages have limitations on available libraries when running on Wasm.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.