6 ms·
I am thinking that Perl is (probably) the computer language which uses the most operators, but not everyone believes this is a good thing. I mean, it seems the
by blue1 10y ago
I am thinking that Perl is (probably) the computer language which uses the most operators, but not everyone believes this is a good thing.
I mean, it seems there is somewhere a sweet spot between lack of expressiveness and overcomplication.
- bunchofdweebs 10y agoNot everything has to be about programming.
- DasIch 10y agoPerl might have a lot of operators but Haskell's ability to define your own operators leads to a ton of operators in the standard library and third party packages.
- zzleeper 10y agoThat's one of the things keeping me away from Haskell. It seems that to be proficient I would need to know way more beyond the "standard library", but go into the String vs Text debates, and the huge amounts of common knowledge out there.
- kazagistar 10y agoString is a type alias for a lazy linked list of characters: not very high performance, but easy to work with using all the basic list manipulation tools. Text is a compact and efficient representation, more similar to strings in other languages. As far as learning libraries: its not mandatory and you can code as well as anywhere else without them, but the "language enhancing libraries" are undeniably useful, and can do some incredibly useful things. Monad transformers let you merge computational contexts, Conduit lets you cleanly define stream transformations, Lens lets you manipulate specific aspects of some state in a context, etc.
- klodolph 10y agoI feel your pain. Haskell makes it possible to write very powerful libraries which change how you think about your program, like MTL or conduits, and has APIs like Data.Text which change how you think about string processing. However, the language and community is quite mature. Most of the debates either have answers (use Text instead of String, most of the time) or don't matter to most people (MTL vs transformers or monadLib). In my mind, it's no worse than trying to pick a JavaScript framework. If you're interested, give it a shot some day.
- evincarofautumn 10y agoExcept for Lens, most packages shy away from operator soup. The basic set you need to know to read most Haskell code is quite small, and tied to the core concepts you need to know anyway, such as: Functor (<$>) Applicative (<*>, <*, *>) Monad (>>=, =<<, >=>, <=<) Monoid (<>) Alternative (<|>)
- nv-vn 10y agoAlso ++, $, ., and some others. But yeah, you don't need to know too many to be able to read 90% of Haskell code.
- GlitchMr 10y agoSo does Perl 6 (it may be because initial Perl 6 implementation was made in Haskell).
- ugexe 10y agoLike Perl 6?
- labster 10y agoPerl 6 has a similar ability to define custom operators. In addition to the rich selection of normal operators, there are the meta operators like summation [+] and the bat operator ^..^ and a full range of set operators like ∈.
- JoshTriplett 10y agoNo, that crown would almost certainly go to one of the variants of APL, which have more operators than ASCII has symbols. https://en.wikipedia.org/wiki/APL_(programming_language) https://en.wikipedia.org/wiki/APL_(programming_language)
- Cyph0n 10y agoI've always thought that if you learn one programming language, you can probably pick up any other language quite easily, except for APL/J/K.
- nv-vn 10y agoMany claim that Haskell is easiest to learn as a first language.
- Cyph0n 10y agoI don't know Haskell, but from what I've seen, it doesn't look like a beginner-friendly language. I think Python is the undisputed king of introductory languages.
- tome 10y agoIt means that the easiest time to learn Haskell is as a first language, not that it's the easiest of all first languages!
- Cyph0n 10y agoOhh I see. That makes sense!
- ue_ 10y agoThe strange syntax of Haskell is what's turning me off from learning it. With Lisp, the syntax was strange still, sure, but it wasn't confusing, it made sense. I feel like I can't even get in to reading Haskell or even OCaml. However if Haskell had macros (like Perl 6's or even Lisp's), I'd jump ship from Lisp quite quickly. It's a mature language with the libraries I want.
- zzleeper 10y agoInterestingly, the same might be true with languages. Quechua (from the Andean Mountains) only has three vowels (a, i, u). I can't find a reference, but AFAIK the main hypothesis was that a 3-vowel system made it easier to communicate across longer distances (i.e. across a canyon or valley in the Andes).
- deleted 10y ago[deleted]
- zzzcpan 10y ago> which uses the most operators, but not everyone believes this is a good thing You cannot really have too much builtin operators, they are basically functions that don't depend on context (i.e. on type of the object). The only side effect is that some of them are not going to be used often and you'll need a quick way to look them up to be able to understand the code in those cases. However, having too few of them is a problem that leads to contextual dual meaning operators (like '+' in many languages), related cognitive overhead and bugs.
- vorg 10y agoProgramming language operators seem more analogous to words like prepositions and pronouns in natural languages than to sounds. I think the analogous concept to a NL sound in a PL is a token (ASCII or Unicode).