frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

zearch: regular expression searching on grammar-compressed text

https://pevalme.github.io/zearch/graphs/index.html
4•1vuio0pswjnm7•3mo ago

Comments

1vuio0pswjnm7•3mo ago
.

   cd zearch-master/
   ed Makefile <<__GGG__
   11c
   CC = gcc
   .
   4,6c
   CFLAGS = -static -s -I/usr/include -fcommon -O3 -march=native -flto -mtune=native
   # CFLAGS = -fcommon -flto -DNDEBUG -ggdb -fno-inline-functions
   LFLAGS = -L/usr/local/lib/ /usr/lib/libfa.a
   .
   w
   q
   __GGG__


   ed main.c <<__HHH__
   750,751c
   if(mode=='q'){ret=run_boolean_zearch(minimize,argv[argc-1],argv[argc-2]);exit(ret);}else run_zearch(minimize,argv[argc-1],argv[argc-2]);
   .
   730,733c
   if(argc==4)if(argv[1][0]=='-')mode=argv[1][1];else mode='l';
   .
   707,728c
   if(argc!=3&&argc!=4)help();
   .
   703c
   int help(){
   fputs("Usage: zearch [OPTION] PATTERN RE-PAIR FILE\n",stderr);
   fputs("  -c: prints only a count of selected lines in RE-PAIR FILE\n",stderr);
   fputs("  -q: suppress all normal output\n",stderr);
   exit(0);
   }
   .
   525a
   int help();
   if(slp==NULL)help();
   .
   501c
   ret=1;
   .
   491c
   ret=0;
   .
   482c
   ret=0;
   .
   430a
   int help();
   if(slp==NULL)help();
   .
   419c
   if(mode=='c')printf("%d\n",ret+counting_overflows*COUNTER_TOP);
   .
   350c
   if(mode!='c'&&mode!='q'){
   .
   238,253d
   w
   q
   __HHH__

   ed nfa.c <<__III__
   103,104c
   extern unsigned int num_e_l;
   extern unsigned int num_e_r;
   .
   diff -re zearch-master/src/stack.c zearch-master.new/src/stack.c
   56c
   s->data = (unsigned int*)realloc(s->data, sizeof(unsigned int) * s->size);
   .
   53c
   __attribute__((always_inline)) inline void stack_push(STACK *s, unsigned int n){
   .
   42,43c
   __attribute__((always_inline)) inline unsigned int stack_pop(STACK *s){
   unsigned int ret;
   .
   37c
   posix_memalign((void **)&s->data, 64, STACK_SIZE * sizeof(unsigned int));
   .
   w
   q
   __III__

   ed stack.h <<__JJJ__
   65c
   void stack_push(STACK *s, unsigned int n);
   .
   55c
   unsigned int stack_pop(STACK *s);
   .
   36c
   unsigned int *data;
   .
   5c
   * Each element is a unsigned int.
   .
   w
   q
   __JJJ__
1vuio0pswjnm7•3mo ago
Corrected

More code for experimentation: https://github.com/s-maruyama/exrepair

    cd zearch-master
    ed Makefile <<__GGG__
    11c
    CC = gcc
    .
    4,6c
    CFLAGS = -static -s -I/usr/include -fcommon -O3 -march=native -flto -mtune=native
    # CFLAGS = -fcommon -flto -DNDEBUG -ggdb -fno-inline-functions
    LFLAGS = -L/usr/local/lib/ /usr/lib/libfa.a
    .
    w
    q
    __GGG__

    cd src
    ed main.c <<__HHH__
    750,751c
    if(mode=='q'){ret=run_boolean_zearch(minimize,argv[argc-1],argv[argc-2]);exit(ret);}else run_zearch(minimize,argv[argc-1],argv[argc-2]);
    .
    730,733c
    if(argc==4)if(argv[1][0]=='-')mode=argv[1][1];else mode='l';
    .
    707,728c
    if(argc!=3&&argc!=4)help();
    .
    703c
    int help(){
    fputs("Usage: zearch [OPTION] PATTERN RE-PAIR FILE\n",stderr);
    fputs("  -c: prints only a count of selected lines in RE-PAIR FILE\n",stderr);
    fputs("  -q: suppress all normal output\n",stderr);
    exit(0);
    }
    .
    525a
    int help();
    if(slp==NULL)help();
    .
    501c
    ret=1;
    .
    491c
    ret=0;
    .
    482c
    ret=0;
    .
    430a
    int help();
    if(slp==NULL)help();
    .
    419c
    if(mode=='c')printf("%d\n",ret+counting_overflows*COUNTER_TOP);
    .
    350c
    if(mode!='c'&&mode!='q'){
    .
    238,253d
    w
    q
    __HHH__

    ed nfa.c <<__III__
    103,104c
    extern unsigned int num_e_l;
    extern unsigned int num_e_r;
    .
    w
    q
    __III__

    ed stack.c <<__JJJ__
    56c
    s->data = (unsigned int*)realloc(s->data, sizeof(unsigned int) * s->size);
    .
    53c
    __attribute__((always_inline)) inline void stack_push(STACK *s, unsigned int n){
    .
    42,43c
    __attribute__((always_inline)) inline unsigned int stack_pop(STACK *s){
    unsigned int ret;
    .
    37c
    posix_memalign((void **)&s->data, 64, STACK_SIZE * sizeof(unsigned int));
    .
    w
    q
    __JJJ__

    ed stack.h <<__KKK__
    65c
    void stack_push(STACK *s, unsigned int n);
    .
    55c
    unsigned int stack_pop(STACK *s);
    .
    36c
    unsigned int *data;
    .
    5c
    * Each element is a unsigned int.
    .
    w
    q
    __KKK__

Compiling Prolog to Forth [pdf]

https://vfxforth.com/flag/jfar/vol4/no4/article4.pdf
1•todsacerdoti•9s ago•0 comments

Show HN: Cymatica – an experimental, meditative audiovisual app

https://apps.apple.com/us/app/cymatica-sounds-visualizer/id6748863721
1•_august•1m ago•0 comments

GitBlack: Tracing America's Foundation

https://gitblack.vercel.app/
1•martialg•1m ago•0 comments

Horizon-LM: A RAM-Centric Architecture for LLM Training

https://arxiv.org/abs/2602.04816
1•chrsw•2m ago•0 comments

We just ordered shawarma and fries from Cursor [video]

https://www.youtube.com/shorts/WALQOiugbWc
1•jeffreyjin•2m ago•1 comments

Correctio

https://rhetoric.byu.edu/Figures/C/correctio.htm
1•grantpitt•3m ago•0 comments

Trying to make an Automated Ecologist: A first pass through the Biotime dataset

https://chillphysicsenjoyer.substack.com/p/trying-to-make-an-automated-ecologist
1•crescit_eundo•7m ago•0 comments

Watch Ukraine's Minigun-Firing, Drone-Hunting Turboprop in Action

https://www.twz.com/air/watch-ukraines-minigun-firing-drone-hunting-turboprop-in-action
1•breve•8m ago•0 comments

Free Trial: AI Interviewer

https://ai-interviewer.nuvoice.ai/
1•sijain2•8m ago•0 comments

FDA Intends to Take Action Against Non-FDA-Approved GLP-1 Drugs

https://www.fda.gov/news-events/press-announcements/fda-intends-take-action-against-non-fda-appro...
4•randycupertino•9m ago•1 comments

Supernote e-ink devices for writing like paper

https://supernote.eu/choose-your-product/
2•janandonly•11m ago•0 comments

We are QA Engineers now

https://serce.me/posts/2026-02-05-we-are-qa-engineers-now
1•SerCe•12m ago•0 comments

Show HN: Measuring how AI agent teams improve issue resolution on SWE-Verified

https://arxiv.org/abs/2602.01465
2•NBenkovich•12m ago•0 comments

Adversarial Reasoning: Multiagent World Models for Closing the Simulation Gap

https://www.latent.space/p/adversarial-reasoning
1•swyx•12m ago•0 comments

Show HN: Poddley.com – Follow people, not podcasts

https://poddley.com/guests/ana-kasparian/episodes
1•onesandofgrain•20m ago•0 comments

Layoffs Surge 118% in January – The Highest Since 2009

https://www.cnbc.com/2026/02/05/layoff-and-hiring-announcements-hit-their-worst-january-levels-si...
7•karakoram•20m ago•0 comments

Papyrus 114: Homer's Iliad

https://p114.homemade.systems/
1•mwenge•20m ago•1 comments

DicePit – Real-time multiplayer Knucklebones in the browser

https://dicepit.pages.dev/
1•r1z4•20m ago•1 comments

Turn-Based Structural Triggers: Prompt-Free Backdoors in Multi-Turn LLMs

https://arxiv.org/abs/2601.14340
2•PaulHoule•22m ago•0 comments

Show HN: AI Agent Tool That Keeps You in the Loop

https://github.com/dshearer/misatay
2•dshearer•23m ago•0 comments

Why Every R Package Wrapping External Tools Needs a Sitrep() Function

https://drmowinckels.io/blog/2026/sitrep-functions/
1•todsacerdoti•24m ago•0 comments

Achieving Ultra-Fast AI Chat Widgets

https://www.cjroth.com/blog/2026-02-06-chat-widgets
1•thoughtfulchris•26m ago•0 comments

Show HN: Runtime Fence – Kill switch for AI agents

https://github.com/RunTimeAdmin/ai-agent-killswitch
1•ccie14019•28m ago•1 comments

Researchers surprised by the brain benefits of cannabis usage in adults over 40

https://nypost.com/2026/02/07/health/cannabis-may-benefit-aging-brains-study-finds/
1•SirLJ•30m ago•0 comments

Peter Thiel warns the Antichrist, apocalypse linked to the 'end of modernity'

https://fortune.com/2026/02/04/peter-thiel-antichrist-greta-thunberg-end-of-modernity-billionaires/
3•randycupertino•31m ago•2 comments

USS Preble Used Helios Laser to Zap Four Drones in Expanding Testing

https://www.twz.com/sea/uss-preble-used-helios-laser-to-zap-four-drones-in-expanding-testing
3•breve•36m ago•0 comments

Show HN: Animated beach scene, made with CSS

https://ahmed-machine.github.io/beach-scene/
1•ahmedoo•37m ago•0 comments

An update on unredacting select Epstein files – DBC12.pdf liberated

https://neosmart.net/blog/efta00400459-has-been-cracked-dbc12-pdf-liberated/
3•ks2048•37m ago•0 comments

Was going to share my work

1•hiddenarchitect•40m ago•0 comments

Pitchfork: A devilishly good process manager for developers

https://pitchfork.jdx.dev/
1•ahamez•40m ago•0 comments