Submit

Back to the channels

#primate

  1. * skillbot joined #primate
  2. * skillnews joined #primate
  3. * jreicher joined #primate
  4. dreamreal feed subcribe https://primate.run/blog.rss
  5. dreamreal feed add https://primate.run/blog.rss
  6. nevet Error: No RSS/Atom feed found at https://primate.run/blog.rss
  7. * nevet joined #primate
  8. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  9. dreamreal feed add https://primate.run/blog.rss
  10. nevet Added feed "Primate Blog" with 20 entries
  11. dreamreal feed subscribe https://primate.run/blog.rss
  12. nevet Subscribed to "Primate Blog"
  13. dreamreal blue: there you go
  14. blue thanks, dreamreal
  15. dreamreal blue: I was thinking of publishing the backend rest services to rest.bytecode.news, which would mean that I could actually handle github updates live instead of polling for them
  16. dreamreal and that would give UIs a consistent thing to hit, but it means that I need to harden some aspects of the services while I'm at it
  17. blue I'm... not sure why that is the case; because you can't do it without a universally reachable url?
  18. blue anyway don't call it REST: call it api, would be my call. rest exposes the technically implementation, which is irrelevant
  19. dreamreal true enough
  20. dreamreal but what do you mean: why is that not the case for... what?
  21. dreamreal if we have api.bytecode.news, github can indeed post updates to a consistent URL
  22. dreamreal and then we can stop polling github for updates
  23. blue yes that was my point. if you don't 'expose' the backend in some universally reachable way, you can only do polling
  24. dreamreal I feel like we're saying the same things but different
  25. blue yes
  26. dreamreal so let's reset: my thought is, get api.bytecode.news online ASAP. Since it allows anonymous posts to the content, that means we need to make sure that *write* operations are constrained where possible and have *limits* where constraints aren't possible, like content posting
  27. blue dreamreal: idea; if you have api.bytecode.news, then... other subdomains feel a bit overengineered. I'm truly questioning the usefulness of primate/nextjs here vs just a frontend
  28. blue why the indirection? what's the value?
  29. dreamreal blue: https://enigmastation.com/2014/07/09/repost-some-of-what-id-wanted-to-do-for-theserverside/ is the mindset I had
  30. dreamreal Ignore the JCR bit, JCR is great but effectively dead and gone
  31. dreamreal (not really, but it's a lot for the value it would provide here)
  32. blue yeah I'm down to frotnends now
  33. blue I read REALLY fast -- faster than you :P
  34. dreamreal it's not a race, newsom
  35. blue yeah the problem still remains the indirection. a react.bytecode.news might make sense... I'm not sure nextjs/primate
  36. dreamreal my thought was that most users would use bytecode.news or www.bytecode.news
  37. dreamreal so whatever fulfilled the interface requirements best would be that
  38. blue I understand that. I'm just still convinced about having two backends, especially if you have api.bytecode.news
  39. blue not convinced*
  40. blue but maybe.. hm.
  41. dreamreal Yeah... I ... don't know what the "other backends" would be
  42. dreamreal There's a design question here I'm not qualified to answer
  43. blue so there's a real tension here, and the tension is there. normal web app applications typically don't use APIs, at least directly
  44. blue they use bespoke paths, which might or might not compose over APIs
  45. blue you follow?
  46. blue api.bytecode.news is interestingly not for a web app... but for someone writing clients for nevet
  47. blue interesting*
  48. blue of course, a web app COULD use it. but it would typically also access a DB in a more direct fashion
  49. blue things like transactions... are harder to realise if you have a backend solely relying on an API
  50. dreamreal I mean... this is just AJAX stuff
  51. dreamreal I'm saying that front ends would use AJAX to hit the api
  52. blue I realise this is ajax stuff. but say I want to have a route bunlding SEVERAL API calls in one. how do I transactionalise this?
  53. dreamreal Admittedly I'm probably BADLY out of date...
  54. dreamreal I don't know! But the API endpoints were designed to BE transactional endpoints - you wouldn't normally WANT to bundle them separately
  55. blue in which case, an extra backend such as nextjs/primate is an indirection layer with zero added value
  56. dreamreal unless the front end NEEDED it, I suppose, gut ... again, this is not my area of expertise at all
  57. dreamreal I had to look up the term AJAX to remember it!
  58. blue yeah, we don't use that anymore. just REST/JSON
  59. blue but let me give you an example
  60. dreamreal sure
  61. blue DELETE /admin/comments/{id}
  62. dreamreal okay?
  63. blue say the frontend has the ability to select several comments for deletion. the primate route would get the ids. what does it do now?
  64. blue in a normal application, this would be transactionalised
  65. blue now you COULD say, I'll just create another endpoint where you can delete several comments at once, fair
  66. blue but there are other cases that are less straightforward
  67. dreamreal ah. Right. Okay, I'd say that THAT BEHAVIOR is actually out of spec. And if behavior like that SHOULD BE in spec, we need to create a backend endpoint for it. That's part of why I want to get the API public and out there as soon as possible.
  68. blue I guess the point I'm trying to make is... building web apps on top of APIs is possible, but typically, you do need transactions to give you the bespoke abstraction level that isn't available over API call composition
  69. blue "I want to delete the comments but also inform the user about it, and I want it as a binary operation -- either everything or nothing"
  70. dreamreal yeah, well, I've been trying to design the API such that the response to that is "cool story bro the API is right there." And the other thing about nevet is that it's VERY literally designed on a messaging platform: you could, in fact, connect to the underlying mechanisms if you had access and do EXACTLY THAT.
  71. * phaleth joined #primate
  72. dreamreal The API isn't designed to be composed; it's designed to be "these are the things you can do," not elements of transactions *but transactions*.
  73. blue yeah I understand
  74. blue that however, makes frontends very rigid
  75. blue and maybe that's intended
  76. dreamreal it is, for better or for worse
  77. blue but frontends aren't supposed to transport API/backend logic 1:1
  78. dreamreal well, there are different design philosophies, and tradeoffs are definitely involved
  79. dreamreal I didn't want the ability of a front end to work to depend on how well a given developer could compose operations
  80. dreamreal the operations work or they don't, so the front end's "works or not" is based on whether it interacts with those sets of operations
  81. blue so from this perspective, I *think* having a secondary backend is totally an overkill
  82. blue that is: rather than using primate, I would be taking your reference and rewriting it in svelte or react
  83. dreamreal the front end, in the end, is an ingress/egress adapter itself: the controllers *quite literally* translate the HTTP data into operational types, and these get fed into the event system, *just like* IRC strings do, discord, slack. It's all the same engine. the factoid operations work over HTTP just like they do IRC - it's *very* literally the same code, there's not an HttpFactoidOperation, just a
  84. dreamreal GetFactoidOperation that knows how to translate strings into factoid requests (for stringly communications) and how to respond to factoid requests
  85. dreamreal *nod*
  86. blue but also, this might result on having to reiterate on the API quite a lot; see comments example: if you want to be able to delete several comments, sending n API calls is a nightmare
  87. blue result in*
  88. blue any composed operation in the frontend that has no API correspondence... would trigger either "no, you can't do that" or "wait, I need to add this to the API"
  89. blue I'm telling you from experience this COULD become rather unpleasant
  90. blue different proposition:
  91. dreamreal Oh, you're not wrong, at all. But again, this is why I was trying to involve people with UI experience early and often, and I even said "please give me feedback" because we expect the surface to mutate until it fits the needs well
  92. blue the primate backend is a FULL-STACK app *using* nevet. in which case, it has its own database. but there might be a lot of data repetition involved
  93. blue so the primate backend/app can compose however much it wants, using nevet API primitives
  94. dreamreal *nod* And I'd say that as a strategy, that could *work* but would be suboptimal - a front end should NEVER EVER talk to nevet's database, because the fact that nevet uses postgresql is *incidental*. I could easily swap it for an IMDG (and as soon as I convince gigaspaces to give me a license, you better believe I'm doing it) or mongodb.
  95. blue it's more than that. primate would enterain its own db, completely separated from nevet's pgsl
  96. blue entertain*
  97. dreamreal if it did so, that'd be fine. I wouldn't care.
  98. dreamreal The key is that they'd be SEPARATE systems, and the system of record would be nevet.
  99. blue but I'm not a super huge fan of data duplication
  100. dreamreal (I used to work for gigaspaces; nati shalom is a good friend.)
  101. dreamreal So is gil tene, actually
  102. blue .ils?
  103. blue they do sound like it
  104. dreamreal aye
  105. blue maybe the golden path is the primate app acting as a sort of medial cache here
  106. dreamreal ... for primate, sure
  107. blue for data
  108. dreamreal Like I said, my goal was to provide the system of record and the API as a baseline; how it's used isn't important to me AS LONG AS nevet remains the system of record
  109. blue I'd need to think how to make that works, but things like posts/comments would be cached
  110. blue work*
  111. blue deleting them.. well, there it becomes hard because you need the source of truth for that
  112. blue so for example
  113. dreamreal Well, primate could do that as a transaction: cascade each one as an op through nevet in order. failures would radiate outward depending on what they were (not found isn't the same as "could not delete.") But if the API *needs* a "delete multiple things" then maybe that's a need that gets addressed.
  114. blue `GET /posts/search` this could be well cached by the primate database, with periodic resync
  115. dreamreal I'd think search would be one of those things caching would serve LEAST, but eh
  116. dreamreal the way I see it, primate's local DB would be a cache of *actual known data* - like, hit a slug, that's a known thing, you can cache that (and hope it doesn't get updated after caching).
  117. blue well, consider this
  118. blue for me as an app developer, doing this is ideal: `const posts = await Post.find({ where: ... });`
  119. blue this is typically a primate ORM query
  120. blue I can build an interface around it, with querying for certain aspects for a post, limiting, criteria, etc.
  121. blue now, one things I've been working on which would be already beneficial is the generation of the openapi client
  122. blue in which case, I'd already have at least a client that can do API calls, as documented
  123. blue so if the operation id is searchPosts, it'd be `client.searchPosts` instead
  124. blue this call, however, is EXPENSIVE. it's an API call
  125. blue it's possibly also not very flexible, so maybe doing a GET posts periodically instead, and caching it in my own db, is faster
  126. phaleth does that call enforce pagination?
  127. dreamreal in the openapi call, yes
  128. blue there is a `page` param, yes
  129. blue in both GET posts and GET posts/search
  130. phaleth then can put max limit to the page size in order to not make it expensive
  131. blue the expensive part is the extra web request
  132. blue that means every primate frontend<>backend request is essentially two web requests
  133. phaleth well, that's the problem of the web
  134. blue also, if I ever wanted to stream posts... or dynamically update the page..
  135. phaleth provide bson API or some sort of gRPC, but that's all you can do
  136. phaleth cause there are two big problems in programming, and you can avoid the second one: cache invalidation problem
  137. blue yeah I thought of gRPC or json rpc, but currently nevet is a simple JSON api, and there's charm in that simplicaition
  138. blue and yes, cache invalidation is an absolute dumpster fire catastrophe, I 100% agree
  139. blue but I'm worried about performance, perhaps prematurely here
  140. blue my mind says: "if there's an API, and the API is all the composition we get, why not query it directly then? what's the use for a primate backend?"
  141. blue just issue `fetch` directly to api.bytecode.news and be done with it. no real need for primate
  142. phaleth in any case we can always employ memcached or something like that but only when that starts making any sense, but I'd not worry even if there's traffic already
  143. phaleth of which there is currently none
  144. blue ya
  145. dreamreal ew
  146. dreamreal memcached
  147. dreamreal ew
  148. blue maybe I'm chasing imaginary ghosts
  149. dreamreal ew
  150. dreamreal memcached--
  151. nevet memcached now has karma of -1.
  152. dreamreal what a POS
  153. dreamreal memcached--
  154. nevet memcached now has karma of -2.
  155. blue but APIs aren't built for performance... they're built for inter-app communication
  156. phaleth for sure one can shoot themselves in the foot with memcached, but again avoid the second big problem of programming if possible
  157. blue you didn't stay the first one
  158. phaleth what you can do is make the application layer scalable by not storing sessions server side
  159. blue state*
  160. phaleth eh
  161. phaleth of course it's naming, can't solve that one
  162. blue ah. thought you'd say rust
  163. blue :P
  164. phaleth heh
  165. blue which btw
  166. blue ew
  167. blue rust
  168. blue ew
  169. blue ew
  170. blue rust--
  171. nevet rust now has karma of -1.
  172. blue what a PON
  173. blue rust--
  174. nevet rust now has karma of -2.
  175. blue done!
  176. dreamreal karma chronos
  177. nevet chronos has karma of 3.
  178. dreamreal nevet's karma database still isn't old enough to decay yet :D
  179. blue true
  180. dreamreal karma decays so "old karma" affects you less than new karma
  181. blue rust--
  182. nevet rust now has karma of -3.
  183. blue *patpat* good boy nevet
  184. dreamreal nevet is in the "ignore list" for karma automatically, too :D
  185. blue phaleth: dreamreal had a cool suggestion earlier: https://github.com/primate-run/primate/issues/250
  186. nevet Support for HEAD · Issue #250 · primate-run/primate
  187. blue which I'm probably gonna add to .37
  188. blue as an opt-in config option: http.autoHead: p.boolean.default(false)
  189. blue oh man I HATE camelcase
  190. phaleth yeah, web is broken when services respond with 404 on HEAD requests
  191. blue 16:45 < phaleth> of course it's naming, can't solve that one
  192. blue +1
  193. blue I need to update the config page
  194. blue https://primate.run/docs/configuration
  195. blue https://github.com/primate-run/primate/blob/master/packages/core/src/private/config/schema.ts
  196. blue those aren't synced
  197. blue you know what, maybe I should just add jsdocs atop that and general that page automatically
  198. blue generate*
  199. blue because I know I will never remember to update the docs whenever I add or remove a config option
  200. phaleth yeah, clankers are getting confused now
  201. blue this is another case against ai, true
  202. blue emergent technology is practically useless
  203. blue so everyone just regenerates old, outdated code
  204. phaleth with the same old bugs
  205. blue we had it earlier with nevet, I was querying it for an HTTP RFC, it gave me an old, obsolete one instead of the newer one
  206. blue it's almost like AI hinders progress
  207. blue it will give you reliable info about express, but garbage about primate
  208. phaleth AI straight up hinders progress
  209. blue dreamreal: how far are we from nevet informing us here in the channel about issues, issue comments, PRs, commits and commit comments occuring on GH?
  210. dreamreal if it can poll, about two minutes
  211. * nevet joined #primate
  212. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  213. dreamreal yeah, webhooks needs the api.bytecode.news
  214. blue ok, I'll wait for that then
  215. blue those can be reliably tested, btw
  216. blue in the webhook conf screen ongh
  217. blue on gh*
  218. blue there's like a test event
  219. blue dreamreal: https://github.com/terrablue/gpbot/blob/master/routes/index.js
  220. blue if you need reference, here is how gpbot used to do it. I only added the events I was interested in
  221. phaleth last night at the exact same moment 47.7 clankers have been misled https://images4.imagebam.com/2e/60/e5/ME1AZ46G_o.png
  222. blue which was release, issues, push, commit_comment and ping
  223. blue phaleth: LOL
  224. * nevet joined #primate
  225. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  226. blue https://github.com/terrablue/gpbot/blob/master/routes/index.js#L25-L27
  227. blue I do believe that htia function can be replaced by https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromHex today
  228. nevet Uint8Array.fromHex() - JavaScript | MDN
  229. blue which is so nice!
  230. blue dreamreal: java equivalent: byte[] bytes = HexFormat.of().parseHex("CAFED00D");
  231. blue (need `import java.util.HexFormat`)
  232. * nevet joined #primate
  233. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  234. phaleth not too sure I ran the right command https://images4.imagebam.com/de/91/9f/ME1AZ705_o.png
  235. bot <discord:blue> Looks good
  236. bot <discord:blue> But you can also drop the mvnw nonsense and use maven directly
  237. phaleth maven: not found
  238. bot <discord:josephbottinger> mvn and mvnw
  239. phaleth mvn: not found
  240. blue phaleth: https://gitea.repopack.app/jottinger/bytecode.news/commit/3162d8ed1ae5d7d789b7005468e144bc44f3cb87
  241. blue dreamreal: fyi https://github.com/terrablue/bytecode.news/commit/3162d8ed1ae5d7d789b7005468e144bc44f3cb87
  242. blue phaleth: I'll move that jottinger org to `blue`, on gitea, if you don't mind
  243. blue it would be nice if you could include this primate app in your deployment, and it would be able to reach the nevet backend
  244. blue so three nspawn machines: pgsl, nevet, and primate
  245. blue the only one that needs exposure to the world is the primate one
  246. blue is this possible?
  247. blue regarding mvn, you need an image that contains mave
  248. blue maven*
  249. blue phaleth: https://dpaste.com/GWFBVPGA3
  250. phaleth yeah, trying to make it work with the zip first
  251. blue `maven:3.9.12-eclipse-temurin-25`
  252. phaleth dpaste.com blocks my proxy, but don't worry, it builds
  253. blue dreamreal: the most relevant part of that integration is the otp/request route: https://github.com/terrablue/bytecode.news/blob/master/apps/primate/routes/otp/request.ts
  254. blue it takes JSON from the frontend, verifies it's an email, then sends it to nevet
  255. blue most of this is boilerplating that will later be replaced by the opencpi client
  256. blue so: client.verifyOtp({ email })
  257. blue should replace https://github.com/terrablue/bytecode.news/blob/master/apps/primate/routes/otp/request.ts#L15-L23
  258. blue ... and this probably shouldn't be a GET route
  259. blue anyway, I just need something for phaleth to work with. once we have that threeway setup, I can get productive with it!
  260. blue expect... greatness!
  261. phaleth turns out nevet runs on postgres 18.3 https://upaste.de/raw/5gH
  262. blue very nice
  263. phaleth yeah, it keeps crashing
  264. blue lol
  265. blue phaleth: https://gitea.repopack.app/blue/bytecode.news/
  266. phaleth actually, the connection failed, so I
  267. phaleth I'll try postgres 17.9 tomorrow
  268. blue ok
  269. phaleth gotta go now
  270. blue ciao
  271. phaleth bye
  272. * nevet joined #primate
  273. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  274. * nevet joined #primate
  275. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  276. * blue joined #primate
  277. blue dreamreal: https://github.com/primate-run/primate/issues/251
  278. nevet Proposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  279. blue chovy: I believe automatic env loading is also something you have expressed interest in in the past
  280. blue jreicher: if you feel like commenting this, you're welcome! https://github.com/primate-run/primate/issues/251
  281. nevet Proposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate

Search posts