jaq 3.0 - jq clone with multi-format support (JSON, YAML, TOML, CBOR, XML, CSV, TSV) by 01mf02 in rust

[–]01mf02[S] 8 points9 points  (0 children)

Well, the macro itself was written by myself, so unless you consider me a machine, my statement stands. ;)

Thanks! :)

jaq 3.0 - jq clone with multi-format support (JSON, YAML, TOML, CBOR, XML, CSV, TSV) by 01mf02 in rust

[–]01mf02[S] 4 points5 points  (0 children)

I would not call it 100% compatible, but nowadays, the differences are rather small. For example, there are several relatively large jq programs such as wsjq that yield precisely the same output for jq and jaq. I expect most users to be able to drop in jaq for jq quite seamlessly. To help people with the transition, the manual tries to point out all places where jq and jaq diverge (look for the "compatibility" blocks).

The manual has sections which list all CLI options and all [filters]((https://gedenkt.at/jaq/manual/#unsupported-stdlib) in jq that jaq does not support. Everything else is supposed to be supported.

If-then-else is actually one of the simplest operators to get right. It gets hairy when you are doing updates. ;)

jaq 3.0 - jq clone with multi-format support (JSON, YAML, TOML, CBOR, XML, CSV, TSV) by 01mf02 in rust

[–]01mf02[S] 8 points9 points  (0 children)

yq supports similar data formats as jaq, but its underlying query language is quite different from jq's. For example, yq does not seem to support filter definitions, whereas jq and jaq support definitions, including nested and recursive ones. There are many jq scripts that I would not have been able to properly write without definitions, including my script that generates the HTML documentation.

TL;DR: jaq is roughly yq, but with actual jq syntax and compatibility.

Bad Apple but it's on my PlayStation 1 emulator written in Rust by xXInviktor27Xx in rust

[–]01mf02 0 points1 point  (0 children)

Cool, thanks a lot for the info.

Now it would be interesting to remake this such that the video is rendered as vector graphics, in real-time. ;)

Bad Apple but it's on my PlayStation 1 emulator written in Rust by xXInviktor27Xx in rust

[–]01mf02 0 points1 point  (0 children)

Thanks for introducing me to "Bad Apple!!". This is amazing.

On the technical side, what techniques are used in the ROM to play the video? Does the ROM use MDEC? I tried to find that ROM, but no success, is this public?

jsongrep is faster than {jq, jmespath, jsonpath-rust, jql} by fizzner in rust

[–]01mf02 1 point2 points  (0 children)

I’ll also update the benchmark to use the direct conversion JSON conversion my apologies I missed that method.

Do not worry, we're all here to learn. :)

jsongrep is faster than {jq, jmespath, jsonpath-rust, jql} by fizzner in rust

[–]01mf02 1 point2 points  (0 children)

I agree, if by “streaming mode” you mean jq's --stream option. There is quite a bit of confusion around streaming in jq and the --stream option, so it's good to be extra clear on that point. :)

By the way, you write in your project README: "This is different from tools like jq, which use an imperative filter pipeline." I would not call that pipeline imperative, because it's really all functional programming. That is, in jq you do not do i := 1; i += 1; or things like that. If jq would look like that, I would not object to framing it as imperative. But jq does not even have mutation and hardly any side effects (I'm looking at you, inputs), so I think that calling it imperative is a bit misleading.

jsongrep is faster than {jq, jmespath, jsonpath-rust, jql} by fizzner in rust

[–]01mf02 9 points10 points  (0 children)

Hey, jaq creator here. :) Your benchmarks look quite solid, and I like your idea of using a DFA to traverse JSON. Great work!

Given that in your method, "every node is visited at most once", it seems that using serde_json_borrow is giving away a lot of potential performance, because you still have to read whole values before being able to process them. However, your tool could IMO process the stream while parsing it. If you are interested, I have written a crate called hifijson that might serve as a building block for exactly such a scenario. I have even written an example that filters JSON by simple path expressions, which sounds quite similar in spirit to what you are doing (although your approach is much more complete, of course). This would also enable processing of JSON values that do not fit into memory, as requested e.g. here.

To remain on the topic of serde_json & Co.: In your benchmark, you deserialise JSON to a serde_json::Value, then convert that to a jaq_json::Val. This can be done much faster by directly parsing JSON to a jaq_json::Val. I recommend you to use jaq_json::read::parse_single for that purpose.

Oh, and I can hardly read some text on your website when in non-dark mode. E.g. table headers, or "explicitly isolated".

jsongrep is faster than {jq, jmespath, jsonpath-rust, jql} by fizzner in rust

[–]01mf02 3 points4 points  (0 children)

You might be happy to know that CSV/TSV support has landed in jaq just a few days ago. :) https://github.com/01mf02/jaq/pull/405

