Job H wrote on 7/21/19 1:46 PM:
hello friends,

how do you generate the frontend of a website with Racket?

There are many ways.  You might want to start with a tutorial on one way -- "https://docs.racket-lang.org/continue/index.html"; -- and then decide what you like and don't like about that, and then go from there.

Quick comments on some of my Web frontend/fullstack work in Racket...

I have some complicated Racket Web projects in production that, for historical reasons, use SCGI ("https://www.neilvandyke.org/racket/scgi/";), and they generate HTML of various kinds (including a full HTML5 Offline app that pushes some limits) using something similar to "https://www.neilvandyke.org/racket/html-writing/"; as well as generating JS, using handwritten CSS and JS, and using some off-the-shelf JS toolkits, and then uses JSON-based and other kinds of Web services implemented in Racket for when the app is online.

That HTML of that HTML5 Offline app is actually generated and updated (and cached in the usual HTML5 Offline way) automatically, and can change dramatically, during running of the server, based on some changes in "meta" schema (for a typically large and complicated data model) that can change dynamically.  (Which is not something that many frameworks can handle, but it was doable in Racket, because we understand and control the Web stack, and can make it do what we want, and apparently with a dramatically smaller amount of human resources than such a product would normally take.)  Also, certain handheld companies that like controlling app stores seemed to have mixed feelings about how well they want W3C standards for more Web-ish apps to work, but, with the power of Racket and way too much JS wrangling and polyfilling, we made it work. :)

On the side, I have an unreleased Web site software in Racket, for incrementally publishing a series of topical book chapters as more like blog posts, with a kind of table of contents navigation in addition to the temporal one.  It uses a bit of an inline DSL that translates to SXML for `html-writing`.  It also uses the ancient "https://www.neilvandyke.org/racket/uri-old/"; (because I wanted anti-resolve for the framework, and didn't want to get distracted by rethiking the URI library like I really want to).  The HTML and CSS are designed carefully, to work on both desktop and handheld, for reading long-ish form text, and no off-the-shelf frameworks that time.

I've also used the `html-template` package for small static HTML generation tasks, though the intention was to use it for just-in-time HTML serving, and to have site-specific structural/semantics macros layered on it (at the cost of losing some of the dynamic flexibility of the `html-writing` approach): https://www.neilvandyke.org/racket/html-template/

Of course these can work with most off-the-shelf slick frontend frameworks, as well, with Racket code generating some of the input to those frameworks, or simply doing Webservice backend.

There are a lot of other valid ways to do Web frontends in Racket, and I'll let the people with experience in those talk about them.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f13dbb2d-3f1e-9d86-8fe0-578dc01a1eba%40neilvandyke.org.

Reply via email to