juan_gandhi: (VP)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2014-06-02 04:22 pm
Entry tags:

apple swift

So, with the new "Apple language", object-oriented Java people are going to do what?
There must be some deep philosophy, explaining why they are so retarded.
I think.

I mean, I kind of heard an explanation from Josh; in my translation it sounds like this: "Java programmers are not very smart anyway, let's not overload them with closures and all that stuff."

The correlation I was writing about lately kind of shows itself again.
Weird.

Well, it's not Scala, of course; but it's a nice step in the right direction, I think.

[identity profile] alamar.livejournal.com 2014-06-02 11:36 pm (UTC)(link)
Well, now we've got lambdas, why complain?

I haven't seen apple language but I assume it is an unsafe toy that calls native libraries on every cough? Do not want.
garote: (castlevania library)

[personal profile] garote 2014-06-03 12:01 am (UTC)(link)
Hmm? What do you mean by "unsafe"?

[identity profile] dmytrish.livejournal.com 2014-06-03 12:03 am (UTC)(link)
No, it has borrowed from modern languages surprisingly much (http://www.reddit.com/r/programming/comments/274t5s/apple_swift_programming_language_unveiled/chxgtfh), at the first glance I see a lot of things from Rust: no-nil-values, structured enums like functional ADTs, static compilation, type inference, so underrated C# nullable values (Int?, ?. operator), generics (hi to lame Go!), the right approach to mutability (to ditch it as much as possible or to limit it at least), etc, etc.

In general, languages designed by Apple may often be elitist and highly experimental (Dylan as ThinkDifferentLisp, Objective-C with its strong flavor of Smalltalk, very human AppleScript, etc), so I would not expect Swift to be just another scripting language hacked on top of C run-time.
garote: (bonk)

[personal profile] garote 2014-06-03 12:03 am (UTC)(link)
I was particularly surprised to see closures appear. So far I've only been using them in Javascript and Perl, but my experience has been that they are about 15% added flexibility for about -40% readability. That is, they make it harder to tell what's going on, more than they reduce development time.

[identity profile] dmytrish.livejournal.com 2014-06-03 12:10 am (UTC)(link)
Closures may be not The Comfortable Thing and not the nostrum to be used everywhere, but they're The Right Thing to have because of their theoretical profoundness. SICP explain in depth how to use them to build higher-level primitives.
garote: (cat sink)

[personal profile] garote 2014-06-03 12:15 am (UTC)(link)
A higher level primitive ... how might that differ from an ordinary C++ class?

[identity profile] vaddimka.livejournal.com 2014-06-03 01:36 am (UTC)(link)
Closures are bad! The Great Oracle forbids it!

[identity profile] fatoff.livejournal.com 2014-06-03 02:45 am (UTC)(link)
Эппль-свифт, то для гурманов. Опять вокруг меня всё эпплем заставлено, ответственно заявляю, пока что у них Обжектив-Си есть краеугольный камень, интенсивно и беспроблемно мешаемым прямо в том же файле с Си-Плас-Плас.

[identity profile] migmit.livejournal.com 2014-06-03 04:48 am (UTC)(link)
Very interesting. No monads or continuations, which is a shame, but seems to be a decent language anyway.

[identity profile] thedeemon.livejournal.com 2014-06-03 05:00 am (UTC)(link)
Swift has classes and inheritance, Java people should feel fine about it.

[identity profile] mikkim08.livejournal.com 2014-06-03 06:07 am (UTC)(link)
I mean, I kind of heard an explanation from Josh; in my translation it sounds like this: "Java programmers are not very smart anyway, let's not overload them with closures and all that stuff."

Допустим. А что означает в данном случае "not very smart" ? Не поймут, что такое closures и не будут их использовать вообще или будут их использовать неправильно, что приведет к дополнительным багам ?

[identity profile] freedom_of_sea.livejournal.com 2014-06-03 06:30 am (UTC)(link)
да кложуры есть те же самые объекты с состоянием внутри. Ты их делаешь (конструктор) и потом вызываешь. Проверив что не нуль. Даже фабрики делают для кложуров. Иногда скажут - гляди вот новое...
А по сути со времен C callbacks ничего новоого и нет. foreach map и grep вот и все что привнесла функциональщина

[identity profile] dkfl.livejournal.com 2014-06-03 06:37 am (UTC)(link)
разве это не просто замена AppleScript?

[identity profile] thedeemon.livejournal.com 2014-06-03 06:39 am (UTC)(link)
ํНет, это Objective-C замена.

[identity profile] sassa-nf.livejournal.com 2014-06-03 07:07 am (UTC)(link)
думаю, третье: "хер его знает, чем это обернётся!"

[identity profile] alamar.livejournal.com 2014-06-03 07:16 am (UTC)(link)
I mean that your program may segfault due to error in library or your code, or corrupt data. And that's the end of the show.

[identity profile] migmit.livejournal.com 2014-06-03 08:07 am (UTC)(link)
I really want to see the language that makes it impossible. So far, I haven't seen one. Well, except Malbolge.

[identity profile] alamar.livejournal.com 2014-06-03 08:35 am (UTC)(link)
Well, it's very hard to actually crash JVM or corrupt memory unrelated to the task at hand. Your code might malfunction but all the other code in the system will live on.

[identity profile] migmit.livejournal.com 2014-06-03 09:15 am (UTC)(link)
> Your code might malfunction but all the other code in the system will live on.

Which is exactly what happens when something segfaults, so what's the difference?

[identity profile] alamar.livejournal.com 2014-06-03 09:50 am (UTC)(link)
No. After segfault you can't assume your process is in working condition.

With JVM this is not the case, any number of exceptions doesn't hurt the whole process.

[identity profile] dmytrish.livejournal.com 2014-06-03 09:51 am (UTC)(link)
Ну так выкатили это чудо буквально позавчера.

[identity profile] dmytrish.livejournal.com 2014-06-03 09:53 am (UTC)(link)
Я бы скорее сказал, что классы — это такие усложненные замыкания с сабтайпингом.

[identity profile] migmit.livejournal.com 2014-06-03 09:59 am (UTC)(link)
> With JVM this is not the case, any number of exceptions doesn't hurt the whole process.

You mean, "process" in the OS sense? Who cares, JVM not failing is exactly the same as the OS not failing.

[identity profile] alamar.livejournal.com 2014-06-03 10:26 am (UTC)(link)
No, it's not exactly the same. It's not even nearly the same.

OS is a loose coupling of processes, while JVM program is a tight mess of interacting services.

OS only has kill switch that allows it to destroy whole processes losing everything inside. JVM ensures every service inside behaves well so there's no reason to hard-kill everything. The worst thing you normally see is an exception. This allows for very different architectures than unsafe platforms permit.

[identity profile] migmit.livejournal.com 2014-06-03 11:49 am (UTC)(link)
> OS only has kill switch that allows it to destroy whole processes losing everything inside. JVM ensures every service inside behaves well so there's no reason to hard-kill everything. The worst thing you normally see is an exception.

Again: what's the difference between "hard-killing" the misbehaving OS process and unhandled exception killing the misbehaving service?

Page 1 of 3