back to article In mourning for Nano, chap crafts 1k-loc text editor

Ticked off by the news that Nano opted out of GNU, a programmer called Salvatore Sanfilippo has written his own text editor. What's impressive about it is that it provides a basic code editor with syntax highlighting and search, without ncurses as a dependency, and in a mere 1,000 lines of code (at Github). Why did he decide …

  1. RIBrsiq

    .kkrieger

    1. Peter Gordon

      Elevated by RGBA and TBC

      and

      Puls by Rrrola

      1. GrumpenKraut Silver badge
        Happy

        Cubic Team & $eeN - Lasse Reinbøng

        Still pretty much my favorite, from 1995. 64 kB, though. Linky

  2. Notas Badoff
    Unhappy

    Libre liver bile

    "No, you're not Libre enough!"

    "No, *you're* not Libre enough!"

    "No, _you're_ not !Libré! enough!!1!"

    ...

    I've repeatedly been left with the impression that FSF and kin are like bleeding-heart misanthropes. Their written pronouncements have everything good in them. Poke'em a bit though and they seem to bleed bile and legalisms, shouting that no one else's terms/ideas/feelings are near good enough for them.

    Oh well, we're now educated to route around damage ...

    1. AustinTX

      Re: Libre liver bile

      NAY, MON! No true Libre would do that!

      Anyway, I used to have a disk full of 1-line LBASIC games I typed in from various magazines. I recall one was a scrolling racecar track.

      1. Chika

        Re: Libre liver bile

        Sounds a lot like the various ZX magazines that tried to write fully functional programs into what was left of the 1KB on a ZX81. ISTR they did it, too!

        1. Anonymous Coward
          Anonymous Coward

          Ah, my misspent youth...

          For the ZX81 it was quite easy - create a rem statement with enough space, then poke in the machine code. I recall making quite a nice little scroller using lddr...

          Of course, for a given value of easy...

        2. Alan Brown Silver badge

          Re: Libre liver bile

          "tried to write fully functional programs into what was left of the 1KB on a ZX81"

          All ROM BASIC systems had a major advantage that BASIC keywords were tokenised down to 1 byte, so as long as you were economical with everything else it was relatively easy.

    2. LDS Silver badge

      "did not want to assign *copyright* to the FSF for his contributions"

      Wasn't the FSF all about *copyleft*? Why does it want copyright on someone else work? FSF always has a smell of Orwell's "Animal Farm"...

      1. Charlie Clark Silver badge

        Re: "did not want to assign *copyright* to the FSF for his contributions"

        The copyright assignment is indeed one of the most pernicious parts of the GNU.

        1. Phil Lord

          Re: "did not want to assign *copyright* to the FSF for his contributions"

          Copyright assignment is actually not a GNU policy. There are GNU projects which do not require assignment. Indeed, if you go and read the messages about Nano that possibility was raised, but never resolved. Benno's other major criticism was that the GNU coding standards and associated documentation were too long; he may have a good point here.

          Seems to be that most of the issue here is one of miscommunication, though.

      2. Dom 3

        Re: "did not want to assign *copyright* to the FSF for his contributions"

        It's based on a strong assertion of *copyright*. "You *can* make copies, but *only* if you follow these rules".

        1. LDS Silver badge

          Re: "did not want to assign *copyright* to the FSF for his contributions"

          Very strong, if you have to surrender your rights to them. So copyright is bad unless it's theirs.

      3. Alan Mackenzie
        Happy

        Re: "did not want to assign *copyright* to the FSF for his contributions"

        > Why does it [the FSF] want copyright on someone else [sic] work?

        Because only then is it in the legal position to defend a work's copyright. I look at it this way: having assigned my copyright to the FSF, that is one burden lifted from me should some nasty person violate my copyright. I am in no position as an individual to initiate legal procedings.

        1. I am the liquor

          Re: "did not want to assign *copyright* to the FSF for his contributions"

          Another benefit is that it prevents the author taking the product down the closed source or freemium route in the future. The copyright-holder doesn't have to rely on the GPL to create derivative works, so they could release a paid-for, closed-source "pro" version based on the open source software. FSF doesn't want that happening to their products so they prevent it by ensuring they hold the copyright.

          1. LDS Silver badge

            Re: "did not want to assign *copyright* to the FSF for his contributions"

            They can still fork it, can't they? And why the original creator shouldn't be allowed to change his or her mind? While, once the FSF has the copyright, it can do whatever it likes....

        2. LDS Silver badge

          Re: "did not want to assign *copyright* to the FSF for his contributions"

          And what if FSF violates it once you surrendered it? Anyway if the code is under GPL the FSF can still sue for a license violation, AFAIK. The reason behind the copyright are others... FSF wants total control.

          1. Phil Lord

            Re: "did not want to assign *copyright* to the FSF for his contributions"

            No, the FSF cannot sue for licence violation if they do not own the code. Then could support others, of course, in doing so. It's also easier to enforce the licence is you own all the code.

            Set against this, getting a CCA for all code contributions is a significant barrier. Gains and losses.

      4. Chika

        Re: "did not want to assign *copyright* to the FSF for his contributions"

        Generally or just the pigs?

        Four legs good, two legs baaaaaaad

        1. LDS Silver badge

          Re: "did not want to assign *copyright* to the FSF for his contributions"

          Put Gnus in the place of pigs, and many FSF supporters in the place of sheep, and you get an idea... while some developers may remind a workhorse...

      5. Alan Brown Silver badge

        Re: "did not want to assign *copyright* to the FSF for his contributions"

        "Why does it want copyright on someone else work?"

        "it" doesn't as such. But if it comes time to enforce GPL compliance, individual programmers have usually found they've been strung along for years (and in at least one case I know of in the 1990s, the commercial outfit which ripped off the code turned around and sued the original author in order to claim copyright on the code they'd stolen - but this happened more regularly with BSD-style releases).

        Having the FSF park (well funded) tanks on the front lawn usually results in naughty outfits reassessing their position. The cases you hear about (that are approaching court) are fewer than 1% of the issues that they deal with.

  3. J I

    Succint Software

    Following up the bootnote, the classic of this genre has to be Extra Rheolism - Tetris in a single line of BBC BASIC.

  4. vordan

    Nano is for interns.

    1. phuzz Silver badge
      Gimp

      In the eternal holy war between vi and emacs, nano is the only sane choice!

      (It also pisses off the greybeards at work so much, that I use it just to spite them)

      1. Paul Woodhouse

        hmm, been known to do that from time to time... can cause much spluttering...

      2. Alan Brown Silver badge

        At least one of the greybeards here uses jed and refuses to use anything else.

    2. AustinTX

      Bahahahaha, I still use PICO daily!

  5. Charles 9 Silver badge

    Single line?

    Horse hockey! I only call a program a single line if it occupies a single line on the screen: no overflowing or any of that garbage. Instead, we should be judging short-program lengths by character count, not line. Let's see people produce a complete game or utility when restricted to, what, 40 characters.

    1. John Brown (no body) Silver badge

      Re: Single line?

      "Let's see people produce a complete game or utility when restricted to, what, 40 characters."

      Bollox! A line is defined by the language and it's definition of EOL ;-)

      40 Characters? Commodore Pet? Tandy had 64. So an xterm on a very high res screen with a tiny typeface isn't allowed?

      1. Charles 9 Silver badge

        Re: Single line?

        "Bollox! A line is defined by the language and it's definition of EOL"

        Bollock on the bollocks! If any form of text overflows the single line on display, then by definition it's not a single (as in ONE) line anymore. We'd never say that of text, code, or whatever, so I stand my ground. A single-line program is only such if it takes up no more than a single screen line; no ifs, ands, or buts.

        10 PRINT "HELLO, WORLD!"

        THAT is a single-line program.

    2. Captain DaFt

      Re: Single line?

      "Let's see people produce a complete game or utility when restricted to, what, 40 characters."

      data:text/html, <html contenteditable>

      Cut and paste that in your navigation bar. Boom! Text editor!

      Not mine, But I thought it was a clever bit of html.

  6. TS15

    A programmer called...

    Salvatore Sanfilippo - probably deserves a bit more credit/recognition than "A programmer called".

    He wrote a little something called Redis (http://redis.io/), which if you've not come across it directly is a supremely fast in-memory data structure store able to be used in a multitude of ways.

    Often used in large-scale web infrastructure and powers a bunch of websites you may have heard of: http://redis.io/topics/whos-using-redis

    1. Lee D Silver badge

      Re: A programmer called...

      Ah, do you mean this one:

      https://developers.slashdot.org/story/16/07/09/0448257/researchers-find-over-6000-compromised-redis-installations

      "By default, Redis has no authentication or security mechanism enabled, and any security mechanisms must be implemented by the end user."

      The large-scale web infrastructure data structure that "is designed to be accessed by trusted clients inside trusted environments," according to its documentation. "This means that usually it is not a good idea to expose the Redis instance directly to the internet or, in general, to an environment where untrusted clients can directly access the Redis TCP port or UNIX socket... Redis is not optimized for maximum security but for maximum performance and simplicity."

      Yeah, not entirely sure that that's a good thing, to be honest. Quick-and-dirty probably isn't what you want if you intend to edit files in /etc/ as root, for instance.

      1. TS15

        Re: A programmer called...

        Indeed. Unfortunately there's not much mitigation for a service being installed by a village idiot who hasn't got a clue how to secure their systems or understanding of what something does.

        Suspect you'd find a few more than 6000 insecure Windows or Linux machines kicking around on the web. Or compromised mysql installs.. or anything else you care to think of.

        1. Anonymous Coward
          Anonymous Coward

          Re: A programmer called...

          So why doesn't software take the idiot into consideration given his actions can have knock-on effects for everybody else?

  7. Bronek Kozicki Silver badge

    Nice

    had a look at the source code, and even though I am not a big fan of C this is a very nice example how this language should be used properly. Definitely one to watch.

    1. Wilco

      Re: Nice

      Not sure about that. It's neat enough, but most of it depends on updating a global struct editorConfig instance E. It wouldn't have been that hard or that many more lines (could be less), to wrap this up so that changes to this global state were encapsulated. Some tests would be nice, too.

      Love the comment on enableRawMode

      1. Bronek Kozicki Silver badge

        Re: Nice

        In practice this is not editor config, it is editor state and very neatly packed into a single struct. It would be neat to pass it explicitly to all functions as a pointer, agreed. But then it would not be so blatantly obvious that it is one-end-the-only editor state, and there are benefits to such bluntness of design. In case when the whole project sits in a single .c file, without any headers, this seems appropriate.

      2. Dan 55 Silver badge

        Re: Nice

        Unless you're planning on having multiple files/windows open at one time, a global state will do.

        Maybe one day it'll be called 2-kilo and do that, but until then it does what it says on the tin and it's nicely structured.

  8. energystar
    Alien

    What the f_(* is this? Is Github part of the NWO?

    "It seems the argument came down to licensing rules, because an idea of moving Nano to Github was incompatible with the GNU license. ®"

    1. Phil Lord

      Re: What the f_(* is this? Is Github part of the NWO?

      I suspect that this is not true. The GPL does not limit where you can place code. It's just not normal for a GNU project to host itself on non-free software, which is true of github.

  9. rsole

    I just love the name :)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019