April 28th, 2019

(no subject)

Have to learn Perl, and am finding it frustratingly elusive. Especially in dealing with variables. That there is a keyword for declaring a variable ("my"; I haven’t yet got to a point where I would need "our") is understandable, although Ruby and Python manage to do without; but the differences between $, @, and % are making me cry. I was trying for half an hour to make this function, for looping through an array of hashes (that comes from a decoded JSON) work:

sub render_children {
  my @children_data = @_[0];

  foreach my $term (@children_data) {
    say ref($term);
    say Dumper $term;
  }
}


The children_data passed to the function were an array (of hashes); I was pretty sure about that. So, does this mean they are @children_data? Or $children_data that will be a reference to the children_data array? Or will $children_data be in fact the scalar representation of the array, i.e. its length? It’s thousand times worse that JavaScript’s "this", honestly!

Anyway, the foreach loop in the function above was not working the way I expected. Instead of individual hashes from that array, what I was seeing in the console bound to the $term variable was the original array. How can one foreach an array and get this very array passed as an element into the loop is completely beyond me. Finally, inspired by a discussion on StackOverflow, I changed the code to this:

sub render_children {
  my $children_data = @_[0];

  foreach my $term (@{$children_data}) {
    say ref($term);
    say Dumper $term;
  }
}


Now the function works as I intended — it loops through the hashes in the array. But what the hell does it mean? What is $children_data? Why should it be a scalar? What, in turn, is "@{$children_data}"? What sick mind came up with such lunacy as this? Why do I need to annotate variables this way in a dynamically typed language? There is nothing even remotely that insane in JavaScript, or Python, or Ruby, or PHP. Not even in Haskell. Not that I can write Haskell, but still.

(no subject)

It’s interesting how over the course of one interview Chomsky says that Facebook influenced elections in Germany and Brasil:



and at the same time says that the whole Russiagate is a joke:

(no subject)

One of the traumatic memorable experiences from the university was when we had a very basic introductory course of English phonetics (not as a science, regrettably, but as a practical second-language skill). If I remember correctly, the teacher (a Russian speaker), gave us a text, which could have been this Russian fragment:

Английская артикуляционная база характеризуется следующими особенностями:

а) выдыхаемый воздух подается краткими отрывистыми порциями («стаккато») в отличие от русской плавной манеры («легато»);

б) анатомические особенности строения речевого резонатора (более вытянутая форма по сравнению с более плоской в русском варианте) обуславливают апикальное положение языка (в отличие от дорсального в русском языке, когда он выгибается кончиком вниз и сильно прилегает к зубам всей передней частью- языку как бы тесно во рту), когда активным в производстве согласных звуков является только самый его кончик- tip (в отличие от передней части в русском языке- blade); в английском варианте язык как бы больше оттянут назад и с трудом дотягивается до зубов и альвеол; кроме того, спинка языка распластана и имеет плоскую форму (flat);

в) верхняя губа слегка растянута в улыбке (a phonetic smile) и не меняет своего положения в процессе произнесения, т.е. губы не двигаются в горизонтальной плоскости, так что их углы остаются неподвижными (stiff upper lip); в русском языке губы очень подвижны: они сильно округляются и выпячиваются, звуки, произносимые с выпячиванием и округлением губ, называются лабиализованными;

г) раствор, т.е. расстояние между челюстями, в английском произнесении уже, чем в русском.



or this English translation (that I found in some student’s paper on the Internet):


In contrast with Russian, the articulation basis of English language is characterized by the following rules:
1) The tongue is flat and drawn back from the teeth, which it scarcely ever touches. The front part of the tongue is lowered and slightly hollowed out.
2) In English lips are passive, they never go forward the way they do in Russian. The upper lip is practically immovable. Only the lower jaw goes freely up and down.
3) Lips are slightly spread in the so-called "phonetic smile".
4) The distance between the upper and the lower teeth should be very small, so that you can place the tip of a well-sharpened pencil between them. However, the main attention must be transferred to the glottis, because this is the mainstay of the English articulation basis. Only by learning to manipulate it we may hope to make real progress in the acquisition of literary English.


What struck me as odd was the suggestion that the lips "are passive", that they "never go forward" and are slightly spread in the "phonetic smile". "Phonetic smile" — this is the only phrase that got stuck in my head from those lessons. From my previous course in Russian phonetics, I knew how lips must be involved in producing [o] and [u] sounds; and I knew of the Southern Russian dialectal approximant [w], which articulation-wise is not too dissimilar from the English /w/. I was shocked by the suggestion that the respective English sounds were made without similar involvement of the lips.

The teacher believed in that description though, and when I pressed the point, said (if I remember correctly) that there is no lip rounding in pronunciation of English sounds. So for a while I was obsessed by catching actors in the process of pronouncing something that contained a /w/, and watching how their lips moved. I might have even shown some such frames, or descriptions of the articulatory phonetics of /w/ from English textbooks, to her, but I am not sure. Our English department (or at least the teachers assigned to our faculty) was not very scientifically minded.

It remains a complete mystery to me who came up with that horrid idea of the "phonetic smile".