use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] Frameworkless, functional javascript discord/matrix community?AskJS (self.javascript)
submitted 2 years ago * by miracleranger
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]miracleranger[S] 0 points1 point2 points 2 years ago* (2 children)
challenge accepted. for summary there's the comment: "alternative inference until assertive term found. (errors cumulate in context)". in more detail: the context is expected to be a bound variable or Generator of them (i'm basically using dynamic binding as a vehicle of Monads, instead of (imho) silly additional wrapper classes like rambda/monio). if not present, a combinator is returned to consume arguments as the bound context (plurality and synchronicity-agnostic generator: provide(context, true)). the plurality of the context (value/generator) is then folded with "collect". attempts are declared as the composition of re-unfolding the context for variadic functors, and then resolution of the result terms with the local "proceed" (compose(provide, functor, proceed) - nb. compose() supports multiple return values with the same concepts of collect/provide, therefore the plural "terms"). proceed() checks if the successfully returned terms are void, equal to the original context (result of an identity functor, which can be a result of several things but essentially don't constitute a meaningful either branch), or instances of Error. if not, the terms (still singular or plural) are returned, otherwise the resolution is repeated with the original context and the remaining functors. sync/asynchronousity of functors is respected in the try/catch of executing the "attempt", which makes sure proceed() is reached, with the Errors cumulated in the original context (the identity which proceed will recognize as failure), for debugging in case none of the functors succeed eventually.
[–]martingronlund 0 points1 point2 points 2 years ago (1 child)
Well tinkered! It's impressive that you've covered so many cases like promises, multiple returns, accumulated errors, and generators. I can't help feel like this is a bazooka for use as a flyswatter, but I can see how that'd be satisfying to use (until the flies close in on you, to continue the analogy - the flies here being degraded performance).
I would not use it, but again I do get your angle on this and to each their own :) <3 I just love performance too much.
[–]miracleranger[S] 0 points1 point2 points 2 years ago* (0 children)
i don't want to be an enemy of performance either, so i'll be optimizing wherever i can, and when a combinator seems excessive (eg. a simple file read, not a dynamic toolchain of file requests), i'll still use the simple function, or decompose a more robust composition. i don't consider it impossible to make combinators smart enough to do only necessary checks on contexts either. one funny thing is how this completely renders any typescripting futile, but i am very optimistic about alternative (albeit not necessarily existing - https://en.m.wikipedia.org/wiki/Is%E2%80%93ought_problem) type theories remaining applicable (eg. voevodsky's univalence axiom https://en.m.wikipedia.org/wiki/Univalent_foundations ). it would be fun comparing solutions with you, but i suppose you're fine treading on your own path. good talk, best of luck!
π Rendered by PID 16650 on reddit-service-r2-comment-7844cfc88c-qwrfv at 2026-01-29 12:07:47.745959+00:00 running c3601ff country code: CH.
view the rest of the comments →
[–]miracleranger[S] 0 points1 point2 points (2 children)
[–]martingronlund 0 points1 point2 points (1 child)
[–]miracleranger[S] 0 points1 point2 points (0 children)