Showing posts with label cognisciences. Show all posts
Showing posts with label cognisciences. Show all posts

Monday, September 15, 2025

Debates about “faster” languages are just plain silly. It’s the optimization of compiler that makes the BIG difference.

 


Question

Why is C++ used at all now that a faster language (Go) has been created?

Just wanted to throw in two cents about binaries from GO supposedly being faster than C++. Recently C++ compiler made my jaw fall to the floor. At my job I have heard a riddle whether modern c++ compilers would be able to convert this recursive function into a loop, at sufficient optimization level. (AFAIK most programming languages would not do that)

int sum(int n) { 

return n ? sum(n-1) + n: 0; 

} 

Generally the answer is yes, gcc or icc would make loop of it and, with extra optimization, unroll it a couple of times. But then one tried clang 5.0, and it produced an arithmetic series summation formula, making this function O(1)!

One could argue that this is just a cheap trick… the thing is there could be thousands of such “cheap tricks” in C++ compilers… And you need long years of well planned development to put such “cheap tricks” in production.

Answer

I “grew up” with optimizing compilers. At one point, Carnegie Mellon University, Computer Science, had one of the most advanced optimizing compilers of its day (1970s). But I’ve read the code from GNU and Microsoft C++, and today’s compilers make our efforts look like a good amateur attempt at optimization. Current compilers can compile 50,000 lines per minute (at least!) and produce code that has inline expansion of functions, cross-procedural optimizations, and mind-boggling optimization techniques. I once read code in which function A called function B, but instead of passing parameters to it, the Microsoft C++ compiler determined that some of the inputs were constants or pass-by-values that were not changed, and instead of pushing parameters onto the stack and calling function B, function A preloaded some registers with values and BRANCHED INTO THE MIDDLE of function B’s code. And the registers were precisely correct, and it avoided doing a hundred or more instructions that would have not been necessary at all if the inputs were known to be read-only. I would fire someone who did that in assembly code, but the compiler gets away with it because it accounts for every source change before determining the validity of the optimization. I’ve seen the Microsoft C++ compiler collapse multiply-instantiated templates into a single code body. I’ve seen output from GNU gcc that makes my head hurt trying to understand it, but which is perfectly correct.

I have no idea what a “faster” language is compared to C++, but I would want to see nontrivial metrics (forget Towers of Hanoi, Sieve of Eratosthenes, and similar toy programs. Compare code size and performance of systems 100K SLOC Source Lines of Code or better). I suspect that Microsoft C++ and gcc can run circles around GO. And take a look at Java HotSpot dynamic compilation and optimization before comparing Java to C++ or any other language. We used to see the same silly comparisons for language complexity, because you could implement “Hello, world” in BASIC in only one line, but every other language took lots of lines and correct punctuation. But you couldn’t maintain 100K SLOC written in BASIC (and I mean the original BASIC, not languages like Visual BASIC, which are modern languages with a few pieces of syntax borrowed from the original Darmouth BASIC).

A good optimizing compiler can take you through a dozen levels of abstraction and generate half an instruction. I don’t trust anyone who says “Language X is faster than Language Y” unless they give details of the metrics they used. Anyone can write a compiler that makes trivial code examples run quickly. Professional compilers can make 100K SLOC be smaller or faster,, independent of the source language.

Each time we added an optimization to the compiler, we knew that it might improve the code by 1%-3%. But put a couple hundred such optimizations in, and “compound interest” wins big. Some years ago, IBM was dismayed that under SPECMark array benchmarks, their compiler ran at 45 SPECMarks and Sun’s ran at 61 (bigger is better). So they wrote a program that took a configuration of the cache behavior of different models of their RISC6000, and wrote a FORTRAN program that took, as input, a FORTRAN program, and produced, as output, another FORTRAN program which did the exact same computation, but segmented the data to maximize cache hits. They ran the array example through this and got a score of…wait for it…900! Many modern FORTRAN compilers now incorporate these transformations internally (this experiment was done in the early 1990s).

Debates about “faster” languages are just plain silly. It’s the compiler that makes the difference.

Monday, January 9, 2017

Glossa supporters are encouraging colleagues not just to submit to Glossa, but also to abandon Lingua (elsevier), which they now call “zombie Lingua.”


Academics Want You to Read Their Work for Free (or small article processing charge)
https://en.wikipedia.org/wiki/Article_processing_charge


https://en.wikipedia.org/wiki/Lingua_(journal)
Lingua: An International Review of General Linguistics is a peer-reviewed academic journal of general linguistics that was established in 1949 and is published by Elsevier.
https://www.journals.elsevier.com/lingua

