Blog post highlighting cool features in the newest release.
Also fix the version number in the .cabal file from 0.4 to 0.4.0.0. It's too late for the release (it always reports there is a new version available since 0.4.0.0 does not match 0.4) but oh well.
Some terminals (*e.g.* `gnome-terminal`) use the character to decide
how dark or light the color should be, rather than showing the
character itself (like *e.g.* `rxvt-unicode`). Light Shade looks OK
in terminals that display the actual character, but too dark in
terminals that use it as a brightness hint. Medium Shade seems to
look good (at least, IMO) in both.
See https://github.com/swarm-game/swarm/issues/196#issuecomment-1147298159 .
Fixes#385 . Note, we will need to update `TUTORIAL.md` since this changes what world 0 looks like, but I wanted to get some feedback before launching into updating that.
Lots of refining, adding more menu options, etc. that still needs to happen, but this adds a basic menu. Quitting a game now quits to the menu rather than quitting the entire application.
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.
- adds `editors` directory
- migrates [xsebek/swarm-vscode](https://github.com/xsebek/swarm-vscode) repo to `editors/`
- updates the highlighting (drill, sum types,...)
- adds some notes how to test and build the extension
- part of #100
- closes#123
Make explicit in the type system when evaluation of a computation should be delayed. This gives the user fine-grained control over selective laziness (for example, once we have sum types and recursive types, one could use this to define lazy infinite data structures). It also allows us to guarantee that certain commands such as `build` and `reprogram` delay evaluation of their arguments, and lets the user e.g. define their own modified versions of `build` without compromising those guarantees.
- Delay is indicated by curly braces both at the value and type levels, that is, if `t : ty` then `{t} : {ty}`.
- `force : {ty} -> ty` is now exposed in the surface language.
- Change from a CEK machine to a CESK machine. Recursive `let` and `def` delay via allocating a cell in the store. For now, there is no other way to allocate anything in the store, but see discussion at #150 for some possible future directions.
- change the types of `build` and `reprogram` to require a delayed program, e.g. `build : string -> {cmd a} -> cmd string`
- `if` and `try` also require delayed arguments.
- don't elaborate Build and Reprogram with extra Delay wrappers since one is now required by the type
- Division by zero, negative exponents, and bad comparisons now throw exceptions.
Closes#150. Closes#226.
The original main goals of this PR are to (1) solve #36 , that is, make the bottom-left info area fully wrapped and scrollable; and (2) solve #40 , that is, persist the info in that bottom-left info area even when switching to other panels. In order to address those I ended up making a rather large constellation of related changes, which in the end I hope work well with each other. Eager to hear others' feedback either from looking at the code or just trying out the game with this PR.
- In order to make the bottom-left area scrollable, split it out into its own panel. Now we can focus it and then use normal keybindings to scroll it.
- The bottom-left info panel now indicates whether it has additional content scrolled off the top or bottom.
- The bottom-left panel used to display a global list of log/error messages when the inventory was not focused. So where will those messages be viewable now, if the information displayed in the bottom-left panel persists? My answer: there is a special `logger` device (#39) which, when focused, now displays the log messages.
- This means that logs are now per-robot instead of global.
- The base starts with a `logger` installed.
- A `log` command can be used to write to a logger.
- Uncaught exceptions also now write to a logger (instead of using `say`), or are simply discarded if there is no `logger` device installed.
- The first time a robot's inventory is viewed after a message has been appended to its log, the `logger` device will be automatically focused and the log scrolled all the way to the bottom to show the new entry. This means that e.g. typing `move` at the REPL will immediately show an exception in the lower left.
- Add a `salvage` command, making it possible to access the log of a dead robot after the fact, once we implement #17 .
There are still a few issues to address which I think can be done in separate PRs:
- The global message log still exists, and the `say` command still appends to it, but there is no way to view it. Obviously we need to do something with this --- either get rid of it, or figure out a sensible way to view it, etc.
- Exception messages should probably be reformatted to not include any newlines, now that we know they will be wrapped.
Closes#36. Closes#40. Closes#39. Closes#21.
- adds CLI option `--seed` and propagates it to `testWorld2` (Closes#14)
- moves the base in the tree shade (Closes#90)
- makes the `random` command depend on initial seed (Closes#13)
Draw nicely formatted recipes using ASCII art, showing inputs on the left, outputs on the right, and any other required entities at the top, and with the focused entity highlighted in one color, and missing or insufficient ingredients highlighted in a different color. Thanks to Mark Goadrich for the idea!
Closes#122 .
Closes#96.
- Delete the `rangefinder` entity.
- A `scanner` now provides the capability to execute `blocked`.
- Add a new direction, `down`, to be used for scanning the current
cell (i.e. `scan down`). Can also be used with `drill` in the future.
- `scan` and `upload` commands work as described in #96.
This PR does not implement showing things as question marks, that can
be decided and implemented separately.