Pollen: the book is a program
docs.racket-lang.org
docs.racket-lang.org
It's a surprising shift. "Separation of concerns" is still a thing everybody wants to do, it's just flipping the idea of what should be the same "concern", where React considers every piece of a component to be one concern...and, it seems to work. I'm not sure I'm on board with this for writing, but the results certainly do look very nice; the books the author has published with Pollen all look gorgeoues and are very navigable.
I've been tinkering with Hugo for converting my projects docs to something that isn't in a wiki or a CMS (because I find I dread working with either a wiki or a CMS for large documents). I think it's probably "enough" for all of my needs, so I doubt I'll take the time to learn a bigger system like Pollen...but, it's hard to argue with the quality of the results.
When I was learning react when it came out I had such a visceral reaction I just wanted to run away.
After coding within react for the past couple years I strongly feel that react has got it right.
A concern is after all a generality that has the potential to generate a strong bias.
My lesson is that concerns should be taken with a grain of salt, and be willing to try new things with as little as bias as possible; and then form a new opinion, maybe a slightly different concern.
P.s I have also started writing CSS in our presentational focuses react components and I couldn't be happier. It naturally did a BEM-like architecture. I highly recommend it. I say this with extensive experience of CSS architecture for applications.
ie css, html and javascript for that page contained within that page.
Then, as you notice common use cases accross pages start to abstract them to a central library (be it js, css).
This way it makes it easy to develop any size application because each page is coded as needed and code relevant to each page is always right there with it.
I've worked on plenty of codebases that start out with a central library and then build outward but they always seem harder to maintain due multiple layers of abstraction.
I guess, in summary, this method is a way to lazy load abstraction.
JSX is just syntactic sugar on top of method calls. One is perfectly free to extract the `render` functions into separate files and call them "templates". Unless the argument is that virtual DOM libraries are an inherently bad idea, I don't see what's to complain about separation of concerns.
And I’d prefer if we could go back to that as much as possible.
Separation of concerns was a problem twenty years ago when source code looked like [this](https://github.com/kmainyu/EveHQ/blob/c3406c9cffca744500213f...). Since then the tools & languages have reached, maybe not the optimal abstraction level, but at least damn close to it. Everything is here to build apps as fast as possible ; the only thing left to do is write the actual software.
Personally, I quickly become disillusioned about "separation of concern". It was a webdev slogan that ignored the fact that form is also content. I mean, it makes sense if all you're doing is hyperlinked free-form documents. But the web ended up being used for web sites (and later web apps), where how you say something matters just as much as what you say. Separation of concerns is not an adequate rule for those kinds of works. You could see its death in every site that had its HTML littered with divs that existed only to hang JS code and CSS rules off them (and for some reason people still believed they're "separating concerns" there).
And books, again, are different from free-form documents. Their layout/typesetting decisions are often important part of the content.
I think the shift you noticed is a welcome breath of sanity into this space.
But sure, there aren't a lot of them out there.
It's also neat to show students, after they've spent months learning Racket, that all sorts of useful things -- including the writing of their assignments! -- can be automated with their new skills.
https://gist.github.com/alex-lew/883ee382a697b39f0f6b49561a0...
By the way, I use Atom, which has an excellent Pollen plugin, to write. Typing '@' then pressing tab turns into ◊{}, with the cursor between the lozenge and the braces.
Racket by default also doesn’t use the keyword "lambda", but instead uses "λ".
You can obviously use something different, if you want to, but the default, and recommended solution, is using unicode characters.
As Racket is frequently written in the DrRacket IDE, this also makes sense.
I'm not sure that's true:
Welcome to Racket v6.10.1.
> (define foo (lambda (x) (+ x 1)))
> (foo 1)
2In my current checkout of the codebase, I see the following:
~/src/racket/racket/share/pkgs$ ag lambda **/*.rkt | wc -l
1041
~/src/racket/racket/share/pkgs$ ag λ **/*.rkt | wc -l
163
Note also consistent usage of spelled-out lambda in the Racket style guide, https://docs.racket-lang.org/style/. ~/src/racket/racket/share/pkgs$ find . -iname '*.rkt' | xargs ag lambda | wc -l
33589
~/src/racket/racket/share/pkgs$ find . -iname '*.rkt' | xargs ag λ | wc -l
16722
Glyph λ is more common than I thought, but still heavily outnumbered by spelled-out lambda.Quibble after scanning, but the book as produced appears to be a standard web page, no more or less a "program" than any other web page.
Your looking at it as if the output is the programming piece. Heck markdown outputs to HTML. You wouldn't look at markdown as a programming language in the general sense?
Look a little closer my friend and you will see that this is very unique and special.
"Pollen gives you access to a full programming language (Racket) with a text-based syntax that makes it easy to embed code within your documents."
But to double down on my quibble, when I go into a bookstore, or on O'Reilly (or now, Amazon, sniff), what's on offer are books. Even if on github and similar, what's on offer there is source of various languages and markup, which go to produce a book.
I just can't see any final, static rendering of source as a "program." I would consider Stephenson's Young Lady's Illustrated Primer, or anything that aspires to that, as a program. https://en.wikipedia.org/wiki/The_Diamond_Age
Unfortunately it doesn't seem to be.
I also noted others using to handle blog publishing tasks like latest post pages and tags and such
I guess in total its a general html publishing framework, and at least partly notable for being built in a lisp, given htnl's usage of basically s-expressions
Org Babel is more about evaluating code snippets in a variety of languages. Even if you can evaluate to produce org markup that's processed it doesn't have the same level of structural integration.
What, isn't everybody using DITA nowadays? /s
OP link is about using code to create a document.
Probably you could use OP tool to write literate programs but that is not the primary intention.
Would consider using this instead of LaTeX for my thesis, but not so much if the time investment is too much.
If I had it to do over again, I'd have spent the time I spent bikeshedding doing something more properly restorative such as exercising or video games or... anything else other than grokking the internals of my home-built LaTeX template :-)
Then again, if there are no formatting requirements, a digital version will suffice, and writing Pollen rather than your thesis brings you joy, then go for it.
http://wcm1.web.rice.edu/plain-text-citations.html
https://programminghistorian.org/lessons/sustainable-authors...
Good luck!
Overall it enabled us to do many things that would have required lots of specialized tools. The downsides were things like people ramping up on editing s-expressions in text files and lots of gotchas with hygienic macros.
I'm fascinated by procedural generation and constrained randomness in games, and I'd think something like Racket would be a fun choice for that. Do you reckon you'd make the same choice if you were starting today?
We used DSLs on top of a data pipeline to create things like particle effects, animations, sound, and scripting.
We chose Racket because it seemed to be the best supported open source scheme implementation at the time I started working on this system (back in 2005).
* https://beautifulracket.com/ (and this about making it https://beautifulracket.com/appendix/racketcon.html)
https://practicaltypography.com/how-to-pay-for-this-book.htm...
That reminds me of this: “But look, you found the notice, didn’t you?” “Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard.”
Given the choice between this and advertisements, I much prefer this.
I respect his choices though and I hope future devices eliminate his typography and format concerns.
[1]: https://practicaltypography.com/why-theres-no-e-book-or-pdf....
People who have something to say, and who know all the techs, and who are willing to keep their work up, may well be a small set.
> If you’re using DrRacket, you can use the Insert Command Char button at the top of the editing window to — you guessed it — insert the command character.
> If you’re using a different editor, here’s how you type it:
> Mac: Option + Shift + V > Windows: holding down Alt, type 9674 on the num pad > GNU/Linux, BSD: Type Ctrl + Shift + U, then 25CA, then Enter
> For more information on entering arbitrary Unicode glyphs, see Wikipedia.
Jesus Christ that's a terrible design.
I say this because when installing a new OS and it defaults to en-UK locale, some of my buttons on the right side of the keyboard do unexpected things (US here), and I always have to look up where exactly the single-quote button is. I believe sometimes that angle pops up.
Tbh if you're assuming unicode input (which pollen does), and assuming its easy to write the character (which it is, given that system hotkeys for unicode are available or can be made available on most/all target systems), then it seems to me absurd to use the normal ascii character + escape character operators for embedding functionality in text
I also find his redesigns of documentation pages uninviting to read.
I find Butterick to be a passionate, opinionated, hard working, but ultimately a poor designer.
> He also advocate not using underline to denote links.
>In his practical typography book he practically hides all hyperlinks.
I think that's a fine, defensible stylistic choice. When reading a paragraph of prose, I find it INTERRUPTS MY FLOW if there is a jarring style change in the middle of a sentence, as in this one.The visual style of a hyperlink is only relevant to the point that you know the hyperlink is there and can find it when you want to click on it. Most of the time, that's not a goal, so you want it to fade into the background unless the user has indicated that is their goal.
So my preferred style for hyperlinks in prose is a color that's right at the just-noticeable difference [1] relative the normal text. When you mouse over the paragraph, which indicates you are intending to click, the contrast increases.
[1]: https://en.wikipedia.org/wiki/Just-noticeable_difference
What would you suggest in the case of touchscreens? Increased contrast while scrolling with a slow fade-out afterwards?
Things blinking/fading/shifting/changing when I'm taking completely unrelated actions (or, worse, all on their own) is one of the most unreadable/unusable design decisions I regularly face. It's a good way to get me to close a tab, regardless of any other factors.
The problem with trying to achieve JND for online publishing formats is that you have to account for variable monitor settings and lighting conditions. What stands out on my monitors at home might be barely noticeable on the crap displays at the office or my laptop under some lighting conditions or when I have it set to low power.
On top of technological differences, you also need to contend with variances in people's eye-sight.
Underlining is far simpler and more reliable. Perhaps highlighting with an underline as the link is drawn or scrolls into view, and fading the underline out soon after, to be drawn again if the pointer hovers over the paragraph or the page scrolls, would work?
Same for "black lozenge" ⧫, "rightwards two-headed triple dash arrow" ⤐, "islamic ligature bismillah ar-rahman ar-raheem" ﷽.
Unicode input can be easy if you have an input method with fuzzy search and aliases (e.g. "up tack" ⊥ shows up when you search for "bottom")