The editorial board of the former Lingua continues publishing their journal. As Elsevier insists they hold the right to the journal title “Lingua”, the original editorial board continues publishing their journal under the new name Glossa in association with Ubiquity Press.
http://www.glossa-journal.org/
https://en.wikipedia.org/wiki/Ubiquity_Press

---

In 2012, more than 12,000 researchers vowed to boycott Elsevier for supporting the Research Works Act (RWA), a bill that would have made it illegal for federal grants to require grantees to publish the work in open-access journals. Members of the academic community saw this as a move to protect big publishers’ business interests while restricting open-access options. More recently, Elsevier was hit with another wave of negative publicity for issuing takedown notices to scientists sharing copies of their published research on their personal websites and on Academia.edu, a social-networking site for academics.

Now, Glossa supporters are encouraging colleagues not just to submit to Glossa, but also to abandon Lingua, which they now call “zombie Lingua.”

“Glossa is the new Lingua—same [editorial] processes, same team, same editorial board, same editors. Only the name changes,” says Rooryck. On blogs and online message boards, Glossa supporters have been rallying their colleagues to refrain from submitting, reviewing, or editing papers for Lingua. Scores of authors are moving their Lingua submissions to Glossa; Rooryck says that thus far, between regular submissions and a Lingua special issue, authors have pulled around 100 papers from Lingua and transferred them to Glossa.

Harry Whitaker, the interim editor-in-chief of Lingua, disapproves of the Glossa editorial board’s approach. “What’s the point of trying to tear down Lingua?” he asks. “It doesn’t add anything to whatever luster Glossa may acquire.”

Whitaker, who founded two other Elsevier journals and has a combined 50 years of editorial experience with the company, came into his new position after he heard about the former Lingua board’s actions and contacted Elsevier to express his dismay. “I disagreed with just about everything they were doing,” he said. He came out of retirement to sign a new contract with Elsevier in early January, and has since recruited several interim editors. He says that he and his editorial staff have received a fair amount of animosity from Glossa supporters.

But Whitaker stands firmly in favor of for-profit publishing; noting that publishers’ profits allow them to invest in new projects. (Elsevier gave Whitaker funds to found two new journals—Brain and Cognition and Brain and Language.) Plus, he says, profits ensure longevity. “That’s one of the many reasons I support the idea of a publisher that makes money,” he says. “Lingua will be here when I retire, and Lingua will be here when I die.”

The fate of Cognition, meanwhile remains to be seen. Barner and Snedeker plan to submit their petition to Elsevier on Wednesday. “The battle has been taken from a very small region—linguistics—to a much larger one,” says Rooryck. Barner and Snedeker are staying silent about their long-term plans, but their request sends a clear message to publishers: Scientists are ready for change.

http://www.theatlantic.com/science/archive/2016/01/elsevier-academic-publishing-petition/427059/

Tuesday, January 8, 2013

Michel JOUVET et le sommeil/éveil


Michel Jouvet est né le 16 novembre 1925 à Lons-le-Saunier (Jura).

Il a mené ses études secondaires au lycée Rouget de Lisle à Lons-le-Saunier et supérieures à la faculté de médecine de Lyon.
  • Interne des hôpitaux de Lyon (1951).
  • Séjour au Veteran’s Hospital de Long Beach, californie (1954-1955) où il travaille avec des équipes de neurophysiologistes.
  • Docteur en médecine (1956).
  • Chargé de recherche au CNRS (1958), travaux dans le laboratoire de physiologie de l’hôpital neurologique de Lyon.
  • Professeur agrégé de médecine expérimentale et biologiste des hôpitaux (1961). Professeur de médecine expérimentale à la faculté de médecine, université Claude-Bernard de Lyon, et chef du département de neurophysiologie fonctionnelle (1968).
  • Directeur de l’unité de recherche Inserm 52 « Neurophysiologie expérimentale et clinique » (1964-1974), intitulée ensuite « Onirologie moléculaire » (1975-1998); Directeur de l'unité de recherche associée URA 1195 du CNRS (1971).
Professeur honoraire de médecine expérimentale à l’université de Lyon depuis 1977.
Professeur émérite à l’université Claude-Bernard à Lyon encore actuellement.

