 Yeah, my name is Santosh Rajan. I don't have a job now or I don't work anywhere other kind of semi-retired as you can see I'm a little old programmer compared to all of you. I've been programming for about 30 years. Kind of did everything then I decided what to do now you know like you know so I decided to write my own programming language. So it's called Lisp Script. You've heard of it? Yeah, okay. Well it's like how many of you know Lisp? Okay, quite a few. So this is a Lisp language that converts to JavaScript. So you can go to LispScript.com. Anyway, I'm not going to talk about the language and maybe I'll leave it for a half an hour top sometime in the future. Today I just want to show it to you. Okay, this is the source code of the Lisp Script command line processor. So basically you do Lisp slash H it gives you help Lisp slash V or Lisp test dot Ls it will compile and you know your usual command line processor. This is the source code of the command line processor written in Lisp Script. Now if you know JavaScript and if you know Node you will be able to understand this code. If you read the you know require dot yeah you can understand all this. YFS equal to require FS. How many of you know Node.js? You know if you know Node.js you will understand this code. Now what is interesting here? Say something called do monad maybe monad. Keep making use of it. Yes. Is it going up? Yeah. Okay. So how many of you know about monads? Well actually monads are something you know it came from the language called Haskell. It's supposed to be something very esoteric. I myself did not have any experience or I didn't have much experience with monads but what happened was when Lisp Script supports macros, Lisp style macros. So I had some people say that the Lisp Script macros are not powerful enough like other Lisp. So I thought if I could write monads in Lisp Script then that would be proof to all of them that Lisp Script macros are really good and powerful. So Lisp Script supports monads. Okay. Basically monads are abstractions. They allow you to abstract computations. Maybe I will explain that in some other in more detail. And they also allow you to abstract a program structure. Now when you are writing a command line processor usually what you do you will have some kind of loop. You will have some if statements and switch statements. You need all that, you know. But in this case you will find that there are no loops. You will see the code. If you look at the code it's all straight. You don't have to understand the code but you will see. I'll just tell you. See the whole thing is straight. You don't have to understand the code. Just see here it's taking care of the flag. Here it is taking care of the running. You see it takes care of the flags, slashes, slash p, slash r. Then it is taking care of the input file. It's taking care of the output file. And then it compiles the whole thing. And then it runs. Compile and run. You don't have to understand the code. But the important thing to see here is that the whole thing is in a straight line. There is no loop. You are not going around in circles. There are no if statements. You have simplified the program structure itself. If you have written a command line processor you will know. You will have to go into some loop and all that. In this case using this maybe monad, what we have done is we have streamlined, simplified the command line processor and what it's doing in one straight line, it is eliminating all the possibilities. Okay, user type slash h, then print the help. If you slash slash, actually show the version. Okay. Or if you gave a file name then compile it. So it's all in one straight line. That's what monads do. So you can go to lispyscript.com and I hopefully I will be here for more meetings and if you are interested in learning more or maybe I can explain more or teach more about monads next time. So that's it for now. Any questions? How long have you been working? On lispyscript? Yeah, I started, I've been working on it on and off. I started last June. Worked for 2-3 months on it. Then I was working on something. Maybe I worked total of 6 months on this. On and off but it's been almost. Did you have any application for this? Application? I have my own and yeah, it has a few people who are using it, who have done some stuff. So the compiles in JavaScript obviously you can run in the browser and stuff. Yeah, yeah. You can even, there is a tried page. I'll show you the tried page. If you go to the tried page it actually runs on the browser. It will compile and this is the tried page, this is the code and it will show you the compiled code. So whatever you type on the left side, it gets compiled on the and this is the output JavaScript. And it is readable JavaScript. It's not like your, like how many of you know Clojo script? Yeah, Clojo script compiles Clojo to JavaScript. But it comes with a lot of extra baggage. It comes with 20 K of code along with the code and it's very difficult for you to, but in this case you will see that each line is corresponding there. Console.log, hello script, there it is in JavaScript. So you will see that, you can see your code. I have a question. It's like something that if you write a list script and you include a file in your HTML page. The whole page is coded in the list script and you include a file that compiles it and can we use it directly in... No, no, yeah. See, it's not a good idea to compile it in the browser. You load it, the user is anyway waiting for you. So on top of that you're adding compiles. So it's better to compile it, recompile it and... But for some, like... It supports this feature as of now. Like you can, like small block of code is written in the list script and we send it directly on the browser. It compiles... Yeah, that's what is happening here. That's what is happening. You type some code here on this side. It gets compiled here. So it's like... Compilation service is on the client side. Yeah, I see it now. Suppose I type something here. Well, the compilation is happening either way? Yeah, yeah. No, in this particular case it is. But you don't... It doesn't have to. You can compile it on the server also. So this line, I've already... Actually, I've already injected the code here instead of having to type it out and show you. So basically this is as good as me typing it out. Yeah, but... Yes, my question is like... This is like compilation. You are showing the output. But if this JavaScript runs on... Like if I write... Don't compile and run it. Yeah, compile and run it on the browser itself. Yeah, you'll have to evaluate or whatever. Yeah. It's JavaScript. In which language is the compiler... Is that in the LISP script itself? No, it's written in JavaScript. That's why it's running on the line. Yeah, it can be written in LISP script also. It's already... Yeah, because it's... It's compiled. It runs in JavaScript only. It has to run in JavaScript. So, yeah, in fact... Germany, Ashkenas asked me, why don't you... Because JavaScript is written in JavaScript itself. So when he had written to him, he saw this and he said, now why don't you write the... LISP script compiler in LISP script? Yeah, but I thought, now it's working fine. You know? So now if I write it, then I don't want to get into more trouble, right? I think you should write community to it. Yeah. So many guys wanted to write. Every second guy says the same thing. If you do all the obvious stuff, you don't even have the opportunity to step in. Yeah, I would... No, and what do you gain? Other than the... Sorry, just bragging rights. You know, that it's... Self-hosting. Yeah, self-hosting. It's called a self-hosting language. So... Yeah, let's see. Many questions? So how do you debug this? Is there any support for debugging? No, no. You can use any debug where you want. You can... Because this is JavaScript, so... So it's actually... So you have source maps? Yeah. They have source maps to help... You see, basically, this is Java... Now, you see here, console.org, hello LISP script. Yeah. You are just calling a function. In a LISP-like language, everything is a function called. Hmm. Okay, so you are just calling JavaScript function. So if you are debugging, you are just calling the debugging function. You just include the debug... So it's only a syntax difference. So it is not a language in itself? It is a language in itself because it has macros. Okay, so you do have... Everything, it's got macros. I mean, I'll show you the features it's got. No, I'll show you the features it's got now. Okay, here it's got macros. In LISP-type macros, it's got tail call optimization. It's got callback sequences. Callback sequences are used, you know, in Node, you get into this loop of calling, calling, you know, getting deeper and deeper. Using LISP-type callback sequences, you can write them in a straight line. Like I showed you, you know, you can write all your functions, callbacks one after the other, and it will call them... Then it's got templates, it's got monads, it's got some basic unit testing. Unit testing is good. And it's browser compatible also. It's got tail call optimization. I don't know if you are familiar with JavaScript problem of tail call optimization. I've heard of it. Yeah, okay. The problem in JavaScript is that if a function recursively calls itself, it will eventually blow the stack. If you... It will crash your program. So like in a normal browser, if you're calling recursively, calling yourself, let's say, 10,000 times, it will blow the stack. You will get the stack overflow or whatever. So in LISP-type, we have a certain loop which overcomes this. So you can even call it a million times and nothing will happen. So that is tail call optimization. It's got in this description. Good. Thanks. Okay.