学习 Perl - 哪个版本?

发布于 2024-09-11 16:29:06 字数 1436 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

≈。彩虹 2024-09-18 16:29:06

如果您想要 CPAN,则使用 Perl 5;如果您想要可接受的运行时性能,则使用 Perl 5;如果您想要稳定性和完整的语言,则使用 Perl 5。如果您想玩世界上最漂亮的玩具,请选择 Perl 6。

当然,它们并非互不兼容——我编写 Perl 5 是为了报酬和大部分“严肃”的开源工作,而编写 Perl 6 是为了乐趣。但我编写 Perl 的时间已经足够长了,以至于我对 Perl 5 已经很适应,所以我可以在业余时间转换方向并编写 Perl 6。

但对于刚刚起步的人来说,您当然只想专注于一种语言,并且出于最实际的目的,该语言应该是 Perl 5。无论 Perl 6 取得多大成功,Perl 5 在未来 10 年内不会随时消亡,尽管 Perl 5 和 Perl 6 是完全不同的语言,但您仍然可以学到很多东西如果您将来选择学习 Perl 5,《Perl 5》将帮助您开始使用 Perl 6。

Perl 5 if you want CPAN, Perl 5 if you want acceptable runtime performance, Perl 5 if you want stability and a language that's complete. Perl 6 if you want to play with the world's niftiest toy.

Of course, they're not mutually incompatible -- I write Perl 5 for pay and for most of my "serious" open-source work, and Perl 6 for fun. But I've been writing Perl for long enough that I'm comfortable enough with Perl 5 to switch gears and write Perl 6 in my spare time.

But for someone just starting out, of course you want to focus on just one language, and that language should be Perl 5 for most practical purposes. Perl 5 is not going to die anytime in the next 10 years, no matter how much success Perl 6 enjoys, and even though Perl 5 and Perl 6 are definitively different languages, still a lot of what you learn from Perl 5 will help you get started with Perl 6 if you choose to learn it in the future.

心头的小情儿 2024-09-18 16:29:06

以下是 Perl6 网页 的引用(重点是我的):

Perl 5 和 Perl 6 是两种语言
Perl 家族,但不同
血统。如果您正在寻找
生产就绪代码请使用 Perl
5
.

Perl5已经成熟了。 Perl6 正在开发中。

Here is a quote from the Perl6 webpage (emphasis is mine):

Perl 5 and Perl 6 are two languages in
the Perl family, but of different
lineages. If you are looking for
production ready code please use Perl
5
.

Perl5 is mature. Perl6 is in development.

寒江雪… 2024-09-18 16:29:06

Perl5。

如果您愿意进行全新的开发并且可以等待 N 年直到 Perl 6 真正问世,您可以学习 Perl 6。但实际上,Perl5。

编辑澄清:Rakudo Star,a

有用、可用、“早期采用者”的 Perl 6 发行版

最近引起了一些关注,但它还不是完整的或最终的,并且还没有真正准备好在生产环境中部署。如果您在未来一三年内寻找新工作,它不太可能帮助您获得那份工作。也许最重要的是,如果企业对 Perl 6 感兴趣,那么它很可能也有一些 Perl 5 基础设施,并且在学习之前先学习 Perl 5 及其局限性,您会更好地准备理解它一种明显较新的语言,如 Perl 6。

如果您只是寻找“乐趣”,您可能确实更喜欢 Perl 6...或者您可能更喜欢更可用的 Perl 5 及其通过 CPAN 提供的各种预打包模块。

Perl 6 没有发布日期。

Perl5.

If you're willing to do all-new development and can wait N years until Perl 6 is actually out, you can learn Perl 6. But really, Perl5.

edit to clarify: Rakudo Star, a

useful, usable, "early adopter" distribution of Perl 6

has recently garnered some attention, but it's not complete or final, and it's not really ready for deployment in a production environment. If you're looking for a new job in the next year or three, it's unlikely to help you get that job. Perhaps most importantly, if an enterprise is interested in Perl 6, chances are it's got some Perl 5 infrastructure too, and you would be better prepared to understand it by learning Perl 5 and its limitations first before you learn a significantly newer language like Perl 6.

