Bsed

Dev tools

text processing cli

SHOW HN2019

Bsed

Simple, English syntax on top of Perl text processing

github.com

#sed alternative#perl one-liner#text processing#command line

178points
67comments
#229of 2,195 in 2019
Top 11%of 2019 by points

How HN took it

MixedNo clear lean

5 positive, 8 neutral or asking, 0 mixed, 8 critical, out of 21 comments about the project. Thread score -0.10.

Execution: 1 for, 6 againstIdea: 2 for, 2 againstDesign: 1 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Clean, readable English-like syntax compared to sed and awk

    From 2 comments
    • I'd definitely incorporate it into my projects if it were ported Go, Rust, or any reasonable redistributable form, and continued to use a BSD license. Way clearer than cryptic…
      jaytaylor on HN
    • Really looking forward to trying this out. The syntax looks very clean & clear. I hate the insanity of sed, and assuming the performance is here, I’d switch to this in a heartbeat.
      king_magic on HN

Objections

  • Python install requirement is a barrier; Perl would be more portable

    From 3 comments
    • Kinda off that this is written in Python, and not Perl. If it was written in Perl, it'd have the portability that the underlying translated commands have! I'd be happy to help…
      peteretep on HN
    • I'd definitely incorporate it into my projects if it were ported Go, Rust, or any reasonable redistributable form, and continued to use a BSD license. Way clearer than cryptic…
      jaytaylor on HN
    • > if it were ported Go, Rust, or any reasonable redistributable form I still consider Perl being, from the portability standpoint, the best language to pre-process a single text…
      acqq on HN
  • Safer to rely on standard sed and awk in scripts

    From 1 comment
    • This is very cool for simplifying interactive use :) but I'd like to caution people away from immortalizing it in their scripts. sed and awk are both standardized by POSIX and…
      Sir_Cmpwn on HN

Requests

  • Port to Perl as a single file

    From 2 comments
    • Kinda off that this is written in Python, and not Perl. If it was written in Perl, it'd have the portability that the underlying translated commands have! I'd be happy to help…
      peteretep on HN
    • Yeah, there's not a lot of point in having the python layer. Perl excels at these kinds of things. I'm guessing that the original developer just doesn't know perl well enough to…
      singingfish on HN
  • Add a dry-run or diff mode

    From 1 comment
    • Neat, but a little scary because you rely on it to interpret your intentions correctly. Usually when I am trying to do something, I build up my command in multiple steps,…
      seiferteric on HN
  • Document the -t flag for Perl translation

    From 1 comment
    • > For anything longer term, I'd recommend finding the right bsed command and then using -t flag to get the Perl translation. That could be a part of the readme!
      acqq on HN

Questions

  • How does performance compare to sed and other tools?

    From 2 comments
    • How does it compare performance-wise to other tools with similar goals? Seeing this is written in 100% python, I suspect it will be an order of magnitude slower.
      chmln on HN
    • that would depend on a lot of factors sed provides only BRE/ERE which has lot less features than perl, however in my experience speed is better with BRE/ERE than PCRE, except…
      asicsp on HN

Alternatives named

  • sed and awk

    From 2 comments
    • Perl aside, I would say that's almost imperative to learn sed and awk. They invaluable tools for getting things done in *nix. They seem cryptic at first, but put a weekend into…
      ilovetux on HN
    • This is very cool for simplifying interactive use :) but I'd like to caution people away from immortalizing it in their scripts. sed and awk are both standardized by POSIX and…
      Sir_Cmpwn on HN
  • psed (Perl sed implementation)

    From 1 comment
    • You should really use psed then, which came with perl5 from 5.002 until v5.21.1 and is now on CPAN. This is a proper sed, implemented in perl.…
      rurban on HN
  • sd (Rust find and replace)

    From 1 comment
    • Shameless plug for even terser syntax: https://github.com/chmln/sd
      chmln on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/19540104)