Experience with wisp
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Subtitle |
| |
Title of Series | ||
Number of Parts | 561 | |
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 | 10.5446/44259 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
DampingFormal languageBit rateComputer animationLecture/Conference
00:21
NeuroinformatikGroup actionMathematicsCanonical ensembleInheritance (object-oriented programming)Revision controlTraffic reportingFile formatNumbering schemeLecture/Conference
01:26
Code refactoringMachine visionNumbering schemeInterior (topology)MathematicsPhysicsJava appletGame theoryWebsiteFreezingVirtualizationComputer programmingJava appletNumbering schemeTelecommunicationLimit (category theory)SoftwareMereologyUniverse (mathematics)AlgorithmFormal languageSocial classInheritance (object-oriented programming)Multiplication signData recoveryCompilerSoftware frameworkContext awarenessCodeComputer animation
03:02
Machine visionNumbering schemeInterior (topology)MathematicsMachine visionPower (physics)
03:24
Machine visionNumbering schemeInterior (topology)MathematicsTask (computing)CompilerMathematicsMereologyData managementXML
03:49
Task (computing)CompilerNumbering schemeMathematicsConstructor (object-oriented programming)Inheritance (object-oriented programming)Contrast (vision)Data structureMathematicsOrder (biology)NumberLecture/ConferenceComputer animation
04:28
Computer programmingCompilerSoftware developerCasting (performing arts)Numbering schemeRun time (program lifecycle phase)Lecture/Conference
04:46
CodeNumbering schemeMathematicsNumbering schemeComputer iconCodeMereologyComputer programmingFamily
05:34
CodeLine (geometry)Numbering schemeIdentifiabilityMereologySocial classScalable Coherent InterfacePhysical systemLecture/Conference
06:05
Numbering schemeCondition numberInterior (topology)Numbering schemeFrequencySystem callFunctional (mathematics)Line (geometry)YouTubeWordThermal expansionSource codeComputer animation
07:08
Numbering schemeMathematicsElement (mathematics)Block (periodic table)Network topologyData structureCodeLine (geometry)Source codeDivisorOverhead (computing)Inheritance (object-oriented programming)Regular expressionMathematics2 (number)ParsingNumbering schemeCodeSpacetimeIdentical particlesWireless LANCASE <Informatik>Local area networkWave packetDifferent (Kate Ryan album)Lecture/ConferenceComputer animation
09:26
CodeMathematicsFrequencyCodeFrequencyMathematicsDoubling the cubeProcedural programmingSystem callComputer hardwareComputer animation
10:08
Projective planeLecture/Conference
10:27
Formal languageLine (geometry)CodeArray data structureRepetitionFrequencyCategory of beingMathematicsTwitterWhiteboardLine (geometry)Electronic mailing listOcean currentArray data structure
10:51
Category of beingMathematicsWrapper (data mining)Functional (mathematics)FrequencyLogistic distributionTable (information)Lecture/Conference
11:17
Line (geometry)IcosahedronEstimationDigital filterMathematical optimizationMusical ensembleFunction (mathematics)Game theoryScripting languageComputer networkSimulationFreewareError messageClient (computing)Communications protocolLibrary (computing)MultiplicationArray data structureSoftware testingModule (mathematics)Electric currentMountain passCodeGame theoryHash functionImplementationString (computer science)Different (Kate Ryan album)EstimatorPresentation of a groupScripting languageMathematicsPasswordSoftwareMereologyStreaming mediaParameter (computer programming)Software testingBuildingStability theoryMultiplication signLine (geometry)Control flowElectric generatorMusical ensembleFunctional (mathematics)Personal identification numberComputer simulationBit rateForestGroup actionComputer animation
12:43
Software testingArray data structureElectric currentConvex hullFrequencyRepetitionCodeLine (geometry)FrequencyComputer fileBlock (periodic table)Different (Kate Ryan album)Type theoryMultiplication signString (computer science)Coefficient of determinationPresentation of a groupSheaf (mathematics)Standard deviationSoftware testingSpacetimeNumbering schemeComputer animation
13:39
Software testingArray data structureModule (mathematics)Electric currentMountain passEquals signMacro (computer science)Lecture/ConferenceComputer animation
14:14
Regular expressionMathematicsSquare numberFormal languageFreewarePerfect groupFitness functionMultiplication signSpecial unitary groupLecture/Conference
14:50
Game theoryUser profileGame theoryProcedural programmingScripting languageMacro (computer science)Type theorySystem callComputer animation
15:19
Multiplication signControl flowString (computer science)Macro (computer science)Content (media)Ring (mathematics)TouchscreenTrailLecture/Conference
15:43
Game theory2 (number)Computer animation
16:29
DemosceneInversion (music)Game controllerFormal languageNatural numberRevision controlRight angleSystem callLecture/Conference
16:52
Game theoryUser profileNormal (geometry)Procedural programmingSystem callStatement (computer science)ResultantMereologyComputer animationLecture/Conference
17:17
TelecommunicationComputer networkStudent's t-testCodeCodeStandard deviationComputer animation
17:35
Content (media)BitBinary multiplieroutputModulo (jargon)SummierbarkeitBit error rateRadio-frequency identificationDemonArrow of timeXML
18:30
Formal languageBitSpacetimeMereologyLecture/Conference
19:13
Numbering schemeCodeRecursionMathematicsUnicodeCodeComplex (psychology)Water vaporSoftwareComputer simulationData managementNumbering schemeTesselationLaptopLecture/Conference
20:04
RecursionParameter (computer programming)MathematicsUnicodeMaxima and minimaOverhead (computing)Complex (psychology)Modul <Datentyp>Scripting languageSoftware testingDistanceNumbering schemeMereologyComputer animation
20:43
Macro (computer science)Extension (kinesiology)Procedural programmingSoftware bugChromosomal crossoverInternetworkingLecture/Conference
21:10
Fiber bundleComputing platformComputer programMereologyCodeMultiplication signPoint (geometry)Computer animation
21:34
Code
21:53
Point cloudLecture/ConferenceComputer animation
Transcript: English(auto-generated)
00:05
Thank you for coming. This talk is not about adding a new language, not like creating the new language from scratch because, well, I want to get finished with it at some point. So, rather this is giving you access to all of scheme,
00:23
we are annotation sensitive formatting. Also, it won't be as flowery as the talk by Ricardo, which I like very much because it's a report. It's a report of the steps to what the one zero. So, actually to what getting this done and completed that I can say, I don't think that there will be any changes after today.
00:45
So, the talk is about my experience with width, five years. It's now five years since I started this. The idea was that I looked at scheme and really liked it, but I got a problem with the parents. I think that's a problem many people have.
01:02
Yes. So, let me get started. This here is an example of how Wisp looks. The canonical example I use everywhere because I like it a lot. I started in 2003. Since 2015, this is specified in the schema request for implementation, 119.
01:21
It's now at version 0.9.9.1 because I missed adding some Emacs files. So, short about me, I won't talk about everything which is there. I started programming only in 2006 with Python, and used that for six years in the PhD almost exclusively.
01:44
But in 2013, I started going into scheme because I realized that I'm hitting limits of Python. I saw that in scheme I can actually go further into how programming can be, and not just into using things other people do or just having to go deep into the compiler.
02:04
The parents shouldn't vary me because I've been using Emacs since about 2008. I've been looking into E-LISP, so it shouldn't hurt me but it still does. I'm strange. Since 2017 now, I'm actually working full-time on Java. So, I saw the other side
02:21
and I'm seeing the other side daily. So, I can really appreciate what I can do here. Also, we had this about education here. Last year, I had the chance to give a networking technology and communication class at university and there I could actually use
02:41
the language to describe to them how an algorithm works. They asked me whether it's pseudocode. So, I was really happy about that. Yes, the part below you see. My wife and kids are certainly not here, but if they were, I wouldn't have time.
03:00
So, maybe that's good right now. So, what is WISP? The vision of WISP is really to get a syntax like Python, but with keeping the simplicity and power as in LISP. The way toward that is to get the outer parenthesis away by just inferring them
03:22
from indentation to have in-line parenthesis for some edit beautification, to do in-line infix math just by shelling out to some work other people did before me, and to the wife HTML which Python sadly does not manage.
03:40
So, I knew that it is important. So, but let's go back. Why is actually scheme-grade? When you look at the readability of scheme, while the parents make many people think that it's hard to read, when you look at it in detail you see that all the contrast structures are just the most common letters you can use
04:03
if you omit normal A to Z and you omit the math characters and the numbers. All the rest, this is when you look at the order, just the order in how common they are in normal prose. I actually looked at newspapers and books and so on.
04:21
So, this period, comma, quotes, colon and so on. This is the order how common the characters are and these are just the characters used in scheme and LISP. So, when you're looking at that, it is really close to just looking like prose. And also, it is flexible enough
04:40
that you can program your compiler at runtime. So, you can actually build everything without relying on the compiler developer. But I would like to ask you to look at these two code snippets, the one above and the one below, and then think about what if you showed it to your son or your daughter?
05:02
What would they perceive as easier to read? And for me, that answer is clear. And this is why I'm doing this because I think that it's actually easier to read. So, in short, there's a kind of elegance for me.
05:21
Scheme provides homo iconicity. Homo iconicity, I can never speak that right, which just means that you cannot distinguish between code and data if you just look at the sub part of the code of your program. It can both be the same, can both look the same. And you can use code as data and data as code.
05:40
And then if you use the most common characters. But the elegance I want to add is that the first and last characters of a line shouldn't just be a parenthesis because then you lose the most, the strongest identifier of each line to always the same character until you manage to unsee it.
06:01
So, why WISP? I want the simplicity elegance of Scheme with the readability of Python. And I now show you visually how this is done. I had a longer talk about the details here, so I just show it. This is Scheme. And this is already valid WISP.
06:21
I go back, you see the parenthesis, they disappear. And the one thing which appears are these periods in the beginning. Because WISP just inverts what Scheme does and what LISP does. It does not mark where you call a function, it marks where you don't. And since where you don't call a function, in the next part, when you want to call a function
06:43
in the next part, you actually don't need to add more indentation than before. You do not need to finish the period. So, you actually minimize the syntax from you need two characters at the beginning and at the end to just one at the beginning.
07:02
And lines which do not start a function call are much less common in Scheme. I actually grabbed the guile source code and two thirds of the lines start with the parenthesis. And these two thirds of the lines now do not need that anymore. So, the syntax overhead is cut by about factor four.
07:22
Okay, next step. You see the parenthesis here, they are okay. But sometimes you want to avoid them because inside parenthesis, WISP parsing is disabled. So, you can always paste in Scheme verbatim and it will run because this will just be run through the Scheme reader.
07:40
So, you can remove them. Which then makes this look even simpler if you're not used to parenthesis. But that's not the reason why it exists. The reason why it exists is that for constructs like let values, you need three parenthesis after each other.
08:01
So, you need a way to represent this is an empty parenthesis and after it, there comes another one. And this is what the colon on the empty line does. It just says, here's an indentation level, add a parenthesis and check the next line. And the inline parent just comes from that because when you have syntax and you already take up that space,
08:20
then you should use it as wide as possible. Next part, I had a colleague who looked at my Scheme code and said, prefix math. And I realized, yes, this is a problem for many people. And for some, especially smaller mathematical expressions, prefix math is hard to read. So, I just activate SRFE 105, that's curly infix.
08:46
So, in WISP, you can always use this expression. Just curly braces around that and you have infix math. You can also do it in Scheme by the way, at least in Gaia. Just add this curly infix marker and then you can use infix math.
09:02
And finally, there's HTML. It won't go away. So, we need something which can survive when you strip away, when you collapse all spaces into one. And this is here, the leading underscore. You can, in WISP, always replace leading white space by underscores. You just need to keep one single leading white space
09:21
at least in front of your token because otherwise it cannot distinguish between that. So, when you write code like this and you post it into a forum, someone can always copy it, throw it into the repl and it will run. So, that's it. That's the basics of, no actually, that's all of WISP.
09:41
The indentation is used to show the outer parenthesis. Leading period is used to say, this does not start a procedure call. The colon provides double parenthesis and inline parenthesis. And infix math and underscores are provided for convenience because otherwise it's really hard.
10:02
There are some things which just, the infix math, that's something where people just say, no, and suddenly they are out. And this way we can avoid that. So, now we come to what I actually want to say here. That's the past five years because I used WISP for about two-thirds
10:23
to three-quarter of my hobby projects in the past five years just to see whether it works. And I found two things which should have changed, which should be changed and which I already changed. That's a literal array. Currently you can make a literal list by just saying quote and the line afterwards
10:45
and it is interpreted as the line is quoted. What was missing is I couldn't do arrays and Guile only treats an array as property of a function if you actually take a literal array. If you say this is an array, then it doesn't do it.
11:02
So, that was sadly needed to add this. And then there's a trailing period to make the wrapper more convenient. But with these changes, I don't see anything else coming. And this is the changes since 2015. So, there wasn't a lot. So, I think it's stable.
11:21
Here's a short overview of the stuff I did that goes from writing pi to guy that was reproducing all my workflows from Python in Guile. Then implementing advection diffusion, building function parameter estimation. Actually, the first part was work. Then there comes game scripting that was what can I do with WISP.
11:41
This is what Christopher presented last time here, which was really great. I saw it in the stream. And then I built a password generator which I'm using now. Built a network simulator. All this stuff afterwards is networking. Hemming code, the Hemming code
12:02
is actually an implementation of a Hemming code for a lecture. And then there's dry-its-wake. This is game scripting again because a colleague left to a game company and wanted to give him a present of something he can show all the game script as, hey, this is how it could look.
12:21
So, the first change is what you see here, the two hashes that makes a literal array. And with that, you can implement doc strings in Guile, which are almost like, tests in Guile, doc tests, which are almost like the doc tests in Python with a difference. Then in Python, you write them in the string, and if you make line breaks, everything breaks
12:42
until you figure out that you have to quote them. Now, in WISP, and this actually also works in Guile now in normal scheme, you can just define these doc strings and they are normal code. So, you write them like you would write the code for that. No difference between your code, your doc tests,
13:00
and so on, it just works. But for that, I needed this extra syntax here. And then in the wrapper, typically in WISP, if you run an expression, you have to type enter three times to have it executed because it waits for two empty lines to say this block is finished. This is the same in the REPL and in the file, but end of file also counts.
13:23
Now in the REPL, you often just want to say, I want to execute this expression, so if you put this period behind that, and press enter, then it's executed right away, and treat it as the block has ended here. You can also use this in code files. Question?
13:42
Yeah?
14:04
Yes. Yes. Yes. Yes. And in this case, this just takes it, and I think it transforms it with a macro. So, I'm not perfectly sure, oh, repeating the question. Yes, you asked whether this is the first change
14:22
which doesn't apply to everything, every S expression language. And yes, it does not apply to every S expression language. So, this is something which is unfortunate to me, but which I needed to get this working in Guile. For doing this in another scheme,
14:42
for another language, another S expression language, I would leave that out. Okay. So, and this is the game scripting. So, what you see here is, I'm using actually a procedure for a scene, and then this is stolen from Shakespeare.
15:02
The people who are in there enter, because they enter, and then the name. This defines a macro for the name, and then you can just use the name here, and type below that what it does, and all of this is implemented in macros. So, there's no special syntax in Wisp for that.
15:20
It's just that you can make a macro which looks at the content of the next line, interprets it as symbols, looks at the names of the symbols, takes a string out of that, and then shows it character by character, which is really cool that this is possible in scheme, and which is one of the justifications why I think that this is something where we should go.
15:42
And now, I think there's time for a short break here, because I've been talking the whole time, and I should actually stop talking for 30 seconds. This is how the game looks.
16:03
I don't get it much bigger, sadly. Basically, here it asks you a question, you answer that, and this question is what you had in the slide, as choose.
16:25
Yes, it's where I want to go, and this is what I want to use for games, because there you have the writer in the front seat. The writer can always change things and just call scenes and calls actions, which is an inversion from the writer
16:41
having to wait for a feature coming available by the one who writes the scripting language. And you have all of schema available here. Control tab, here. This here, these are just normal procedure calls. As you can see, if you know scheme,
17:00
actually there's quasi-quoting around the lines, so this is an executed statement. And the result is actually printed. this is what I did here. Now, we come to the educational part. Last year, as I said,
17:21
I had the chance to use Wisp in a lecture, and they implemented Hamming code for them to show it to them, so they could actually understand it from a working example. And this is how that looked. This is the Hamming decoder.
17:40
This is an 11.7 Hamming decoder, so it takes 11 input bits and extracts the seven content bits from that, and all the while, it corrects up to one bit error. It takes here the bits, the C bits are check bits, the D bits are data bits, and then it just calculates the modulo two sum
18:01
of the first check bit and the associated content data bits, multiplies it with one, and then it does the same for the second check bit, up to the fourth. And by adding all these, we find where the bit is flipped.
18:24
Then it flips the broken bit and just extracts from the fixed bits again, only the data bits, though the bits starting with D. Question? Why is the reading?
18:41
Because language does not only have to survive HTML, it also has to survive Minted, which kills your indentation when you have more than eight characters of white space. So this is an unexpected advantage that I could actually do that because otherwise this would be garbled.
19:02
So not only HTML is white space hostile. I'll skip this and just go, since I only have five minutes left, I think, and just go into where it helps me in learning. So first part, who among you writes code by hands?
19:23
Who has, let's ask it differently, who has written code with pen on paper? It was four, six. Yes, I mean four is my experience. You had to four, okay. Yes, I mean. Actually, horrible. Okay, yes. Or should we just do tiles and we did a clear degree?
19:42
I actually do this to understand complex stuff. For example, the network simulator, I wrote like that in my notebook here. And that's how I really understood what I'm doing. And I think that helps a lot. And you see in the writing, this is pretty natural to write down code like that.
20:03
Then, scheme has a beautiful elegance that lettering. Okay, so let me check.
20:21
Okay, I'm leaving out these parts. Some of these are already set and jump forward to one of the things I found with works. Use more inner defines in WISP than in scheme because the indentation is, because deeper indentation is more nasty
20:41
than deeper nesting in parenthesis. So this is one thing I found which I do differently. And then, always prefer procedures over macros when you can and prefer macros over reader extensions. This is why WISP doesn't do a lot in reader extension because these are nasty to debug
21:00
and interact badly with other stuff. So, skipping this. And so, there's finally the future I see. I want to explore more possibilities here without changing the language itself. It needs more documentation and better tooling. For example, publishing is really unsolved.
21:21
This is horrible. And then, I would really like to get it into Guile at some point. And for you, the next time you get to write pseudocode, it would be really cool if you would try to write it as WISP you can execute and talk about it and tell me because that's one of the best things to see
21:42
when someone uses this. And with that, thank you.