Commit graph

211 commits

Author SHA1 Message Date
Ruud van Asseldonk
95a4d7728c Try to improve Collection docs
Still not really happy with this, but it's better I think.
2025-03-27 22:40:06 +01:00
Ruud van Asseldonk
840aa1b5aa Add some docs for the Collection type
I am not really happy with this, because the type is not really
something that end-users should use (although they can), it's more for
the typechecker internally. How to explain this nicely?
2025-03-15 22:22:49 +01:00
Ruud van Asseldonk
994df536df Delete builtins from highlight module
Let's not put too much effort in the highlight command, the fmt command
prints in color and should be preferred anyway.
2025-03-15 19:58:19 +01:00
Ruud van Asseldonk
59be133128 Bump version to 0.8.0
I'm leaving the Zed extension pointing to the older commit of the
Tree-sitter grammar, I'll update that after this version bump. It's
a bit awkward to do it this way around, but there are circular
dependencies that can't be avoided. Maybe with an attack on SHA1 it
can be done in theory, but let's not go there.
2025-03-02 21:15:33 +01:00
Ruud van Asseldonk
ab343e935c Finalize changelog for v0.8.0 2025-03-02 20:59:01 +01:00
Ruud van Asseldonk
f0e4cd13b5 Add Number.round method
At first I also wanted to support rounding to a negative number of
decimals (so rounding to a positive power of 10), but scope creep,
complications ... I don't need it, and we can always add that later.
2025-03-02 18:32:21 +01:00
Ruud van Asseldonk
60ce70e1a8 Overhaul the readme and docs index page 2025-02-27 22:29:13 +01:00
Ruud van Asseldonk
a3103a9bb1 Remove the json superset vaporware warnings
RCL is now truly -- for all practical purposes, yeah yeah pedantics
surrogate pairs and a file with 20 GiB of zeros are technically valid
json but let's talk about documents used in the real world -- a json
superset!

Also I think I should try to make the readme and index pages a bit more
attractive to people who discover this. I wrote them from my niche
perspective and I had a lot of background about what I was building, but
probably it needs to be explained more to new users.

Also improve a few other things, e.g. as a quick hack, add a
"Playground" link in the website header to make the feature more
discoverable. We can extract it into a separate page at a later stage.
2025-02-26 19:17:17 +01:00
Ruud van Asseldonk
7a36947dfb Clean up and clarify Number docs 2025-02-25 20:38:05 +01:00
Ruud van Asseldonk
163c143f43 Add more details about floats to the changelog 2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
9030ffd528 Store decimal point and exponent separately
This enables us treat numbers with an exponent losslessly. We don't
conflate the decimal point with the exponent in case they get in the
way of each other.

It also greatly simplifies the formatting. We can mechanically format
the representation now, without having to use heuristics for when to
switch to scientific notation. The catch is of course that the
heuristics will need to move elsewhere. We'll have to normalize the
numbers after arithmetic operations.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
25df5c8f3b Clarify the documentation for number types 2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
3b7720940e Replace Int with Number in the docs
This is part of updating the implementation to have a single number type.
I have to admit, doing this, I'm hesitant again. I would really like len
functions to return Int, or to clarify in the types that std.range
accepts only integers. But let's experiment, implement this, and get a
feel for it before I make a call.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
58073229f0 Document the Number type changes in the changelog
This documents the intended behavior, the implementation currently does
not match this.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
8cc1f263d8 Begin writing docs for the new Number type
I decided, after going through a few iterations of a blog post that
explains the trade-offs, to have only a single Number type, and to
remove Int. This is an invasive change, let's start with the docs
because those are somewhat easier.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
684efd8a9b Write and extend some docs on numbers
I thought I was close to having a finished design, but re-reading what
I wrote before ... there are still some loose ends, like the comparison
operator now behaving very unexpectedly. Maybe I should ban cross-value
comparisons after all, and move that to a different function?
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
85b7bb0df2 Explain more about why floats are hard design-wise 2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
c1dee506de Begin writing up design choices for numbers
I realized yesterday, the interaction between Int and Float creates a
rabbit hole of subtleties. I wrote down some thoughts on GitHub, but
important decisions like these are best kept under source control.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
f0f968da27 Add Set.sort method
It's not really needed, sets are currently implemented as BTreeSets, so
they are sorted anyway, you could also just use a list comprehension.
But I do want to change that in the future, and also symmetry with List
is nice, so let's add it.
2025-02-24 19:54:32 +01:00
Ruud van Asseldonk
6c0734148f Add List.sort_by and Set.sort_by methods
I realized today that I want this. In particular, the API of my music
player Musium returns albums with a numeric playcount and discovery
score, and I want to sort on that. Finally that is possible now that I
am adding support for floats. But I need a way to sort on one field of
a dict! Arguably this is more important than the bare sort itself.

