Concept Programming: The Art of Turning Ideas into Code
This is a modal window.
Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.
Formale Metadaten
Titel |
| |
Untertitel |
| |
Alternativer Titel |
| |
Serientitel | ||
Anzahl der Teile | 490 | |
Autor | ||
Lizenz | CC-Namensnennung 2.0 Belgien: Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen. | |
Identifikatoren | 10.5446/47018 (DOI) | |
Herausgeber | ||
Erscheinungsjahr | ||
Sprache |
Inhaltliche Metadaten
Fachgebiet | ||
Genre | ||
Abstract |
|
00:00
Gebäude <Mathematik>ProgrammierungSoftwareentwicklungRechter WinkelSoftwareentwicklerProgrammiergerätObjektorientierte ProgrammierungMaschinencodeFigurierte ZahlVirtuelle MaschineSoftwareTranslation <Mathematik>Schreib-Lese-KopfComputeranimation
00:47
Translation <Mathematik>ProgrammierungMaschinencodeVirtuelle MaschineInstantiierungRechter WinkelSchreib-Lese-KopfInjektivitätComputeranimation
01:09
MaschinencodeRechter WinkelComputeranimation
01:22
SprachsyntheseSoftwareMaschinencodeComputeranimation
01:39
MaschinencodeAggregatzustandMetrisches SystemQuick-SortComputeranimation
02:09
MaschinencodeMetrisches SystemBandmatrixBruchrechnungFehlermeldungKlasse <Mathematik>Zeiger <Informatik>Lokales MinimumFlip-FlopOrdnung <Mathematik>Hill-DifferentialgleichungFunktion <Mathematik>TemplateVererbungshierarchieFormale SemantikArithmetisches MittelFunktion <Mathematik>Nichtlinearer OperatorRelativitätstheorieOrdnung <Mathematik>BruchrechnungSchreib-Lese-KopfObjektorientierte ProgrammierungAuswahlverfahrenRauschenZeiger <Informatik>Radikal <Mathematik>TypprüfungTemplateGeradeEigentliche AbbildungMailing-ListeFormale SpracheZeichenketteFunktionale ProgrammierungMultiplikationsoperatorBitTypentheorieKomplex <Algebra>ZahlenbereichPunktPaarvergleichÜberlagerung <Mathematik>Ganze ZahlMaschinencodeBandmatrixAnalysisFormation <Mathematik>ResultanteAnalogieschlussStandardabweichungCoprozessorBeweistheorieBoolesche AlgebraSampler <Musikinstrument>Arithmetischer AusdruckPseudometrikTouchscreenLokales MinimumMathematikInnerer PunktErwartungswertCoxeter-GruppeAutomatische IndexierungPhysikalischer EffektCASE <Informatik>AppletWeb-SeiteElement <Gruppentheorie>KontrollstrukturMobiles EndgerätPoisson-KlammerProdukt <Mathematik>EinsSystemaufrufDienst <Informatik>Prozess <Informatik>InstantiierungEinfache GenauigkeitMetropolitan area networkStichprobenumfangGüte der AnpassungThreadAbstandLie-GruppeRechter WinkelZahlensystemUmsetzung <Informatik>Matrix <Mathematik>SCI <Informatik>EnergiedichteHypermediaInformationComputeranimation
09:52
AbstraktionsebeneGebäude <Mathematik>MaschinencodeSkalierbarkeitElektronische PublikationDatenbankSpeicherabzugMooresches GesetzFormale SpracheSoftwareentwicklungFunktionale ProgrammierungDatenverwaltungMultiplikationsoperatorMaschinencodeAbstraktionsebeneUmwandlungsenthalpieSchnittmengeElektronische PublikationInformationsspeicherungSkriptspracheKomponente <Software>Gesetz <Physik>Reelle ZahlCompilerZentrische StreckungDatenbankKategorie <Mathematik>Schreiben <Datenverarbeitung>Prozess <Informatik>InstantiierungComputerspielFormation <Mathematik>PunktPrimidealRechter WinkelSpeicherabzugZählenArithmetischer AusdruckObjektorientierte ProgrammierungBAYESMereologieStrukturierte ProgrammierungComputeranimation
12:24
ProgrammMaschinencodePersönliche IdentifikationsnummerProgrammierungDesign by ContractMultiplikationsoperatorZahlenbereichFormale SpracheDesign by ContractUnendlichkeitImplementierungSchnittmengeLogische ProgrammierungRechenbuchGewicht <Ausgleichsrechnung>Rechter WinkelPunktProgrammierungInstantiierungSpieltheorieComputerspielKartesische KoordinatenComputeranimation
13:05
SoftwareentwicklungSpieltheorieImmersion <Topologie>KontinuumshypotheseJensen-MaßWellenlehreKartesische KoordinatenAutomatische HandlungsplanungProgrammierungSpieltheorieComputeranimation
13:17
SpieltheorieImmersion <Topologie>Jensen-MaßKontinuumshypotheseWellenlehreIRIS-THilfesystemObjektorientierte ProgrammierungSoftwareentwicklungSpieltheorieAssemblerArithmetisches MittelDeskriptive StatistikSchreib-Lese-KopfSystemplattformMatrix <Mathematik>Formale SpracheKartesische KoordinatenVorzeichen <Mathematik>RechenwerkEndliche ModelltheorieComputeranimation
13:57
RISCSimulationMatrix <Mathematik>Graphische BenutzeroberflächeKernel <Informatik>LoopVisualBASICBetragsflächeFormale SpracheSkriptspracheSoftwareentwicklungFormale SpracheMatrix <Mathematik>VisualisierungSimulationMathematikInstantiierungSoftwareentwicklerDomain <Netzwerk>TelekommunikationSystemprogrammierungMereologieDeskriptive StatistikZahlensystemProgrammierungCASE <Informatik>MultiplikationInverser LimesPunktSpieltheorieZahlenbereichComputeranimation
14:38
SpieltheorieBefehlsprozessorMultiplikationMatrix <Mathematik>Produkt <Mathematik>HIP <Kommunikationsprotokoll>Formale SpracheZahlenbereichVirtuelle MaschineMAPSpieltheorieCASE <Informatik>MultiplikationDemo <Programm>Matrix <Mathematik>CompilerArithmetische FolgeComputeranimation
15:08
SystemprogrammierungMatrix <Mathematik>Virtuelle RealitätKonsistenz <Informatik>DatenstrukturAssemblerBinärdatenÜbersetzer <Informatik>Befehl <Informatik>Globale OptimierungSoftwareentwicklungFormale SpracheSyntaktische AnalyseSinguläres IntegralObjektorientierte ProgrammierungInhalt <Mathematik>TopologieSoftwareentwicklungSoftwaretestMultiplikationsoperatorFormale SpracheInverser LimesResultanteComputeranimation
15:44
PunktwolkeOpen Source
Transkript: Englisch(automatisch erzeugt)
00:06
Okay, so we'll start with the next talk by Christophe de D'Anchon. Concept programming. He'll be talking about concept programming. Hello, so my name is Christophe de D'Anchon. It's indeed hard to say, so thank you for ...
00:21
And my objective today is to make you better programmers, like making you think about something that programmers usually don't think about, and help you figure out mistakes that you may be making in your code, because everybody has been making them for 20 or 30 years. So who is a developer in the audience?
00:43
Okay, so I'm talking to the right crowd. So what is concept programming? Basically it's focusing on the translation from wetware, which is in your head, into software, which is into a machine. So it looks extremely simple, like this, right?
01:03
Basically it's a one-to-one mapping. Turns out it's not that simple, because for instance I have this in my head, right? And when I go into code, it looks more like this. Who has this experience?
01:21
Okay, so again, right crowd. So what you remember the WYSIWYG, well, your old-timers might remember what you see is what you get. In software, what you think is not what you get.
01:40
So let's try to identify a few problems in the code, and going from intuition, on stuff that doesn't quite work as we want, to method. I liked this picture. I was biking near to my home, and I got this nice car that polluted me with a diesel exhaust while I was biking, and then they got stuck, and I saw them trying to get
02:03
out of the rock they were on, and they had no method to do it. So they basically stayed stuck there until I called the fireman. Okay, so let's start with something that I call pseudometrics. And I'm sorry if I turned my back to you, I can't get a mirroring to work here, so I have to look at the screen to check that it's okay.
02:23
So pseudometrics are pseudo, because we can't really measure what is in our brain yet. However, you'll see that they are quite intuitive and easy to use. Syntactic noise, for example, is code that does not look as expected. An example is in Lisp, you write plus two three, whereas in mathematical notations,
02:45
you write two plus three. So that is an example of syntactic noise. Syntactic noise is code that does not behave as expected. The next example of that is small talk, where if you write two plus three times five, you get 25 and not 17, because small talk, everything is an object,
03:04
and basically it passes objects left to right, therefore priorities are not respected, precedence is not respected, and you get 25 instead of 17. When I mention that to Alan Kay face to face, his answer is yes, because mathematics are wrong. I think this is the wrong answer.
03:23
Bandwidth is an analysis of how much of the problem your code does cover. For instance, in OCaml, you have to write 2.0 plus dot 3.0. And this plus dot means that the plus in OCaml does not cover floating point numbers.
03:40
So it has a low bandwidth compared to the plus in C. And finally, the signal-to-noise ratio is what fraction of your code is useful. And here, you know, we can take, for instance, a complex operator in C++, where all the stuff in red is really not that useful. It doesn't give you information. I included that the return type of the function, which you can deduce from the expression in the function.
04:03
Now, what is interesting, and the analogy to music or signal processing, is that much like in music, what is noise to one person might actually sound like music to someone else. So that's important to remember. All this because it's in our head, it's subjective. However, it is useful.
04:22
So let's, I mentioned mistakes that everybody does. Let me start with a simple example, which I call concept cast. Concept cast is when you replace a concept in your head with another one that is related. For example, and the problem with that is that very often it's unconscious. You don't know you're doing that. And it seems to work.
04:41
So what's wrong with it? But it generates many problems. Because you lose a lot of semantics and a lot of signal. And you introduce another employees. So here are a few examples of concept cast. An example is all the languages that don't have variadic functions, you need to replace a variadic function with a list.
05:02
When you have text, well, if your language does not really support the notion of text, you can replace that with a pointer to a char. Anybody who has programmed in C knows how many mistakes we can make out of that. Write line, same thing. You can replace the idea of writing a line with the idea of writing a character that skips a line.
05:22
Which is fancy on old terminals in 1972. But today causes many problems. Like for instance, there is practically no way today in C++ to write a line in a correct portable way that doesn't break because you put a lock around it. So if you have multiple threads,
05:40
you get mixed outputs. You can also, and that's basically the next one. It's replacing write with an operator that does one operation at a time. Because at the time this was introduced, C++ did not have proper variadic typesafe functions. So they had to replace one concept with another. Replacing an array of something
06:01
with a pointer to something. Also found in C. Causes so many mistakes, you can take any 100 CVE 99 are one of these issues. Replacing A of N indexing in an array with star of A plus N which is the definition in C.
06:21
How many of you did know that? Good fraction. Now the fact is that you can write in correct C minus one bracket A and it indexes the one element before your array. And it's perfectly legal. And the last one which is more complicated is replacing the idea of resource with a C++ idea of
06:41
resource acquisition is initialization. This one is much more subtle and if you want to know more please ask me after the talk. Now let me go to a very very new concept. None of you has ever used that concept. The concept of maximum which is written from the Wikipedia page as mean of any number of things
07:02
is the first one if it's smaller than all the others than the mean of all the others and otherwise is the mean of all the others. Looks simple right? Let's try this in C. So I can write this as int min and what is the problem with this? Low bandwidth only deals with integers can't deal with more than
07:21
two values so it does only one comparison so basically we are quite far away. I can increase the bandwidth a little bit in CPP using the C proof processor which is the standard definition of min in C that most of us have used and that is much better because now it works with floating points. That's the good news. The bad news is it also works
07:41
with char star. Remember the text to char star conversion? Now for char star it gives a completely nonsensical result because it compares not the text but the pointers which has absolutely no usage whatsoever. Let me try that in C++. Now I write a template. Larger bandwidth now because now I can have any type
08:01
and my less than is more controlled so it still fails on pointers but it doesn't fail on an ECD string because operators less than exists on an ECD string. OK. I've been writing languages inspired by this since the late 1990s and in 2001
08:21
one of my compilers could actually compile that stuff. And what this says is that a type is ordered if it has a less than that returns a boolean and the mean of one ordered entity is that value. The mean of one order and other stuff is you do the mean of the rest. This looks much more like what you have on the left, right? But there is still a bit
08:40
of extra noise. But I'm still very happy with this one because frankly so I've been on the C++, at that time I was doing that stuff, I was on the C++ committee and I've been talking to C++ committee members and only 20 years later we see some concepts appear in C++ except they are not my concepts but well, at least they are something.
09:01
Now in C++11, now you can have variadic templates. And this is again just only 10 years after Excel was doing it. But I'm glad it's there, so now we can use that. OK. In Java we have nothing, so basically when Java looks up to C++, it does all the mistakes. Now it has a list and you have a list of untyped objects
09:21
and you basically have all the drawbacks that you had before. And for fun, in Emacs Lisp, you can actually get something relatively decent. So that's what it looks like in my current language. And just in case you're curious, this is not completely vaporware. The definition that you see there is the definition that is used in the presentation that I'm giving
09:41
you, because that presentation is written in this language. Hence all the fancy animations. So, representing concepts in the code, can the code be as rich as our brains? Let's try. First of all, let's try concept-inspired naming to make the code understandable. Programmers, for instance,
10:01
write file, and they think file, and it has the same properties. If you call it cat, it doesn't work. So we all do concept programming without knowing it. Thank you. And that means you can do concept-based composition to make the code scale all. For instance, in code, like in real life, a file can be used to build
10:20
a database. Then you can have concept-inspired behaviors to make the code reusable. For instance, you don't need to know the OS magic behind file. All you need to know is that it behaves like a file. You can store stuff in it, and it stays. And finally, concept-based specifications make the
10:41
code manageable. You can exchange stuff. For instance, the behavior of file is, to a large extent, reliable, portable, documented, et cetera. So you all do concept programming without knowing it. But we can do slightly more than that. So let's think about the process of creating abstractions in our code, of composing stuff. It started like this with Fortran, basic, et cetera.
11:02
The abstraction you had where compiler provided symbols, expressions, stuff like that. And then the next step was to have structured programming so you could have proper loops, you could have function names like plot, et cetera. Then the next step was objects. All this was, you know, when I was young, a long time ago.
11:21
Then Java distributed programming and you have more stuff. And Python, well, I take Python, Excel, et cetera. It's basically you start composing stuff more than writing your own. And it's basically you're looking at software components. That was a dream when I was a kid. So what does Excel bring you to that? Well, basically,
11:42
you start there, and that's the Moore's law, right? It's an exponential law. So if you don't change the tools, what happens is you fall under the law as time goes by. You don't change the tools. You just automatically follow that. So you need to change parallel every n year to make progress. So you're always there in practice.
12:01
So the idea behind my language, and by the way, I'm giving a talk tomorrow on the language specifically if you're interested, is to have something that is on demand. You evolve your set of concepts all the time. Excel stands for extensible language. You add concepts as you go. And the idea is that instead of being on the right, you can basically bounce
12:21
whenever you need, and you can take advantage of this stuff. It's important because the set of concepts is infinite. For instance, even if we consider only those that are relevant to a program, like, for instance, here we can exclude the cigarette lighter if it's a car simulator, we still need a number of minority paradigms, like,
12:42
I'm going to show a few, but basically that means you invent your own incompatible language every time. So, for instance, you have logic programming that was a language prologue. Or you have design by contract that made it to a few other languages, but basically for today, the best implementation of that remains if I fall. And
13:00
in the end, you create your own language like I just did, basically. So, keep going like this. I'm going to very, very quickly go through a few applications to show you that in real life, it does actually matter. For instance, I wrote a game, I just gave a talk, you can look it up later when you're back from first-hand, but I gave a talk in the ritual gaming. That's what
13:20
I was doing when I was 18 or something. That was the first 3D platform game. How did concept programming play into that? Well, that's the description of 3D objects in it. To you, it's probably unreadable. But if you know, like I did, because I created that ZM5 means
13:42
along the Z axis minus 5, XP5, along the X axis plus 5 units, etc., this is actually a description I can replay in my head and I can understand what object I'm talking about. So, it's 3D modelling with only assembly language, if you wish. Okay, that's a bit far-fetched. Another example. A car simulation that basically was
14:02
a matrix for car electronics. You put an electronic device in it, it doesn't know it's not in a car. So now you can run at 50 miles an hour in the Sahara Giza and run into a snow pile and see what happens. Okay, where does concept programming play a role here? In the development itself, converting
14:20
for instance between C and C++, C and Visual Basic, in the description of the system itself, the scenario language. So you basically, what changes here? You start with the notations and then you create the tools to play with the notations that you understand that are part of your domain concept. Same thing with some games I wrote
14:41
when I was young. So in that case it's the matrix multiplication because there was a number of these games that actually went to the United States infrared connecting machines to infrared. So, actually these were just basically demos for that tool. And that was a tool that allowed you to program these machines
15:00
at high level. It was a cross-compiler for the machine. And you can see the same idea of trying to have the high-level concepts that are relevant to what you're doing. I'm going to skip that one and just going to show you what 3D looks like. So you have dynamic text, you have 3D transforms.
15:20
Basically, my question when I started trying to push the limits about my language was how do I go beyond standard programming and I thought oh, documents, that's a good test. And you see the result. So I hope that this will give you ideas and sorry I'm out of time. But I try to speak fast. Thank you.