mirror of
https://github.com/swarm-game/swarm.git
synced 2024-10-27 10:04:12 +03:00
b62d27e566
The basic idea of this change is to create a new `robot` type and use it to identify robots instead of `string` names. Internally, a `robot` value is just a (unique) `Int`. Closes #212 . This ended up turning into a sort of constellation of related changes. - Add the `robot` type and change the type of various built-in functions which used to take a robot name so they now take a `robot` (`give`, `install`, `reprogram`, `view`, `upload`) and change `build` so it returns a `robot`. - All internal data structures that store robots are now keyed by a unique (`Int`) robot ID rather than by name. - Add a `setname` command for setting a robot's display name (which no longer needs to uniquely identify a robot). - Import a big list of words which we can use to randomly pick names for robots, just for fun. This is why the diff says "+31,050 -265"; I did not write 31 thousand lines of code. - Add constants `base`, `parent`, and `self` for getting a `robot` value referring to the base, one's parent, and one's self, respectively. - Top-level binders like `r <- build {move}` now export a variable binding which can be used in later expressions entered at the REPL; additionally, unlike Haskell, a binder can now appear as the last statement in a block. - Fix the pretty-printer for `Value` by doubling down on our current strategy of injecting `Value`s back into `Term`s and then pretty-printing the result. I am now convinced this is the Right Way (tm) to do this; it only required adding a couple additional kinds of `Term` which represent internal results of evaluation and cannot show up in the surface language (`TRef`, `TRobot`). - Update the tutorial. - While updating the tutorial, I noticed that #294 had introduced a bug, where the inventory display no longer updated when 0 copies of an entity are added to the inventory (as with `scan` + `upload`), so I fixed that by changing the way inventory hashes are computed. I tried running the benchmarks both before & after this change. I was hoping that it might speed things up to be using `IntMap` and `IntSet` instead of looking things up by `Text` keys in a `Map` all the time. However, if I'm interpreting the results correctly, it seems like it didn't really make all that much difference, at least for the particular benchmarks we have.
239 lines
1.9 KiB
Plaintext
239 lines
1.9 KiB
Plaintext
# Adapted from https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go
|
|
agnesi
|
|
albattani
|
|
allen
|
|
almeida
|
|
antonelli
|
|
archimedes
|
|
ardinghelli
|
|
aryabhata
|
|
austin
|
|
babbage
|
|
banach
|
|
banzai
|
|
bardeen
|
|
bartik
|
|
bassi
|
|
beaver
|
|
bell
|
|
benz
|
|
bhabha
|
|
bhaskara
|
|
black
|
|
blackburn
|
|
blackwell
|
|
bohr
|
|
booth
|
|
borg
|
|
bose
|
|
bouman
|
|
boyd
|
|
brahmagupta
|
|
brattain
|
|
brown
|
|
buck
|
|
burnell
|
|
cannon
|
|
carson
|
|
cartwright
|
|
carver
|
|
cerf
|
|
chandrasekhar
|
|
chaplygin
|
|
chatelet
|
|
chatterjee
|
|
chaum
|
|
chebyshev
|
|
clarke
|
|
cohen
|
|
colden
|
|
cori
|
|
cray
|
|
curran
|
|
curie
|
|
darwin
|
|
davinci
|
|
dewdney
|
|
dhawan
|
|
diffie
|
|
dijkstra
|
|
dirac
|
|
driscoll
|
|
dubinsky
|
|
easley
|
|
edison
|
|
einstein
|
|
elbakyan
|
|
elgamal
|
|
elion
|
|
ellis
|
|
engelbart
|
|
euclid
|
|
euler
|
|
faraday
|
|
feistel
|
|
fermat
|
|
fermi
|
|
feynman
|
|
franklin
|
|
gagarin
|
|
galileo
|
|
galois
|
|
ganguly
|
|
gates
|
|
gauss
|
|
germain
|
|
goldberg
|
|
goldstine
|
|
goldwasser
|
|
golick
|
|
goodall
|
|
gould
|
|
greider
|
|
grothendieck
|
|
haibt
|
|
hamilton
|
|
haslett
|
|
hawking
|
|
hellman
|
|
heisenberg
|
|
hermann
|
|
herschel
|
|
hertz
|
|
heyrovsky
|
|
hodgkin
|
|
hofstadter
|
|
hoover
|
|
hopper
|
|
hugle
|
|
hypatia
|
|
ishizaka
|
|
jackson
|
|
jang
|
|
jemison
|
|
jennings
|
|
jepsen
|
|
johnson
|
|
joliot
|
|
jones
|
|
kalam
|
|
kapitsa
|
|
kare
|
|
keldysh
|
|
keller
|
|
kepler
|
|
khayyam
|
|
khorana
|
|
kilby
|
|
kirch
|
|
knuth
|
|
kowalevski
|
|
lalande
|
|
lamarr
|
|
lamport
|
|
leakey
|
|
leavitt
|
|
lederberg
|
|
lehmann
|
|
lewin
|
|
lichterman
|
|
liskov
|
|
lovelace
|
|
lumiere
|
|
mahavira
|
|
margulis
|
|
matsumoto
|
|
maxwell
|
|
mayer
|
|
mccarthy
|
|
mcclintock
|
|
mclaren
|
|
mclean
|
|
mcnulty
|
|
mendel
|
|
mendeleev
|
|
meitner
|
|
meninsky
|
|
merkle
|
|
mestorf
|
|
mirzakhani
|
|
montalcini
|
|
moore
|
|
morse
|
|
murdock
|
|
moser
|
|
napier
|
|
nash
|
|
neumann
|
|
newton
|
|
nightingale
|
|
nobel
|
|
noether
|
|
northcutt
|
|
noyce
|
|
panini
|
|
pare
|
|
pascal
|
|
pasteur
|
|
payne
|
|
perlman
|
|
pike
|
|
poincare
|
|
poitras
|
|
proskuriakova
|
|
ptolemy
|
|
raman
|
|
ramanujan
|
|
ride
|
|
ritchie
|
|
rhodes
|
|
robinson
|
|
roentgen
|
|
rosalind
|
|
rubin
|
|
saha
|
|
sammet
|
|
sanderson
|
|
satoshi
|
|
shamir
|
|
shannon
|
|
shaw
|
|
shirley
|
|
shockley
|
|
shtern
|
|
sinoussi
|
|
snyder
|
|
solomon
|
|
spence
|
|
stonebraker
|
|
sutherland
|
|
swanson
|
|
swartz
|
|
swirles
|
|
taussig
|
|
tereshkova
|
|
tesla
|
|
tharp
|
|
thompson
|
|
torvalds
|
|
tu
|
|
turing
|
|
varahamihira
|
|
vaughan
|
|
villani
|
|
visvesvaraya
|
|
volhard
|
|
wescoff
|
|
wilbur
|
|
wiles
|
|
williams
|
|
williamson
|
|
wilson
|
|
wing
|
|
wozniak
|
|
wright
|
|
wu
|
|
yalow
|
|
yonath
|
|
zhukovsky
|