> My biggest criticism of Elixir has been the difficulty of writing quick scripts
Curious what you find to be the biggest pain point(s) here. Is it runtime containment? Library access? Etc.
Curious what you find to be the biggest pain point(s) here. Is it runtime containment? Library access? Etc.
$ elixir test.exs
hello, world!
$ hyperfine "elixir test.exs"
Benchmark 1: elixir test.exs
Time (mean ± σ): 471.1 ms ± 2.6 ms [User: 187.4 ms, System: 83.1 ms]
Range (min … max): 467.1 ms … 475.6 ms 10 runs
Compared to: $ ruby test.rb
hello, world!
$ hyperfine "ruby test.rb"
Benchmark 1: ruby test.rb
Time (mean ± σ): 36.3 ms ± 2.6 ms [User: 26.0 ms, System: 8.4 ms]
Range (min … max): 34.5 ms … 53.6 ms 53 runs
In practice, I've been able to get the ruby startup time to as low as 6ms - this is what I use for scripts running as keyboard macros, for example. I cannot practically use elixir for that. hyperfine "./derp"
Benchmark 1: ./derp
Time (mean ± σ): 241.0 ms ± 7.4 ms [User: 146.9 ms, System: 170.8 ms]
Range (min … max): 235.1 ms … 261.7 ms 11 runsBEAM should still be able to compile new code on the fly, for one-off scripts
Maybe, but that comes with two disadvantages:
- I would have to re-architect my scripts to work like that, and run a server with uncertain memory costs perpetually; and - I would have to use something with faster start time to run the call on my keyboard macros, e.g. bash, which would mean writing bash instead of elixir/ruby and/or being clever.