-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Moor Book, v0.1 #378
base: main
Are you sure you want to change the base?
The Moor Book, v0.1 #378
Conversation
bc17509
to
5523a9e
Compare
The implementation is heavily dependent on highlightjs. There are noises about mdbook replacing highlightjs with something different; if/when that happens, this will need to be ported.
Removed the old ToastStunt forward. Wrote my own.
First draft here. Replace references to Toast with mooR. Tones down "virtual reality" talk a bit. Explanatory note about mooR vs LambdaMOO.
Also removes some Toast-specific entries, adds context text, and shuffles location in the SUMMARY.md
* Remove WAIFs, bools, and anonymous objects (bools may come back) * Add flyweights * Update notes about maps since mooR maps are slightly different * Update notes about maximum integers and floats.
It would be nice to also have some information about running moor in a guide like this too, server administration of it requires a little know-how :( Attaching to moor-daemon, moor-telnet-host, moor-web-host |
@anubi server admin will definitely be a part of it. unfortunately this is a huge project, writing the documentation. For your specific problem, it'd be easier to diagnose with more info if you want to join the Discord https://discord.gg/f5NnYJBfcG -- I don't see anything unusual in the logs, so I dunno what happened there. |
book/src/foreword.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
book/src/introduction.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Portions adapted from the [Stunt Programmers Manual](https://lisdude.com/moo/ProgrammersManual.html) by Todd Sundsted Copyright © 2011, 2012, 2013, 2014 by Todd Sundsted. | ||
|
||
Portions adapted from the [WAIF documentation](http://ben.com/MOO/waif.html) and [WAIF Programmers Manual](http://ben.com/MOO/waif-progman.html) by Ben Jackson. | ||
Copyright @ 2025 by [Ryan Daum](http://github.com/rdaum) and [Zoltán Nagy](https://github.com/abesto) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aww
|
||
## Real Number Type | ||
> Note: Many databases define the values $maxint and $minint. Core databases built for LambdaMOO or ToastStunt may not have values set which correspond to the correct (64-bit signed integer) maximum / minimum values for `mooR`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add something like:
In general, the integer range supported by mooR
tends to be at least as large as the integer range supported by other servers (definitely true for LambdaMOO and ToastStunt), so this shouldn't lead to any errors.
|
||
We will go into more detail on Anonymous Objects in the [Working with Anonymous Objects](#working-with-anonymous-objects) section. | ||
mooR adds a new type called flyweights which are lightweight, garbage collected bundles of a delegate object, attributes ("slots") and arbitrary contents, and so combine features of objects, lists, and maps. Verb calls against flyweights dispatch against the delegate, and property lookups work gainst both the delegate and the flyweight's own set of slots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/gainst/against/
|
||
You create and destroy OBJs explicitly with the builtins create() and recycle() (or allocate them from a pool using verbs in the core). They stay around no matter what you do until you destroy them. | ||
flyweights are useful for representing large quantities of small, lightweight things (like a maze or a large quantity of small items). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize f
?
|
||
All of the other types you use in MOO (that require allocated memory) are reference counted. However you create them, they stay around as long as you keep them in a property or a variable somewhere, and when they are no longer used, they silently disappear, and you can't get them back. | ||
In particular, they have been especially structured to be able to mimic tree structured data like an HTML or XML document. There are builtins (`to_xml` and `xml_parse`) for converting properly structured flyweights to/from such documents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My brain snagged on the first sentence. Here's an attempt to un-snag it:
The syntax is specifically designed to easily express tree structured data like an HTML or XML document.
|
||
OBJs grow by value_bytes(value) - value_bytes(0) for every property you set (that is, every property which becomes non-clear and takes on its own value distinct from the parent). LISTs and WAIFs both grow by value_bytes(value) for each new list element (in a LIST) or each property you set (in a WAIF). So a WAIF is never more than 4 bytes larger than a LIST which holds the same values, except WAIFs give each value a name (property name) but LISTs only give them numbers. | ||
``` | ||
< $div_tag, [ class -> "background_div" ], { child_node_a, child_node_b } > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll need to extend the highlight.js
syntax highlighter for this block to look good :D
|
||
The value of a map can be any valid MOO type including another map. | ||
> Note: mooR maps are built internally on a sorted vector, and searching within them is a BigO(Log(N)) operation. As they are immutable, and a copy must be made for modification, insertions and deletions are an BigO(n) operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, that's surprising.
Tl;dr: https://abesto.github.io/moor/the-moo-programming-language/built-in-functions/manipulating-moo-values.html#function-tostr
mdBook
(book/gen-from-stunt
)mdBook
)book/theme/moo-syntax-highlight.js
)main
This should be all that's needed to allow work to start on the content for real.
N.B.: the Legal and Foreword sections need to be updated ASAP.
!!! Required repo setup !!!
For the workflow to work, the GitHub Pages settings of the repo need to be flipped from "Deploy from a branch" to "GitHub Actions" under Settings -> Pages.
References
mdBook
: https://rust-lang.github.io/mdBook/highlight.js
docs 10.1.1 (very old, but this is what's used inmdBook
): https://github.com/highlightjs/highlight.js/tree/10.1.1/docsmdBook
automated deployment: https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions