Commit graph

176 commits

Author SHA1 Message Date
Ruud van Asseldonk
c51b77a59e Add 'rcl re' and 'rcl rq' shorthands for -fraw
This is somewhat common, especially when used as jq replacement, so
let's add a shorthand for them.
2024-08-23 22:14:41 +02:00
Ruud van Asseldonk
82cf536c6f Add documentation about the grammars and testing 2024-08-02 23:12:18 +02:00
Ruud van Asseldonk
9105bb9f17 Add Tree-sitter highlights for Zed
Documentation is quite absent for Zed, but that is not stopping people
from developing extensions apparently.
2024-08-02 21:33:05 +02:00
Ruud van Asseldonk
2d5cd372dc Begin collecting meanings of the name "RCL"
I just encountered "Reduce Cognitive Load" in a comment on Hacker News
and it fits the acronym very well, I'm going to keep a list of possible
meanings of the name "RCL".
2024-07-31 22:09:23 +02:00
Ruud van Asseldonk
1389f7c7a5 Mention if-else syntax change in the changelog 2024-07-31 21:46:23 +02:00
Ruud van Asseldonk
414b9c5051 Update docs to use new if-else syntax 2024-07-31 21:46:23 +02:00
Ruud van Asseldonk
28d920e4ac Bump version to 0.5.0 2024-07-28 21:43:29 +02:00
Ruud van Asseldonk
d096139541 Improve the Ninja documentation
Previously we named the file "build.rcl", but now that that is the
default name for "rcl build", let's name the Ninja meta build file
"ninja.rcl". Also, clarify that Make is able to use the depfiles too,
just in a way that I personally try to stay far away from.
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
e7f6f21700 Document new "rcl build" command in changelog 2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
12ffe62cf4 Address a few minor issues in the new build code
Caught in self-review, and I don't feel like turning them into fixups
for all of the commits that introduced these.
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
7c8382ab3d Update Ninja docs chapter to match "rcl build" 2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
31f7c07176 Write docs chapter about "rcl build" usage
This is somewhat of an alternative to the Ninja chapter, I still need to
update that one.
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
0831fda447 Add --dry-run option to "rcl build"
As expected, the golden tests fail to run under Nix because the test
directory is not writable. And it's better to not write in my opinion,
let's not hack that and have a dry run output mode.

For now the output format is not structured, this is good enough for the
thests. It could be nice to do structured output in RCL format, but we
can do that later if needed.
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
db69504ccf Allow banner in build config to be null
I don't like this distinction that in the build file, we don't
implicitly add a newline, but on the command line we do. But making
users specify a trailing newline on the command line is annoying. So
then the RCL build spec will have to match the CLI, and append the
newline. But then empty string cannot be the default, so let's accept
null too.
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
56a0737349 Remove default value for 'format' in build
There is no good default value, and there is no reason this should have
a default, if you generate files, you are expecting some particular
format!
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
2ac766a101 Extend 'rcl build' docs a bit 2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
8e0465c73c Elaborate a bit in "rcl build" docs 2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
85cba66c7d Add docs for new 'rcl build' subcommand
Readme-driven development here, the command doesn't exist yet!
2024-07-27 23:03:05 +02:00
Ruud van Asseldonk
38cc285d65 Add and fix links in the documentation index 2024-07-22 23:36:01 +02:00
Ruud van Asseldonk
5406c936ea Link to RCL blog post series from type system docs 2024-07-22 23:00:24 +02:00
Ruud van Asseldonk
5f3b4efb2f Explain utility in the changelog
The previous one was technically correct, but less helpful to users.
2024-07-21 13:42:56 +02:00
Ruud van Asseldonk
a6039618ce Address to do in 'rcl highlight' documentation
The html color mode has been implemented in v0.4.0!
2024-07-13 14:23:14 +02:00
Ruud van Asseldonk
4aaab52879 Add CLI option to specify --banner in output
For the 'build' subcommand, I am adding a banner setting, so for
consistency, let's have it for all evaluation commands.
2024-07-13 12:57:34 +02:00
Ruud van Asseldonk
2967267622 Bump version to 0.4.0 2024-07-13 10:37:59 +02:00
Ruud van Asseldonk
86686eb32c Document the new List.sum and Set.sum methods 2024-07-12 23:55:02 +02:00
Ruud van Asseldonk
41c094880a Document List.flat_map and Set.flat_map
And apply a few drive-by fixes and improvements to the docs.
2024-07-12 22:30:40 +02:00
Ruud van Asseldonk
ed72fd8939 Document new map and filter methods in changelog 2024-07-11 22:34:14 +02:00
Ruud van Asseldonk
c28052703e Document List.filter and Set.filter 2024-07-11 22:25:49 +02:00
Ruud van Asseldonk
8e16101d02 Document Set.map 2024-07-11 20:06:38 +02:00
Ruud van Asseldonk
b4bff52cc4 Document List.map 2024-07-11 19:53:00 +02:00
Ruud van Asseldonk
f6bf7ae7e9 Document some of the fuzz properties in the docs 2024-07-03 20:03:36 +02:00
Ruud van Asseldonk
250a59fc9e Add an html output mode
So I can highlight stuff on my blog as long as there is no highlighting
in Pandoc/Skylighting. With the change to MarkupString, this was really
easy to do!
2024-06-23 20:51:08 +02:00
Ruud van Asseldonk
0993b3199c Bump version to 0.3.0 2024-06-23 11:08:49 +02:00
Ruud van Asseldonk
165f071a18 Write changelog for v0.3.0 2024-06-23 11:08:43 +02:00
Ruud van Asseldonk
f57572a945 Link to website from docs 2024-06-23 10:26:38 +02:00
Ruud van Asseldonk
45b545562b Stylize RCL consistently in small caps in docs
The diff here is best viewed with --word-diff.
2024-06-20 22:36:50 +02:00
Ruud van Asseldonk
3b44c48876 Clarify what null means in RCL 2024-06-20 22:35:35 +02:00
Ruud van Asseldonk
84523fd33c Save body span info in the loader
This fixes a longstanding issue where reporting errors that we have to
blame on just the document's result in general got blamed on its full
span, which is often a comment and not the offending value. Now we blame
it on the inner body expression, which is more natural.
2024-06-18 20:22:33 +02:00
Ruud van Asseldonk
a070021547 Make a trailing comma always force tall
At first I thought, “but a single-element collection should always fit,
right?” And sure it fits, but then I reformatted a larger experimental
config I have, including some GitHub Actions, and it turns out that
sometimes I prefer even single-element litst to be tall. Black is right
about this. I should be less opinionated, leave it to the user.
2024-06-18 19:23:40 +02:00
Ruud van Asseldonk
830fa48598 Update changelog for wider changes
I changed the syntax of for loops too, not just collections. Assertions
remain untouched though!
2024-06-17 00:00:39 +02:00
Ruud van Asseldonk
43fd48d106 Restrict what expressions can be conditions
The fuzzer now discovered a non-idempotency in the formatter, in case
there is a non-code prefix for the condition. This has something to do
with the space between "if" and the condition, there is no separator
there, whatever follows goes on the same line, which is usually not the
case.

