apple swift
Jun. 2nd, 2014 04:22 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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.
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.
no subject
Date: 2014-06-03 01:15 pm (UTC)For clarification: it seems like you think that garbage from one (non-VM) process somehow messes with other processes. Please tell me you don't mean it.
no subject
Date: 2014-06-03 01:24 pm (UTC)So naturally the solution for non-VM languages is multiprocessing, but it is often problematic (just look at the CORBA disaster).
no subject
Date: 2014-06-03 01:34 pm (UTC)1) What does it have to do with "That's why you want to restart on segfault"?
2) Do you REALLY think anybody EXCEPT the failing process cares about some jerk corrupting memory?
3) Do you REALLY think corrupting some random memory is in any way different from corrupting some data structure?
4) What exactly does your "often" mean? Are you aware that all major OS'es are doing multiprocessing for a long time now?
no subject
Date: 2014-06-03 01:44 pm (UTC)2) I don't care about anybody except my process. My process[es] is the only important thing on my dedicated machines.
3) You don't corrupt some random data structure in VM language. This is only possible with evil determination. In non-VM language, any buffer overrun might corrupt some unrelated data structures. Doesn't happen in VM languages.
4) You don't care about "major OS'es", you care about YOUR TASK.
VM languages are good for YOUR TASK, however big and complex it is. OSes and non-VM languages are good for many things but NOT for your task.
You're too much theoretical. That's boring.
no subject
Date: 2014-06-03 02:02 pm (UTC)1) And what does it have to do with restarting?
2) You know that there is exception handling in non-VM languages too, right?
> My process[es] is the only important thing on my dedicated machines.
Just to clarify: do you also mean that only your services are important on JVM?
> You don't corrupt some random data structure in VM language.
Are you serious? Do you REALLY mean that I can't allocate two structures and accidentally write to the wrong one?
> In non-VM language, any buffer overrun might corrupt some unrelated data structures. Doesn't happen in VM languages.
Oh, really? So, when you say "non-VM language", you actually mean C (and friends), right?
> You don't care about "major OS'es", you care about YOUR TASK.
So, does it mean "no"?
> OSes and non-VM languages are good for many things but NOT for your task.
So far, you failed to show the difference.
no subject
Date: 2014-06-03 02:48 pm (UTC)2) There is exception handling in non-VM languages, but there are also segfaults which can't be avoided or handled as exceptions.
3) Surely, in my VM only my services are important. You're free to have your own VM.
4) "Do you REALLY mean that I can't allocate two structures and accidentally write to the wrong one?"
This is entirely different problem from buffer overruns. You can't overwrite unrelated data structure (if you allocate two structures in one place, they're related).
5) When I say non-VM language, I mean everything that calls into a wide range of native libraries. That includes Haskell, OCaml, ObjC, you name it.
6) The fact that OS'es do multiprocessing doesn't help you solve your task that much. Certainly that doesn't solve your task for you.
7) The difference is simple: non-VM languages emit SEGV, VM languages don't.
One that doesn't emit SEGV is safer because longer-living processes open up new possibilities.
no subject
Date: 2014-06-03 03:09 pm (UTC)Ah, so you mean restarting the process. Well, that goes for JVM services as well after an unhandled exception, doesn't it?
> This is entirely different problem from buffer overruns.
Well, you only mentioned buffer overruns in the previous comment. Your original statement was "your program may segfault due to error in library or your code, or corrupt data". There are LOTS of errors that lead to data corruption, and, frankly, buffer overruns are an insignificant minority.
> When I say non-VM language, I mean everything that calls into a wide range of native libraries.
What exactly do you mean by "calls"? You know that JVM libraries at least CAN call arbirtary native libraries, right?
> The difference is simple: non-VM languages emit SEGV, VM languages don't.
Am I supposed to care if my process fails because of SEGV or because of unhandled exception?
no subject
Date: 2014-06-03 03:15 pm (UTC)What's unhandled exception and why won't I handle it?
Every exception is logged and then execution continues as usual.
Non-VM languages don't have this option - they have to hard-fail and restart.
"buffer overruns are an insignificant minority"
Maybe I should have clarified, I thought this is obvious.
No they aren't so insignificant, but the problem here is - they're really deadly and there's not much you can do.
JVM libraries CAN call native libraries but they don't do that.
If they will it will be a totally different story.
JVM languages don't call native code, but {python/haskell/swift/whatever} libraries do it all the time. Which is kind of scary to me.
You can handle all exceptions. You can't handle SEGV gracefully. Why would you have unhandled exceptions?
no subject
Date: 2014-06-03 05:54 pm (UTC)no subject
Date: 2014-06-03 09:28 pm (UTC)В случае с JVM они не будут испорчены. JVM не позволяет лёгким движением руки переписать чужие данные мусором. Поэтому в реальной жизни что испортится - это данные одного запроса/задачи/этапа.
И всё, дальше система продолжает работать. Параллельно выполнявшийся код даже не заметил беды.
"Поднять процесс заново - дело не хитрое и чаще чем нет почти ничего не стоящее"
Это всё потому, что при хрупких процессах люди предпочитают ничего в них не иметь ценного. Но это имеет свою цену. Чтобы процесс было поднять быстро и нехитро - за это платится определённая цена.
Напомню на всякий случай архитектуру раннего Stack Overflow: одна машина с 64G RAM под .net, плюс один сервер баз данных с таким же количеством памяти. Эта штука держала сотни rps сложных запросов (SO, ну ты представляешь), в сто потоков, с гигантским кешем в памяти.
Эту штуку не так просто запустить (минут 20 будет прогреваться), зато потом заменяет сразу целый кластер. Вот так надо.
no subject
Date: 2014-06-04 12:40 am (UTC)no subject
Date: 2014-06-04 08:58 am (UTC)"нулы постоянно дереференсятся, за пределы массивов постоянно кто-то норовит вылезти, ексепшоны типа еррор вылетают и разламывают код до основания контейнера"
Это всё не приводит к протуханию всего процесса. Проезд по чужой памяти - приводит.