3 ms·
I’ll say it out loud. Erlang is cool, but so are loops, types, a whole bunch of common punctuation, idioms, packages and so on. Esoteric languages may have core
by wruza 4y ago
I’ll say it out loud. Erlang is cool, but so are loops, types, a whole bunch of common punctuation, idioms, packages and so on. Esoteric languages may have core killer features, but otherwise are weak and pointless in a sense of general-purpose business programming. Even LISP is less odd than Erlang. What’s with [,.], =<, #[], symbol/n, -etc? As if they wanted to win an obfuscation contest and succeeded.
For some reason, great tech often comes with “strings attached”. Relational engines - SQL only, no direct api. Concurrency - Erlang. Symbolic computing - Haskell. Embedding a dynamic runtime - Lua. Controlling desktop - AHK, AppleScript. Why can’t we have these things in mainstream, “day job”-grade languages with a human face.
- macintux 4y agoErlang was created in the 80s as a layer atop Prolog. Not surprising that it doesn't look like C or Python. (You can always use Elixir if you want something more modern-looking, or lfe if you prefer Lisp. Personally I like Erlang's syntax because it's concise and helps me think in Erlang, vs Python or Ruby.) I'm a big fan of languages that pick an area of expertise. Perl for text processing. Erlang for robust, concurrent operations. Fortran for numerical processing. Kitchen sink languages (yes, I'm looking at you, C++) try to meet every need and don't do anything as well as a specialized language can. Erlang does its job so very well because it makes tradeoffs that other languages can't. Arbitrary integer sizes, for example. Asynchronous message passing with mailboxes. Immutable data. Those are unacceptable for a language that's trying to break speed records.
- User23 4y agoLisp isn’t odd at all. It’s just a locally optimal direct representation of an abstract syntax tree (AST). Above all else, that’s the defining characteristic of Lisp. The programmer is necessary manipulating an AST when writing in any language, Lisp just makes it clear.
- toast0 4y agoIf you live in Erlang for a while, you'll come to terms with recursion for loops. It's kind of weird to start with, but you get used to it. Kind of the same thing with the rest of the syntax issues. Of course, I wanted Erlang with nicer syntax, but then they gave me Elixir, which is worse (IMHO), so be careful what you ask for. Immutable data is a key simplifying assumption of the VM though, and you can't write traditional loops without mutating some data, so there you go. Yes, sometimes the VM cheats a bit and mutates some data here and there, especially if you do stuff with the process dictionary, but you can't make self-referential data structures, which keeps GC simple.
- xupybd 4y ago>As if they wanted to win an obfuscation contest and succeeded. Have you used Perl? I think it would win that contest. Here is an example: my %author; while (<FH>) { next unless /^\d{6}=[^|]+\|/; my($l, $r) = split /=/, $_, 2; $author{$l} = [ split /\|/, $r, 2 ]; }
- autoexec 4y agoPerl gets trashed a lot for how unreadable it is, but examples that aren't intentionally written to be as obfuscated as possible are often just examples of how ugly regular expressions are. For people who understand regular expressions and understand how they are used in perl it's not as hard to read/follow as it looks. Perl certainly has a few features that don't help its reputation (like the extremely useful '$_') but it gets more hate than it deserves. It's still my language of choice when it comes to regex heavy projects. That said, if your goal was to write obfuscated code, perl wouldn't be a bad choice!
- wruza 4y agoYes. Even made job-related tools in it, and was looking forward to perl 6 as a fix-it-all version. There is no value in %<${, and it could look like let author = {} for (let line in stdin.lines()) { if (not line.m(/…/)) next let [l, r] = line.split('=', 2) author[l] = r.split('|', 2) } The key feature of perl is basically inline regexps. Everything else is an unnecessary noise. qx{…} -> sh("…"), bless -> class, etc. I loved perl and still know it, but haven’t written a single line in 17 years because there was no reason.
- rad_gruchalski 4y ago> What’s with [,.], =<, #[], symbol/n, -etc. The last two, most likely directly influenced by Prolog. What's wrong with the other ones?
- roenxi 4y ago> For some reason, great tech often comes with “strings attached”... why can’t we have these things in mainstream, “day job”-grade languages with a human face. Because mainstream languages make it expensive to implement new features. Eg, Python has made it to 3.10 and unless something changed in the last few releases there is still no answer to threading macros. Even if there was, Python doesn't let people sneak the feature in by a library which really delayed the whole thing. And Python is popular with the data science people, we know a whole bunch of them have seen Hadley Wickham's much-nicer-than-SQL relational algebra DSL that depends heavily on threading macros. Instead, Python has ... sqlalchemy, perhaps. Not a bad effort, but also no dplyr. <EDIT> Oh yeah, I forgot pandas. Maybe that works? Still not really tapping into the natural flow that threading can bring to the situation, and I think it is arguable as to whether it qualifies as a DSL. I stand by my example, Even if pandas is fit for task I don't think it opens up interesting opportunities like Hadley's use of threading did.</EDIT> Is this good? Is it bad? Simple Python is good Python. But if you want to know why it doesn't have interesting experimental features, my call is because they were designed out of the language unless someone invests a huge amount of work. Most other mainstream languages will be similar.
- pif 4y ago> Relational engines - SQL only, no direct api. This one has always baffled me, too!