To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 20 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1

🤠 Pluto developer call, 2022-05-02 🤠

heyllo Yayyy hurray Check the new PlutoSliderServer-powered website about climate science: https://margo.plutojl.org/

👀 Reading hidden code
@mdx """
# 🤠 Pluto developer call, *$(today)* 🤠
heyllo
Yayyy hurray
Check the new PlutoSliderServer-powered website about climate science:
[https://margo.plutojl.org/](https://margo.plutojl.org/)
"""
1.9 s

To discuss

  • fons: Backend testing Pluto

  • Paul: BetterFileWatching.jl

  • Paul: Functors & Base.show

  • Machine Status UI

    • CPU

    • MEM

    • Time left in JuliaHub

    • Time left outside of JuliaHub (Battery)

  • Should/Can we save Bind state in metadata? (API: set_cell_metadata/get_cell_metadata, send an CustomEvent("input", get_cell_metadata[:bindsomething]))

  • T shirts please!

md"""
# To discuss
- fons: Backend testing Pluto
- Paul: BetterFileWatching.jl
- Paul: Functors & Base.show
$(panagiotis)
"""
👀 Reading hidden code
3.3 ms

👀 Reading hidden code
80.1 μs

👀 Reading hidden code
77.8 μs

BetterFileWatching.jl

Working on the Windows issues...

Will it work on all platforms that Pluto works on? We'll try! Maybe we need to figure out a way to not use BetterFileWatching.jl when not available on the platform.

👀 Reading hidden code
289 μs

Callable structs & Base.show

Example, this should work:

👀 Reading hidden code
251 μs
Error message

Multiple definitions for C

Combine all definitions into a single reactive cell using a `begin ... end` block.

# Define a struct C
struct C
x
end
👀 Reading hidden code
---
Error message

UndefVarError: `C` not defined in `Main.var"workspace#4"`

Suggestion: check for spelling errors or missing imports.

Stack trace

Here is what happened, the most recent locations are first:

  1. # Create an instance of C with the Constructorc = C(1.)
# Create an instance of C with the Constructor
c = C(1.)
👀 Reading hidden code
---
Error message

Multiple definitions for C

Combine all definitions into a single reactive cell using a `begin ... end` block.

# Define a function that makes C as callable
# AND ALSO uses an instance of C (here: `c`)
(::C)() = 1 + c.x
👀 Reading hidden code
---
2.0
begin
struct D
x
end
dd = D(1.)

# dd() # <-- fails here
(::D)() = 1 + dd.x # <- makes the instance callable, not the "type"
# ---- This fn below
function (d::D)(args...)
d.x
end
# ---- gets rewritten as
function D(d, args...)

end
D(nothing) # <- still invokes the constructor
dd() # <-- succeeds
end
👀 Reading hidden code
15.8 ms
Error message

UndefVarError: `c` not defined in `Main.var"workspace#4"`

Suggestion: check for spelling errors or missing imports.

Stack trace

Here is what happened, the most recent locations are first:

  1. c()
c()
👀 Reading hidden code
---
# d = C(true)
👀 Reading hidden code
11.6 μs
# d()
👀 Reading hidden code
12.4 μs

This is a similar problem to #326: defining a Base.show method for a type changes how it is displayed, but this is not reactive. That's why you get two different outputs here:

👀 Reading hidden code
250 μs
struct Cool
x
end
👀 Reading hidden code
837 μs
Cool(1)
👀 Reading hidden code
9.8 μs
Base.show(io::IO, ::MIME"text/plain", c::Cool) = print(io, "Coooool $(c.x)")
👀 Reading hidden code
601 μs
Coooool 1
Cool(1)
👀 Reading hidden code
10.2 μs

Solutions

Why not run them during the definition of A itself? Because A needs to be defined before Base.show or the callable. So they should be ordered.

👀 Reading hidden code
299 μs
Error message

UndefVarError: `DoesNotExist` not defined in `Main.var"workspace#4"`

Suggestion: check for spelling errors or missing imports.

Stack trace

Here is what happened, the most recent locations are first:

  1. Base.show(io::IO, m::MIME"text/plain", thing::DoesNotExist) = nothing
Base.show(io::IO, m::MIME"text/plain", thing::DoesNotExist) = nothing
👀 Reading hidden code
---

Why not a normal reference? Like: every reference to A also references Base.show(.., .., ::A). Because it can create a cycle that was not there before. Example:

👀 Reading hidden code
285 μs
Error message

UndefVarError: `A` not defined in `Main.var"workspace#4"`

Suggestion: check for spelling errors or missing imports.

Stack trace

Here is what happened, the most recent locations are first:

  1. Base.show(io::IO, m::MIME"text/plain", thing::A) = print(io, myfunc(thing))
Base.show(io::IO, m::MIME"text/plain", thing::A) = print(io, myfunc(thing))
👀 Reading hidden code
---
Error message

UndefVarError: `A` not defined in `Main.var"workspace#4"`

Suggestion: check for spelling errors or missing imports.

Stack trace

Here is what happened, the most recent locations are first:

  1. myfunc(thing::A) = "hello"
Everything is going to be okay!
myfunc(thing::A) = "hello"
👀 Reading hidden code
---

🙌 Maybe we can use the soft definitions idea to solve. Maybe soft references, where every reference to A also has a soft reference to its callable definition, and its Base.show method.

👀 Reading hidden code
365 μs

Testing

We might want to use a testing package for our julia backend tests because:

👀 Reading hidden code
611 μs

Pluto tshirts!

Which color??

We could use the birds!! From https://plutojl.org/plutocon2021

cutebanner

on the front

nothing on the back

Jupyter notebook with a "... is not defined" error on the back

How P chooses tshirts: first on the stack

md"""
# Pluto tshirts!

Which color??

We could use the birds!! From [https://plutojl.org/plutocon2021](https://plutojl.org/plutocon2021)

![cutebanner](https://user-images.githubusercontent.com/6933510/166295621-43395689-b7ed-450e-b289-3193842a9b8c.png)

on the front

nothing on the back

Jupyter notebook with a "... is not defined" error on the back

How P chooses tshirts: first on the stack



"""
👀 Reading hidden code
500 μs
  • Machine Status UI

    • CPU

    • MEM

    • Time left in JuliaHub

    • Time left outside of JuliaHub (Battery)

  • Should/Can we save Bind state in metadata? (API: set_cell_metadata/get_cell_metadata, send an CustomEvent("input", get_cell_metadata[:bindsomething]))

  • T shirts please!

panagiotis = md"""
- Machine Status UI
- CPU
- MEM
- Time left in JuliaHub
- Time left outside of JuliaHub (Battery)
- Should/Can we save Bind state in metadata? (API: `set_cell_metadata`/`get_cell_metadata`, send an `CustomEvent`(`"input"`, `get_cell_metadata`[`:bindsomething`]))
- T shirts please!


"""
👀 Reading hidden code
41.3 ms

👀 Reading hidden code
77.3 μs

👀 Reading hidden code
78.3 μs

👀 Reading hidden code
77.9 μs
2022-05-02
today = try
join(splitpath(pwd())[end-1:end],"-") |> Date
catch
Dates.now() |> Date
end
👀 Reading hidden code
596 ms
using MarkdownLiteral: @mdx
👀 Reading hidden code
81.6 ms
using PlutoUI, MarkdownLiteral, Dates
👀 Reading hidden code
165 ms