Please excuse the funny title, I am using it in analogy with "zip bomb". Is it possible to create a scala source file, that will, when compiled, produce a large number of class files (or a very large single class file)? Is there any way the size of the class files could grow faster than linearly with the size of the source file?
Most modern antivirus programs can detect zip bombs by looking for overlapping files. They know not to unpack layer after layer of recursive data, which is a sign of a decompression bomb. Often, antivirus software labels a file a decompression bomb when it is not actually a bomb.
In computing, a zip bomb, also known as a decompression bomb or zip of death, is a malicious archive file designed to crash or render useless the program or system reading it. It is often employed to disable antivirus software, in order to create an opening for more traditional malware.
Bomb Prevention Its quite easy to prevent a zip bomb from exploding… All you need to do is check the file's original size before writing it to disk. Set a limit to the uncompressed file sizes, or a deviation between the compressed and uncompressed sizes.
Specialization is inherently exponential in the number of type parameters specialized.
class Huge[@specialized A, @specialized B, @specialized C]( val a: A, val b: B, val c: C ) {} // 730 files, 2.9 MB class Gigantic[@specialized A, @specialized B, @specialized C, @specialized D]( val a: A, val b: B, val c: C, val d: D ) {} // 6562 files, 26 MB
Pattern matching can also involve a lot of code duplication for complex cases (though I find it difficult to predict exactly when this will occur).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With