I just released version 0.2 of Pigeon, a wrapper around Prologue with a DSL for easily creating Remote Procedure Call functionality for web applications. You can find out more at the repo, and try it out by installing from Nimble.
Feedback would be greatly appreciated as I'm trying to reach a stable API. I know this might be too much magic for some, but I find it useful, and I hope others do to :)
This is really cool!! I love the arbitrary level of magic of writing Nim and how trivial it can be to alter the casting so to speak. ;-)
Keeping easy things easy, and letting your cleverness go to systems design instead of composition of ambiguous primitives in the grammar like rust(And Nim's sane grammar is also what makes so many backends so feasible!) This whole idea of ambiguous grammar, rigorous implementation, keeping easy things easy(and hard things hard) with however much magic you desire is what made me fall in love with this language in the first place. Thanks for the reminder <3
As much as araq likes to claim a lack of understanding in type theory and category theory through sheer pragmaticism and stubbornness has made the language category theorists dream of. Every object is some data type, every morphism a computation, the category defines how computations compose to make programs. And most importantly: functors act as compilers not as pointers.
When you apply a functor you are changing what the data structures are, and changing what the computations are, but in such a way that the languages (semantic)grammar is preserved in an approximate way. Mathematica for things you already know and willing to spend $50 on the compute of a weirdly optimized(but infinitely composable) function named after a dead guy. And Nim for the rest, though I don't see why Nim won't take the crown and have a template language for Wolfram eventually either.....Just murmurs in the wind.
I just updated my "simple-twitter" example code[1] to use pigeon and @treeform's taggy library. Maybe looking at it will give you ideas on how this could be made better :)
Overall, I really do like the fact that the routes can be auto generated from the name of a proc. The only point of friction I ran into regarding that (and only because I'm not using it as an RPC framework) is that I can't have my entire Norm model be an argument to some of these methods. As I'm relying on a Javascript form submit, I can't easily nest all of the values under the name of the variable that is specified in the proc, I instead need to extract out all of the types and "flatten". Again, that's more a symptom of trying to use standard form submission instead of JSON.
Thanks @ajusa, great to see it in action on someone else's project! I think it's important to reduce that friction when using a pigeon server without the generated JS procs, because there's always going to be a mobile app, third-party client, or something else wanting to access the API.
In the case of the form submission, it could be as simple as looking to form-data in the absence of a JSON body.
As much as araq likes to claim a lack of understanding in type theory and category theory through sheer pragmaticism and stubbornness has made the language category theorists dream of.
Thank you! But it's not that I "like" to claime it, it's just true :D
Can't help but bump this really lovely project as I'm not on github, I'll just comment quick, and dirty and say; I think exactly this effects system as the universal composer of threaded programs that MonAaraj proposes is a category error. Or rather it is almost as interesting and deep as abstraction goes in language itself: arbitrary accounting for arbitrary weavings. He's entirely correct, and yet maybe not contextually. Tracking of effects as opposed to handling them forces you to keep it sane. Monads make composition the central design issue, which is all sorts of interesting, but as ~hard~ as can be. C
Every conversation gone long enough will lead to that effect system debate, any physical theory will too. This is the Grothendieck wizard's wisdom on groupoids and spaces.
I think he is actually pointing at something incredibly deep. Hard to say you don't have an intuition for homotopy type theory by how you avoid his categorical idealism. If you need this "morphism of compilation" primitive that you call a monad.
True compositionality that does not make the same mistake physics has made for 50 boring years is the `enlightened in-lining` of nim.
I can already tell this in English will forever descend into the neologism-modularity-hell baked into to its grammar, one can easily miss the rigour of the East. But to sum up and be quiet from here; It is omni-valent, heavily opinionated, and absurdly foundational, I find this to be the future of abstraction, it's the reason for Chomsky AI skepticism and is a central issue of lexical analysis. Ambiguous grammar compilers >> Atomic grammar compilers as a basis for functoriality; http://www.appliedcompositionality.com/ (You cannot compose the weaving of a thread from its decomposed atomics, generally, and even heuristically as a handling effect system is what every discipline in the world will occupy itself with for the next 100 years at least, and y'know if this isn't done in one language then the world will get the actual -> scope <- of the tower of babel story. ;P
Is there any way for you to expose the "Prologue" object of prologue? I've written a prologue extension that adds routes for an Admin Route (server side rendering) and it pretty much only needs access to the "app" object so that one can call. It isn't yet fully finished due to an issue in one of the packages it uses, but other than that it's functionality stands.
It adds routes via app.addCrudRoutes(<normModel>) and app.addAdminRoutes(). Provides basic CRUD functionality over all provided norm models and a couple more things. Given that it uses Prologues basic route-adding functionality under the hood, it can't be used if the User doesn't have access to the Prologue "app" object. If you enabled a method of exposing that app object, pigeon could be compatible with any prologue extension that sets up specific routes for prologue automatically.