While I do this for lists, we can do the same for sets.
2025-02-24 19:44:04 +01:00
Ruud van Asseldonk
0e722b155c Make default help text briefer
Inspired by Cue, the `cue` commands without arguments prints somewhat
useful basic usage. I suppose `git` does so too. RCL used to print the
full reference help, which ends in the details for the color mode, which
is useful to have somewhere, but not that helpful as the first thing you
see when you run `rcl` (because the rest is too far up in your window).
So print the brief help if you run `rcl` without commands, and the full
help when requested with --help.

Document help text change in the changelog as well.
2025-02-12 22:39:09 +01:00
Ruud van Asseldonk
9dc5092279 Bump version to 0.7.0 2024-12-31 13:34:37 +01:00
Ruud van Asseldonk
3bddfac746 Add warning about comparisons being unstable
I've been thinking about floats again lately, and one of the options
I'm considering is to make it an error to compare values of different
types.
2024-12-31 13:26:41 +01:00
Ruud van Asseldonk
1ffa18e602 Make 'rcl highlight' respect --color
This behavior was lost in the transition to the new doc-based output
coloring. Thanks Sergey for reporting this bug!
2024-12-31 13:24:22 +01:00
Ruud van Asseldonk
664e02dc38 Add --check mode to 'rcl build'
Mostly so that I can use it on CI to check that I didn't forget to
commit the generated files.
2024-12-08 15:24:28 +01:00
Ruud van Asseldonk
37a682e6b4 Lift Int restriction on comparison operators
In a real-world use case, I had dates as ISO-8601 strings, and I wanted
to filter any entries after a given date, but the comparison operators
were not allowed on strings. Lift that restriction.
2024-12-08 12:34:21 +01:00
Ruud van Asseldonk
76e48f9421 Use new std.empty_set constant 2024-12-07 20:57:26 +01:00
Ruud van Asseldonk
9e48d4f066 Document {List,Set}.{all,any} 2024-12-07 20:57:26 +01:00
Ruud van Asseldonk
2601582abe Add std.empty_set constant
It started to get annoying to have to define it myself every time, so
let's just add it properly now. This also resolves the longstanding
issue in the RCL pretty-printer that we have no good way to print the
empty set -- now we do!
2024-12-07 20:26:40 +01:00
Ruud van Asseldonk
e26c18815b Add a pull request checklist 2024-12-07 16:21:40 +01:00
Ruud van Asseldonk
dff50984d9 Document and highlight new List.sort method 2024-12-01 13:15:28 +01:00
Ruud van Asseldonk
1bac59668e Bump version to 0.6.0
See docs/changelog.md for a summary of the changes in this release.
2024-12-01 11:52:49 +01:00
Ruud van Asseldonk
95a89408a5 Write changelog for v0.6.0 2024-12-01 11:33:55 +01:00
areskill
0e1658c779 Document how to set the file type in Neovim 2024-09-29 18:47:26 +02:00
Ruud van Asseldonk
0f6a034fa2 Point Zed docs at its extension registry
It was included upstream in the registry, so it is now easy to install.
2024-08-26 19:59:58 +02:00
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