Conversation
| [Discord](https://discord.gg/bwY4TRB8J7), writing | ||
| [blog](https://trynova.dev/blog/) and | ||
| [Bluesky](https://bsky.app/profile/trynova.dev) posts, | ||
| [doing talks](https://trynova.dev/talks) and of course code reviews. |
There was a problem hiding this comment.
thought: We should add the JSConf.jp talk link.
| talks. But getting into Nova is no small task, even though we wish it was. | ||
| Adding the simplest of builtin functions requires learning about the ECMAScript | ||
| standard, a bit of data-oriented design and last but certainly not least: | ||
| Wrangling our garbage collector. |
There was a problem hiding this comment.
nitpick: Semicolon does not capitalise the next word :)
| being difficult is not something we're unaware of. In fact, we are actively | ||
| working on making the experience of using the garbage collector better in | ||
| multiple ways[^1]. When getting started with contributing to Nova, one might | ||
| want to contribute something simple, for example a that JavaScript builtin you |
There was a problem hiding this comment.
issue: "a that JavaScript builtin"
| found in a mysterious Markdown file in the main repository, probably a few of | ||
| our blog posts, probably a talk or two and of course a heaping lot of code. You | ||
| might start researching a bunch of other prerequisites which we mention like you | ||
| already know them, what the hell is even a "mark-and-sweep" garbage collector? |
There was a problem hiding this comment.
nitpick: "is even" => "even is"
| ## Being lazy | ||
|
|
||
| Alright, so how did we do this? About a year ago I stumbled upon | ||
| [Dylint](https://github.com/trailofbits/dylint) which is basically standalone |
There was a problem hiding this comment.
thought: Maybe "basically a standalone clippy"?
| well to Dylint lints, a big help when getting started. Additionally the Clippy | ||
| project provides a [utils](https://crates.io/crates/clippy_utils) crate which | ||
| has a lot of useful helpers for writing lints. Our first lint will be a simple | ||
| lint checking that the ordering of parameters is correct and consistent |
There was a problem hiding this comment.
nitpick: "ordering of parameters" => "order of parameters".
| has a lot of useful helpers for writing lints. Our first lint will be a simple | ||
| lint checking that the ordering of parameters is correct and consistent | ||
| throughout the codebase, importantly we want the `Agent` to come first in the | ||
| parameter list and `GcScope` or `NoGcScope` to come last. In the case of the |
There was a problem hiding this comment.
suggestion: Maybe something like "For the GcScopes this is actually load-bearing..."? I didn't realise "garbage collection scopes" referred to GcScope and NoGcScope initially.
| call(agent, gc.reborrow(), data.unbind()); | ||
| ``` | ||
|
|
||
| This case wouldn't work because `gc.reborrow()` invalidates `data` immediately, |
There was a problem hiding this comment.
suggestion: "This code wouldn't compile".
| meaning that when `data.unbind()` is being called the `data` is already | ||
| invalidated and illegal to use, leading to a borrow checker error. | ||
|
|
||
| To define a lint which catches badly formed function definitions we start by |
There was a problem hiding this comment.
suggestion: "we start by writing some boilerplate"
| reviews will be less about pointing out these common issues and nitpicks | ||
| allowing us to rather focus on the more fun parts instead. Not unlike a robot | ||
| vacuum our lints hopefully help us and you to keep your codebase clean and | ||
| avoiding stupid avoidable mistakes. But keep in mind that just like a robot |
There was a problem hiding this comment.
though: I wouldn't personally call them stupid mistakes, maybe "simple mistakes" rather? But that's a matter of authorial preference :)
No description provided.