Hi everyone,
I built a new Crystal shard: awesome_print, GitHub - crystal-china/awesome_print: Awesome Print for Crystal · GitHub
It is a colorful pretty-printer for Crystal values, inspired by the Ruby versions:
- awesome_print: GitHub - awesome-print/awesome_print: Pretty print your Ruby objects with style -- in full color and with proper indentation · GitHub
- amazing_print: GitHub - amazing-print/amazing_print: Pretty print your Ruby objects with style -- in full color and with proper indentation · GitHub
All source code of this shard was written with Codex, and I think AI is actually very good at this kind of library work: lots of formatting rules, many supported types, output polish, recursion handling, limits, colors, and edge cases.
It is not a direct port, but a Crystal-style implementation that borrows ideas from both Ruby projects.
To see the current output, just run:
crystal run example.cr
Feedback is welcome.
following is the output of my another meta shards, which use awesome_print as printer. (Yes, this is the original reason I port awesome_print)
require "awesome_print"
require "./src/meta"
class Foo
def aaa; end
end
class Bar < Foo
def bbb; end
end
class Baz < Foo
def ccc; end
end
ap! Baz.new.all_methods
Following is the part of output of example.cr