Sociétés savantes – Académies
Membre de la Société de neurologie, de la Société EEG, de la Sleep Research Society, membre honoraire de l'American Physiological Society.
Membre de l’Académie des sciences - Institut de France (1977). Membre de l’Académie des arts, sciences et belles lettres de Lyon
Membre de l'Academia Europaea, membre étranger de l'Académie royale de médecine de Belgique.
Docteur Honoris Causa de l’université de Zürich (1986), du Technion, HaÏfa (1991), des universités de Liège (1992) et de Montréal (1993).
Il a été membre de comités de lecture de nombreuses revues scientifiques de haute tenue (Brain Research, Biochemical Pharmacology, International Journal of Neuroscience, etc.)

Distinctions – Prix
Prix Laborde de la Société de biologie (1961), prix Petit d'Ormoy de l'Académie des sciences (1966), prix Bing de l'Académie des sciences médicales de Suisse (1966), Intra Science Awaed, Los Angeles (1981), prix de la Fondation pour la recherche médicale (1983), médaille d'or Morgani, université de Padoue (1988), médaille d’or du CNRS (1989), Distinguished Scientist Award of The Sleep Research Society, Etats-Unis (1989), prix mondial Simone et Cino del Duca (1991), prix recherche et médecine de l’Institut des sciences de la santé (1991), Prix Blaise Pascal (1991), prix Maurice Pérouse de la Fondation de France (1993), prix international Fyssen (1997), prix Farell Sleep medicine, Harvard Medical School, Etats-Unis (2003).
Docteur Honoris Causa des universités de Zurich (Suisse), Haifa (lsraël), Liège (Belgique) et Montréal (Canada).
Officier de la Légion d’honneur, commandeur dans l’Ordre national du mérite, commandeur des Palmes académiques, officier de l’Ordre du mérite du Niger.
Croix du combattant volontaire 1939-1945.

