From 96f74b313a0239f46106194670887d8d293abda3 Mon Sep 17 00:00:00 2001 From: Guy Van den Broeck Date: Sun, 28 May 2023 20:18:02 -0700 Subject: [PATCH] Enable package precompilation --- Project.toml | 4 +++- src/Dice.jl | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 78e5be8a..be21d0e9 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" IRTools = "7869d1d1-7146-5819-86e3-90919afe41df" Jive = "ba5e3d4b-8524-549f-bc71-e76ad9e9deed" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" [compat] CUDD = "0.3" @@ -22,4 +23,5 @@ Graphs = "1" IRTools = "0.4.7" Jive = "0.2" MacroTools = "0.5" -julia = "1.8" +PrecompileTools = "1" +julia = "1.8,1.9" diff --git a/src/Dice.jl b/src/Dice.jl index ccbaad35..17ccf7eb 100644 --- a/src/Dice.jl +++ b/src/Dice.jl @@ -5,6 +5,7 @@ module Dice ################################## using MacroTools: prewalk, postwalk +using PrecompileTools export @dice_ite @@ -38,4 +39,12 @@ include("dsl.jl") include("plot.jl") include("util.jl") -end # module +# add precompile statements here - keep it lightweight for main features +@compile_workload begin + code = @dice begin + if flip(0.5) true else flip(0.1) end + end + pr(code) +end + +end # module \ No newline at end of file