News for hackers. Stuff that matters.
Re:Don’t Think, Just Defunctionalize by Someone on Wednesday December 23, 2020 @02:51PM (#25521423)
“we could limit RAM usage to 64K to prevent buggy programms allocating too much, those which want more can edit files in a tempfs; processes should run for no longer than 1 minute”

In JCL (https://en.wikipedia.org/wiki/Job_Control_Language), you can specify how much CPU time a program can spend, how many pages it can output before the OS kills it, and have to specify what files it reads and writes.

That was useful at a time when CPU time, memory and disk space were scarce and expensive, and still would be useful when sandboxing untrusted code.

Re:Don’t Think, Just Defunctionalize by chriswarbo on Tuesday January 05, 2021 @06:52AM (#25644585)
> you can specify

It's nice to have the option of specifying such limits, but not all programs are batch jobs. For example, the correct CPU time cap for a HTTP server is infinity. Likewise, if that server were written as a recursive function then the correct stack size would be infinity:

    def serve(request):
      response = process(request)
      socket.send(response)
      serve(socket.receive())