Suggestion: Replace Perl with Lua in the OpenBSD Base System

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

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Bob Beck-3
read fucking code.  change fucking things. send some fucking diffs. get
fucking yelled at. learn from your fucking mistakes.  show some fucking
passion.  filter fucking misc@ and all this useless bleating into the
toilet.

none of us have time to spoon feed you in some “boot camp”

there are two types of programmers. the self taught, and the hopeless. it
is your job to turn yourself from the hopeless to the self taught.

shut up and fucking hack.


On Tue, Dec 31, 2019 at 23:50 Frank Beuth <[hidden email]> wrote:

> On Wed, Jan 01, 2020 at 04:00:37AM +0000, [hidden email] wrote:
> >rather than the programmer being responsible for
> >writing unsafe
> >code we need to regulate what the programmer can do just like we need to
> >regulate what the community can say, do, see, and think.
>
> where do I sign up for OpenBSD write-perfect-C-code programmer training
> bootcamp?
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Frank Beuth
On Tue, Dec 31, 2019 at 11:56:46PM -0700, Bob Beck wrote:

>read fucking code.  change fucking things. send some fucking diffs. get
>fucking yelled at. learn from your fucking mistakes.  show some fucking
>passion.  filter fucking misc@ and all this useless bleating into the
>toilet.
>
>none of us have time to spoon feed you in some “boot camp”
>
>there are two types of programmers. the self taught, and the hopeless. it
>is your job to turn yourself from the hopeless to the self taught.
>
>shut up and fucking hack.

Well put.

But I don't want deeper point to get missed -- which is that if eecd
doesn't like the idea of regulating what the programmer can do, then the
programmer has to have the skills to safely write unsafe code.



>
>
>On Tue, Dec 31, 2019 at 23:50 Frank Beuth <[hidden email]> wrote:
>
>> On Wed, Jan 01, 2020 at 04:00:37AM +0000, [hidden email] wrote:
>> >rather than the programmer being responsible for
>> >writing unsafe
>> >code we need to regulate what the programmer can do just like we need to
>> >regulate what the community can say, do, see, and think.
>>
>> where do I sign up for OpenBSD write-perfect-C-code programmer training
>> bootcamp?
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Anders Andersson
In reply to this post by Stuart Longland
On Wed, Jan 1, 2020 at 4:51 AM Stuart Longland
<[hidden email]> wrote:

> Perl 6 will be a major change though, more disruptive than the Python2→3
> mess was.  So we may be in for some "fun" in the near future.

Gotta stop this before it derails: perl 6 is not the next version of
perl 5. It's not compatible, it's not an upgrade, it's a completely
new language and does no longer even share the same name (renamed to
raku). There is no "perl 6" that will replace perl 5.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

eecd
In reply to this post by ansimita
 > where do I sign up for OpenBSD write-perfect-C-code programmer training
bootcamp?

here we go ladies and gents an unadulterated look at the manchild in the
wild
as he looks for something else to take responsibility for his work. after
decades of being spoonfed it's lost the ability to fend for itself as
previous
generations once did. where autodidacts once had the initiative to read,
study
and learn how to use tools inherently more dangerous than the relatively
tame c,
children nowadays only know how to blame the job for being too hard. the
tool
for being unsafe. or the teacher for being too strict. where men once fixed
steel without harness or lanyard, hardhat or steelcaps they now want
everything
handed to them on a silver platter

 > But I don't want deeper point to get missed -- which is that if eecd
 > doesn't like the idea of regulating what the programmer can do, then the
 > programmer has to have the skills to safely write unsafe code.

no you're belying the point: the good programmer regulates himself while
you
want to police everything and everyone else to compensate for your own
shortcomings


At moment, I want my privacy to be protected.
https://mytemp.email/

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Espie-2
In reply to this post by Anders Andersson
On Tue, Dec 31, 2019 at 10:36:15PM +0100, Anders Andersson wrote:
> Of course its age is showing in some areas but in my experience, those
> things are actually still worked on, and have been fixed without major
> incompatibilities (python3 anyone?).

The only thing that's really missing in perl is proper thread support.
Don't know if that's going to happen.

Its garbage collector is also slightly peculiar...  I remember looking
really hard for a leak because a file handle in an anonymous sub wouldn't
be properly collected (the one from pkg_add's progressmeter, actually)


I have a wish-list of things that are not that likely to happen, I would
like to be able to use prototypes on methods, for instance.


> I remember a few years ago when I was briefly researching a
> replacement for perl for my personal projects and I tried out python3
> and ruby in parallel and ruby was definitely the winner there. I have
> absolutely no idea why python even gained the popularity it has, it
> felt like a random hack, especially compared to ruby. The only thing I
> really miss from python is "yield".

Yeah, native coroutine support without a hack would be a blast.
Even C++ is getting that for its next main revision.

The popularity of python is partly explained by them catering more to
teaching needs.   As far as I know, there is no equivalent of the python
notebooks.  Stuff like jupyter means you don't even have to install
complicated arcane stuff to learn python. Cool for the young pups.

Perl also missed a turn for web development. I think Catalyst was a huge
mistake (hey, you've got *choices* everywhere. Let's confuse everyone),
so a lot of people didn't transition from Meson to another perl module, but
instead switched to ruby-on-rails or something like that.

Dancer was a few years too late to the party.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Marc Espie-2
In reply to this post by Steve Litt
On Tue, Dec 31, 2019 at 10:01:50PM -0500, Steve Litt wrote:

> On Tue, 31 Dec 2019 15:57:47 -0600
> Eric Zylstra <[hidden email]> wrote:
>
> > Proposing such a huge project without the ability to do it?  I may
> > have been a little disrespectful, but not the first one in the
> > thread.  And my point wasn’t to be disrespectful, but to point out
> > that most proposals unaccompanied by code and that don’t solve
> > obvious problems don’t seem to be received very well.  Apologies if
> > that wasn’t within bounds.
>
> What if the OP had instead of the suggestion submitted two or three Lua
> scripts to replace two or three Perl scripts? Would you still have the
> same opinion?

Good luck with that.

Tools in base written in perl:
- libtool
- pkg-config
- pkg_add

The libtool part is insane. pkg-config is doable.

You won't be able to rewrite pkg_add without rewriting the whole
ecosystem, because it's heavily based on a few choice modules (see
OpenBSD::Intro(3) )  and you more or less have to rewrite all of it
together, meaning:
-> pkg_add, create, delete
-> fw_update
-> dpb
-> update-plist
-> check-lib-depends
-> pkg_check-*
-> pkg_outdated
-> pkg_subst
-> port-resolve-lib-helper
-> proot
-> register-plist

There are a few other scripts which are independent of that framework,
but still that's some complicated job.


Instead of rewriting it, I would be way more interested in somebody
looking carefully at (say) libtool and fixing the missing parts...

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Marc Espie-2
In reply to this post by Anders Andersson
On Wed, Jan 01, 2020 at 10:06:47AM +0100, Anders Andersson wrote:

> On Wed, Jan 1, 2020 at 4:51 AM Stuart Longland
> <[hidden email]> wrote:
>
> > Perl 6 will be a major change though, more disruptive than the Python2→3
> > mess was.  So we may be in for some "fun" in the near future.
>
> Gotta stop this before it derails: perl 6 is not the next version of
> perl 5. It's not compatible, it's not an upgrade, it's a completely
> new language and does no longer even share the same name (renamed to
> raku). There is no "perl 6" that will replace perl 5.

Actually all the cool and useful ideas that perl6 had DID trickle down
into perl5 a few years ago.

Perl6 was (I think) intended as a test bed for ideas by Larry.  Everybody
got sidelined when a perl6 implementation came out of nowhere,
written by Audrey Tang, an extra-terrestrial years ahead of everyone.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Marc Espie-2
In reply to this post by Christer Solskogen-3
On Tue, Dec 31, 2019 at 09:06:38PM +0100, Christer Solskogen wrote:
> On Tue, Dec 31, 2019 at 5:50 PM Marc Espie <[hidden email]> wrote:
>
> > We did retire vax, and we no longer have any platform without dynamic
> > libraries.
> >
> >
> OT but: out of sheer curiosity, why didn't VAX support dynamic libraries?

Very different architecture, no register to do pic code efficiently and
512 bytes pages.

NetBSD moved to shared libraries on vax at a huge performance cost
(something like 30%), if I recall what Miod was saying at the time.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Marc Espie-2
In reply to this post by Bob Beck-3
On Tue, Dec 31, 2019 at 11:56:46PM -0700, Bob Beck wrote:
> read fucking code.  change fucking things. send some fucking diffs. get
> fucking yelled at. learn from your fucking mistakes.  show some fucking
> passion.  filter fucking misc@ and all this useless bleating into the
> toilet.
>
> none of us have time to spoon feed you in some “boot camp”
                  ^fucking
>
> there are two types of programmers. the self taught, and the hopeless. it
                ^fucking
> is your job to turn yourself from the hopeless to the self taught.
                                        ^fucking
>
> shut up and fucking hack.
>

There, you missed a few.

Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Frank Beuth
In reply to this post by eecd
On Wed, Jan 01, 2020 at 10:29:53AM +0000, [hidden email] wrote:
>> But I don't want deeper point to get missed -- which is that if eecd
>> doesn't like the idea of regulating what the programmer can do, then the
>> programmer has to have the skills to safely write unsafe code.
>
>no you're belying the point: the good programmer regulates himself
>while you
>want to police everything and everyone else to compensate for your own
>shortcomings

I don't think I suggested anywhere that I want to police anyone else. I
largely agree with what you write with respect to self-regulation.
However, I'm not sure that ranting about it on misc@ is the most
effective way to make positive progress in the desired direction.

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Chantreux
In reply to this post by Anders Andersson
hello,

as intro: i would like to make clear that i'm not promoting perl (my go
to langage for scripting is now raku by far) but as i was a member of the perl
community more than 20 years, i have some opinions about it.

> felt like a random hack, especially compared to ruby. The only thing I
> really miss from python is "yield".

why is this ? return is the perl yield. the only difference is that the
"exhausted" situation is on your own. so basically:

    def count_from(x):
        while True:
            yield x
            x = x + 1

    naturals = count_from(0)
    print(next(naturals))
    print(next(naturals))
    print(next(naturals))
    print(next(naturals))

is written in perl

    use experimental 'signatures';
    use feature 'say';

    sub count_from ($x) { sub { $x++ } }
    sub NEXT ($generator) { $generator->() }
    my $naturals = count_from 0;

    say NEXT $naturals;
    say NEXT $naturals;
    say NEXT $naturals;
    say NEXT $naturals;

there are complete modules on CPAN based on this. Perlude provide
keywords stolen from haskell to make things more like shell scripting
so the equivalent of

    grep root "$@" | sed 100q