If you're just looking for "fun" you may indeed prefer Perl 6... or you may prefer the much more available Perl 5 and its wide variety of prepackaged modules available via CPAN.

There is no release date for Perl 6.

骄兵必败 2024-09-18 16:29:06

建议先学习 Perl 5 再学习 Perl 6 有几个原因。

  • 关于编写 Perl 5 程序的书籍比 Perl 6 程序要多。
  • Perl5 编程的信息比编程的信息多Perl 6.
  • Perl 6 仍在设计过程中。这意味着您现在学到的一些东西以后可能不再适用。
  • 有许多高质量的 Perl 5 模块,而 Perl 6 模块的数量相对较少。
    • CPAN
    • 大多数 Perl 6 模块目前只是 Perl 5 模块的重新实现。
  • Perl 5 不会消失。
    • Perl 5 语言的大多数当前版本都是在 Perl 6 规范工作开始之后发布的。
    • 可以说 Perl 6 保存了 Perl 5。

推荐 Perl 6 而不是 Perl 5 还有一些原因。

  • 它经过重新设计,使不同的事物看起来有所不同,而相似的事物在更大程度上看起来相似。
  • 并行性已被设计到语言中,
  • 许多可以说是相互冲突的范例以一种感觉好像它们只是整体的一部分的方式组合在一起。
  • 更好的默认对象系统
    (Perl 5 中的 Moose/Moo/etc 也很棒,并且已被复制到其他语言)
  • 特殊情况较少。
  • 有更多的方式来表达您的想法,这使您可以选择一种更容易阅读的方式。
  • 元运算符
  • 普通运算符只是子例程,它允许您添加新运算符并扩展现有运算符。
    (不要将现有的运算符用于其设计目的之外的用途,添加新的运算符)

There are several reasons for recommending learning Perl 5 before learning Perl 6.

  • There are more books on writing Perl 5 programs than Perl 6 programs.
  • There is just more information for programming in Perl5 than for programming Perl 6.
  • Perl 6 is still in the process of being designed. Which means that some of the things you would learn now, might not be applicable later.
  • There are many quality Perl 5 modules, while there are only a relatively small number of Perl 6 modules.
    • CPAN
    • Most of the modules for Perl 6 are currently just reimplementations of Perl 5 modules.
  • Perl 5 isn't going to go away.
    • Most of the current versions of the Perl 5 language have come out after work on the Perl 6 specification started.
    • Arguably Perl 6 saved Perl 5.

There are also a few reasons for recommending Perl 6 over Perl 5.

  • It has been redesigned so that different things look different, and similar things look similar, to a much greater extent.
  • Parallelism has been designed into the language
  • Many arguably conflicting paradigms have been combined in a way that feels as if they were just some part of a whole.
  • Nicer default object system
    ( Moose/Moo/etc in Perl 5 is great too, and have been copied to other languages )
  • There are fewer special cases.
  • There are more ways to express your ideas, which allows you to choose one that is easier to read.
  • Meta operators
  • Normal operators are just subroutines, which allows you to add new ones, and extend existing ones.
    ( don't use existing operators for things they weren't designed for, add new ones )
木森分化 2024-09-18 16:29:06

Perl6 自2000 年 7 月开始开发。您决定是否要等待。

Perl5 仍然建议用于生产代码,并且拥有庞大的支持社区,不过,作为 Perl6 的证明,如果您遇到问题,则更有可能是该语言的新增内容,而不是 Perl5 中的那些问题。

一旦 Perl6“发布”,Larry Wall 和其他人就创建了一个翻译器,它将把大多数(如果不是全部)Perl5 代码转换为 Perl6 语法,如果这对您的决定有帮助的话。

Perl6 has been in development since July 2000. You decide if you want to wait on it.

Perl5 is still suggested for production code and has a large support community, though, as a testament to Perl6, if you encounter problems, it is more likely to be from new additions to the language, not those things that were in Perl5.

Once Perl6 is "released", Larry Wall and others have created a translator, which will convert most (if not all) the Perl5 code into Perl6 syntax, if that helps in your decision.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文