# \[ANN\] EyeOfRa.jl for rapid function writing

**URL:** <https://discourse.julialang.org/t/ann-eyeofra-jl-for-rapid-function-writing/46488>\
**Category:** Tooling\
**Tags:** testing, repl, emacs\
**Created:** [September 12, 2020, 12:27am UTC](https://discourse.julialang.org/t/ann-eyeofra-jl-for-rapid-function-writing/46488 "2020-09-12T00:27:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pengwyn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pengwyn/32/6961_2.png) [@pengwyn](https://discourse.julialang.org/u/pengwyn)\
**Post date:** [September 12, 2020, 12:27am UTC](https://discourse.julialang.org/t/ann-eyeofra-jl-for-rapid-function-writing/46488/1 "2020-09-12T00:27:04Z")

</div>

Hi all,

To speed up my workflow, I’ve made a “continuous testing” package for seeing function output on every editor save called [EyeOfRa.jl](https://github.com/pengwyn/EyeOfRa.jl). This aims to make the edit/save/run loop of function writing/debugging more comfortable.

The package piggy backs off `Revise.jl` to notice when a module has been updated and reruns a given function, displaying the return value, its Type, run time and stdout/stderr. A difference in inferred type will also be noticed. In the future this will also show a diff of the outputs.

To use from the REPL, make sure `Revise` and `EyeOfRa` are imported, then call:

```julia
@observe some_func(...)

```

Now edit your code and save, and observe the changes in output.

For example, a call `@observe MyModule.greet()` could generate the following output:

Successful run:  
 ![](https://global.discourse-cdn.com/julialang/original/3X/d/7/d76a9d09648a4126b3ce3b4a83360c2516d86c5a.png)

Module code throwing an exception after a previous successful run, showing stacktrace and previous success:

 ![](https://global.discourse-cdn.com/julialang/original/3X/3/f/3f3504caeb0efec360656336a3aab4429693027d.png)

I have also created an emacs package to interface with this through `julia-mode` and `julia-repl`, which is hosted at [julia-funcobs](https://github.com/pengwyn/julia-funcobs). This allows for `Plots.jl` objects returned from functions to be displayed:

 ![](https://global.discourse-cdn.com/julialang/original/3X/a/4/a4ef0dd5510679dae71466ea9f691e6a633d7f9e.png)

If anyone is interested in a similar implementation for VSCode or another editor, I eagerly await your pull request!

The inspiration for this package came from a talk by Brett Victor: [Inventing on Principle](https://www.youtube.com/watch?v=8QiPFmIMxFc).

I have described this as “continuous testing” but I’m sure there is a better term for this, as CT brings to mind CI testing in repositories, rather than local updates.
