Chat Logs

  1. * skillbot joined #primate
  2. * skillnews joined #primate
  3. * jreicher joined #primate
  4. dreamrealfeed subcribe https://primate.run/blog.rss
  5. dreamrealfeed add https://primate.run/blog.rss
  6. nevetError: 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. dreamrealfeed add https://primate.run/blog.rss
  10. nevetAdded feed "Primate Blog" with 20 entries
  11. dreamrealfeed subscribe https://primate.run/blog.rss
  12. nevetSubscribed to "Primate Blog"
  13. dreamrealblue: there you go
  14. bluethanks, dreamreal
  15. dreamrealblue: 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. dreamrealand 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. blueI'm... not sure why that is the case; because you can't do it without a universally reachable url?
  18. blueanyway don't call it REST: call it api, would be my call. rest exposes the technically implementation, which is irrelevant
  19. dreamrealtrue enough
  20. dreamrealbut what do you mean: why is that not the case for... what?
  21. dreamrealif we have api.bytecode.news, github can indeed post updates to a consistent URL
  22. dreamrealand then we can stop polling github for updates
  23. blueyes that was my point. if you don't 'expose' the backend in some universally reachable way, you can only do polling
  24. dreamrealI feel like we're saying the same things but different
  25. blueyes
  26. dreamrealso 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. bluedreamreal: 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. bluewhy the indirection? what's the value?
  29. dreamrealblue: https://enigmastation.com/2014/07/09/repost-some-of-what-id-wanted-to-do-for-theserverside/ is the mindset I had
  30. dreamrealIgnore 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. blueyeah I'm down to frotnends now
  33. blueI read REALLY fast -- faster than you :P
  34. dreamrealit's not a race, newsom
  35. blueyeah the problem still remains the indirection. a react.bytecode.news might make sense... I'm not sure nextjs/primate
  36. dreamrealmy thought was that most users would use bytecode.news or www.bytecode.news
  37. dreamrealso whatever fulfilled the interface requirements best would be that
  38. blueI understand that. I'm just still convinced about having two backends, especially if you have api.bytecode.news
  39. bluenot convinced*
  40. bluebut maybe.. hm.
  41. dreamrealYeah... I ... don't know what the "other backends" would be
  42. dreamrealThere's a design question here I'm not qualified to answer
  43. blueso there's a real tension here, and the tension is there. normal web app applications typically don't use APIs, at least directly
  44. bluethey use bespoke paths, which might or might not compose over APIs
  45. blueyou follow?
  46. blueapi.bytecode.news is interestingly not for a web app... but for someone writing clients for nevet
  47. blueinteresting*
  48. blueof course, a web app COULD use it. but it would typically also access a DB in a more direct fashion
  49. bluethings like transactions... are harder to realise if you have a backend solely relying on an API
  50. dreamrealI mean... this is just AJAX stuff
  51. dreamrealI'm saying that front ends would use AJAX to hit the api
  52. blueI 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. dreamrealAdmittedly I'm probably BADLY out of date...
  54. dreamrealI don't know! But the API endpoints were designed to BE transactional endpoints - you wouldn't normally WANT to bundle them separately
  55. bluein which case, an extra backend such as nextjs/primate is an indirection layer with zero added value
  56. dreamrealunless the front end NEEDED it, I suppose, gut ... again, this is not my area of expertise at all
  57. dreamrealI had to look up the term AJAX to remember it!
  58. blueyeah, we don't use that anymore. just REST/JSON
  59. bluebut let me give you an example
  60. dreamrealsure
  61. blueDELETE /admin/comments/{id}
  62. dreamrealokay?
  63. bluesay the frontend has the ability to select several comments for deletion. the primate route would get the ids. what does it do now?
  64. bluein a normal application, this would be transactionalised
  65. bluenow you COULD say, I'll just create another endpoint where you can delete several comments at once, fair
  66. bluebut there are other cases that are less straightforward
  67. dreamrealah. 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. blueI 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. dreamrealyeah, 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. dreamrealThe 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. blueyeah I understand
  74. bluethat however, makes frontends very rigid
  75. blueand maybe that's intended
  76. dreamrealit is, for better or for worse
  77. bluebut frontends aren't supposed to transport API/backend logic 1:1
  78. dreamrealwell, there are different design philosophies, and tradeoffs are definitely involved
  79. dreamrealI didn't want the ability of a front end to work to depend on how well a given developer could compose operations
  80. dreamrealthe 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. blueso from this perspective, I *think* having a secondary backend is totally an overkill
  82. bluethat is: rather than using primate, I would be taking your reference and rewriting it in svelte or react
  83. dreamrealthe 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. dreamrealGetFactoidOperation that knows how to translate strings into factoid requests (for stringly communications) and how to respond to factoid requests
  85. dreamreal*nod*
  86. bluebut 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. blueresult in*
  88. blueany 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. blueI'm telling you from experience this COULD become rather unpleasant
  90. bluedifferent proposition:
  91. dreamrealOh, 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. bluethe 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. blueso 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. blueit's more than that. primate would enterain its own db, completely separated from nevet's pgsl
  96. blueentertain*
  97. dreamrealif it did so, that'd be fine. I wouldn't care.
  98. dreamrealThe key is that they'd be SEPARATE systems, and the system of record would be nevet.
  99. bluebut 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. dreamrealSo is gil tene, actually
  102. blue.ils?
  103. bluethey do sound like it
  104. dreamrealaye
  105. bluemaybe the golden path is the primate app acting as a sort of medial cache here
  106. dreamreal... for primate, sure
  107. bluefor data
  108. dreamrealLike 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. blueI'd need to think how to make that works, but things like posts/comments would be cached
  110. bluework*
  111. bluedeleting them.. well, there it becomes hard because you need the source of truth for that
  112. blueso for example
  113. dreamrealWell, 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. dreamrealI'd think search would be one of those things caching would serve LEAST, but eh
  116. dreamrealthe 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. bluewell, consider this
  118. bluefor me as an app developer, doing this is ideal: `const posts = await Post.find({ where: ... });`
  119. bluethis is typically a primate ORM query
  120. blueI can build an interface around it, with querying for certain aspects for a post, limiting, criteria, etc.
  121. bluenow, one things I've been working on which would be already beneficial is the generation of the openapi client
  122. bluein which case, I'd already have at least a client that can do API calls, as documented
  123. blueso if the operation id is searchPosts, it'd be `client.searchPosts` instead
  124. bluethis call, however, is EXPENSIVE. it's an API call
  125. blueit's possibly also not very flexible, so maybe doing a GET posts periodically instead, and caching it in my own db, is faster
  126. phalethdoes that call enforce pagination?
  127. dreamrealin the openapi call, yes
  128. bluethere is a `page` param, yes
  129. bluein both GET posts and GET posts/search
  130. phaleththen can put max limit to the page size in order to not make it expensive
  131. bluethe expensive part is the extra web request
  132. bluethat means every primate frontend<>backend request is essentially two web requests
  133. phalethwell, that's the problem of the web
  134. bluealso, if I ever wanted to stream posts... or dynamically update the page..
  135. phalethprovide bson API or some sort of gRPC, but that's all you can do
  136. phalethcause there are two big problems in programming, and you can avoid the second one: cache invalidation problem
  137. blueyeah I thought of gRPC or json rpc, but currently nevet is a simple JSON api, and there's charm in that simplicaition
  138. blueand yes, cache invalidation is an absolute dumpster fire catastrophe, I 100% agree
  139. bluebut I'm worried about performance, perhaps prematurely here
  140. bluemy 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. bluejust issue `fetch` directly to api.bytecode.news and be done with it. no real need for primate
  142. phalethin 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. phalethof which there is currently none
  144. blueya
  145. dreamrealew
  146. dreamrealmemcached
  147. dreamrealew
  148. bluemaybe I'm chasing imaginary ghosts
  149. dreamrealew
  150. dreamrealmemcached--
  151. nevetmemcached now has karma of -1.
  152. dreamrealwhat a POS
  153. dreamrealmemcached--
  154. nevetmemcached now has karma of -2.
  155. bluebut APIs aren't built for performance... they're built for inter-app communication
  156. phalethfor sure one can shoot themselves in the foot with memcached, but again avoid the second big problem of programming if possible
  157. blueyou didn't stay the first one
  158. phalethwhat you can do is make the application layer scalable by not storing sessions server side
  159. bluestate*
  160. phaletheh
  161. phalethof course it's naming, can't solve that one
  162. blueah. thought you'd say rust
  163. blue:P
  164. phalethheh
  165. bluewhich btw
  166. blueew
  167. bluerust
  168. blueew
  169. blueew
  170. bluerust--
  171. nevetrust now has karma of -1.
  172. bluewhat a PON
  173. bluerust--
  174. nevetrust now has karma of -2.
  175. bluedone!
  176. dreamrealkarma chronos
  177. nevetchronos has karma of 3.
  178. dreamrealnevet's karma database still isn't old enough to decay yet :D
  179. bluetrue
  180. dreamrealkarma decays so "old karma" affects you less than new karma
  181. bluerust--
  182. nevetrust now has karma of -3.
  183. blue*patpat* good boy nevet
  184. dreamrealnevet is in the "ignore list" for karma automatically, too :D
  185. bluephaleth: dreamreal had a cool suggestion earlier: https://github.com/primate-run/primate/issues/250
  186. nevetSupport for HEAD · Issue #250 · primate-run/primate
  187. bluewhich I'm probably gonna add to .37
  188. blueas an opt-in config option: http.autoHead: p.boolean.default(false)
  189. blueoh man I HATE camelcase
  190. phalethyeah, web is broken when services respond with 404 on HEAD requests
  191. blue16:45 < phaleth> of course it's naming, can't solve that one
  192. blue+1
  193. blueI need to update the config page
  194. bluehttps://primate.run/docs/configuration
  195. bluehttps://github.com/primate-run/primate/blob/master/packages/core/src/private/config/schema.ts
  196. bluethose aren't synced
  197. blueyou know what, maybe I should just add jsdocs atop that and general that page automatically
  198. bluegenerate*
  199. bluebecause I know I will never remember to update the docs whenever I add or remove a config option
  200. phalethyeah, clankers are getting confused now
  201. bluethis is another case against ai, true
  202. blueemergent technology is practically useless
  203. blueso everyone just regenerates old, outdated code
  204. phalethwith the same old bugs
  205. bluewe 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. blueit's almost like AI hinders progress
  207. blueit will give you reliable info about express, but garbage about primate
  208. phalethAI straight up hinders progress
  209. bluedreamreal: 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. dreamrealif 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. dreamrealyeah, webhooks needs the api.bytecode.news
  214. blueok, I'll wait for that then
  215. bluethose can be reliably tested, btw
  216. bluein the webhook conf screen ongh
  217. blueon gh*
  218. bluethere's like a test event
  219. bluedreamreal: https://github.com/terrablue/gpbot/blob/master/routes/index.js
  220. blueif you need reference, here is how gpbot used to do it. I only added the events I was interested in
  221. phalethlast night at the exact same moment 47.7 clankers have been misled https://images4.imagebam.com/2e/60/e5/ME1AZ46G_o.png
  222. bluewhich was release, issues, push, commit_comment and ping
  223. bluephaleth: 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. bluehttps://github.com/terrablue/gpbot/blob/master/routes/index.js#L25-L27
  227. blueI 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. nevetUint8Array.fromHex() - JavaScript | MDN
  229. bluewhich is so nice!
  230. bluedreamreal: 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. phalethnot 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. phalethmaven: not found
  238. bot<discord:josephbottinger> mvn and mvnw
  239. phalethmvn: not found
  240. bluephaleth: https://gitea.repopack.app/jottinger/bytecode.news/commit/3162d8ed1ae5d7d789b7005468e144bc44f3cb87
  241. bluedreamreal: fyi https://github.com/terrablue/bytecode.news/commit/3162d8ed1ae5d7d789b7005468e144bc44f3cb87
  242. bluephaleth: I'll move that jottinger org to `blue`, on gitea, if you don't mind
  243. blueit would be nice if you could include this primate app in your deployment, and it would be able to reach the nevet backend
  244. blueso three nspawn machines: pgsl, nevet, and primate
  245. bluethe only one that needs exposure to the world is the primate one
  246. blueis this possible?
  247. blueregarding mvn, you need an image that contains mave
  248. bluemaven*
  249. bluephaleth: https://dpaste.com/GWFBVPGA3
  250. phalethyeah, trying to make it work with the zip first
  251. blue`maven:3.9.12-eclipse-temurin-25`
  252. phalethdpaste.com blocks my proxy, but don't worry, it builds
  253. bluedreamreal: 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. blueit takes JSON from the frontend, verifies it's an email, then sends it to nevet
  255. bluemost of this is boilerplating that will later be replaced by the opencpi client
  256. blueso: client.verifyOtp({ email })
  257. blueshould 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. blueanyway, I just need something for phaleth to work with. once we have that threeway setup, I can get productive with it!
  260. blueexpect... greatness!
  261. phalethturns out nevet runs on postgres 18.3 https://upaste.de/raw/5gH
  262. bluevery nice
  263. phalethyeah, it keeps crashing
  264. bluelol
  265. bluephaleth: https://gitea.repopack.app/blue/bytecode.news/
  266. phalethactually, the connection failed, so I
  267. phalethI'll try postgres 17.9 tomorrow
  268. blueok
  269. phalethgotta go now
  270. blueciao
  271. phalethbye
  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. bluedreamreal: https://github.com/primate-run/primate/issues/251
  278. nevetProposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  279. bluechovy: I believe automatic env loading is also something you have expressed interest in in the past
  280. bluejreicher: if you feel like commenting this, you're welcome! https://github.com/primate-run/primate/issues/251
  281. nevetProposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate