Earlier quoted context omitted.
I should have been more specific. Try this in Ruby, Python, PHP or Javascript: 0.1 + 0.2 - 0.3 . You'll get an approximation in most languages but only Perl 6 returns 0.
Yes, I understand the example. It's a classic floating point numbers demonstration. What I am saying is that I have not encountered a real-life case where this would have made my life easier. Again, it's neat, but not a real reason to move to a new language.
Why I’m Learning Perl 6
361–370 of 380 posts
Re: Why I’m Learning Perl 6
#362Earlier quoted context omitted.
Why is CPAN not a viable replacement? It has always been perfectly viable for me.
CPAN packages are written by thousands of different people with varying styles (cf. the issue with 10 different ways of doing the same thing), quality standards and maintenance schedules. In Python I can expect the standard library to be consistent and be maintained as part of the core language. Now I don't mean that everything has to be in the standard library (I'm fine with the database access libraries being third…
Which means that perhaps for many of them there is a better module out in the ecosystem that almost nobody uses because they have one extra step to install them.
If you want something close to that in Perl 6, just install Inline::Python and you can use all of those “batteries included” with Python as if they were modules written in Perl 6.
Exceptions in Perl 6 are much easier to deal with than they are in Perl 5.
Re: Why I’m Learning Perl 6
#363Earlier quoted context omitted.
I'm not sure I understand your exercise. What do you mean by "Python's quoting documentation", and what do you mean by "editing" it?
> What do you mean by "Python's quoting documentation" String literals are described by the following lexical definitions: stringliteral: shortstring | longstring shortstring: "'" shortstringitem* "'" | '"' shortstringitem* '"' longstring: "'''" longstringitem* "'''" | '"""' longstringitem* '"""' shortstringitem: shortstringchar | escapeseq longstringitem: longstringchar | escapeseq shortstringchar: longstringchar: e…
If you needed to have `」` in there you can fall back to `Q{{{{{{…}}}}}}` or `Q:to;…END`
Re: Why I’m Learning Perl 6
#364I like writing bash scripts a lot and perl is a natural step-up with powerful libraries to use. As others have said, the major obstacle for me has been the lack of great literature.
For small tasks I enjoy aesthetics of small dedicated Unix tools (grep, sed, awk, cut, sort) working together much more. Perl tries to be everything at once, still mysteriously lacking interactive REPL out of the box. Yes, Python is more heavyweight for scripting, but it pays in the long term with better maintenance and tooling for big scripts.
In fact there are two flip-flop operators that exist in Perl 5, one which works like the one in awk `..` , and the other like the one in sed `...`. Perl 6 renames them to `ff` and `fff`.
I remember hearing/reading that the release of Perl was delayed until a2p and s2p were written, specifically for people who used awk and sed to be able to get going quickly in Perl.
Re: Why I’m Learning Perl 6
#365All I think about when I hear M:N thread multiplexing is "1992 is calling to have its stupid threads hacks back". M:N is what you do when you don't have real kernel thread support. You hacked N user space threads per process (N:1) but then 1990 rolled in and cheap SMP with M processors started to spread across the land, so you needed N:M to take a bit of advantage of that.
Re: Why I’m Learning Perl 6
#366It's terrible that you put Erlang on a list with other languges/VMs. >There’s no GIL, so unlike Those Other Languages There is no GIL in EVM as well, but playing with the words you make it look like "all are the same". This does not deserve top HN and just stupid. If your Perl6 VM is _so_ great, why didn't you mention anything about what's really important like preemptive scheduling which has been Erlang's unbeatable…
Re: Why I’m Learning Perl 6
#367Earlier quoted context omitted.
Yes, I understand the example. It's a classic floating point numbers demonstration. What I am saying is that I have not encountered a real-life case where this would have made my life easier. Again, it's neat, but not a real reason to move to a new language.
Banking/accounting software? Generating reports that are expected to return correct data w/o cumulative errors from flating point arithmetic? After all, Perl is the Practical Extraction and Report Language.
What I am saying is that this isn't a killer feature.
It makes me go, "Oh, neat", and not, "Wow, this will make my life so much easier".
Re: Why I’m Learning Perl 6
#368Earlier quoted context omitted.
Yes, I understand the example. It's a classic floating point numbers demonstration. What I am saying is that I have not encountered a real-life case where this would have made my life easier. Again, it's neat, but not a real reason to move to a new language.
Then I have to assume you're not working in any kind of commercial or financial sector where approximations are not acceptable. Perl 6 and Go should be lauded for solving this problem.
I wish more languages would do this and I happily applaud Perl 6 and go for allowing sane operations in the real space without needing separate packages.
But there are high quality packages for all modern languages that allow you to get precision if you need it.
I'm not debating the utility of this feature, but I am saying it's not--by itself--going to make me want to pick up Perl 6 for my next project.
Re: Why I’m Learning Perl 6
#369I hate perl6. I hate it because I tried to get involved in the project early on, and it led me down the Haskell rathole. I don't know what Haskell looks like today, but a decade or more ago it was the hardest language to pick up that I had ever experienced. It was as if I had a solid background in latin languages and I was trying to pick up Chinese based on a handful of tutorials written by a tourist on the back of a…
FWIW, I, too, have tried learning Haskell and ended up banging my head against the wall over and over. With Lisp, I eventually "got it", but Haskell has evaded my attempts at understanding it with impressive stubbornness[1]. Disclaimer: I do not hate Haskell, I just don't "get it". If you love the language, fine, have as much fun with it as you possibly can. I for one have given up, at least for now. Maybe I'll try a…
I understand the tutorials and have read though the books available, but when I try to use the language on a small real project, say a 2d barcode generator, I have trouble getting off the ground. Its not even clear to me which set of features are recommended for the language. It seems like different users program in different, incompatible, languages! Here is a list of optional language extensions supported by GHC:
Cpp
OverlappingInstances
UndecidableInstances
IncoherentInstances
UndecidableSuperClasses
MonomorphismRestriction
MonoPatBinds
MonoLocalBinds
RelaxedPolyRec
ExtendedDefaultRules
ForeignFunctionInterface
UnliftedFFITypes
InterruptibleFFI
CApiFFI
GHCForeignImportPrim
JavaScriptFFI
ParallelArrays
Arrows
TemplateHaskell
TemplateHaskellQuotes
QuasiQuotes
ImplicitParams
ImplicitPrelude
ScopedTypeVariables
AllowAmbiguousTypes
UnboxedTuples
UnboxedSums
BangPatterns
TypeFamilies
TypeFamilyDependencies
TypeInType
OverloadedStrings
OverloadedLists
NumDecimals
DisambiguateRecordFields
RecordWildCards
RecordPuns
ViewPatterns
GADTs
GADTSyntax
NPlusKPatterns
DoAndIfThenElse
RebindableSyntax
ConstraintKinds
PolyKinds
DataKinds
InstanceSigs
ApplicativeDo
StandaloneDeriving
DeriveDataTypeable
AutoDeriveTypeable
DeriveFunctor
DeriveTraversable
DeriveFoldable
DeriveGeneric
DefaultSignatures
DeriveAnyClass
DeriveLift
DerivingStrategies
TypeSynonymInstances
FlexibleContexts
FlexibleInstances
ConstrainedClassMethods
MultiParamTypeClasses
NullaryTypeClasses
FunctionalDependencies
UnicodeSyntax
ExistentialQuantification
MagicHash
EmptyDataDecls
KindSignatures
RoleAnnotations
ParallelListComp
TransformListComp
MonadComprehensions
GeneralizedNewtypeDeriving
RecursiveDo
PostfixOperators
TupleSections
PatternGuards
LiberalTypeSynonyms
RankNTypes
ImpredicativeTypes
TypeOperators
ExplicitNamespaces
PackageImports
ExplicitForAll
AlternativeLayoutRule
AlternativeLayoutRuleTransitional
DatatypeContexts
NondecreasingIndentation
RelaxedLayout
TraditionalRecordSyntax
LambdaCase
MultiWayIf
BinaryLiterals
NegativeLiterals
DuplicateRecordFields
OverloadedLabels
EmptyCase
PatternSynonyms
PartialTypeSignatures
NamedWildCards
StaticPointers
TypeApplications
Strict
StrictData
MonadFailDesugaring
I've seen different subsets of these extensions recommended. Is there some canonical subset recommended by anyone doing real work in Haskell?
Even more off topic: in reference to your note about the word "stubbornness", the word "bookkeeping" has three consecutive doubled letters. I believe that there are no examples of four consecutive doubled letters in any ordinary English dictionary, but I ought to grep the longer lexicons I've got at home.
Re: Why I’m Learning Perl 6
#370For some reason, when I started my software engineering career I got it into my head that I needed to learn as much as I could about programming languages. I learned ruby, perl5, python, lisp, forth, ml, ocaml, scheme, haskell, r, c#, java, lua, c++, factor, idris, asm, erlang, prolog, rust, d. But that wasn't quite enough because haskell and idris kept on talking about complicated type theory stuff. So I also learne…
With all due respect, you didn't "learn" these languages. You got a superficial understanding of these languages. It's like someone who learns to say "hello, name is John, what is your name" in 17 human languages saying they learned 17 languages.
Being able to write "hello world" in all these languages doesn't mean you "learned" it.