|
|
|
|
|
by runT1ME
3982 days ago
|
|
Scala! It's mutli paradigm, it can be very simple to read, has amazing concurrency support and can utilize all the NIO goodies from the JVM. Here's an example of me using it to make multithreaded NIO calls with XMPP: val conn = Connection.create(getConnParams("username", "password"))
val result =
for {
(conn, myjid) <- ConnectionHelper.gchatConnect(conn, "xmppzExampleClient")
(conn, presence) <- conn.sendGet[Presence](Presence(from=Some(myjid), to=Some(tojid), presenceType=Some("probe")))
conn <- conn.send(Message(body=Some(msgtext), to=tojid, from=Some(myjid)))
conn <- conn.send(StreamEnd())
} yield conn
Each <- is actually an NIO callback that uses a threadpool (so you aren't spawning too many threads).But you don't get the nested craziness of ugly callbacks like you would in python or javascript (for instance). Edit: If you really want whitespace, maybe F#? http://www.tryfsharp.org/ |
|