We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Concept Programming: The Art of Turning Ideas into Code

00:00

Formal Metadata

Title
Concept Programming: The Art of Turning Ideas into Code
Subtitle
Building the Matrix. Understanding how we programm
Alternative Title
Concept Programming, from ideas to code
Title of Series
Number of Parts
490
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Programming is the art of turning ideas into code. Ideas and code do not live in the same space. Any translation is lossy. Concept programming is a cross-language approach that focuses on this translation process, and helps identify often overlooked classes of issues. Ideas and code do not live in the same space. Consequently, any translation is lossy. But this loss is not immediately visible. For example, how does your programming language coerce you into coding a concept as simple as "maximum" or list in a way that is generally full of warts? Concept programming is a cross-language approach that focuses on this translation process, and helps identify often overlooked classes of issues. It separates the "concept space" and the "code space", and focuses on how the mechanics in one space translate (or not) into the other. It introduces a few core ideas: Syntactic noise is the difference in look between code and concept. For example, in Lisp, you write (+ 1 2) Semantic noise is the difference in behavior between code and concept. For example, in C, text is null-terminated. Bandwidth is the amount of the concept space covered by the code. For example, the "+" operator has higher bandwidth in C++ than in C Signal/noise ratio is the amount of code that does not carry any useful concept. For example, curly braces and semi-colons in C.
33
35
Thumbnail
23:38
52
Thumbnail
30:38
53
Thumbnail
16:18
65
71
Thumbnail
14:24
72
Thumbnail
18:02
75
Thumbnail
19:35
101
Thumbnail
12:59
106
123
Thumbnail
25:58
146
Thumbnail
47:36
157
Thumbnail
51:32
166
172
Thumbnail
22:49
182
Thumbnail
25:44
186
Thumbnail
40:18
190
195
225
Thumbnail
23:41
273
281
284
Thumbnail
09:08
285
289
Thumbnail
26:03
290
297
Thumbnail
19:29
328
Thumbnail
24:11
379
Thumbnail
20:10
385
Thumbnail
28:37
393
Thumbnail
09:10
430
438
BuildingComputer programmingComputer programmingRight angleSoftware developerProgrammer (hardware)Object-oriented programmingMachine codeFigurate numberVirtual machineSoftwareTranslation (relic)Disk read-and-write headComputer animation
Translation (relic)Computer programmingMachine codeVirtual machineInstance (computer science)Right angleDisk read-and-write headInjektivitätComputer animation
Machine codeRight angleComputer animation
Speech synthesisSoftwareMachine codeComputer animation
Machine codeState of matterMetric systemQuicksortComputer animation
Machine codeMetric systemBand matrixFraction (mathematics)Error messageSocial classPointer (computer programming)Maxima and minimaFlip-flop (electronics)Order (biology)Hill differential equationFunction (mathematics)Template (C++)Inheritance (object-oriented programming)Semantics (computer science)Arithmetic meanFunction (mathematics)Operator (mathematics)Theory of relativityOrder (biology)Fraction (mathematics)Disk read-and-write headObject-oriented programmingCasting (performing arts)Noise (electronics)Pointer (computer programming)Radical (chemistry)TypprüfungTemplate (C++)Line (geometry)Proper mapElectronic mailing listFormal languageString (computer science)Functional programmingMultiplication signBitType theoryComplex (psychology)NumberPoint (geometry)Pairwise comparisonCovering spaceIntegerMachine codeBand matrixMathematical analysisMusical ensembleResultantAnalogyStandard deviationCoprocessorProof theoryBoolean algebraCompilation albumExpressionPseudometrikTouchscreenMaxima and minimaMathematicsInterior (topology)Expected valuePresentation of a groupSubject indexingCausalityCASE <Informatik>Java appletWeb pageElement (mathematics)Control flowPortable communications devicePoisson-KlammerProduct (business)1 (number)System callService (economics)Process (computing)Instance (computer science)Single-precision floating-point formatMetropolitan area networkSampling (statistics)Goodness of fitThread (computing)DistanceLie groupRight anglePositional notationData conversionMatrix (mathematics)Scalable Coherent InterfaceFood energyHypermediaInformationComputer animation
AbstractionBuildingMachine codeScalabilityComputer fileDatabaseCore dumpMoore's lawFormal languageComputer programmingFunctional programmingData managementMultiplication signMachine codeAbstractionLatent heatSet (mathematics)Computer fileData storage deviceScripting languageComponent-based software engineeringPhysical lawReal numberCompilerScaling (geometry)DatabaseCategory of beingWritingProcess (computing)Instance (computer science)Video gameMusical ensemblePoint (geometry)Prime idealRight angleCore dumpCountingExpressionObject-oriented programmingThomas BayesMereologyStructured programmingComputer animation
Computer programMachine codePersonal identification numberComputer programmingDesign by contractMultiplication signNumberFormal languageDesign by contractInfinityImplementationSet (mathematics)Logic programmingCalculationWeightRight anglePoint (geometry)Computer programmingInstance (computer science)Game theoryVideo gameCartesian coordinate systemComputer animation
Computer programmingGame theoryImmersion (album)Continuum hypothesisAlpha (investment)WaveCartesian coordinate systemPlanningComputer programmingGame theoryComputer animation
Game theoryImmersion (album)Alpha (investment)Continuum hypothesisWaveIRIS-TOnline helpObject-oriented programmingComputer programmingGame theoryAssembly languageArithmetic meanDescriptive statisticsDisk read-and-write headComputing platformMatrix (mathematics)Formal languageCartesian coordinate systemSign (mathematics)Execution unitEndliche ModelltheorieComputer animation
Reduced instruction set computingSimulationMatrix (mathematics)Graphical user interfaceKernel (computing)Loop (music)VisualBASICReliefFormal languageScripting languageComputer programmingFormal languageMatrix (mathematics)Visualization (computer graphics)SimulationMathematicsInstance (computer science)Software developerDomain nameTelecommunicationSystem programmingMereologyDescriptive statisticsPositional notationComputer programmingCASE <Informatik>MultiplicationLimit (category theory)Point (geometry)Game theoryNumberComputer animation
Game theoryBefehlsprozessorMultiplicationMatrix (mathematics)Product (business)Host Identity ProtocolFormal languageNumberVirtual machineLevel (video gaming)Game theoryCASE <Informatik>MultiplicationDemo (music)Matrix (mathematics)CompilerArithmetic progressionComputer animation
System programmingMatrix (mathematics)Virtual realityData integrityData structureAssembly languageBinary fileCompilerStatement (computer science)Mathematical optimizationComputer programmingFormal languageParsingSinguläres IntegralObject-oriented programmingContent (media)Network topologyComputer programmingSoftware testingMultiplication signFormal languageLimit (category theory)ResultantComputer animation
Point cloudOpen source
Transcript: English(auto-generated)
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 ...
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?
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?
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?
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.
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
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.
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,
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,
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.
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.
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.
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.
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.
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.
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.
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,
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
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.
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
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
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
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
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
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
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
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.
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
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
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,
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
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
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.
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.
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,
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.
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
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,
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
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
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
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
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
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
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
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.
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.