3 ms·
I thought the cool kids had already moved on to Scala...
by davidw 19y ago
I thought the cool kids had already moved on to Scala...
- bilbo0s 19y agoThat's the interesting thing isn't it. With the Scala platform around people have very little incentive to go in and make the improvements to Erlang that would help it to become more mainstream. Particularly on the web. For instance, what follows is the code to the Scala address book example: object addressbook { case class Person(name: String, age: Int) /** An AddressBook takes a variable number of arguments * which are accessed as a Sequence */ class AddressBook(a: Person*) { private val people: List[Person] = a.toList /** Serialize to XHTML. Scala supports XML literals * which may contain Scala expressions between braces, * which are replaced by their evaluation */ def toXHTML = <table cellpadding="2" cellspacing="0"> <tr> <th>Last Name</th> <th>First Name</th> </tr> { for (val p <- people) yield <tr> <td> { p.name } </td> <td> { p.age.toString() } </td> </tr> } </table>; } /** We introduce CSS using raw strings (between triple * quotes). Raw strings may contain newlines and special * characters (like \) are not interpreted. */ val header = <head> <title> { "My Address Book" } </title> <style type="text/css"> { """table { border-right: 1px solid #cccccc; } th { background-color: #cccccc; } td { border-left: 1px solid #acacac; } td { border-bottom: 1px solid #acacac;"""} </style> </head>; val people = new AddressBook( Person("Tom", 20), Person("Bob", 22), Person("James", 19)); val page = <html> { header } <body> { people.toXHTML } </body> </html>; def main(args: Array[String]) { println(page) } } This is so much less scary to people than the Erlang equivalent. EQUALLY complicated, just less scary! So if there are kids out there looking at implementing something new really fast, they will be drawn to Scala. Remember PERL, it was lightning fast . . . and really scary. Java was less scary. PHP was friendlier still. And, I suspect, the frameworks built using Scala will be downright promiscuous. It's too bad, I'm an old fart, 36, but I like Erlang. Maybe the kids will let their religion get the best of them. They are really anti-Java, and Scala is built on Java. Of course, they love JRuby. Quel dommage.
- rontr 19y agoThe cool kids won't move on to Scala for a number of reasons, the primary of which is that Scala's actors are not as powerful as Erlang processes. See Virding's First Rule of Programming (http://www.nabble.com/Erlang-concurrency-to14747956.html http://www.nabble.com/Erlang-concurrency-to14747956.html): "Any sufficiently complicated concurrent program in another language contains an ad hoc informally-specified bug-ridden slow implementation of half of Erlang."
- davidw 19y ago> Scala's actors are not as powerful as Erlang processes. How so? I know Erlang reasonably well, but haven't messed with Scala at all.