<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>rinoc</title>
  <subtitle>Personal notes</subtitle>
  <link href="https://rinoc.org/"/>
  <link rel="self" type="application/atom+xml" href="https://rinoc.org/feed.xml"/>
  <id>https://rinoc.org/</id>
  <updated>2026-02-16T00:00:00Z</updated>
  <author><name>rinoc</name></author>
  <entry>
    <title>the most important things in the new agentic era</title>
    <link href="https://rinoc.org/notes/2026/02/the-most-important-things-in-the-new-agentic-era/"/>
    <id>https://rinoc.org/notes/2026/02/the-most-important-things-in-the-new-agentic-era/</id>
    <published>2026-02-16T00:00:00Z</published>
    <updated>2026-02-16T00:00:00Z</updated>
    <category term="ai"/>
    <content type="html">&lt;p&gt;The last sentence of the OpenAI &lt;a href="https://openai.com/index/harness-engineering/"&gt;Harness Engineering&lt;/a&gt; post:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our most difficult challenges now center on &lt;strong&gt;designing environments, feedback loops, and control systems&lt;/strong&gt; that help agents accomplish our goal: build and maintain complex, reliable software at scale.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is the defining concept of this era.&lt;/p&gt;
&lt;p&gt;Everything has shifted from writing code, to setting up these feedback loops and control mechanisms.&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>note 02: python vs javascript async/await</title>
    <link href="https://rinoc.org/notes/2025/11/note-02-python-vs-javascript-async-await/"/>
    <id>https://rinoc.org/notes/2025/11/note-02-python-vs-javascript-async-await/</id>
    <published>2025-11-17T00:00:00Z</published>
    <updated>2025-11-17T00:00:00Z</updated>
    <category term="programming"/>
    <category term="python"/>
    <category term="javascript"/>
    <content type="html">&lt;p&gt;I’ve historically found &lt;code&gt;async&lt;/code&gt; in Python a bit confusing. Partly because I haven’t taken the time to fully understand it, partly because it actually &lt;em&gt;is&lt;/em&gt; confusing. The async story in Python has gone through significant changes to reach where it is now.&lt;/p&gt;
&lt;h2 id="the-event-loop"&gt;The Event Loop&lt;/h2&gt;
&lt;p&gt;Javascript has an &lt;em&gt;implicit&lt;/em&gt; event loop that’s always running. This is not the case in Python.&lt;/p&gt;
&lt;p&gt;When you do a &lt;code&gt;setTimeout&lt;/code&gt; or &lt;code&gt;setInterval&lt;/code&gt;, you’re interacting directly with this global event loop.&lt;/p&gt;
&lt;p&gt;In Python, you need to create this loop yourself.&lt;/p&gt;
&lt;pre class="sourceCode python"&gt;&lt;code class="sourceCode python"&gt;&lt;span&gt;&lt;span class="cf"&gt;async&lt;/span&gt; &lt;span class="kw"&gt;def&lt;/span&gt; main():&lt;/span&gt;
&lt;span&gt;    &lt;span class="bu"&gt;print&lt;/span&gt;(&lt;span class="st"&gt;&amp;#39;hello there&amp;#39;&lt;/span&gt;)&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;loop &lt;span class="op"&gt;=&lt;/span&gt; asyncio.get_event_loop()&lt;/span&gt;
&lt;span&gt;&lt;span class="cf"&gt;try&lt;/span&gt;:&lt;/span&gt;
&lt;span&gt;    loop.run_until_complete(main())&lt;/span&gt;
&lt;span&gt;&lt;span class="cf"&gt;finally&lt;/span&gt;:&lt;/span&gt;
&lt;span&gt;    loop.close()&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;span class="co"&gt;# or: send this to the event loop&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;asyncio.run(main())&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="futures-generators-promises"&gt;Futures, Generators, Promises&lt;/h2&gt;
&lt;p&gt;In Python, &lt;code&gt;async&lt;/code&gt; functions return &lt;code&gt;coroutine&lt;/code&gt; objects when called. This is different from JS.&lt;/p&gt;
&lt;pre class="sourceCode javascript"&gt;&lt;code class="sourceCode javascript"&gt;&lt;span&gt;&lt;span class="kw"&gt;async&lt;/span&gt; &lt;span class="kw"&gt;function&lt;/span&gt; &lt;span class="fu"&gt;foo&lt;/span&gt;() {&lt;/span&gt;
&lt;span&gt;    &lt;span class="bu"&gt;console&lt;/span&gt;&lt;span class="op"&gt;.&lt;/span&gt;&lt;span class="fu"&gt;log&lt;/span&gt;(&lt;span class="st"&gt;&amp;#39;hello there&amp;#39;&lt;/span&gt;)&lt;/span&gt;
&lt;span&gt;}&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;span class="fu"&gt;foo&lt;/span&gt;() &lt;span class="co"&gt;// this logs &amp;#39;hello there&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class="sourceCode python"&gt;&lt;code class="sourceCode python"&gt;&lt;span&gt;&lt;span class="cf"&gt;async&lt;/span&gt; &lt;span class="kw"&gt;def&lt;/span&gt; py_foo():&lt;/span&gt;
&lt;span&gt;    &lt;span class="bu"&gt;print&lt;/span&gt;(&lt;span class="st"&gt;&amp;#39;hello here&amp;#39;&lt;/span&gt;)&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;coro &lt;span class="op"&gt;=&lt;/span&gt; py_foo() &lt;span class="co"&gt;# this just creates the coroutine object&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;&lt;/span&gt;
&lt;span&gt;&lt;span class="co"&gt;# let&amp;#39;s run the func&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;asyncio.create_task(coro)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;asyncio.create_task&lt;/code&gt; runs the task without blocking &lt;code&gt;asyncio.run()&lt;/code&gt; or &lt;code&gt;loop.run_until_complete&lt;/code&gt; blocks until finished&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>Monads, monoids, categories…oh my</title>
    <link href="https://rinoc.org/notes/2025/11/monads-monoids-categories-oh-my/"/>
    <id>https://rinoc.org/notes/2025/11/monads-monoids-categories-oh-my/</id>
    <published>2025-11-14T00:00:00Z</published>
    <updated>2025-11-14T00:00:00Z</updated>
    <category term="math"/>
    <category term="functional"/>
    <content type="html">&lt;p&gt;I have this thing where sometimes I want to understand a complex topic, even though it has little relevance to my life at the moment.&lt;/p&gt;
&lt;p&gt;I’ve been looking at &lt;a href="https://effect.website"&gt;Effect.ts&lt;/a&gt; which has a somewhat steep learning curve. Trying to understand the theoretical basis of what an Effect is, lead me back to monads. And so here we are…I’m working on writing a proper article about how to think about Monads, from both a category theory and a programmer’s perspective.&lt;/p&gt;
&lt;p&gt;Like most math topics, it takes a few clicks of insight to fully grasp. Here are some of those for me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Categories are “easy” to grasp abstractly: Objects and Arrows.&lt;/li&gt;
&lt;li&gt;Similarly, functors are easy: they map objects to objects, and arrows to arrows, in a way that preserves structure&lt;/li&gt;
&lt;li&gt;A functor &lt;span class="math inline"&gt;F: \mathcal{C} \to \mathcal{D}&lt;/span&gt; has to be defined on all of &lt;span class="math inline"&gt;\mathcal{C}&lt;/span&gt;, but can collapse multiple objects to a single object in &lt;span class="math inline"&gt;\mathcal{D}&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;The simple descriptions above get more confusing when you get concrete. Most &lt;em&gt;objects&lt;/em&gt; in interesting categories, are actually themselves composed of items. For example, sets and groups. A single set is an object in &lt;span class="math inline"&gt;\mathbf{Set}&lt;/span&gt;, but there are also elements of that set. You can work at either level of abstraction.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;monoids&lt;/em&gt; are just like groups but you don’t have inverses.&lt;/li&gt;
&lt;li&gt;A &lt;em&gt;monoidal category&lt;/em&gt;: you take a regular category and equip a &lt;em&gt;bifunctor&lt;/em&gt;. Given two objects, you need a “natural” way to get out another object. And similarly for two arrows. And you need an &lt;em&gt;identity&lt;/em&gt; object.&lt;/li&gt;
&lt;li&gt;There are alot of requirements in category theory that you need to be precise, but, imo, often hinder understanding. For example, in the above, you have coherence relations and a few other things that you need, to make sure that things play nicely together.&lt;/li&gt;
&lt;li&gt;The category &lt;span class="math inline"&gt;\mathbf{Type}&lt;/span&gt; is where programming comes in. This is category where objects are &lt;span class="math inline"&gt;types&lt;/span&gt; and the arrows are actual functions, in the programmatic sense!&lt;/li&gt;
&lt;li&gt;The category of endofunctors on &lt;span class="math inline"&gt;\mathbf{Type}&lt;/span&gt; is where &lt;em&gt;monads&lt;/em&gt; come up.&lt;/li&gt;
&lt;li&gt;Monads are actually easier to grasp from a programming perspective. Conceptually, it is the &lt;em&gt;wrapping up&lt;/em&gt; of a value in another type! You’ve probably come across this heavily in Rust with the &lt;code&gt;Option&amp;lt;T&amp;gt;&lt;/code&gt; type.&lt;/li&gt;
&lt;li&gt;A &lt;em&gt;monad&lt;/em&gt; is a triple:
&lt;ul&gt;
&lt;li&gt;a map from types to types, and function to functions.&lt;/li&gt;
&lt;li&gt;a &lt;em&gt;unit&lt;/em&gt; operation that lets you enter monad space: &lt;span class="math inline"&gt;A\to M[A]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;a &lt;em&gt;flatten&lt;/em&gt; operation: given a doubly wrapped monad object, peel back one layer: &lt;span class="math inline"&gt;M[M[A]]\to M[A]&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;flatten&lt;/em&gt; operation is not at all the same as &lt;em&gt;extract&lt;/em&gt; which goes from &lt;span class="math inline"&gt;M[A]\to A&lt;/span&gt;. Why? Look at &lt;code&gt;Option&amp;lt;T&amp;gt;&lt;/code&gt;. If &lt;code&gt;T&lt;/code&gt; is something, you can get &lt;code&gt;Some&amp;lt;T&amp;gt;&lt;/code&gt;, but in the other case, there’s no &lt;code&gt;T&lt;/code&gt; to return! Since &lt;code&gt;nil&lt;/code&gt; is not a &lt;code&gt;T&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;For a long time, I was under the impression that a monad was &lt;em&gt;just&lt;/em&gt; a function of a certain kind, but no, it’s a triple!&lt;/li&gt;
&lt;/ul&gt;</content>
  </entry>
</feed>