For evaluation everything works fine, but how do you format this? We can
try to repair it, but it's hard. A solution that sidesteps all this is
to restrict what kind of expressions we can have after an if. Just don't
allow statements and ifs there. We don't lose any expressivity, if you
want that it still works, just put parens around it. With parens it is
also possible to format the expression properly, e.g.

if (
  // Comments are fine, everything is indented here, etc.
  condition
):
  then_value
else
  else_value

Oh, and unrelated, I think I am convinced that I want the colon after
"else" back. But let's do that in a follow-up. Or maybe it can be
optional but the formatter always puts it there?

The implementation of this forces propagating spans in more places,
which ended up being a drive-by fix for one place where spans were
computed incorrectly. This fix shows up in the golden tests.
2024-06-16 22:49:36 +02:00
Ruud van Asseldonk
39da4259c2 Document formatter improvements in changelog 2024-06-15 21:55:38 +02:00
Ruud van Asseldonk
a2b1257603 Document the magic trailing comma for formatting 2024-06-15 21:55:38 +02:00
Ruud van Asseldonk
d007eaf6d2 Document the new "rcl format" options properly 2024-06-15 18:55:26 +02:00
Ruud van Asseldonk
50650f1b97 Document --in-place in the changelog 2024-06-15 15:05:26 +02:00
Ruud van Asseldonk
0add600279 Rename main fuzzer to "fuzz_source"
So now I have the two primary ones, "fuzz_source" and "fuzz_smith". Now
I just need to make something to feed the outputs of the smith into the
fuzz_source corpus.
2024-04-27 14:11:03 +02:00
Ruud van Asseldonk
8460a14f2e Rename all fuzzers to have fuzz_ prefix
I have this "smith" fuzzer now, but I also want to have a "smith" tool
to inspect the corpus, having two similar binaries is confusing, and
also having files with the same name is confusing in editors that don't
show the full path. So rename all fuzz binaries to start with fuzz_.
2024-04-22 23:56:26 +02:00
Ruud van Asseldonk
c1847ccfb5 Document union types 2024-04-22 21:38:18 +02:00
Ruud van Asseldonk
eb48d2ccd4 Add changelog for next version 2024-04-21 21:42:35 +02:00
Ruud van Asseldonk
20daf3e020 Remove Cargo installation instructions
Selecting the Rust version here is harder than it needs to be, it
creates confusing errors when it’s not installed, also fetching the Git
ref fails for some people, and I have to keep the version number up to
date ... better to just not have this, people should git clone + cargo
build.
2024-04-20 11:41:38 +02:00