Company
Date Published
Author
Amjad Masad
Word count
1076
Language
English
Hacker News points
None

Summary

Repl.it's code execution service allows users to build complex programs without timeboxing, but this also means they can hit infinite loops that cause browser crashes due to excessive output or running on the client-side. To address this, Repl.it has implemented measures such as streaming output from user programs directly to the browser, using pseudo-terminals and raw i/o, and implementing a frontend server in Go that limits output rate to 20 messages per second to prevent browser overload. For JavaScript languages, Repl.it uses Babel plugins to detect potential infinite loops and throws errors if certain conditions are met, such as running on a single thread or exceeding maximum iteration or time limits, allowing users to turn off this feature from settings.