Travaux scientifiques
Michel Jouvet a consacré ses recherches à l’étude des structures et des mécanismes du cycle éveil – sommeil - rêve (ou sommeil paradoxal). Il est considéré comme l'un des pionniers de l'hypnologie.
Ce neurobiologiste est à l’origine de la découverte du sommeil paradoxal. Cet état, caractérisé par une atonie musculaire totale des ondes cérébrales (activité PGO) proches de celles de l’éveil, est, selon lui, le support biologique du rêve. Il s’agirait d’un troisième état du cerveau aussi différent du sommeil que celui-ci l’est de l’éveil.
Les principaux travaux scientifiques de Michel Jouvet ont été les suivants.
En 1959, il décrit les signes électroencéphalographiques de la mort cérébrale.
La même année, découverte du sommeil paradoxal chez le chat et démonstration que cet état dépend du tronc cérébral inférieur, puisqu’il persiste dans les préparations pontiques chroniques dépourvues du télédiencéphale et de l’hypophyse.
Auteur, en 1961, de la classification du sommeil en ses différents stades, télencéphalique (sommeil lent, en raison des ondes lentes qui l'accompagent sur les tracés d'EEG) et rhombencéphalique (sommeil paradoxal, durant lequel sont enregistrés des mouvements oculaires rapides, d'où son nom en anglais de REM-sleep, REM pour rapid eye movements).
Découverte de l’évolution ontogénétique du sommeil paradoxal par la démonstration de l’existence du sommeil paradoxal chez des animaux nouveaux-nés et chez des fœtus in utero.
Description des caractéristiques de l’évolution phylogénétique du sommeil paradoxal : présence de cet état chez tous les mammifères et les oiseaux, absence du sommeil paradoxal chez les reptiles et les poissons.
Par l’étude pharmacologique de sommeil paradoxal, démonstration de la possibilité de le supprimer sélectivement sans supprimer le sommeil.
Mise en évidence par l’électrophysiologie de l’organisation des différents systèmes entrant en jeu au cours du sommeil paradoxal.
Découverte des comportements oniriques survenant au cours du sommeil paradoxal chez le chat.
Détermination du système ponto-géniculo-occipital (PGO) et de ses voies ascendantes.
Théorie sétoninergique du sommeil. Cette théorie a connu une évolution récente, la sérotonine n’étant plus considérée comme le neurotransmetteur hypogène, mais comme une neuro-hormone entraînant la synthèse d’un facteur responsable du sommeil.
Découverte de la mort cérébrale chez l’homme.

Parallèlement à l’approche expérimentale chez l’animal, Michel Jouvet n’a pas cessé de développer des recherches cliniques. Il a, en particulier, découvert les propriétés « éveillantes » d’une molécule (le modafinil), qui reste aujourd’hui la plus efficace pour traiter l'hypersomnie et la narcolepsie, deux pathologies du sommeil très invalidantes.

Sélection des principales publications
- Jouvet M. Michel F. Recherches sur l'activité électrique cérébrale au cours du sommeil CR Soc Biol (Paris) 152 : 1167-70, 1958.
- Jouvet M, Michel F, Courjon J. Sur un stade d'activité électrique cérébrale rapide au cours du sommeil physiologique. CR Soc Biol. (Paris) 153 : 1024-8, 1959.
- Jouvet M, Michel F, Courjon J. L'activité électrique du rhinencéphale au cours du sommeil chez le chat. CR Soc Biol (Paris) 153: 101-5, 1959.
- Jouvet M, Michel F. Electromyographic correlations of sleep in the chronic decorticate & mesencephalic cat. CR Soc Biol (Paris), 153 422-5, 1959.
- Jouvet M. Electro-subcorticographic diagnosis of death of the central nervous system during various types of coma. Electroencephalogr Clin Neurophysiol 11: 805-6, 1959.
- Jouvet M, Mounier D. Effect of lesions of the pontile reticular formation on sleep in the cat. C R Seances Soc Biol Fil 154: 2301-5, 1960.
- Jouvet M. Telencephalic and rhombencephalic sleep in the cat. In: The Nature of Sleep. A Ciba Foundation Symposium, Churchill Livingstone, Londres, 1961, p.188-208.
- Jouvet M, Pellin B, Mounier D. Polygraphic study of the different phases of sleep during chronic consciousness disorders (prolonged comas). Rev Neurol (Paris) 105: 181-6, 1961.
- Jouvet M. Research on the neural structures and responsible mechanisms in different phases of physiological sleep. Arch Ital Biol 100 : 125-206, 1962.
- Jouvet M, Vimont P, Delorme F. Elective suppression of paradoxal sleep in the cat by monoamine oxidase inhibitors. C R Seances Soc Biol Fil 159: 1595-9, 1965.
- Jouvet M. Etude de la dualité des états de sommeil et des mécanismes de la phase paradoxale. In : Aspects anatomo-fonctionnels de la physiologie du sommeil. Symposium du CNRS, Lyon, 1965.
- Jouvet M. The paradoxical phase of sleep. Int J Neurol 5: 131-50, 1965.
- Jouvet M. Biogenic amines and the states of sleep. Science 163 (862): 32-41, 1969.
- Valatx JL, Bugat R, Jouvet M. Genetic studies of sleep in mice. Nature 238: 226-7, 1972.
- Jones BE, Bobillier P, Pin C, Jouvet M. The effect of lesions of catecholamine-containing neurons upon monoamine content of the brain and EEG and behavioral waking in the cat. Brain Res 58: 157-77, 1973.
- Sastre JP, Jouvet M. Oneiric behavior in cats. Physiol Behav 22: 979-89, 1979.
- Gonon F, Buda M, Cespuglio R, Jouvet M, Pujol JF. In vivo electrochemical detection of catechols in the neostriatum of anaesthetized rats: dopamine or DOPAC? Nature 286:902-4, 1980.
- Sallanon M, Janin M, Buda C, Jouvet M. Serotoninergic mechanisms and sleep rebound. Brain Res 268: 95-104, 1983.
- Jouvet M. Epistemology of hypnology. Arch Int Physiol Biochim 94: C77-83, 1986.
- Jouvet M. Paradoxical sleep: is it the guardian of psychological individualism. Can J Psychol 45: 148-68, 1991.
- Jouvet M. Phylogeny of sleep stages. Acta Psychiatr Belg 94:256-67, 1994.
- Jouvet M. Sleep and serotonin: an unfinished story. Neuropsychopharmacology 21(2 Suppl): 24S-27S, 1999.
- Jouvet M. How sleep was dissociated into two states: telencephalic and rhombencephalic
sleep? Arch Ital Biol 142: 317-26, 2004.

Ouvrages de synthèse et de culture scientifique
- Neurophysiologie des états de sommeil. CNRS, Paris, 1965.
- La Natura del Sogno. Theoria, Roma, 1991.
- Le sommeil et le rêve. Odile Jacob, Paris, 1992, 1998, 2000, 2006 .
- Le château des songes. Odile Jacob, Paris, 1992, 2006.
- Le grenier des rêves, avec Monique Gessain. Odile Jacob, Paris, 1997.
- Pourquoi rêvons-nous, pourquoi dormons-nous ? Où, quand, comment ? Odile Jacob, Paris, 2000.
- Le voleur de songes. Odile Jacob, Paris 2004.

--------------
Ref: http://www.vjf.cnrs.fr/histrecmed/entretiens/jouvet/jouvet-bio.html