is

    use Perlude;
    now {print}
        take 100,
        filter { /root/ }
        sub    { <ARGV> // () };

Perlude is available on CPAN:

    https://metacpan.org/pod/distribution/perlude/lib/Perlude.pod


> and ruby in parallel and ruby was definitely the winner there. I have
> absolutely no idea why python even gained the popularity it has, it

my opinion: python gained popularity during the dark ages of internet
when most of the people (including developpers and IT people) were using
windows and teach themselves how to use a computer or worse: learned
from java schools.

so python won because:

* they took care about windows users
* the langage is designed to provide simple solutions for simple cases
  which please most of the users (they don't need to maintain large
  codebases)
* the default behaviors of the langage were the same than the langages
  learned in the java schools (POO, ...). the most obvious example is
  the "flatten values by default":
  * it became the center of the stupidest talk ever
      https://media.ccc.de/v/31c3_-_6243_-_en_-_saal_1_-_201412292200_-_the_perl_jam_exploiting_a_20_year-old_vulnerability_-_netanel_rubin
  * thanks to javascript, (with the rest operator and the
    destructuring syntax) they now all get the point and even python
    dpeople now have access to those features and like this.
      https://youtu.be/ggbi4SelOAo?t=955

so perl didn't fit the needs of the internet bubble

* perl were about unix culture, mailing lists and so on: they setup a
  confortable cocoon to work together and this cocoon became an echo
  chamber when the other communities started to use third party services
  like stack overflow.
* something i call "the 'hello world' pride": when perl programmers were
  just putting new modules on CPAN to get the job done, python ones were
  creating tools and projet sites and so on with a logo "powered by
  python". this has an impact on the myth of "perl is dying"
* the python community was unfair comparing the langages (using ugly
  perl code and nice python counterparts). instead of taking time to
  explain all the biases, perl community repetedly asserted that the
  authors of those article were incompetents and gone away.
* same situation regarding the constant FUD from the other dynamic
  langages

perl people didn't realised how unixish perl is:

* it's sad to realize that even linux users of nowaday are not
  confortable with the basics of awk, sed and so on ... and perl
  is born by improving the concepts of those langages and putting
  them together in one tool. it means that learning perl is easy for
  unix users: not for the rest of us. combined to the "DWIM" moto, perl
  has some unexpected behavior because it implies you should *know* what
  you should mean (which implies a unix culture).  the most obvious
  exemple for me is the fact that <> iterates by default on ARGV, not on
  STDIN: ARGV is what you need to know when you want to write a filter
  but it's way too magic when you don't know the unix philosophy.

* when perl gained popularity (the realm of CGIs), lot of aweful scripts
  were written by newbies both in perl and unix. the result was terrible
  and gave perl a very bad reputation.

regards
marc



Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Chantreux
In reply to this post by Marc Espie-2
hello,

> The only thing that's really missing in perl is proper thread support.
> Don't know if that's going to happen.

seems ... complicated ...

> I have a wish-list of things that are not that likely to happen, I would
> like to be able to use prototypes on methods, for instance.

what do you mean by this? prototypes are here for decades and signatures
are experimental and i guess it will be core in some releases.

also, thanks to pluggable keywords, some very powerful modules exists
like https://metacpan.org/pod/Function::Parameters

> Perl also missed a turn for web development. I think Catalyst was a huge
> mistake (hey, you've got *choices* everywhere. Let's confuse everyone),

perl had CGI.pm, maypole, mod_perl, catalyst, jifty, dancer, mojolicious ...
Template toolkit is still by far the best template toolkit i know.
i really thing the only thing where perl was not a precursor in web dev
is plack (which is inspired by wsgi which is inspired by rack ... i
don't know if there is another ancestor).

> so a lot of people didn't transition from Meson to another perl module, but
> instead switched to ruby-on-rails or something like that.

you mean mason ? mason is the php of perl: don't organize your code:
write a single page with everything in it ... it was a terrible thing
to maintain (see the code of request tracker...).

> Dancer was a few years too late to the party.

sinatra (from ruby) was the source of inspiration of Dancer which,
AFAIK, appears years before flask and bottle.

ActiveRecord was easier than DBIx::Class for simple situations. that's
one of the reasons of the popularity of RoR (also the Ruby syntax).

regards
marc


Reply | Threaded
Open this post in threaded view
|

Re: Suggestion: Replace Perl with Lua in the OpenBSD Base System

Marc Chantreux
In reply to this post by Marc Espie-2
hello,

> Actually all the cool and useful ideas that perl6 had DID trickle down
> into perl5 a few years ago.

even if you load a lot of modules from CPAN (which i tried to do with
https://metacpan.org/pod/Sympatic), this is not even close to be true!

for example, raku has

* PEGs are objects
* make multithreaded programming easier than i never seen before
* gradually typing, subsetting types are core
* has much more powerful metamodel, sub and method signatures
* metaoperators
* lambda syntax made right
* Whatever operator
* andless possibilities of new operators that can be used postfixed,
  infixed, prefixed and more ...
* multi signatures (pattern matching for signatures)
* multiple backends (currently jvm and moarvm)

also: globally the langage is much more concistent and readable than
every dynamic langage i saw before.

> Perl6 was (I think) intended as a test bed for ideas by Larry.  Everybody
> got sidelined when a perl6 implementation came out of nowhere,
> written by Audrey Tang, an extra-terrestrial years ahead of everyone.

AFAIK, pugs (it was the name of this implementation) made it possible to
write a test suite that became a reference for all the future
implementations of perl6 (now raku). Now there is a complete community
around the current defacto official backend (named rakudo).

raku is the perl of 2020:
a dynamic langage that is ahead of its time made by an inspiring,
competent and dedicated community which suck at marketing.

regards
marc





Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Roderick
In reply to this post by Marc Chantreux

BTW. Also tcl has coroutines since a while:

https://www.tcl.tk/man/tcl8.6/TclCmd/coroutine.htm

Rodrigo.

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Chantreux
In reply to this post by Marc Espie-2
hello,

> The only thing that's really missing in perl is proper thread support.
> Don't know if that's going to happen.

just to be sure: are you aware of the MCE module?

https://metacpan.org/pod/distribution/MCE/lib/MCE.pod

regards
marc

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Espie-2
In reply to this post by Marc Chantreux
On Wed, Jan 01, 2020 at 03:43:38PM +0100, Marc Chantreux wrote:
> hello,
>
> > The only thing that's really missing in perl is proper thread support.
> > Don't know if that's going to happen.
>
> seems ... complicated ...

Tell me about it. The only existing thread support  was so clunky it got
thoroughly deprecated.   It was really bad back in userland pthread days,
because you couldn't even build perl binaries depending on threaded libraries
(all-or-nothing -pthread flag) such as frozenbubble.

> > I have a wish-list of things that are not that likely to happen, I would
> > like to be able to use prototypes on methods, for instance.
>
> what do you mean by this? prototypes are here for decades and signatures
> are experimental and i guess it will be core in some releases.


You can't mix oo lookup and prototypes.

Stuff like
$o->method { code }
for instance.

you have to use the clunkier
$o->method(sub { code });

> > Perl also missed a turn for web development. I think Catalyst was a huge
> > mistake (hey, you've got *choices* everywhere. Let's confuse everyone),
>
> perl had CGI.pm, maypole, mod_perl, catalyst, jifty, dancer, mojolicious ...
> Template toolkit is still by far the best template toolkit i know.
> i really thing the only thing where perl was not a precursor in web dev
> is plack (which is inspired by wsgi which is inspired by rack ... i
> don't know if there is another ancestor).

That's the big issue. Too much choice in the ecosystem, with some of it not
clearly enough explained... and no simple integration with js libraries for
ajax at first.

> you mean mason ? mason is the php of perl: don't organize your code:
> write a single page with everything in it ... it was a terrible thing
> to maintain (see the code of request tracker...).

Yeah, I mean mason.  At some point long ago, it was about the only
game in town for perl.

> > Dancer was a few years too late to the party.
>
> sinatra (from ruby) was the source of inspiration of Dancer which,
> AFAIK, appears years before flask and bottle.

> ActiveRecord was easier than DBIx::Class for simple situations. that's
> one of the reasons of the popularity of RoR (also the Ruby syntax).

I still thing DBIx::Class is overkill. The DB::Rose stuff was way simpler
and I would have preferred for it to win.

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Chantreux
hello,

> > what do you mean by this? prototypes are here for decades and signatures
> > are experimental and i guess it will be core in some releases.

> Stuff like
> $o->method { code }

ooohh right! this is a thing i also missed with perl (fixed in raku).

> > Template toolkit is still by far the best template toolkit i know.
> > i really thing the only thing where perl was not a precursor in web dev
> > is plack (which is inspired by wsgi which is inspired by rack ... i
> > don't know if there is another ancestor).

> That's the big issue. Too much choice in the ecosystem, with some of it not
> clearly enough explained... and no simple integration with js libraries for
> ajax at first.

> Yeah, I mean mason.  At some point long ago, it was about the only
> game in town for perl.

yes! the eperl competitor. i remember that.

> > ActiveRecord was easier than DBIx::Class for simple situations. that's
> > one of the reasons of the popularity of RoR (also the Ruby syntax).
>
> I still thing DBIx::Class is overkill. The DB::Rose stuff was way simpler
> and I would have preferred for it to win.

Well... i liked the simplicity until i had some cases like having 2
different DBs with the same model: piece of cake with DBIxC and
impossible with ActiveRecord (AFAIR).

regards
marc


Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Espie-2
On Wed, Jan 01, 2020 at 04:44:48PM +0100, Marc Chantreux wrote:
> > I still thing DBIx::Class is overkill. The DB::Rose stuff was way simpler
> > and I would have preferred for it to win.
>
> Well... i liked the simplicity until i had some cases like having 2
> different DBs with the same model: piece of cake with DBIxC and
> impossible with ActiveRecord (AFAIR).

Oh, I'm not talking ActiveRecord.

Did you ever look at the suite of modules from John Syracusa (DB::Rose and
the like) ? fairly clean and nice.

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Marc Chantreux
> Did you ever look at the suite of modules from John Syracusa (DB::Rose and
> the like) ? fairly clean and nice.

I had this under my radar but no one around be wanted to test anything
else but DBIxC so i never took time to read the code or use it.

regards
marc

Reply | Threaded
Open this post in threaded view
|

Re: perl popularity inside openbsd community? (Re: Suggestion: Replace Perl ...)

Frank Beuth
In reply to this post by Marc Chantreux
On Wed, Jan 01, 2020 at 03:30:44PM +0100, Marc Chantreux wrote:

>why is this ? return is the perl yield. the only difference is that the
>"exhausted" situation is on your own. so basically:
>
>    def count_from(x):
>        while True:
>            yield x
>            x = x + 1
>
>    naturals = count_from(0)
>    print(next(naturals))
>    print(next(naturals))
>    print(next(naturals))
>    print(next(naturals))
>
>is written in perl
>
>    use experimental 'signatures';
>    use feature 'say';
>
>    sub count_from ($x) { sub { $x++ } }
>    sub NEXT ($generator) { $generator->() }
>    my $naturals = count_from 0;
>
>    say NEXT $naturals;
>    say NEXT $naturals;
>    say NEXT $naturals;
>    say NEXT $naturals;
>



>* perl were about unix culture, mailing lists and so on: they setup a
>  confortable cocoon to work together and this cocoon became an echo
>  chamber when the other communities started to use third party services
>  like stack overflow.

https://github.com/drathier/stack-overflow-import

>* the python community was unfair comparing the langages (using ugly
>  perl code and nice python counterparts). instead of taking time to
>  explain all the biases, perl community repetedly asserted that the
>  authors of those article were incompetents and gone away.

Not sure about anyone else, but comparing the Python vs Perl example you
gave above, I would still say Python is the nicer-looking language.

12345