Coder Social home page Coder Social logo

Comments (6)

brandonbloom avatar brandonbloom commented on June 7, 2024 2

There isn't really a foolproof way to tell keyword arguments from positional arguments. If you've got a sensible heuristic, I'd consider a very simple patch via PR. Absent a PR, I'm going to close this ticket for reasons discussed below.

Since this (and similar comments) have come up before, I'm going to take this opportunity to put some of my design thoughts about Fipp in to writing: First and foremost, Fipp is a pretty printer construction kit. It comes with two pre-constructed printers: One for Edn and one for Clojure Code.

My Edn printer is intended to be fast. Fast enough to use for pretty-printing large data files. If you want truly pretty data, you can use the Fipp-based https://github.com/greglook/puget/ printer, which trades some speed for features (like sorting keys in maps and colorization).

@mkremins' contributed Clojure code printer is intended to be simple. It's never going to support deep analysis, rich customization, or stuff like that. It's not a code reformatter. The primary use-case is for debugging macro-expansions. In that context, failure to meet community accepted style guidelines is perfectly acceptable and entirely expected. If somebody wanted to follow in Puget's footsteps and use Fipp to create a richly featured code-printer (maybe utilizing tools.analyzer), I'd be happy to support and promote their efforts.

That said, Fipp will always strive to provide primitives that can preserve the linear time and bounded space guarantees. That said, the code which produces the "pretty document" fed to the printing engine can trivially utilize non-linear time or unbounded space (Pudget does when sorting). I'd expect that a fully featured source beautifier may also need richer primitives to execute inside the printing engine. Such primitives would need to be considered on a case-by-case basis and any potentially-slow primitives would need a very strong justification.

from fipp.

MIvanchev avatar MIvanchev commented on June 7, 2024

Fair enough, I had the impression Fipp was supposed to replace the source code (as in 'program') capabilities of Clojure's own pprint. My bad!

from fipp.

brandonbloom avatar brandonbloom commented on June 7, 2024

Fipp does in fact have most of the functionality of Clojure's own pprint, which largely targets the same use case (debugging; not reformatting).

from fipp.

bhurlow avatar bhurlow commented on June 7, 2024

@brandonbloom thanks for linking to your discussing here from the fipp docs. I understand fipp is targeting debugging use cases and not code formatting/refactoring. Can you point to any projects that do build off fipp (like puget) to target code formatting? Perhaps there are none, either way Fipp seems like it would be a good building block towards that goal

from fipp.

brandonbloom avatar brandonbloom commented on June 7, 2024

I'm sure some exist, but I do not make use of any of them, so I can't point you in the right direction. Sorry.

from fipp.

bhurlow avatar bhurlow commented on June 7, 2024

@brandonbloom fair enough thnx!

from fipp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.