 Okay, so this is another like we talked for like meeting slide with Jess, but I have to confess that basically I copy everything from Louis that his talk for Haskell Exchange 2015 this year. Yeah, so if you haven't know about just CJ, it's basically just that everything for Haskell, but you could cogen the JavaScript. So compile Haskell to code to JavaScript and it's runtime because you know the GSC comes with the C implement runtime that's on your machine. So when after linkage linking phase and the binary generate have used that runtime a lot, but in the browser or the JS it has to be implementing JavaScript and that's the I think one of the most difficult part for the whole engineering task. Yeah, so with this GSC days with unlike other like implementation that that it could reuse a lot of code between front end and back end that as long as that the compiler doesn't use that those preprocessing like CPP language extension I think it's possible and a lot of package on package that you could just cabal install with dash dash GSC days to to install the GSC days version. So to have some idea that yeah sure so with hello is inside just hello world then then compile it then it would generate a JS EXE folder with a lot of stuff inside that it has live and and other stuff yeah and after that you could just know run hello JS EXE and all then you will print hello world for that. So and you could check out file size that because it comes with the runtime so it's like 970k it's pretty large just purely for hello world and yeah yeah yeah that's a runtime just be aware of it if you're going to like generate some code for browser then that may some cause some impact where you're like loading preloading performance yeah you could specify O2 but at this moment I'm not sure that I haven't benchmarked a lot so I didn't make I'm not pretty sure that that it could be like optimized a lot for those common library could be. I'm not sure if you meant GSC optimization or GSC. Yeah but as far as I know that it can it can be but at this moment is it implemented. You just need a different application. Yeah then running other minifier for the post project. Yeah yeah yeah so then the reading his talk that he demonstrate how to like load the compiled JavaScript into browser so like this example that basically that is the following text is loaded from this program content and there's more dynamic output for the following slide that that it listen down one of the inputs that to calculate the Fibonacci sequence. If you want to show the previous slide where you have this explanation how would that do work? It use the the library that he has coded that in in its repo that that it has a common HS for that that so he has written some function for that to be using in the slide so this common HS would be loaded when the slide HTML was loaded that his structure is using that Pandoc to transform the markdown slides and like adding a filter into it and like rewrite all the things into like smaller pieces and load loaded like in the repo the slide is in markdown so this is the input for standard review and each slide that is common is markdown syntax and for this quoting that mark with run Haskell there's a filter for that that I in the app folder that it would basically that identify those run Haskell that because it's a phase of Panda Panda is that loading parsing all the markdown and face-by-face then one add and you can write a filter to insert a plugin for it and it's standard output basis the thing you generated so what you have to do is to identify those run Haskell block in your markdown and somehow like you like calling out that in collector block sorry so you first have to collect code blocks with those thin taggers run Haskell then somehow write it to a file in the in the source directory this M1 that to M10 is basically that generated by that filter so that filter will collect all of the run Haskell block and write it out to a unique name that's prefix with M so sorry for M1 then M1 address so this is the run Haskell the first block that it has some template in the template directory then interpolate those string this is the main then the module is basically the same template as you see them M1 to M10 that is if you have coded in like snap for some some web framework they use this dollar for inserting to interpolation for that so you collect the block then write it out to M1 they basically just call out to another process which is GHC SAS but I somehow modify it to run it into cabalic sandbox so it's more cleaner for that then come combine them the main HS the main HS basically is just collect all of the M module and run started by sequence the M1 start and to start like that start is like some entry point for the time for its templates yeah so after compile the code you can see that the right main module then compile code when it does it actually with successful state then put it out to the center output then came out with that identify as the output you should output to the HTML yeah so the final result is just GHC SAS slides and you can HTML and if you search for the script that you could see that here it loads from the source directory that for the main jcxc at all so insert that line to load the JS like in one one batch to into the browser so everything you called in the slide this could be called to the module so this dynamic tags and static tags it basis the function it has been coded in that common dot HS so to be easier to insert some div actually it's canvas to insert some like output for that that this diagram is also generated with the diagram library that for the dynamic output is from two three four five six seven yeah yeah but you have to learn about for the diagram which I I still haven't figured out fully yeah and for this that for yeah you can change the number to generate different output yeah even detect them mouse that's because everything you could do for just that basically you could do in Haskell code and compile the JS then load it yeah then tracking down the mouse opposition yeah and here to generate a grid of graph that agree list and center add something then output in a canvas element that's tracking down the mouse to generate different element this is all the example that copy from the Luis repo just that I sort of refactoring it because just gsc.js is under like heavy development that the code changed pretty quickly some of the code inside his repo has been a little bit outdated like this ref has been renamed as J's value or something so I and also in his repo he used cabal for that and I like use stack for it since I thought that would be stack would be in general easier and it's like the future for next Haskell platform and stack also has the plan to support gsc.js if you it detects on your laptop that the gsc.js is missing then you will like download the table and install for on your computer just that but I think the stack current versions 1.1 point 16 and but I try it if the on the wiki that is that it's okay for some resolver naming but I tried it's it's broken so maybe after 1.6 17 in my words that's a question they have they have library for that they they have just CJS Tom the module but still the same it might compile and it works but the performance in my is still not there that yeah and the others so that's a thing for the knowledge it's better yeah yeah is it about two or three years ago so that's just every yeah it's for gsc.js the performance work is definitely of going to the therapy that use webgl with gsc.js that means that you cannot use the whole journal that's going into some hardware support if you want a long-end device. So now at least I think our home for a company announced Mozilla I mean Firefox also and Chrome do support at least experimentally when you try to use the native user support. Yeah, I'm working for them. And that's it, that is progress after this day, they try to pull the render engine to the GL, the open GL. So everything will be rendered in GL. So we will do kind of the to-be engine, yeah. That's maybe, that's maybe good for projects to render. So I've seen like some initial webgl the most like the pool where you make waves and it's all simulated in webgl, yeah. It seems to be running that it's on the icons. The performance in CLHP is there, like possibly even a lot very good. I think for such such magical APIs that in the least the upon bottleneck may be not just only the GL part. Like we have encountered some very low and issue a lot of the big ADM and the digital ADM of the types, type of array, type of array will depend on the hardware. So that may be another issue. Yeah, so GLTJS uses, I think, an ADM compiler if I recover or other to make itself. I think it's co-generated by itself. Okay, but I think it uses this media array model for a location. I think it's interesting, but you will try to get up the microphone for experience. Yeah, it's a long focus. So, and that's the other one more thing is that the source map that for debugging that might still not be there. That's I checked the 2013 status that but this issue has been closed for 2012. So for the one more like trouble you might encounter is that for debugging that might still not that mature for that mapping to the location in your source code that co-gen that part of the JS result into an error. Yeah. I think you are close to this. I'm still in the web application. They are not that optimal latency. So I'm not sure if you have to. Yeah, you have a rendering window that recognizes HTML and then you have a DOM representation, but then the Haskell code that gets compiled to machine code interacts with the DOM in the same way that the JavaScript code would interact with the browser DOM. Yeah, but it behaves the time in the goals module box. It behaves exactly the same. And then of course for profiling for something the assumption is that you're going to browse and you see something slow and then you come back to the machine code and then you assume that if you profile it that it will also translate to the browser. And of course there are also use cases where you might have customers that are able to just run your webkit. Yeah, but I think like you were talking about source map, especially for developers also like the good solution that just eliminates them for browser. That's another question. And that's, yeah. So how many libraries, like Haskell libraries with using this? Yes. I think basically everything in pure Haskell could be reused. Haskell libraries basically only rely on some GTC language extensions so they all compile as long as you don't rely on some binary binding and actually minority of Haskell libraries. For the package that I've had binding for like for the GTK, then those things might not work. Yeah, those have C code. For pure Haskell. Yeah, I think it's work. So you could imagine an HLIT engine. Yeah. Some application of this. Some pure Haskell application. Yeah. You can imagine a full stack application that basically uses javascript sockets on the browser side. It uses normal, you know, why application with subheads on the Haskell side, the server side. And you only touch the javascript and the HTML directly where you either want to use some special feature like with GL or when you interact with the web-based designer. And for JSON auto type, then you could also use for the client side calling for the server API, right? Because you can generate a binding and using JS to compile to the client side code. And the main code of the application can be put somewhere on the cloud basically on the content delivery network. Just put it there once and manage it as something that we have. So if you have heavy applications, it's not that common nowadays. You don't want to make a binding to a javascript. The server can handle this. Can be. Yeah, but if you have like a nice gaming framework in javascript, give it a hand. Go skating is something. You know. No, no. So that is today's four talks that so hope you enjoy it. And as usual now, we encourage that people after talk to that talk to each other. If you have more questions on Haskell, then you can like talk with me or how even some could Simon. Yeah. Yeah, so. Yeah. I would like to have one last question because I hear that somebody tries to organize functional programming in games. Press.