Live Coding Sessions
The four sessions work up to a mini-project in the last 40 minutes of session 4.
The links for session 4 are now included below. There are session links for TwitchTV and YouTube. In session 3 I examine how to rasterize arbitrary WL expressions that are neither Images nor Graphics. We also go over how to control ImageSize and AspectRatio to accommodate HTML requirements (or vis-a-versa).
- Session 1
- Session 2
- Session 3
- Session 4
- Session 1
- Session 2
- Session 3
- Session 4
I frequently say front-end and back-end environments overlook (or under appreciate) the computation-side. However, with a few development requirements the quant-side can deliver to the front-end folks exactly what they need and reduce the amount of processing logic in the front-end. It also conforms to the development team and code writing philosophy of separation of concerns and duties. This opens the door to more modular teams and code with easy to understand handshakes between components and teams.
We start with the most simple use of APIFunction[
] I can think of then step into use cases that confront simple issues, which if not understood upfront, can cause delays and frustration for one of more team members. We make API calls to external resources from inside APIFunction[
This is followed with a look at using APIFunction[
] with NodeJS (backend) building up to dealing with the dreaded CORS issues and look into some security issues.
Lastly, we will look at a few use cases for integrating to AWS resources.
I will update this post and my GitHub as we proceed.
This is an excellent and thorough exploration of Wolfram Language-as-backend design, which is a very powerful paradigm for when a FormFunction frontend doesn't quite cut it. I particularly enjoyed the discussion in session 3 of image sizing and formatting, which is a tricky problem I've dealt with several times and still haven't quite gotten the hang of!
Also, regarding IntegerName, I tried it with a Real and (despite its name) it seems to work:
Out= "minus zero point zero one"
Thank you for your comments and the slap on the back of the head ;-) Perhaps it a version thing. I swear I tried it and I sure am happy you showed me because I dont know when I would have come back to this.
Very cool! Thanks for piloting this I just watched the first session, it's extremely beneficial: the WebExecute framework is one of the latest areas of WL that I've started exploring, and I can't believe I went this long without using it.
I also didn't realize I could extract parts of Message objects: passing error messages of failed API calls back to front-end code is a very good use case of why you'd want to have such flexible structures.
Love the tips of trade bit about lack of analogous structures between languages, like the Real value parameters, and adjusting them to fit the JS code.
Just a lot of great stuff in here, and I'm only one session in!
I happy you're enjoying and finding it useful. I can't wait to here what you have to say after the 4 vedio ;-)
Hi there, I'm Riccardo from WRI.
I really like the work you have been doing, those live coding sessions are really nice.
We have been developing a new technology that is allowing you to serve web content from your local machine, we recently published it on GitHub.
The server is based on some very mature technology and is intended for production, I think it's a perfect fit for the type of applications you are doing (JS frontend with WL backend).
This server is also very useful for developing, because you can develop your APIFunction locally, which allows you to do Print / Echo in order to debug your code and see the output directly in the terminal that is running your server.
Once your APIFunction is coded correctly you can decide how to deploy to production: you can deploy on the Wolfram cloud or use a Wolfram Engine to serve content with your own hardware.
Since I'm the main author of this repo, I would really appreciate a feedback on this technology, so if you have time let us know what you think about it.
Good timing. I'll have a look at the URL and give you some feedback.I recently notice https://reference.wolfram.com/language/WolframNotebookEmbedder/ and have been testing it. Just today I noticed the community post Wolfram Notebook Embedder https://community.wolfram.com/groups/-/m/t/1788578 released by Jan Poeschko. You can see my comments down the post - to summarize - I use ReactJS and NodeJS extensivly and I've always wanted a way for a React component (at arbitragy levels in the component tree) to be responcible for the creation and mangement of WL containers (full of WL goodies) so that React can be used to control and App state and render requriements such that when a WL container living in a React component is part of the render - well - let the magic happen.
Hey, I just found these videos and they are great! I have a project where i want to use Wolfram as the backend to a microservice and this series covers the subject in more detail than i ever hoped to find. In addition to the subject coverage, I really appreciated watching the debugging and the practical discussions around how you go about building these services, handling errors, reals and such.
I have a question: The APIFunction calls take a simple flat association. I want to send a nested JSON structure that may include lists of objects and could run up to several K bytes. Is there a way to put the input data in the body of the message instead of the URL?
Hi there, this might help you:
This is the easiest way to do it, it's not using Body as JSON however. But if you are fine in sending the payload as POST encoded data and add the payload in one of the parameters, you can do that.
Let me know if that helps.
I am fine fine with the POST method, but I wasn't successful. Can you offer a suggestion?