Vladyslav Sitalo 🕰️ 2021-01-17 00:45:20 what is the simples way(s) (minimizing accidental complexity) to spin up a basic website with a form behind authentication that triggers a serverless function on submission (supplying auth context, so I can be sure in the function about the identity of the user) ?
Jared Windover 2021-01-18 14:44:21 I unironically agree with Mariano Guerra. As somebody who went straight from managed hosting (cpanel) to aws, now that I've started managing a site by sshing into a box running apache, I've hit far fewer roadblocks, and the ones I've hit have been simpler to sort out.
That being said, I recently made a google sheet act as a basic cms for a site. So that could be an option too.
Vladyslav Sitalo 2021-01-18 19:03:47 @Tak Tran I’m intrigued by your suggestion! I think you can trigger AWS Lambda or Github Action via Zapier/etc based on entries to Google Forms/Airtable. And presumably you can force people to log-in with their google identity for auth purposes & record that.
I wish I thought of that two days ago 😛
Only thing I’m not sure about is how do you enforce “unique per user field” (e.g. username)
Vladyslav Sitalo 2021-01-18 19:11:00 I’m not convinced by “forego static+serverless” requirement & just spin up the server 🙂
Looked up what it’d take to do that in Python+Flask (as I’d go there given my background vs php). And while I think is/can be/ conceptually simpler, There is a lot more code to write & infra to properly setup. & more complexity lurks around the corner..
Vladyslav Sitalo 2021-01-18 19:12:21 [January 16th, 2021 11:33 PM] root: Netlify functions have been giving me Function logs are currently unavailable. We are working on resolving the issue.
the whole day :disappointed:
and Amplify stuff is complex and underdocumented :disappointed:
Chris Maughan 🕰️ 2021-01-10 15:01:54 I've been looking for a library that does this for a while now; this one has a convenient simple c++ core too. Handles the complex problem of doing 2D layouts for UI, etc.:
https://github.com/facebook/yoga
Vijay Chakravarthy 2021-01-18 23:54:12 There is also a rust version (called stretch) from Visly which is more embeddeable. I prefer the flutter/swiftui layout model which is much easier to use in a visual programming context - the druid toolkit has an interesting implementation. Figma also has a pretty nice autolayout plus constraint system which can be used to build live UI -- see https://github.com/treeform/fidget
Garth Goldwater 2021-01-21 01:18:16 William Taysom 2021-01-21 02:00:19 "Flashfill is not dynamic." 😢 So close to brilliant. (Gharani's tutorial is remarkably clear by the way.)
William Taysom 2021-01-21 06:55:52 I have a simple, yet annoying validation problem. Can any of you think of a language/framework that makes validating the following sort of schema as clear (or clearer) than the English language specification?
Suppose we have a playhouse with a bunch of rooms. In each room, we want there to be a box, a ball or two, and no other toys. If there are two balls, one should be red and the other should be blue. Report all the rooms that have the wrong toys and exactly what's wrong.
William Taysom 2021-01-21 07:04:19 And yes, coding this up earlier today fizzed my buzz: 34 lines, half an hour, several mistakes.
Emmanuel Oga 2021-01-21 07:29:30 relaxng (XML validator) has an https://relaxng.org/compact-tutorial-20030326.html#id2815185 operator for this sort of thing. Its been a while since I last wrote a gramamr but I think it would look something like this:
grammar {
start = element house { room*}
room = element room { box & ((red & blue?) | (blue & red?)) }
box = elem box { "box" }
red = elem ball { "red"}
blue = elem ball { "blue" }
}
Emmanuel Oga 2021-01-21 07:30:14 or else any other grammar would help (ANTLR, PEG, etc):
grammar = "house" room*
room = "box" ("red ball" "blue ball"? | "blue ball" "red ball"?)
Emmanuel Oga 2021-01-21 07:30:40 I think it is useful to think in terms of grammars because then becomes obvious when the thing you are trying to validate is not context free
Emmanuel Oga 2021-01-21 07:37:12 hah had to edit my grammars. Not sure if they match your requirements exactly but you get the idea 😛
Jack Rusher 2021-01-21 08:32:28 +1 Emmanuel Oga's suggestion of grammars, to which I'd add any other automata generating-abstractions. For example, regular expressions over the domain of toys (as opposed to the domain of characters).
Garth Goldwater 2021-01-21 14:40:42 the trickiest part of this is the “report all rooms that have the wrong toys and exactly what’s wrong”—i’d be tempted to reach for the really dynamic grammars that let you pretty easily insert whatever side effects/logic you want, like OMeta/ohm or rebol/red’s parse dialect. do you just want console output or structured data about the errors?
Vijay Chakravarthy 2021-01-21 20:41:24 Wouldnt a datalog or mini-kanren style approach be useful?
William Taysom 2021-01-22 02:22:05 Ah Garth Goldwater, OMeta haven't heard that in a while! Yes friends, an important part here is the detailed error reporting. I'll need to read Parse, don't validate @Don Abrams. Seems many non-trivial programming problems have a parsing (state machine) feel, and at one level we have good parsing tools though they seem to be underutilized in practice. One interesting thing here that counts matter and order does not. (Of course, one quick fix is to sort the list of toys in a room and then match on that sequence.)
As for error reporting, here's an idea. Imagine an interactive grammar generating tool. We start with golden path of validity (imagine a sorted list), something like:
Room = "box" ("blue ball" "red ball" | Color " ball")
Then the tool would propose invalid sequences for which we have to generate error description productions. That would be neat. I suppose other perennial parsing problems are tokenizing nicely so that you can operate on higher-level constructs, and I mean once you are acting on tree-ish data rather than streams, it begins to feel like regular functional programming...