summaryrefslogtreecommitdiffstats
path: root/2022/talks/asmblox.md
blob: b779c622f2d485a6e0234cd34845ee1eaffe61c8 (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
[[!sidebar content=""]]
[[!meta title="asm-blox: a game based on WebAssembly that no one asked for"]]
[[!meta copyright="Copyright © 2022 Zachary Romero"]]
[[!inline pages="internal(2022/info/asmblox-nav)" raw="yes"]]

<!-- Initially generated with emacsconf-generate-talk-page and then left alone for manual editing -->
<!-- You can manually edit this file to update the abstract, add links, etc. --->


# asm-blox: a game based on WebAssembly that no one asked for
Zachary Romero (<mailto:zacromero@posteo.net>)

[[!inline pages="internal(2022/info/asmblox-before)" raw="yes"]]

Over the past decade, programming games have risen in popularity and
become a genre unto themselves. They are loved for their open-endedness
and have helped people get into programming as well as help programmers
hone their problem-solving skills. As a fan of the genre, I decided I
wanted to recreate such an experience in Emacs. Looking at the already
existing collection of games, TIS-100 by Zachtronics stood out as an
especially good candidate for the base of a game, where the user is
entering assembly code into a terminal to solve puzzles. The game
asm-blox switches things around and instead of programming register
machines, you program mini stack machines in a language similar to the
WebAssembly text format.

I'm still wondering if the game is actually any fun or not but either
way it was an interesting project to make. In this talk, I'll demo the
game as well as go over some of the Emacs Lisp tricks I used to make it
work.

The source code can be found at <https://github.com/zkry/asm-blox>


# Discussion

## Questions and answers

-   Q: Why did you choose an internal state versus many`state
    buffers`? (ie. actual windows)  Thanks!
    -   A: A single internal state is easier to deal with in the context
        of the game. Windows would obviously be better for other normal
        applications to allow users to customize how they should behave.
-   Q:Do you have plans to port shenzhen io to emacs?
    -   A:That would be cool, was also thinking about exopunks.
-   Q:Did this use wasm ? We call some wasm code from Emacs?
    -   A:No, more similar to TIS-100, just a game.
-   Q: Why wasm rather than a more traditional Assembly dialect? It
    wouldn't be harder to implement, right?
    -   A: It would have been easier, but less of a challenge and
        resemble TIS-100 too much.
-   Q:Any next projects on your mind?
    -   A: Yes, a couple, hopefully more useful. I think tree-sitter is
        cool. There's a neovim plugin called neogen that generates
        documentation. Hopefully next year I'll be presenting something
        more useful.
-   Q: Does this work with any other paren-based editing packages?
    -   A: Not at all (etc. tbd)
-   Q: What kind of tool could use this idea? 
    -   A: So I think some sort of graph drawing tool in Emacs might
        have a similar idea. Like artist-mode but with graph drawing
        constructs.
-   Q:  How did you go about designing the puzzles?
    -   A: With open-ended puzzles like this, coming up with random
        ideas that seem like they should be implementable usually works.
        If  you've seen some of Zachtronics games, the bar is extremely
        high for what is capable.
-   Q: What' are your favorite changes  in the upcoming emacs 29?
    -   A: Definitely tree sitter. I've played around with it and it
        provides a nice interface for extracting syntax information.
        Like I can probably rewrite this plugin without any crazy
        regexs: <https://github.com/zkry/go-ttest.el>
-   Q: Are there tools to add more puzzles?
    -   A: So the game code itself has a asm-blox-puzzles.el file which
        defines each puzlze. It's pretty easy to add new puzzles but it
        involves digging into the code.
-   QLike a binding to graphviz? (assume this is a continuation of the
    "what kind of tool" question)
    -   A: I was thinking more ASCII, like a tool I saw called diagon.
        Like artist mode but for graphs. But graphviz is amazing and a
        lot could be done with that.

           the diagon tool: <https://arthursonzogni.com/Diagon/#Math>

[[!inline pages="internal(2022/info/asmblox-after)" raw="yes"]]

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

[[!taglink CategoryFun]]