|
|
|
|
|
by ducharmdev
1794 days ago
|
|
No problem, glad I could help - that does clarify where you're coming from. Interestingly, when Brendan Eich was creating JavaScript, he actually intended to make it more like Scheme before his supervisors pushed him to make the syntax more like Java. So I think your thought process is inline with his original intentions. When you say minimal surface area and "whole thing fits in your head," I can't help but think of the Alpine.js API. Although I'm still mixed on how I feel about Alpine, I can't deny how beautifully simple the API & docs are for it. I also wonder whether web assembly could play a part in what you're suggesting. It's a part of the web platform, would potentially help with providing robust in-browser tooling... even the S-expressions of human-readable .wat files look rather Lisp-like, albeit too low-level for most frontend work. But I don't know wasm that well, just thinking out loud. |
|
I prefer the alternative approach where you move as much of the system as you can into JS, since JS is a fully functional language that will adapt to any issue you might run into. Your static HTML would really just be a static skeleton focusing on layout leaving your dynamic content to be dynamically created by JS. Your JS could keep references to those elements in code and then not rely on selectors to find what you need.
With web assembly I'd be really shocked if it was able to provide the same kind of dynamic interactive environment as the Javascript console, but I'm not that well versed in webasm so who knows?