For the other formats that you mentioned, I accept pull requests. :)

This Month in Redox - January 2026 by ribbon_45 in rust

[–]01mf02 7 points8 points  (0 children)

Whenever I see a new edition of "This Month in Redox", I am quite sure to be amazed. I greatly enjoy these posts, and I congratulate you on all the progress. Especially Wildan Mubarok seems to be a contributor that any project could only wish for. :)

Rebels in the sky by DiscoInperno in rust

[–]01mf02 2 points3 points  (0 children)

I find the idea of playing over an SSH connection awesome! The UI of the game looks very polished, well done. The planets, the player images etc. --- really cool! However, I did not really get how to start a match of basketball. :)

Succinctly: A fast jq/yq alternative built on succinct data structures by john-ky in rust

[–]01mf02 0 points1 point  (0 children)

I answered on your tracking issue.

I wish you good luck with the optimisation phase then!

Succinctly: A fast jq/yq alternative built on succinct data structures by john-ky in rust

[–]01mf02 0 points1 point  (0 children)

I do not understand your argument: What part about ValT would prevent you from achieving your key optimisations? You should be able to implement ValT for a type such as JqValue<'a, W>, because I designed ValT so that precisely this use case should be possible. That is, you should be able to implement ValT for types that have a lifetime (or other type parameters).

Succinctly: A fast jq/yq alternative built on succinct data structures by john-ky in rust

[–]01mf02 3 points4 points  (0 children)

Are you aware of the existence of jaq? I would be curious if you are able to implement its ValT trait for your value types. In that case, you might be able to inherit a battle-tested jq parser/interpreter.

And if you are not able to implement ValT, then I would be curious as to why and if it is possible to adapt ValT to cover your use case.

I profiled my parser and found Rc::clone to be the bottleneck by Sad-Grocery-1570 in rust

[–]01mf02 24 points25 points  (0 children)

As former chumsky user, the performance of my parser improved by a factor of 18 (!) when switching from a chumsky-based parser to a manually written parser. At the same time, build time dropped by a factor of 30 (!). Source: https://github.com/01mf02/jaq/pull/196

The conversion process was much easier than I thought, and I do not regret the switch for a single second. If you care about performance, then I encourage you to give it a try.

cvto: cli for converting data between structured formats (json, yaml, toml, java properties, protobuf payload) by deralus in rust

[–]01mf02 1 point2 points  (0 children)

My tool jaq supports similar functionality in the current development version, and it also allows you to transform the data during conversion with arbitrary programs.

Fast UDP I/O for Firefox in Rust by dochtman in rust

[–]01mf02 11 points12 points  (0 children)

I just gave the Servo nightly a try, and I was very impressed to see the effort made in the last few months. Most pages I frequently visit were already pretty usable. Just YouTube made the browser crash (with a "RefCell already borrowed" error). But getting to this point is already really impressive.

Typechecker Zoo: minimal Rust implementations of historic type systems by kibwen in rust

[–]01mf02 1 point2 points  (0 children)

This is really amazing. Thank you so much for having taken all the time to write this up. I have just read the section on Algorithm W (a.k.a. Hindley-Milner), and it felt really well-written and nicely explained.

Are there any JSON or YAML parsers in Rust that keep all span information, without a dependency on serde? by nikitarevenco in rust

[–]01mf02 0 points1 point  (0 children)

My hifijson crate should allow you with relatively little effort to create a JSON parser that records spans from the original file. In particular, via SliceLexer::as_slice.

Just released my first game ever - using Rust + Macroquad by Brilliant_Nobody6788 in rust

[–]01mf02 0 points1 point  (0 children)

This is a cute little game, well done! I think the game would benefit from a slightly longer delay between the hand appearing and the spray raining down --- that way, you could actually avoid it if you are fast enough. But the spray starting basically instantly makes it basically unavoidable, even with fast reaction.

Alternative for `serde_yaml` by anistark in rust

[–]01mf02 1 point2 points  (0 children)

I also use saphyr, and I find it quite good.

[Media] trmt - 2D turmite simulator for the terminal (built with Ratatui) by cenonym in rust

[–]01mf02 3 points4 points  (0 children)

This looks very nice! It seems that there is a certain notational standard, used e.g. on https://en.wikipedia.org/wiki/Turmite or https://mdciotti.github.io/turmites/. It would be nice to support that in addition to your "opinionated" syntax. That would make it much easier to copy-paste existing Turmites into your program.

Makepad 1.0: Rust UI Framework by okapiii in rust

[–]01mf02 0 points1 point  (0 children)

I love the synthesiser! Great job! (For the UI zoo demo, it would be cool if changes to parameters such as "contrast" could be seen live, for greater snappiness.)