[HN Gopher] Portable OpenBSD vi for Unix systems
       ___________________________________________________________________
        
       Portable OpenBSD vi for Unix systems
        
       Author : rdpintqogeogsaa
       Score  : 86 points
       Date   : 2023-08-26 09:15 UTC (1 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | anthk wrote:
       | Most OpenBSD users with Unicode needs will use nvi2 from ports.
        
         | ninjin wrote:
         | Indeed, but it would be nice to have that support in the base
         | install. Sadly I do not have the skill set to work towards it.
        
           | anthk wrote:
           | ed it's in base and it will support anything you throw at it
           | under an XTerm with a Unicode locale in X.
        
             | krylon wrote:
             | There is a reason it is the standard editor, after all.
        
       | [deleted]
        
       | ainar-g wrote:
       | I'll be able to try a bit later, but does it handle UTF-8
       | correctly? I remember having some versions of nvi split
       | characters through the middle when doing e.g. folding back in the
       | day.
       | 
       |  _EDIT:_ Sorry, I 'm a dum-dum, it's written in the README:
       | 
       | > No support for Unicode / UTF-8 / wide character display
       | 
       | > Multibyte support is planned, but is unfortunately non-trivial,
       | [...]
        
         | anthk wrote:
         | Nvi2 from packages/ports it's almost the same as core vi but
         | with Unicode support.
        
         | rahen wrote:
         | If you want a small, portable vi with Unicode, you can static
         | build the version from Busybox. That's what I do.
        
         | cpach wrote:
         | "Multibyte characters are shown as individual bytes, rather
         | than glyphs"
        
       | networked wrote:
       | There are many unofficial efforts to bring OpenBSD software to
       | other systems. For example, there are at least two maintained
       | ports of OpenBSD ksh, https://github.com/dimkr/loksh (Linux) and
       | https://github.com/ibara/oksh (cross-platform). There are also at
       | least two of doas, https://github.com/slicer69/doas and
       | https://github.com/nholstein/OpenDoas. I wish they were
       | catalogued somewhere, like an "awesome list".
       | 
       | I would love to see portable OpenBSD cron. Features like random
       | ranges with steps
       | (https://undeadly.org/cgi?action=article;sid=20230507122935) and
       | `-s` (https://man.openbsd.org/OpenBSD-7.2/crontab.5#s) put it
       | ahead of almost every other. It could replace many uses of
       | systemd timers on Linux.
       | 
       | Edit: Added doas ports.
        
         | ligurio wrote:
         | > I wish they were catalogued somewhere, like an "awesome
         | list".
         | 
         | Sure, they are listed here
         | 
         | https://github.com/ligurio/awesome-openbsd#portable-openbsd-...
        
           | networked wrote:
           | Haha, this is exactly what I asked for. :-) I should have
           | checked Awesome OpenBSD. Thanks for making this list.
        
         | hulitu wrote:
         | What is so difficult in porting ? OpenBSD is a (duck) UNIX so
         | it shouldn't be any issue.
        
           | pravus wrote:
           | It's really just the effort and time to understand the data
           | structures and API considerations between the two systems.
           | Saying something is a UNIX doesn't absolve you of the duty of
           | knowing how the specific UNIX was implemented. Also, Linux
           | has no UNIX heritage so relying on UNIX knowledge isn't as
           | helpful as you might think and most of the commonalities are
           | through things like POSIX standards which don't necessarily
           | drive kernel internals directly. If the application relies on
           | a specific kernel features, you might have a very complicated
           | or impossible task ahead.
           | 
           | Also, OpenBSD really doesn't have a huge install base. It's a
           | fairly niche project and the people that work on it really
           | don't care about Linux at all. You'd have to find someone
           | with the skills to be able to translate between the two, the
           | time to do it, and the desire to do it. I have the skills and
           | most of the desire but not the time otherwise I'd be working
           | on projects like this. I've been getting pretty sick of the
           | Linux eco-sphere for a while now so it'd be nice to have some
           | saner production tools. Unfortunately I have to have a day
           | job and no one at work even knows about OpenBSD.
        
             | SoftTalker wrote:
             | > It's a fairly niche project and the people that work on
             | it really don't care about Linux at all.
             | 
             | Maybe true for the core OS, but they provide portable
             | OpenSSH, OpenSMTPD, OpenNTPD, LibreSSL and a few others.
        
             | DougMerritt wrote:
             | I started with Bell Labs Unix, transitioned through many
             | variations, and then when I came to OpenBSD and Linux, they
             | were both pretty straightforward compared with, say,
             | porting to or from System V Unix.
             | 
             | I don't think you're wrong about anything. It's true that
             | one may need to pore over kernel code, and yes, often you
             | have the "duty of knowing how the specific Unix was
             | implemented". I just that that you're over-emphasizing the
             | difficulty.
             | 
             | Life is hard (including programming), but that's where we
             | calibrate our zero setting.
        
           | SomeoneFromCA wrote:
           | Openbsd has some security related syscalls not present in say
           | Linux and FreeBSD.
        
         | CameronNemo wrote:
         | FYI the doas ports you added are poorly maintained.
         | 
         | The nholstein repo clearly states: _This repository temporarily
         | unmaintained._
         | 
         | And the slicer69 project has had some insecure code added in
         | the past: https://xn--1xa.duncano.de/slicer69-doas.html
         | 
         | The awesome-openbsd repo only links to the Duncaen OpenDoas
         | repo: https://github.com/Duncaen/OpenDoas
        
           | networked wrote:
           | Sorry, I meant to link to https://github.com/Duncaen/OpenDoas
           | instead of https://github.com/nholstein/OpenDoas. Thank you
           | for correcting my mistake.
        
       | suprjami wrote:
       | You mean to tell me vi from the 1970s doesn't support LSP? This
       | is an outrage!
        
         | DougMerritt wrote:
         | Ok, you're joking, but still, are you referring to the 1987
         | Liskov Substitution Principle?
         | https://en.wikipedia.org/wiki/Liskov_substitution_principle
        
       ___________________________________________________________________
       (page generated 2023-08-27 23:02 UTC)