summaryrefslogtreecommitdiffstats
path: root/2021/talks/exec.md
blob: b25defb091b7e9d4181ea1f068fc09f5d66b03e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[[!meta title="Org as an executable format"]]
[[!meta copyright="Copyright © 2021 Tom Gillespie"]]
[[!inline pages="internal(2021/info/exec-nav)" raw="yes"]]

<!-- You can manually edit this file to update the abstract, add links, etc. --->


# Org as an executable format
Tom Gillespie



[[!inline pages="internal(2021/info/exec-schedule)" raw="yes"]]

Org mode is known for its flexibility, power, and staggeringly diverse
number of workflows, users, and use cases.

This talk explores just how far we can push the boundaries of the sane
and sensible with regard to Org workflows.

In particular it will discuss shebang blocks, and elvs: two parts of a
complete system for creating executable Org files.

Org syntax does not support shebang lines. However, it turns out that
Org syntax enables something even better &#x2014; shebang blocks.

Org is also (supposedly) not an executable file format.  However, by
combining a shebang block with a Org babel source block, and eval
local variables (elvs) Org becomes a multi-language executable format.

In this talk we introduce shebang blocks and elvs as a two part system
that transforms Org files into executable documents that can run on any
recent version of Emacs.

These ideas are implemented in
<https://github.com/tgbugs/orgstrap/blob/master/README.org> and
<https://github.com/tgbugs/orgstrap/blob/master/shebang.org>, and
orgstrap.el is available as a package on MELPA and can be installed
via M-x install-package orgstrap.

The talk will open with a demo of how to create an executable Org file
using the orgstrap machinery.

We then discuss security considerations, and show example use cases.

Finally the talk will cover the details and development of the
portable shebang block for Org mode that works on a wide variety of
systems and shells, and on the development of a formal specification
and a reference implementation for using Org source blocks to
transform Org files from plain text documents with a bit of markup
into self describing computational documents, or interactive
applications.

# Discussion

IRC nick: tgbugs

- what prompted you to create orgstrap?
- Tom Gillespie: <https://github.com/tgbugs/orgstrap/blob/master/README.org#background-file-local-variables-and-checksums>
- yeah, usually this kind of stuff starts out as a minor annoyance
- is there a way to choose which blocks are going to be executed?
- What are some practical specific use cases that you had in mind?
- Tom Gillespie: <https://github.com/SciCrunch/sparc-curation/blob/master/docs/sckan/welcome.org>
- Tom Gillespie: <https://github.com/tgbugs/orgstrap/blob/master/README.org#use-cases>
- i'll for sure incorporate it in my company and research, so both corporate and academic environments will benefit from your work. i already use Org for documenting a lot of stuff so its just a natural next step
- I have experimented with dblocks in an org-mode buffer to do the equivalent of javascript in a browser. Does that make sense?

From IRC: 

- This is supercool !!
- That is absolutely wild
- is the hash not just security theater? 
  - tgbugs: you need it to enable non-theater workflows 
    - anyone who could write the org-file could update the hash as well, no?
- I don't understand why he needs to talk about powershell, more than the other shell. :( 
  - tgbugs: very late response, but the reason I talked about powershell more than the others is because it is the most different and required some explainiation, I also was :/ about that
    - that sounds that is a good reason to not include it xD . you can add fish in the talk and it will be bettter.

# Outline

-   5-10 minutes:

A demo of adding the orgstrap block and elvs,
adding a shebang block, and then running an org file.

<!--
-   20 minutes:

Same as above, followed by a walkthrough of the approach orgstrap
takes for preventing arbitrary code execution, followed by some
examples uses of orgstrap.

-   40 minutes:

Depending on flow/interest, security overview and the examples
bits could be swapped and overflow beyond 20 mins, followed by
a deeper dive into the internals, and a discussion about interest
in incorporating such functionality into org-mode directly.

-->
[[!inline pages="internal(2021/captions/exec)" raw="yes"]]

[[!inline pages="internal(2021/info/exec-nav)" raw="yes"]]