13 ms·
Raku vs. Perl
- zerr 7y agoPerl 6 name maybe was a bad choice back then, but we all got used to it - there was no need changing it nowadays.
- awestroke 7y agoI disagree. It's a completely different language. Try reading some of this: https://github.com/Raku/problem-solving/issues/81 https://github.com/Raku/problem-solving/issues/81
- zerr 7y agoYes, but I mean we all got used that "Perl 6" is a different language.
- lizmat 7y agoIndeed, everybody got used to the idea that "Perl 6" was a different language. But a vocal part of prominent Perl community members, preferred for "Perl 6" not to be named "Perl" anymore. As well as a part of the "Perl 6" community. In the end it felt better to stop wasting all those emocycles and suggest a rename.
- lilSebastian 7y agoHad viewers of Police academy 6 been treated to a brutal crime drama, rather than a continuation of the farce found in the series to date, you'd expect them to just get used to it, rather than accept that naming as the next version of something vastly different is a dumb idea. Edit* I make no criticism of the language, simply the argument that a different language should have been named as the incremental release of another.
- hedora 7y agoHighlander 2: Scotts from Space would have been a better comparison than Police Academy 6. They both got 0% on rotten tomatoes, but I don’t think Police Academy 6 tried to switch genres.
- lilSebastian 7y agoThat is my point. "Perl" didn't try to change genres, something different came along and called itself "Perl 6". No disrespect to either language, but linguistically this is has a negative impact for both Perl 5 and "Perl 6". Maintaining that certain people got "used to" the idea proves that it was never a wise move. Also, note what chromatic has to say: https://perlmonks.com/?node_id=1220578 https://perlmonks.com/?node_id=1220578 https://perlmonks.com/?node_id=11105180 https://perlmonks.com/?node_id=11105180 And so on.
- lizmat 7y ago> something different came along and called itself "Perl 6" You appear to forget that the "Perl 6" initiative originally came from the Perl 5 Porters. It did not just come along and called itself "Perl 6": the "Perl 6" name was used because originally it was intended as the successor of Perl 5. That it didn't materialize in time, that it became something much different, is something that happened later. But even with Pugs around 2005, Perl 6 was still the successor to Perl 5. Only around 2010, when the sister language concept was introduced, was Perl 6 considered to be a different language.
- lilSebastian 7y agoThe concept of perl 6, at some stage shifted from being the next incremental release of the Perl language, sure. For around 10 or so years the Perl 6 crew knew this was going to be a different language, yet held onto the name for this period of time and even made arguments in public that Perl 6 should remain the name, given all the facts, as recently as last year. This sort of thing can cause problems in communities, and nobody on the outside of the inner clan really cares, beyond the point that all the slight of hand and infighting pushes good folk away. Bullying Isn't Effective Advocacy: https://perlmonks.com/?node_id=1221390 https://perlmonks.com/?node_id=1221390 Also, when it was known Perl 6 was going to be a different language, they were several year away from a release
- agumonkey 7y agohonestly to me it's like perl^perl
- petre 7y agoYou'll get used to Raku too. When the rename went through I had similar thoughts but now I think it was a very good decision. Less "Perl is dead" BS at least. Now Perl 5.30+ can evolve and become Perl 7 and so on. I also thought Raku was a silly name, but it's short it's consistent with Rakudo.
- rurban 7y agoPerl 7? There are tons of Perl6 features missing still, and I'm the only one working on that. There's zero interest to go to Perl 6, i.e. proper types, OO, FFI, macros, threading, parsing.
- chrisseaton 7y agoEveryone knows it's a completely different language, that's not in question. What is in question was it worth making the already extremely messy name situation even more confusing? Raku, Rakudo, Rakudo Star, it's like they went out of their way to make it confusing. Which, given the Perl culture of whimsy, isn't unlikely.
- lilSebastian 7y ago> Everyone knows it's a completely different language, that's not in question. Working in the perl sphere, I assure you clients do not know this. Also http://blogs.perl.org/users/ovid/2019/08/is-perl-6-being-renamed.html http://blogs.perl.org/users/ovid/2019/08/is-perl-6-being-ren...
- perlgeek 7y ago> Raku, Rakudo, Rakudo Star, it's like they went out of their way to make it confusing. Not at all. Haskell, GHC, hackage/cabal/whatever -- intentionally confusing? No, they are different things. Same in the Raku case: Raku is the language, Rakudo a compiler, and Rakudo Star a distribution (with compiler, docs, module installer etc.) Giving three different things the same name would be much more confusing.
- lilSebastian 7y ago> Giving three different things the same name would be much more confusing. No different than "Perl 6" being a different thing from "Perl 5".
- chrisseaton 7y ago> Haskell, GHC, hackage/cabal/whatever -- intentionally confusing? No, they are different things. Those are all completely different words though... that's my point - that's the sensible way to do it. > Raku is the language, Rakudo a compiler, and Rakudo Star a distribution These all start with Raku. Can you understand how they'd be easy to mix up, rather than using different words like in the previous example? > Giving three different things the same name would be much more confusing. You've got the wrong end of the stick. I think they should have different names. I think at the moment their names are too similar.
- perlgeek 7y agoBefore the rename, any thread about any Perl 6 topic would harp about how it's a terrible name. Now after the rename, I guess every HN discussion will have a subthread discussing how the rename was terrible, and it should've stayed Perl 6. There's just no pleasing the Internet crowd.
- fennecfoxen 7y agoThis happens a lot. The thing is the “crowd” becomes a somewhat meaningless concept when you attempt to assign it opinions. There are two different subsets of the crowd and only one is complaining at any time. This can also come up in political contexts when some of your adversaries say something, but you don’t track which of them said it, and instead assign the opinion to [democrats, republicans, libertarians] as a whole. Next thing you know you think they’re all dirty hypocrites arguing in bad faith, and it takes an effort to see otherwise.
- lilSebastian 7y ago> Now after the rename, I guess every HN discussion will have a subthread discussing how the rename was terrible, and it should've stayed Perl 6. I don't see any evidence for this claim. Besides those on the inside, I have yet to see any support for naming a different language as logical next version of another.
- liupz 7y agoraku
- xupybd 7y agoSo is Perl never going to go past version 5 now?
- lilSebastian 7y agoAs yet there seems to be no solid plan. Context: http://blogs.perl.org/users/ovid/2019/08/is-perl-6-being-renamed.html http://blogs.perl.org/users/ovid/2019/08/is-perl-6-being-ren... http://blogs.perl.org/users/ovid/2019/10/larry-has-approved-renaming-perl-6-to-raku.html http://blogs.perl.org/users/ovid/2019/10/larry-has-approved-...
- Symbiote 7y agoI thought the point of the rename was Perl 5 can now release Perl 6 or 7, with Raku being independent.
- lilSebastian 7y ago> I thought the point of the rename was Perl 5 can now release Perl 6 I think that would only add to the confusion, since Perl 6 was already a thing, albeit totally different from Perl 5
- gus_massa 7y agoThey should skip "Perl 6" and go directly to "Perl 7", like Windows that skip "Windows 9" to avoid confussion.
- lizmat 7y agoUnfortunately, "Perl 7" was a "thing" in the discussions before the name change. IMO, going to "Perl 32" makes more sense, as it actually reflects the current version numbering scheme. Or refer to the year: Perl 2020.
- petre 7y agoIf Oracle had "bought" Perl they'd probably renamed it to Perl 32 by now and sued everyone else for using sygils. The current numbering scheme uses odd minor version numbers for development versions and even for stable, just like Linux used to, until Linus got fed up with 2.6 after 8 years. Now it gets a bump whenever the minor version sticks too much. https://askubuntu.com/a/843247 https://askubuntu.com/a/843247
- codesections 7y ago> by getting the whole parser onto a single screen, I find that I can get the whole problem into my brain’s working memory and avoid burning cycles scrolling up and down to pin down butterflies bugs. This is an excellent point, and one that not enough programmers pay attention to (well, outside of the APL family of languages, anyway!)
- hoytech 7y agoForth programmers often talk about keeping down the number of screens a lot too, for example page 23 of Thinking Forth: "A component can usually be written in one or two screens of Forth." (Aside from the attraction in small and simple code, each screen in forth is traditionally allocated a designated spot on the hard-drive so it's partially also for space and HDD usage efficiency too)
- neutronicus 7y agoAs a C++ programmer, I've grown so sick of } } // not } // a single } // fucking else // implicit else // return nullptr return result; } A deeply-indented scope should mean "shit is complicated, think deeply about it," not "there were five times I tried something and elected to punt and return null if it failed." The LLVM style guide has the right idea; if you're gonna punt, early-return. As a side-note, I really wish the C++ community would take a page out of Lisp's book and stop giving closing braces their own lines. But that'll never happen.
- augustk 7y agoIf a function returns early, its post-conditions cannot be checked.
- lizmat 7y agoThis is not true in Raku: whichever way you leave a subroutine, the returned value will be checked against the return constraint. And throw if that fails. More generally, you can specify KEEP and UNDO phasers in a block, that will fire whether the block is left successfully or not. So a typical usage would be `UNDO $dbh.rollback`.
- hestefisk 7y agoOut of interest: anyone in here using Perl 6 / Raku for anything in production?
- lizmat 7y agoOn the #raku channel on Freenode, several users are using Raku in production.
- bmn__ 7y ago> Yes – a recursive descent parser written from scratch in perl5 – pay dirt! What made the author write this in the first place? He could use one of the many many parsing libraries, and then at least the comparison with Raku grammars would be honest and fair.
- hedora 7y agoI’d prefer to write a hundred or so lines of code to adding a dependency. I can usually get those 100 lines of code right in an afternoon, but keeping up with the dependency is ongoing maintenance. The dependency could break compatibility or add a bug a year from now.
- RicardoLuis0 7y agoParsers aren't particularly difficult to write, and even if a hand-coded parser might not be very efficient compared to a generated one, it's unlikely to be a significant factor in the overall performance of the application. Compared to the complexity overhead of adding another dependency, be it a library or an external parser generator, i feel it's a fair trade-off.
- ZhuanXia 7y agoNot a Perl guy. What are the semicolons in that if statement all about?
- sethammons 7y agoDid you mean “for(;;)”? I didn’t notice semicolons in an if-statement. In the for-loop, it means “forever loop.” There is no declaration , check, iterate parts in the loop. You may be more familiar with “for(i=0; i<10; i++)”
- cygx 7y agoIt's a C idiom. Some people prefer `for(;;)` over `while(1)` to create infinite loops.
- ZhuanXia 7y agoI see. Just a c-style loop absent conditions. I find it kind of ugly for some reason.
- tadzik_ 7y agoWeird, since Raku has `loop { }` that means exactly that. I guess the author was not aware of it (or just doesn't like it). EDIT: Oh, that's in the Perl (5) code. Nevermind then. In C-like it kind of makes sense – it's 1 character shorter, and on some ancient crappy compilers it may actually run faster than while(1) since it doesn't have to check the condition every time ;)
- jandrese 7y agoI thought it was just some old weird hate on the while() construct. I remember a long time ago people advocating for using for() always for looping because that way the language was more regular. I thought it was a weird argument.
- awwaiid 7y agoI think it is usually written as while(1) { ... }
- wodenokoto 7y agoCan someone give a little more background why a unit conversion library needs a parser? Like an ELI5 for someone not into neither Perl or Raku and haven’t met the units library before.
- b2gills 6y agoYou really wouldn't really need to in Raku. Mainly because you can add things to the existing parser instead. (See postfix and infix below.) role Physics::Datum { has Real $.value is required; } role Physics::Distance { also does Physics::Datum; } role Physics::Volume { also does Physics::Datum; } class Physics::Volume::Gallon { also does Physics::Volume; } class Physics::Distance::Mile { also does Physics::Distance; } role Physics::Per[ ::N-Type, ::D-Type ] { has N-Type $.nu is required; has D-Type $.de is required; # could have a submethod TWEAK to reduce the fraction } constant gallon = Physics::Volume::Gallon.new( value => 1 ); sub postfix:<miles> ( Real $value ){ Physics::Distance::Meter.new( :$value ) } sub infix:<per> ( ::NT Physics::Datum $nu, ::DT Physics::Datum $de ){ Physics::Per[NT,DT].new( :$nu, :$de ) } my $mpg = 5miles per gallon; Which would result in the following data structure. Physics::Per[ Physics::Distance::Mile, Physics::Volume::Gallon ].new( nu => Physics::Distance::Mile.new( value => 5 ), de => Physics::Volume::Gallon.new( value => 1 ), ) I think the main reason it was written that way was it was copied from Perl. A lot of the above would be more difficult or slower in Perl. (This was mostly a quick throwaway example of how it could be done.)
- riffraff 7y agoyou would define values like weight = unit("10 kg") speed = unit("2.5 furlong per week")
- wodenokoto 7y agoMy imaginary units library would have been like Unit(float, unit_as_string) The free text version is pretty cool though
- qalmakka 7y agoThe main issue I have with swapping Perl with Raku is that a major strength of Perl is its ubiquitousness. Except on Windows, it's almost certainly installed on 90% of the systems I have ever used. Meanwhile, rakudo is not even in the repositories of most distributions. It's not very encouraging, if I have to be honest.
- kqr 7y agoI'm the same way. I'd love to use Raku over Perl, because it looks like an improvement in many ways. Alas, the use case I have for Perl is whipping up a script on any server for some ad hoc analysis or data massaging or as a UI to something. If I first have to install Raku, I'm more likely to write a shell script or Python code -- both of which tend to execute out of the box. This is also why I'm not as enthusiastic about CPAN as I could be. It's great that the modules are available for when you want to write real applications, but that's not what I do with Perl and one-off scripts really don't seem like it's worth pulling in external dependencies for.
- earthboundkid 7y agoISTM that a grammar parser is a library feature, not a language feature, per se. Any reason you couldn’t port the parser back to Perl 5 and get a similar savings in line count?
- lizmat 7y agoIn Raku, grammars are an integral part of the language. This is necessary, as the language itself uses a grammar to compile Raku code.
- rurban 7y agoBut the grammar parsing and processing is not something which is done with core-only features. Later hopefully, but currently it's very dumb, and can easily be done as library. Only longest token matching is needed.
- wott 7y ago> Any reason you couldn’t port the parser back to Perl 5 and get a similar savings in line count? That's what https://metacpan.org/pod/Regexp::Grammars https://metacpan.org/pod/Regexp::Grammars is for, indeed.
- btcnews 7y agoKiller news Bitcoin vs Ethereum https://coinmarket01.blogspot.com/2020/04/bitcoin-vs-ethereum.html?m=1 https://coinmarket01.blogspot.com/2020/04/bitcoin-vs-ethereu...