GENTUT04.TXT General Tutorial for Lisa GJ2 Fic3 -- the f3 language explained as a series of tiny essays THIS IS ESSAY 04. WHEN IT GETS MORE THAN 99, WE'LL BRING IN LETTERS AND SUCH, E.G. A1 Written by Aristo Tacoma with L.A.H. Date: 2011:2:26 Copyright author, further distribution license is www.yoga4d.org/cfdl.txt. Kids: there are other tutorials for you. But you should find pieces here and there which are easy to read. In B9, use the search function, CTR-F or F4 within each. ***WARPS AND WHY THEY REALLY ARE GREATER THAN CLASSES One has got to admit that when something takes a couple of months of thinking, in which also it helps having a number of conversations, over coffee, with someone who has thought about the matter for decades [[[in this case, Kristen Nygaard, who I met many times -- he and his coworker, who developed object-oriented programming in Oslo in the 1960s won the Turing Price in early 21st century for this work, -- and both died soon thereafter]]], -- well, then, with all this thinking behind oneself, some things become utterly obvious, self-evident, natural, not worthy of further discussion, something so easy and trivial that only idiots would not see the point -- that one is perhaps becoming somewhat careless as a tutor to beginners. And so I concede, after having been asked this question by earnest enquirers, that it is NOT self-evident in every sense that warps indeed can do all and everything that object-oriented programming with classes can do. It is, however, a true point that the warps indeed can do this, and also a very important one. And, hence, this tutorial essay. First, let us not be hypnotised by language. Every task worth doing involves to some extent a person being oriented towards this task as object, and so let us realise that the phrase 'object-oriented' is a rich and metaphorical phrase, which cannot be identified with what some Norwegians in the 1960s with a mathematical eductation and an orientation towards social sciences wanted to use it -- even if it got, to a large part due to further work by authors of C++, Smalltalk and extended Lisp, immensely popular to the extent that it virtually overtook all programming for a good while. So also is the notion of 'object' entirely beyond all definition by nerds and technicians, it is a common word in the English spoken language, and they do not own, possess or copyright the word in any way. Similar can be said of 'class', and indeed all other words used by programmers of this kind. In my early Firth platform, which I developed by hundreds of freeware and open source modules with a modified FreeDOS as kernel, working out the new interactive compiler after having abandoned attempts to work Forth towards what I wanted -- a platform which indeed (as Lisa_CD with U and B menues if one types XO after its startup) is available as operating approach still at the time of writing for the early type of PCs at yoga4d.org/download, and which can run the Lisa GJ2 Fic3 also -- with its vast library of very early programs including DOS games -- I was intrigued by the beauty, as also found in the APL programming language, more or less, as I played with in the 1980s, by the use of arrows. For, when in that platform (with its FreeDOS- derived kernel), one writes COPY FILE1.TXT FILE15.TXT it gives an output of this kind: FILE1.TXT => FILE15.TXT This inspired the use of the arrow now found all over the place in Lisa GJ2 Fic3. At the time I conversed with Kristen Nygaard, during the years before, about, and including, roughly, year 2000 (he was a friend of the family, and my father used indeed the early version of Simula before it became Simula67 in scientific modelling work, which had some influence on Nygaard's and Dahl's further work on Simula), -- I was clear in my mind that I regarded the hierarchical class structures with their socalled "objects" as a false imposition of a meaningless scheme on programming, a wrong step that humanity took, based on an overhyped love affair with the idiotic work of Nygaard and Dahl. I am, however, fortunately, a very polite person when I can be, and I could be, and so I did not more than hint to Nygaard that the hierarchies of their so-called object orientation hardly could be said to reflect the richness of perceptions going on in the minds of people, perceptions which indeed are more network-organised. He talked about a renewal of the best ideas inside object-orientation, that he did not see with Java, with a new language of his, called Beta, and he favoued a syntax which to me looked like Forth-inspired, with some kind of arrow connecting hard-bracket boxes of parameters. Something which looks perhaps good abstractly but which begs the question of practicality when real complexities in programming crops up, for it is not easy to count hard brackets bundling up upon one another. Besides, I favored the more feminine softness of parenthees of Lisp, but with fewer parentheses, and doubling of them, to make them stand out from ordinary laetters, and with space before and after, to make them stand out still more. The parameters, moreover, of any such type of object oriented programming language tends to get what can be called 'strongly typified', leading to an inflexibility that I as anarchistically minded programmer shunned. He spoke enthusiastically about the Norwegian state supporting his Simula Center activities with new millions of kroner (Norwegian currency), and that he wanted to create a new understanding of the depth of object-oriented programming using the Beta language as example. I could not honestly display very much enthusiasm for all of this, and went into a description of the philosophy around an open-minded interpretation of quantum physics empirics each time, so as to come over to some common ground. But what he said about object-oriented programming languages in this particular phrase is worth the while discussing, in order to show how warps transcend all that and includes it also: "In an object-oriented programming language," Mr Nygaard said, "everything -- and I mean everything -- is an object. And very few languages have that feature." Alright, now Nygaard-the-nerd means by "object" something which is, by using more of their phrasology, "an instance of a class". Now a class is a bundle of data and functions. An instance of the class is an instance of all the data in that class which is defined to be unique to each instance of it. A class can, moreoever, be derived from a higher class, so that more general functions can find their particular application further on in the hierarchy of gradually more and more particular types of classes. This sounds rather big, all of it. But we have got to remember what I have said elsewhere, that a programming language is but a cloth of meaning around that which is rather meaningless on its own -- machine language of the CPU, which are numbers which instruct how numbers are going to be pushed around and compared. Some of the number positions correspond to technical hardware elements like monitor, keyboard, mouse, and such stuff. The pushing around involves arithmetic and trigonometric functions might be implemented e.g. by tables of numbers -- or functions of some functions which are implemented by tables of numbers. Of course, under the machine language there is that tiny little segment of the world called 'electronics'. There is as such no particular value to speaking of anything which is sub-machine-code. Electronics is a mechanical thing and do not reflect the larger properties of the world with its landscapes of wave-like nonlocal phenomena. These wave-like nonlocal phenomena involves gestalts of networks of organisation which go on at a much finer level of reality than any such thing as 'nano', 'subnano' or 'pico' or the like, relative to human typical measures such as centimeters. Beyond these again, underneath and also beyond, in a transcendent sense, I propose, in a neopopperian spirit, that there is a Berkeleyan type of wholeness of mind. I have rather often referred to some more or less classical philosophers, such as Berkeley, Anselm and the atheist Russell, but I do not think these works are really much worth reading on their own. They are too wrapped up in the limitedness of the ideosyncracies of these persons. But it may be worth the while, in this regard, to note that when Bishop Berkeley proposed that God is imagining the world, the world is really made o ideas, it is recorded that a critic of this view, on conversing about this view while walking in the woods or something, said that he dismisses the view, and, famously kicked a stone, saying, "I refute it thus!". But that this is not at all a refutation is very simple to show. When you just read what you did read, you did visualise a person kicking a stone, and you visualised that the stone gave a resistance. The person hoped to refute the view by suggesting that since ideas yield to kicking, but stones not, stones cannot be ideas. But a visualised person kicking a visualised stone may perfectly well experience the stone as utterly hard. God day-dreaming the world involves God-daydreaming bodies, minds, ideas, feelings, and the outer world, all the universes, at all levels, and all their interaction. This cannot be empirically refuted but it can be neopopperianistically investigated. I have done so; I support the view. This is that which is beyond all computers, all electronics, and also all the larger beautiful world of living human beings. (I am grateful to Ingar Roggen for asking me a question involving the term 'sub-machine-code' and also 'sub-nano' which led me to clarify these points by means of negation; but we did not venture to discuss these ideas as I worked to get the F3 language to work on his Apple laptop at the time, since he wanted to do scientific work with F3 as a formalism, as a possibility; Roggen is a scientific colleague of my father in the departement of sociology at the University of Oslo, where both have been employed throughout their active careers). To return to the theme at hand, -- it is another feature of object-orientation that some objects, once created, can have an activity or at least persistence during a program run. Some of the functions associated with a class can, in Simula67, be declared 'virtual', meaning that they are to be given a particular implementation at a later stage than that which is involved when the class is first defined. When re-usability and collaboration between people are in focus, it becomes sometimes an area of focus concerning object-oriented languages what types of variables and functions are accessible outside of the class, and what are accessible only within the class. Several degrees of these can be defined. In languages such as Java and its copycat C# by Microsoft there is a level of activity which gives some degree of appearances of parallelism by means of assigning objects to 'threads' of activity, with a priority. All this sounds extremely advanced: it is not. It is just a whole lot of blah-blah on top of what programming is all about. Permit me to decode the phraseology. Last thing first: parallelism. A computer can have more than one CPU or it can have a CPU which has some parallell stuff in it to incrase its performance. But the cleanest and most stable environment is one CPU doing one instruction pr a certain number of very fast computer clock ticks. Performance tricks remains just that: performance tricks. Having settled that, all there is of parallelism means that stuff is going on so fast it appears to be parallell while in practise there is a quick shifting or polling between processes -- by and large. Then, if some program elements -- whatever we call them -- are to be performing in an enduring way, it means that there are some variables involved which are global rather than local or stack-based. It also means that there is a loop that does the polling. If this loop is hidden, as with Java, it means the programmer has less control over it, and thus there is more hacking into the language to be done when the hidden routine works in ways not suited to the application, as often happens, as it turns out. And so the list goes: for every advanced hot sophisticated concept, we find that it is all about whether the real program elements here are in part hidden from the programmer or not. If not hidden, it gets simple. If hidden, we get these sophisticated-sounding concepts. Take now the word 'class'. We said: a bundle of data and functions ("methods", "procedures"). Now what is a bundle? A bundle is an array or a matrix -- in other words, a bundle is data. This matrix contains within it functions. How can it? Answer, it has warps. That is how it would be done in F3. One makes a scheme, if one wants to, then applies it. But it turns out all sorts of schemes like that, also as found in Win32for, just confuse the real programming and does not make it go faster, look better and be done in a way which involves less work or which involves fewer steps of complicated actions. So a class is a matrix of data and functions. Now a class can be inherited from a higher class. That is, a class matrix can be created with reference to (one or more) higher classes, or matrices. Again, that is a matter of warps. A class, then, is a matrix of data, functions and warps. That takes care of the inheritance, which was hierarchical in Nygaard-terms. Let's finally take care of the notion of object. It is said that an object is an instance of a class with its own data. What is an "instance"? It means that we have, again, a matrix with a warp over to the matrix which is its class. In this new matrix, the instance, the object, we have some novel data-warps. This new data was alloted in RAM based on what the class-matrix had in it of information as to the required essential data for each instance of it. When the instance or object is going to have one of its class functions performed -- which is, in the poetic jargon of Smalltalk and such, being the same as "to send a message to the object", -- it simply means that the data-matrix is used to fetch the warp of the relevant class function from the class-matrix, and this warp is then performed. In Lisa GJ2 Fic3, this is done by the word HYPERCONNECT. Satisfied? ;)