Re: Start point to learn OpenBSD programming

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Start point to learn OpenBSD programming

Martijn van Duren-6
On 3/16/20 8:23 AM, Martin wrote:
> Hello list,
>
> The best way for beginner to start with OpenbBSD programming?
>
> Martin
>
This belongs on misc, so moving it there.

My usual routine (and probably of a lot of other OpenBSD developers) is:
1) Use it
2) Get annoyed by something (bug?)
3) Dive into /usr/src to see what it actually does
4a) Realize I'm wrong in my initial annoyance; goto 1)
4b) Realize you can't fix the bug and ask for help on bugs@; goto 1)
4c) Try to fix the bug and sent a patch to tech@
5a) Patch falls in between the cracks (no-one responds) and it's not
    that important to you; goto 1)
5b) Patch falls in between the cracks and it's important to you;
    send reminder and goto 1) in the meantime.
5c) Realize my interpretation was wrong based on feedback; goto 1)
5d) Realize my patch was wrong based on feedback; goto 4b)
5e) Patch gets committed; goto 1)

If you want reading material find a function you don't understand and
lookup the manpage. If you want to have a more adventurage approach:
$ PAGE=$(ls /usr/share/man/man[23] | sort -R  | head -1); \
man ${PAGE##*.} ${PAGE%.*}

Another interesting place for some backstories is:
https://www.openbsd.org/events.html

Hope this helps.

martijn@

Reply | Threaded
Open this post in threaded view
|

Re: Start point to learn OpenBSD programming

Ingo Schwarze
Hi Martijn,

Martijn van Duren wrote on Mon, Mar 16, 2020 at 08:52:54AM +0100:
> On 3/16/20 8:23 AM, Martin wrote:

>> The best way for beginner to start with OpenbBSD programming?

> This belongs on misc, so moving it there.
>
> My usual routine (and probably of a lot of other OpenBSD developers) is:

You forgot two steps:

> 1) Use it
> 2) Get annoyed by something (bug?)

Between steps 2 and 3, read the manual page to make sure your assumptions
about what it is supposed to do are correct.  Often, that will already
reveal they are not: goto 1.

> 3) Dive into /usr/src to see what it actually does
> 4a) Realize I'm wrong in my initial annoyance; goto 1)

After step 4a and before going back to step 1, close the gap in the
manual page and send the patch to tech@; after all, that you even
got to step 4a proves that something a user needs to know wasn't
adequately described in the manual.  Goto 5a.

> 4b) Realize you can't fix the bug and ask for help on bugs@; goto 1)
> 4c) Try to fix the bug and sent a patch to tech@
> 5a) Patch falls in between the cracks (no-one responds) and it's not
>     that important to you; goto 1)
> 5b) Patch falls in between the cracks and it's important to you;
>     send reminder and goto 1) in the meantime.
> 5c) Realize my interpretation was wrong based on feedback; goto 1)
> 5d) Realize my patch was wrong based on feedback; goto 4b)
> 5e) Patch gets committed; goto 1)
>
> If you want reading material find a function you don't understand and
> lookup the manpage. If you want to have a more adventurage approach:
> $ PAGE=$(ls /usr/share/man/man[23] | sort -R  | head -1); \
> man ${PAGE##*.} ${PAGE%.*}

That can be simplified:

  $ man -l $(ls /usr/share/man/man[23]/*.[23] | sort -R  | head -1)

;-)
  Ingo

Reply | Threaded
Open this post in threaded view
|

Re: Start point to learn OpenBSD programming

Martijn van Duren-6
On 3/16/20 9:22 AM, Ingo Schwarze wrote:

> Hi Martijn,
>
> Martijn van Duren wrote on Mon, Mar 16, 2020 at 08:52:54AM +0100:
>> On 3/16/20 8:23 AM, Martin wrote:
>> If you want reading material find a function you don't understand and
>> lookup the manpage. If you want to have a more adventurous approach:
>> $ PAGE=$(ls /usr/share/man/man[23] | sort -R  | head -1); \
>> man ${PAGE##*.} ${PAGE%.*}
>
> That can be simplified:
>
>   $ man -l $(ls /usr/share/man/man[23]/*.[23] | sort -R  | head -1)
>
> ;-)
>   Ingo
>
Who said I went for simple? I even left a minor bug in there for Martin
to find. :-)

Reply | Threaded
Open this post in threaded view
|

Re: Start point to learn OpenBSD programming

Ingo Schwarze
Hi Martijn,

Martijn van Duren wrote on Mon, Mar 16, 2020 at 09:24:26PM +0100:
> On 3/16/20 9:22 AM, Ingo Schwarze wrote:
>> Martijn van Duren wrote on Mon, Mar 16, 2020 at 08:52:54AM +0100:

>>> On 3/16/20 8:23 AM, Martin wrote:
>>> If you want reading material find a function you don't understand and
>>> lookup the manpage. If you want to have a more adventurous approach:
>>> $ PAGE=$(ls /usr/share/man/man[23] | sort -R  | head -1); \
>>> man ${PAGE##*.} ${PAGE%.*}

>> That can be simplified:
>>   $ man -l $(ls /usr/share/man/man[23]/*.[23] | sort -R  | head -1)

> Who said I went for simple?

You said so implicitly, in so far as you are doing good work on
OpenBSD.  :)

> I even left a minor bug in there for Martin to find. :-)

Indeed!  Which proves again that while randomization is important,
it is easy to cause subtle heisenbugs with it.  And i consciously
chose to not point it out but silently fix it, to avoid having to
mark my posting as [SPOILERS].

Yours,
  Ingo

Reply | Threaded
Open this post in threaded view
|

Re: Start point to learn OpenBSD programming

Marc Espie-2
On Mon, Mar 16, 2020 at 10:00:31PM +0100, Ingo Schwarze wrote:

> Hi Martijn,
>
> Martijn van Duren wrote on Mon, Mar 16, 2020 at 09:24:26PM +0100:
> > On 3/16/20 9:22 AM, Ingo Schwarze wrote:
> >> Martijn van Duren wrote on Mon, Mar 16, 2020 at 08:52:54AM +0100:
>
> >>> On 3/16/20 8:23 AM, Martin wrote:
> >>> If you want reading material find a function you don't understand and
> >>> lookup the manpage. If you want to have a more adventurous approach:
> >>> $ PAGE=$(ls /usr/share/man/man[23] | sort -R  | head -1); \
> >>> man ${PAGE##*.} ${PAGE%.*}
>
> >> That can be simplified:
> >>   $ man -l $(ls /usr/share/man/man[23]/*.[23] | sort -R  | head -1)
>

If you install random_run from packages,
you can go for

rr -1 man -l -- /usr/share/man/man[23]/*.[23]

that's precisely the kind of stupid thing it was built to handle.