Julia, 22 bytes (in memory)
0:9^9 .|>i->@eval 2^$i
It's quite easy to make a compilation bomb in Julia, it can easily happen accidentally. Here we use the fact that a^i has some trickery when i is a litteral integer, that allows a^2 to be turned into a*a, and a^-1 into inv(a). It means that there is a new compiled method of litteral_pow being compiled for each i. I'm pretty sure this would be at least 4GB but I don't know how to check it. This is only compiled in memory and not saved in a file though
Julia, 114 bytes (output in a .ji file)
using Pkg
pkg"generate A"
write("A/src/A.jl","module A
!(::Val{x}) where x=x
.!Val.(1:9^9)end")
pkg"dev A"
using A
(can't) Try it online!
Try A online! Try A online!
To save compiled code to a file, the function must be in a package, therefore we create a package A that has the culprit (the function !). Val(i) is of type Val{i}, so a new method is compiled for each i. The output file will be in ~/.julia/compiled/<version>/A/xxx.ji
In my testing, each additional method adds at least 150 bytes (and growing, 182MB for 1M methods), which means 25M would be enough
in Julia 1.7, +2 bytes because pkg"dev ./A" is needed
Julia , 117 bytes (without writing files)
this is basically the same as the above, but with the files already there. This is slightly longer because of the uuid needed in Project.toml (this is taken care of in pkg"generate A")
file structure
A
├── src
│ └── A.jl
├── Project.toml
└── a.jl
Project.toml, 52 bytes
name="A"
uuid="8945f399-ba5e-44d3-9e17-ab2f7e467331"
src/A.jl, 47 bytes
module A
!(::Val{x}) where x=x
.!Val.(0:9^9)end
a.jl, 7 bytes
using A
command line options (in the A folder), +11 bytes
julia --project=. a.jl
Julia, 22 bytes (in memory)
0:9^9 .|>i->@eval 2^$i
It's quite easy to make a compilation bomb in Julia, it can easily happen accidentally. Here we use the fact that a^i has some trickery when i is a litteral integer, that allows a^2 to be turned into a*a, and a^-1 into inv(a). It means that there is a new compiled method of litteral_pow being compiled for each i. I'm pretty sure this would be at least 4GB but I don't know how to check it. This is only compiled in memory and not saved in a file though
Julia, 114 bytes (output in a .ji file)
using Pkg
pkg"generate A"
write("A/src/A.jl","module A
!(::Val{x}) where x=x
.!Val.(1:9^9)end")
pkg"dev A"
using A
(can't) Try it online!
Try A online!
To save compiled code to a file, the function must be in a package, therefore we create a package A that has the culprit (the function !). Val(i) is of type Val{i}, so a new method is compiled for each i. The output file will be in ~/.julia/compiled/<version>/A/xxx.ji
In my testing, each additional method adds at least 150 bytes (and growing, 182MB for 1M methods), which means 25M would be enough
in Julia 1.7, +2 bytes because pkg"dev ./A" is needed
Julia, 22 bytes (in memory)
0:9^9 .|>i->@eval 2^$i
It's quite easy to make a compilation bomb in Julia, it can easily happen accidentally. Here we use the fact that a^i has some trickery when i is a litteral integer, that allows a^2 to be turned into a*a, and a^-1 into inv(a). It means that there is a new compiled method of litteral_pow being compiled for each i. I'm pretty sure this would be at least 4GB but I don't know how to check it. This is only compiled in memory and not saved in a file though
Julia, 114 bytes (output in a .ji file)
using Pkg
pkg"generate A"
write("A/src/A.jl","module A
!(::Val{x}) where x=x
.!Val.(1:9^9)end")
pkg"dev A"
using A
(can't) Try it online!
Try A online!
To save compiled code to a file, the function must be in a package, therefore we create a package A that has the culprit (the function !). Val(i) is of type Val{i}, so a new method is compiled for each i. The output file will be in ~/.julia/compiled/<version>/A/xxx.ji
In my testing, each additional method adds at least 150 bytes (and growing, 182MB for 1M methods), which means 25M would be enough
in Julia 1.7, +2 bytes because pkg"dev ./A" is needed
Julia , 117 bytes (without writing files)
this is basically the same as the above, but with the files already there. This is slightly longer because of the uuid needed in Project.toml (this is taken care of in pkg"generate A")
file structure
A
├── src
│ └── A.jl
├── Project.toml
└── a.jl
Project.toml, 52 bytes
name="A"
uuid="8945f399-ba5e-44d3-9e17-ab2f7e467331"
src/A.jl, 47 bytes
module A
!(::Val{x}) where x=x
.!Val.(0:9^9)end
a.jl, 7 bytes
using A
command line options (in the A folder), +11 bytes
julia --project=. a.jl
Julia, 22 bytes (in memory)
0:9^9 .|>i->@eval 2^$i
It's quite easy to make a compilation bomb in Julia, it can easily happen accidentally. Here we use the fact that a^i has some trickery when i is a litteral integer, that allows a^2 to be turned into a*a, and a^-1 into inv(a). It means that there is a new compiled method of litteral_pow being compiled for each i. I'm pretty sure this would be at least 4GB but I don't know how to check it. This is only compiled in memory and not saved in a file though
Julia, 114 bytes (output in a .ji file)
using Pkg
pkg"generate A"
write("A/src/A.jl","module A
!(::Val{x}) where x=x
.!Val.(1:9^9)end")
pkg"dev A"
using A
(can't) Try it online!
Try A online!
To save compiled code to a file, the function must be in a package, therefore we create a package A that has the culprit (the function !). Val(i) is of type Val{i}, so a new method is compiled for each i. The output file will be in ~/.julia/compiled/<version>/A/xxx.ji
In my testing, each additional method adds at least 150 bytes (and growing, 182MB for 1M methods), which means 25M would be enough
in Julia 1.7, +2 bytes because pkg"dev ./A" is needed