lainchan / λ
(untitled)
Moore · 2018-09-23 19:06
What can Erlang do that Elixir cannot? Is there any need to learn Erlang if one already knows Elixir?
Google isn't giving me any reasonable answer.
Hououin Kyouma · 2018-09-23 22:38
Well Elixir is just syntax for Erlang sooooooooo...
The Fin · 2018-09-23 23:26
my question is what is erlang? i mean what it solves? what kind of problem did they got and created erlang?
Dox · 2018-09-24 05:52
>>10503
Basically it’s for building highly available distributed systems.
You get some nice primitives regarding that.
Sipho Nkosi · 2018-09-24 15:11
>>10502
No it's not, elixir just happens to run on the same BEAM vm as erlang. Erlang is incredibly fast because it was restrictive, for example you can't reassign variables or loop without recursion. This allowed it to do some pretty incredible stuff, like implementing a mark-sweep garbage collector that only needs one pass. Elixir tries to get erlang's speed without those restrictions and falls flat. Luckily most of its userbase just assumes it's fast and doesn't notice.
Also, if you want to understand processes, message passing, etc in the way that the BEAM vm was designed for and is best at using, you need to spend at least 15 minutes using OTP and understanding why it's useful.
Short answer, yes I would learn erlang if you're interested in it. If you're not interested in it, learn something else.
BloodCat · 2018-09-24 17:08
>>10519
Elixir is almost literally just a fancy Erlang compiler. There's a reason Hello.World can't call functions from Hello without prefixing them, because they're compiled into regular Erlang functions (i.e. Hello.World.print is basically HelloWorldprint)
Undisclosed · 2018-09-26 04:51
Erlang is not a general purpose language, Elixir is a general purpose language. Erlang is very restrictive in that it was designed mainly to use lists as actual linked lists which is very slow. A lot of optimizations could be done to container types like maps and structs if they would finally make Elixir its own stand alone language. Erlang is like Haskell, its for FP purists and not people with jobs.
Gyula Kovacs · 2018-10-23 01:34
>>10546
Not true at all. There are plenty of projects that used Erlang that weren't related to servers, such as machine learning.
Dox · 2018-10-23 02:31
>>11063
just so you know, the fact that Erlang gets used for paralelization niche in ML doesnt make it a GENERAL PURPOSE language. But I guess you read that Erlang was used in ML on wikipedia so you need to feel smart
Armitage · 2018-10-23 12:51
>>11069
>say something isn't 'general purpose'
>bad reaction
>say something isn't 'GENERAL PURPOSE'
next steps: figlets, cowsay, a webcomic about a General surnamed Purpose, a suicide cult where everyone dresses up as Erlang and drinks 'general purpose' poison and then dies.
Many languages suck at some tasks. Common Lisp systems are usually pretty bad at making really tiny Unix executables (because only commercial systems have tree shakers). Erlang has some scripting support but you definitely shouldn't use it for frequent cronjobs on your server farm unless the cronjobs are asking a persistent server to do something.
Be precise.
Armitage · 2018-10-24 22:36
>>11069
It is also used in Wings 3D, a graphics modeller program.
>IT DOESN'T COUNT IF I SAY I DOESN'T.
You keep moving the goal posts.
Pris · 2018-10-28 21:24
>>10546
>Erlang is like Haskell, its for FP purists and not people with jobs
Erlang was designed and developed for internal use at Ericcson, and it's a functional language because no other paradigm provides the kind of reliability the telecommunications industry needs.
Until Ericcson's attempt at banning proprietary programming languages in their software development it was the polar opposite of what you claim.
Also, though I don't know much else of Erlang, I would guess that it's not a domain specific language, and is instead more of a general purpose one. It doesn't mean that it needs to be flexible.
Emmanuel · 2019-01-07 16:28
>>10509
that's exactly what JVM was designed for and elixir uses
dup · 2019-01-07 16:30
>>12004
sorry I was thinking of Scheme
Ender · 2019-01-07 17:59
>>10546
Haskell really isn't that pure, if you want a language without a bunch of hacks, look at Idris
Haskell's IO system is more restrictive semantically than say the ref system in Clojure or an ML, however it is hardly hard to do. Furthermore, seasoned Haskell programmers tend to turn away from Lists and use Sets,Maps, Impure Maps (HashTables), Text, ByteStrings, Finger Trees, etc etc. Also exhasution checks from pattern matching and the utility of sum types make Haskell quite useful when refactoring and improving a system.
I personally find elixir nice, but the syntax is infuriating and very noisy. The infuriating part is in that one can avoid using an end if they make their statement one line, so it encourages me to scrunch up my lines. And the noise comes with the syntactic noise that clutters meaning.
H.R. Giger · 2019-11-10 14:44
>>10546
The game Ymir was programmed in Erlang.
↑ · 2019-11-16 01:27
>>12014
I wouldn't quote idris there for being pure as it really depends on what you want. Are floating point operations "pure" even if they vary in quality based on which platform you use. Are wrapping integers "pure" or do we see integer overflow as an effect (currently very few proofs even try to tackle this)? Is the IO monad really the best option for Idris or should EB explore effects by linear types?
ATS2 (even if it has unrestricted effects) is much better in tracking resources since it allows you to decide what you want to track and ensuring we have RF even for memory manipulation (provided we treat pointers as sort of a black box and assume the malloc wrapper is typed well). So a subset of it is more pure than Idris can be (Idris is going in this general direction) while also being more flexible provided you can get over the syntax and documentation (or lack of it).
>>10546
Same way C isn't really made for highly concurrent applications but can be made to dance the dance.
Terzibashjian · 2019-11-18 19:17
>>15920
Integer overflow shouldn't be seen as an effect, as its trivial to do per integer type. As we can say in64 is Z/Z{2^64}.
On the note of few proofs tackling this, I'd beg to differ as F* in particular has a lot of proofs with integers refined to certain bounds and has produced a lot of verified C with actual ints (the ocaml generation is of type Z.t always sadly).
As per tracking effects and resource usage, that serms to be best done using a super set of linear types and an effect system to carry that through. (F* has one of these two, using an effect system and hyper heaps to do pointer aliasing logic for you).
I wouldn't say that makes ATS2 or F* or Idris 2(idris two has a very limited form of quantative types) more pure though. As it just describes impurities, that aren't there in the normal pure type.
Unidentified · 2019-11-20 23:47
>What can Erlang do that Elixir cannot?
you mean the other way around?
Dox · 2020-05-30 08:38
>>10497
Probably not. Elixir leverages BEAM to provide that same level of concurrency and fault tolerance to a wider audience with a language more geared around modern servers than telephone switches. Like for example there isn’t the concept of a String in Erlang because they were of limited use in a telephone switch (although that might have changed by now) whereas not only are Strings a type in Elixir it’s also got all manner of functions for it and regex on Strings.
Think of it as the ruby of functional programming, people are going to soykaf on it for being “easier” but the productivity gains through using it probably negates any apparent performance hit, which I really doubt is true considering it doesn’t change how BEAM can be fast conceptually.
McCarthy · 2020-06-01 17:07
>>18907
>there isn't the concept of a String in Erlang
What are you talking about? Erlang does support strings which are implemented as lists of characters. It also supports binaries which can be used like strings (and they have a lower memory footprint and can be faster in certain usecases). In fact elixir's strings "are" essentially erlang binaries.
Erlang also has plenty of string manipulation functions in the string module and there also exists a regex module. Most of the functions (as long as you are not using the deprecated API) can work with both binaries and strings.
Linda Lee · 2020-06-04 11:54
>>18959
Was that always the case though? Because when I last looked at Erlang, it didn't have Strings in the sense you could store text within double quotes like most languages. Just a [ ] list where number literals can represent textual characters.
Drifter · 2020-06-04 13:15
>>19008
>it didn't have Strings in the sense you could store text within double quotes
$ erl
Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Eshell V10.7.2.1 (abort with ^G)
1> "what are you on?".
"what are you on?"
2> <<"why would you persist in error when looking it up would take seconds?">>.
<<"why would you persist in error when looking it up would take seconds?">>
3>
nibble · 2020-06-05 08:00
>>12005
You were thinking of Clojure
quote · 2020-09-18 16:30
>>10519
>Elixir tries to get erlang's speed without those restrictions and falls flat. Luckily most of its userbase just assumes it's fast and doesn't notice.
You don't know half a thing about Elixir. Those "restrictions" are called functional programming and Elixir is functional.
Lady Jessica · 2021-01-30 07:24
scala can compile to native now, and it's actually really good. really missing haskell too, never got as far as i wanted or needed, but what's a sailed ship anyway. fuarrrk it. just write it in python
() · 2021-01-30 07:28
Elixir is to BEAM what Clojure/Scala/Kotlin is to JVM. It helps to understand how the underlying virtual machine works in order to get out the best performance possible.
Random · 2021-02-01 04:17
Implement the singleton pattern.
Von Neumann · 2021-02-01 06:45
>>19009
You've never had it vomit pages of errors interpreted as integer lists?
Motoko Kusanagi · 2021-03-05 17:30
>>24249
Elixir can use OTP's global module just as well as Erlang can, which provides all you need to implement singletons. Comparing Erlang+OTP to Elixir without Erlang+OTP below it is nonsensical.
Tyrell Wellick · 2022-02-18 00:23
>>11142
>Erlang was designed and developed for internal use at Ericcson, and it's a functional language
>I would guess that it's not a domain specific language
If you ask any of the creators of Erlang, they would say that Erlang was a DSL for describing the kind of problems they were trying to solve, that just so happens to be a functional programming language. I believe Joe Armstrong has a blog post about it, but I can't be bothered finding it right now.
Agent Richard Gill · 2022-02-18 00:28
>What can Erlang do that Elixir cannot?
not be webscale
Davis · 2022-02-18 03:31
>>30147
Ah, so Elixir has sharding, the secret sauce to webscaling right ip.
Roger Pollack · 2022-02-28 19:33
>>10503
>my question is what is erlang?
Something something distributed programming?
A better question is: what kind of software would benefit the most from Erlang/Elixir?
I know it was created/is used by comm corpos, how could the average lainon use it though, should I write my server software in it?
I like Joe Armstrong BTW: https://www.youtube.com/watch?v=lKXe3HUG2l4
H.R. Giger · 2022-06-12 09:08
I encourage everyone to read the first few chapters of Joe's thesis. In order to properly introduce you to the language, concurrency via message passing (which has a long history), fault tolerance (which should be standard in software and every PL), and generally the erlang mindset of practicality. Where, you take the best of Prolog, FP, and sequential programming, to have a very nice language that helps you write proper software.
https://erlang.org/download/armstrong_thesis_2003.pdf