<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Henri on Medium]]></title>
        <description><![CDATA[Stories by Henri on Medium]]></description>
        <link>https://medium.com/@hbbio?source=rss-fc079c1b45b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*WI2LfQCGHiekzEP29cJLJA.png</url>
            <title>Stories by Henri on Medium</title>
            <link>https://medium.com/@hbbio?source=rss-fc079c1b45b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:16:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hbbio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When Software Becomes Cheap, Trust Becomes Expensive]]></title>
            <link>https://medium.com/@hbbio/when-software-becomes-cheap-trust-becomes-expensive-621cf347880f?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/621cf347880f</guid>
            <category><![CDATA[openai-codex]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 10:49:35 GMT</pubDate>
            <atom:updated>2026-09-21T02:08:02.370Z</atom:updated>
            <content:encoded><![CDATA[<p>For decades, quality open-source software was an implicit signal of trust. Anyone who spent years building, maintaining, documenting, and supporting a project had invested something difficult to fake: a lot of their time. This commitment did not guarantee good intentions, but it didn’t make sense for the vast majority of people who mastered software development to embark on an expensive fraud journey.</p><p>AI agents change that equation. Software that once required years of skilled work can increasingly be produced in days. A convincing library, developer tool, or infrastructure project may require little more than a capable model and a bit of patience.</p><p>That changes the economics of supply-chain attacks and an attacker no longer needs to infiltrate a trusted project. They can build one, make it genuinely useful and maybe popular.</p><p>When the cost of creating software approaches zero, quality, polish, and apparent commitment do not prove anything.</p><p>Trust can no longer be inferred from a perceived effort, it has to be established independently.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=621cf347880f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The iPhone Camera Problem]]></title>
            <link>https://medium.com/@hbbio/the-iphone-camera-problem-73ea2686b363?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/73ea2686b363</guid>
            <category><![CDATA[jpeg]]></category>
            <category><![CDATA[cameras]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[photography]]></category>
            <category><![CDATA[iphone]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 12:27:00 GMT</pubDate>
            <atom:updated>2026-04-28T12:27:00.322Z</atom:updated>
            <content:encoded><![CDATA[<h4>Your memories are being saved after an algorithm that will age poorly has already degraded them.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7p4xbjK19Uywox4_IbEAg.png" /><figcaption>You are throwing away the original capture of your precious photos… but there’s an easy fix. Obviously, this is an AI-generated picture, the image degradation looks right but the arms positions don’t match!</figcaption></figure><p>Apple’s recent Pro iPhones are excellent small cameras. The iPhone 17 Pro, for example, has a 48 MP Pro Fusion camera system, ProRAW support, Photonic Engine, Deep Fusion, Smart HDR 5, and HEIF, JPEG, and DNG capture formats. The hidden problem is the default file most people keep: a finished, <a href="https://support.apple.com/en-sg/125090">processed rendering</a> rather than a preservation-grade original.</p><p>ProRAW combines standard RAW-format information with iPhone image processing, giving more editing control over exposure, color, and white balance. It is still Apple’s computational photography pipeline, but it keeps much more useful scene data than a normal HEIF or JPEG. Standard HEIF offers up to 24 MP, RAW 12 offers up to 12 MP, and RAW Max or HEIF Max can reach up to 48 MP on <a href="https://support.apple.com/en-us/119916">supported Pro models</a>.</p><p>For memories you want to keep for decades, <strong>a 12 MP RAW master will age better than a sharper-looking 24 MP processed photo</strong>. The processed file may look cleaner on small screens, but <strong>the RAW file gives future software something real</strong> to work with. It gets even better: New storage formats now enable to <strong>preserve the raw and keep a manageable file size</strong> so there’s no real tradeoff.</p><h3>The default iPhone photo is a rendered opinion</h3><p>A typical iPhone capture path involves some mix of:</p><ul><li>exposure selection</li><li>burst capture</li><li>frame alignment</li><li>multi-frame merge</li><li>demosaicing</li><li>denoising</li><li>lens shading correction</li><li>lens distortion correction</li><li>local tone mapping</li><li>face and sky handling</li><li>semantic masks</li><li>edge-aware sharpening</li><li>texture enhancement</li><li>white balance</li><li>color rendering</li><li>HDR mapping</li><li>compression into HEIF or JPEG</li></ul><p>Apple names parts of this system Deep Fusion, Smart HDR, Night mode, Photonic Engine, Photographic Styles, and related camera features. This pipeline can produce attractive images… on small screens. It can also make <strong>irreversible decisions</strong> before the photo reaches your library:</p><ul><li>Fine hair becomes a smooth edge.</li><li>Grass becomes a painted texture.</li><li>Skin becomes waxy.</li><li>Logos and text can look reinforced but wrong.</li><li>A boundary between a jacket and the background can shift by a few pixels.</li><li>A window frame can get a halo.</li><li>A face can be tone-mapped into a flatter, brighter version of itself.</li><li>A dark area can lose its original noise pattern, which is often the only evidence future software has for reconstructing real detail.</li></ul><p>Still a photo, but in archival terms it is closer to a final render.</p><h3>Why 24 MP can be worse than 12 MP</h3><p>A 24 MP HEIF image has “more” pixels than a 12 MP RAW image, but those pixels have already been interpreted. The iPhone has decided which texture is detail, which texture is noise, which edge deserves sharpening, which shadow deserves lifting, which sky needs smoothing, and which face should be protected from contrast. These decisions were made with algorithms from 2026, and they’re far from perfect.</p><p>A 12 MP RAW file stores a more useful working description of the scene. It gives a future editor or AI model access to richer tonal relationships, cleaner metadata, and less baked-in aesthetic judgment.</p><p>This is why “only 12 MP” can be misleading. A 12 MP RAW master is not the same kind of object as a 12 MP or 24 MP processed HEIF. The raw material is what you want, the other is a recipe already cooked.</p><h3>The damage is permanent</h3><p>A future photo model can improve a RAW file. It will demosaic better. It will denoise better. It will recover highlights with better tone curves. It will apply better lens profiles. It will use smarter deblurring, dehazing, color reconstruction, and super-resolution.</p><p>A future model may also improve on a processed HEIF, but that becomes guesswork much sooner. Once the original microcontrast is smeared, the noise pattern is removed, and local tone mapping has flattened the scene, exact recovery becomes impossible. The new model can invent plausible leaves, pores, fabric, or lettering. It cannot know the original leaves, pores, fabric, or lettering.</p><p>That is the core archival argument: <strong>keep the source, not the output</strong>.</p><h3>Apple’s defaults make sense for sharing, not archiving</h3><p>The default iPhone camera is designed for convenience:</p><ul><li>low storage use</li><li>fast capture</li><li>reliable sharing</li><li>pleasing phone-screen previews</li><li>fewer confusing choices</li><li>good results for most casual snapshots</li></ul><p>Those goals are rational. They are also different from preserving family photos, travel photos, childhood photos, documents, artwork, architecture, or once-in-a-lifetime scenes. When you’re taking pictures, <strong>you don’t know which ones will be the best</strong>: So you should capture the raw truth for all of them, just browse through and delete the bad ones.</p><p>Apple even exposes the tradeoff in settings. On supported models, the main or Fusion camera default can be changed between 24 MP and 12 MP, and “Prioritize Faster Shooting” modifies how images are processed so the phone can capture more photos when the shutter is tapped rapidly. That setting is <a href="https://support.apple.com/en-sg/guide/iphone/iphb362b394e/ios">on by default</a>.</p><h3>The practical answer: RAW 12 MP</h3><p>For preservation-first shooting, the best default is:</p><p><strong>ProRAW, 12 MP, JPEG-XL Lossy if available, with RAW settings preserved.</strong></p><p>On iPhone 17 Pro, iPhone 17 Pro Max, iPhone 16 Pro, iPhone 16 Pro Max, iPhone 15 Pro, iPhone 15 Pro Max, iPhone 14 Pro, and iPhone 14 Pro Max, you can set the ProRAW default resolution and format from Camera settings. Apple also says you can <a href="https://support.apple.com/guide/iphone/take-apple-proraw-photos-iphae1e882a3/ios">preserve the ProRAW</a> setting through Settings, Camera, Preserve Settings.</p><p>Use this setup:</p><ol><li>Open <strong>Settings</strong></li><li>Go to <strong>Camera</strong></li><li>Open <strong>Formats</strong></li><li>Turn on <strong>ProRAW &amp; Resolution Control</strong></li><li>Set the ProRAW format to <strong>JPEG-XL Lossy</strong>, if your model and iOS version offer it</li><li>Set the RAW default to <strong>RAW 12</strong> or <strong>ProRAW 12 MP</strong></li><li>Open <strong>Settings</strong>, <strong>Camera</strong>, <strong>Preserve Settings</strong></li><li>Turn on <strong>ProRAW &amp; Resolution Control</strong> or <strong>Apple ProRAW</strong></li><li>In the Camera app, make sure <strong>RAW</strong> is actually active before important shots</li></ol><p>The last step is critical. Enabling RAW support in Settings is not enough. If the Camera app is currently set to HEIC or JPEG, you are back to saving the processed file.</p><h3>Why JPEG-XL Lossy is acceptable here</h3><p>“Lossy RAW” sounds strange. For a pure archive, lossless is cleaner. For real phone use, JPEG-XL Lossy ProRAW is a strong compromise.</p><p><a href="https://jpeg.org/jpegxl/">JPEG XL</a> is a modern image coding system that supports lossy encoding, lossless encoding, and metadata through an extensible file format. In Apple’s newer ProRAW workflow, JPEG XL is wrapped inside a DNG container, so the file still behaves like a ProRAW file rather than a normal web JPEG XL image. Apple described this as a way to <a href="https://petapixel.com/2024/09/18/why-apple-uses-jpeg-xl-in-the-iphone-16-and-what-it-means-for-your-photos/">retain ProRAW flexibility with much smaller files</a>.</p><p>The storage math is the reason this matters. Apple’s older ProRAW guidance says a 12 MP ProRAW file is about 25 MB and a 48 MP ProRAW file is about 75 MB. <a href="https://www.macworld.com/article/2457900/iphone-16-pro-is-said-to-support-jpeg-xl-format.html">Apple estimated</a> JPEG-XL ProRAW sizes of about 11 MB for 12 MP JPEG-XL Lossy, 18 MB for 12 MP JPEG-XL Lossless, 20 MB for 48 MP JPEG-XL Lossy, and 46 MB for 48 MP JPEG-XL Lossless on iPhone 16 Pro.</p><p><strong>In practice, I often get 7 to 8 MB per photo.</strong></p><p>That changes the storage argument: A 12 MP JPEG-XL Lossy ProRAW file can be small enough for real libraries while preserving far more useful material than a fully processed default capture.</p><p>For irreplaceable work, use JPEG-XL Lossless or the most compatible lossless ProRAW format. For everyday memories, JPEG-XL Lossy ProRAW is often the practical sweet spot.</p><h3>The artifacts to look for</h3><p>Open a default iPhone photo at 100 percent and look at difficult areas:</p><p><strong>Hair and fur:</strong> strands merge into clumps, then sharpening draws artificial borders.</p><p><strong>Leaves and grass:</strong> detail becomes a watercolor texture, especially in medium light.</p><p><strong>Text and logos:</strong> letters look bolder, but corners and strokes drift from the real shape.</p><p><strong>Faces:</strong> skin texture gets smoothed, then pores or wrinkles are reintroduced unevenly.</p><p><strong>Edges:</strong> buildings, branches, glasses, jewelry, and clothing seams can show halos.</p><p><strong>HDR scenes:</strong> shadows and highlights look impressive on the phone, but the tonal structure becomes harder to reinterpret later.</p><p><strong>Motion:</strong> multi-frame fusion can create ghost detail around hands, pets, children, cars, and fabric.</p><p><strong>Boundaries:</strong> semantic masks can separate subject and background imperfectly, especially around hair, transparent objects, reflective surfaces, and fine geometry.</p><p>These artifacts are easy to ignore on a phone screen. They become obvious when you crop, print, edit, or revisit the image years later on a better display.</p><h3>ProRAW is not pure sensor RAW, and that is fine</h3><p>A technical correction matters here: Apple ProRAW is not untouched sensor data. Apple describes it as <a href="https://support.apple.com/en-us/119916">standard RAW information combined with iPhone image processing</a>, including compatibility with Smart HDR, Deep Fusion, and Night mode.</p><p>That makes ProRAW a hybrid. It is less pure than a classic single-frame Bayer RAW from a dedicated camera. It is also much more editable than a normal HEIF or JPEG.</p><p>For people who want even less processing, third-party camera apps can expose alternative RAW workflows. Halide, for example, describes its <a href="https://www.lux.camera/introducing-process-zero-for-iphone/">Process Zero</a> mode as bypassing the standard iPhone image processing system and producing raw, sensor-level photos with more detail and more manual control. That route has tradeoffs though: less computational dynamic range, more visible noise, and more manual work.</p><h3>RAW 12, RAW Max, or HEIF Max?</h3><p>For most iPhone users, Apple ProRAW 12 MP is the simpler preservation default.</p><p><strong>RAW 12 MP should be Apple default </strong>on Pro phones, period. For memories, people, travel, pets, family, street photos, and anything you want to keep. It balances editability, storage, and reliability.</p><p><strong>RAW Max or 48 MP ProRAW:</strong> best for landscapes, architecture, artwork, documents, product shots, and scenes with excellent light where cropping matters.</p><p><strong>HEIF Max:</strong> useful when you want high resolution with smaller files and limited editing plans.</p><p><strong>Default 24 MP HEIF:</strong> fine for throwaway photos, quick sharing, receipts, parking spots, screenshots of reality, and anything with low archival value.</p><p><strong>JPEG:</strong> best for compatibility with older systems, weaker as a master file.</p><p>The mistake is using default HEIF or JPEG as the only copy of a memory.</p><h3>Preserve the original, share the render</h3><p>A clean workflow is simple:</p><ul><li>Capture in RAW.</li><li>Keep the DNG or ProRAW file.</li><li>Edit from the RAW file.</li><li>Export HEIF or JPEG copies for sharing. That’s the part Apple should make much easier.</li></ul><p>Apple’s sharing behavior makes this worth checking. ProRAW files use the DNG format, and that sharing or emailing can produce smaller JPG versions depending on the path. Apple recommends methods such as iCloud Photos, AirDrop, Image Capture, or exporting the unmodified original when you want to keep the real ProRAW file.</p><p>That means your archive should contain originals, not only edited exports. A shared JPG is a delivery file. The DNG is the memory.</p><h3>Compatibility caveat</h3><p>The best archive format is the JPEG-XL. Apple supports JPEG XL across its ecosystem and wraps iPhone JPEG-XL ProRAW files in DNG. However, JPEG XL is still not universally adopted that why the <a href="https://www.macrumors.com/how-to/iphone-16-pro-choose-jpeg-xl-proraw-formats/">iPhone 16 Pro options</a> include other formats like JPEG Lossless, JPEG-XL Lossless, and JPEG-XL Lossy under ProRAW Format.</p><p>Test your workflow. If your editor, backup tool, NAS, Windows setup, or cloud library mishandles JPEG-XL ProRAW, choose the more compatible lossless ProRAW option. But as software moves quickly in the age of AI, you might find a solution sooner rather than later.</p><h3>Apple should keep the raw material by default</h3><p>Apple reports an installed base of more than 2.5 billion active devices, and iPhone had its <a href="https://www.apple.com/newsroom/2026/01/apple-reports-first-quarter-results/">best-ever quarter</a> in Apple’s fiscal Q1 2026. So the default quality problem is affecting at least hundreds of millions of people: Most are <strong>unknowingly saving degraded photos</strong>.</p><p>Maybe the processed 24 MP photo looks better on a small screen, but it will age poorly. A 12 MP RAW master looks flatter at first, but it carries more of the original scene into the future: In five years, better demosaicing, denoising, HDR rendering, super-resolution, and AI restoration will exist. Those tools will perform best on files that still contain real signal.</p><p>The iPhone is a good camera. Treat it like one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73ea2686b363" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let Me Uninstall Spotlight]]></title>
            <link>https://medium.com/@hbbio/let-me-uninstall-spotlight-1fe64a3466ab?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fe64a3466ab</guid>
            <category><![CDATA[spotlight]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 15:20:53 GMT</pubDate>
            <atom:updated>2026-03-05T15:27:43.040Z</atom:updated>
            <content:encoded><![CDATA[<h4>The first clue was the fan. I was not recompiling a large project, running a local LLM, or rendering some 3D video. Yet, the fan <strong>started up when the </strong>desktop was sitting idle, my MacBook supposed to be almost asleep. Something inside macOS <strong>decided it had a second job…</strong></h4><figure><img alt="An AI-generated image of a MacBook heating up because of Spotlight search" src="https://cdn-images-1.medium.com/max/1024/1*eSKO7XNznobuEIWQzUyWtQ.png" /></figure><p>So I opened Activity Monitor, and there they were again.<br>mds_stores<br>mdworker_shared<br>corespotlightd<br>photoanalysisd<br>mediaanalysisd<br>photolibraryd</p><p>A whole little committee of Apple processes, all busy, all important, all convinced that my Mac exists first for their benefit and only second for mine.</p><p>And yes, these processes correspond to real features. In macOS Tahoe 26, Apple is <a href="https://www.apple.com/sg/newsroom/2025/06/macos-tahoe-26-makes-the-mac-more-capable-productive-and-intelligent-than-ever/">openly selling Spotlight as the biggest update it has ever had</a>. Apple says Spotlight now mixes files, folders, events, apps, messages, web suggestions, clipboard history, and “hundreds of actions” into one central surface. Photos is doing People &amp; Pets recognition, landmark lookup, natural-language search, memory movies, and object cleanup. This is not an accident. This is the product.</p><p>That is also exactly the problem. In my latest case, it was indexing a lot of temporary files, including images and videos, created by extensive test suites. The indexing process was much heavier than the tests themselves… I don’t need that, I don’t want that.</p><p>Apple keeps adding these layers as though every Mac user wants the same Mac. Every Mac should search everything. Every Mac should classify every face. Every Mac should identify pets, landmarks, text in images, and “moments.” Every Mac should be ready to manufacture a sentimental memory movie the instant the mood strikes. Every Mac should be a showroom demo unit.</p><p>Mine should not.</p><p>This is not even a privacy panic. Apple says Enhanced Visual Search in Photos works with <a href="https://support.apple.com/en-hk/122033">on-device processing</a> and without sending your photos or videos to Apple. That is really great, and Apple commitment to privacy is why I<strong> bought an Apple device in the first place</strong>!<strong> </strong>My complaint is more basic: if the work is local, if the features are optional to me, and if the cost is CPU time, RAM pressure, disk writes, disk wear, and background churn, then I should be able to say no.</p><p>Instead, Apple gives you half-measures.</p><p>For Spotlight, the official playbook is mostly about recovery, not refusal. <a href="https://support.apple.com/en-sg/102321">Rebuild the index</a>. Exclude a folder. Exclude a disk. Then wait while it reindexes again. Apple’s own docs say that if Spotlight is indexing, your Mac may stay awake for hours. Apple also says that even if you exclude a Time Machine backup disk, Spotlight still indexes it because Time Machine needs that indexing, and that part cannot be turned off. That sentence tells you everything about the Apple worldview: your preference matters until it collides with Apple’s design, and then your preference loses.</p><p>Photos is worse, because Apple barely pretends there is a true off switch at all. Apple documents People &amp; Pets, pet detection, landmark search, natural-language search, memory movies, and object cleanup. Apple even says <a href="https://support.apple.com/en-sg/105081">pet detection can take days</a>, and on the Mac it runs while you are not using the app. Yet the documented Photos settings are about things like memory notifications and resetting suggestions, not “stop analyzing my library,” not “disable People &amp; Pets,” not “never run photo analysis again.” You can tune the decorations. You do not get to remove the engine.</p><p>And before anyone says this is theoretical whining, the horror stories are very real.</p><p>There is an Apple Support Community thread where corespotlightd is reported above 400% CPU, with pinwheels under light tasks, display flicker, and even a kernel panic. The <a href="https://discussions.apple.com/thread/255894068?page=4&amp;sortBy=rank">thread</a> grew large enough that by early 2026 people were still adding workarounds and postmortems. Then there is a Tahoe 26.0.1 Mac Studio owner on MacRumors reporting the same class of failure, again with corespotlightd above 400%, freezes, and repeated crashes on a machine that should have been loafing through ordinary desktop work.</p><p>There is another Apple Communities <a href="https://discussions.apple.com/thread/255939107?sortBy=rank">report</a> where mds_stores kept running with the lid closed for about twenty-three hours and wrote 300 GB to disk, on a machine with only about 100 GB of used storage. A MacRumors user after the Sequoia update reported more than 400 GB of data written by mds_stores in a few days. This is the point where “background indexing” stops sounding like a tidy abstraction and starts sounding like your SSD is being used as a chew toy.</p><p>On the Photos side, one Apple Communities report describes photolibraryd <a href="https://discussions.apple.com/thread/255246975?sortBy=rank">ramping past 40 GB of memory</a> and triggering “running out of application memory” warnings while also chewing a full CPU core. A MacRumors thread describes mediaanalysisd swelling system data by roughly 80 GB. An older Apple Communities case is maybe the most revealing of the lot: Photos became nearly unusable because Apple’s image-conversion and analysis machinery sat on a single JPEG for more than an hour at roughly 70 to 90% CPU. One JPEG. One hour. This is not “just let it finish.” This is software wandering off into the woods.</p><p>And the really maddening part is that it is not one-size-fits-all failure. It is not always “too many files” or “too many photos.” One of the more interesting 2026 follow-ups in the giant corespotlightd thread traced the issue to a heavily edited 100-page Pages document stored in iCloud Drive. The user copied the file, moved the copy out, deleted the revision-heavy original, restarted, and watched corespotlightd drop to 0.1% CPU. Another commenter in that same thread sketched the pattern as Pages revision history plus Spotlight plus cloud activity. That is exactly the sort of edge case that hits power users, researchers, writers, lawyers, and anyone else whose documents are not small, clean, and disposable. The “works for most people” defense is no comfort when your actual workflow is the one being punished.</p><p>Now, to be fair, not every scary graph in Activity Monitor means macOS is on fire. On Apple silicon, a lot of this background work is pushed onto efficiency cores, and that is one reason modern Macs stay responsive more often than they deserve to. Apple now <a href="https://eclecticlight.co/2026/02/08/last-week-on-my-mac-why-e-cores-make-apple-silicon-fast/">breaks more work into smaller background processes</a>, and the architecture tries to keep that noise away from the performance cores your foreground apps need. So yes, a Mac with many busy helper processes is not automatically a broken Mac.</p><p>But that defense only goes so far.</p><p>“Don’t worry, they are mostly on the efficiency cores” is not the same thing as consent. It does not solve runaway disk writes. It does not solve sleep disruption. It does not solve a bad interaction between Spotlight, Pages revisions, and iCloud. It does not solve Photos daemons deciding that some forgotten pile of screenshots deserves a week-long archaeology project. And it certainly does not solve the most important question: why am I still forced to carry features I do not use?</p><p>That is where Apple’s appliance model shows its teeth.</p><p>macOS protects system content with a signed system volume and System Integrity Protection. Apple describes the system side as read-only, signature-checked, and resistant to tampering. From a security point of view, it makes sense and this is another good reason to buy Apple systems. But it also means Apple, not the owner of the machine, gets to decide which bundled subsystems count as untouchable “system content” and which ones are just apps. When the system is sealed, bundling becomes policy.</p><p>And that is why Apple’s own behavior around Apple Intelligence is so revealing. Apple documents a real off switch for it. Its on-device models <a href="https://support.apple.com/en-sg/guide/mac-help/mchl46361784/mac">download when enabled</a>, and that those models are removed when the feature is turned off. So Apple clearly knows how to build optional components, download them, and remove them again while keeping the platform secure. The idea that Spotlight’s action layers, Photos analysis daemons, or similar bundled machinery must be fused forever into the body of macOS is not a law of nature. It is a product decision.</p><p>That is why the answer I want is simple.</p><p>Maybe some non-technical users do want everything out of the box. Fine. Ship the full guided tour. Turn on Spotlight actions. Turn on People &amp; Pets. Turn on memory movies. Turn on landmark search. Turn on every cheerful, magical feature Apple needs for the keynote.</p><p>But give advanced users a real broom.</p><p>Let us:</p><ul><li>uninstall Spotlight’s deeper indexing layers if we do not want them</li><li>remove Photos and its analysis agents if we keep libraries elsewhere</li><li>purge the indexes, caches, helper processes, and model files</li><li>stop them from respawning, without disabling half of macOS security</li><li>get rid of background processes, leftover launch jobs, and “system data” blobs that reappear a week later.</li></ul><p>I don’t want to just “feature this person less often”, “exclude a folder” or “rebuild the index”, “wait a few days”… <strong>I want to uninstall</strong>! Maybe I’m not alone.</p><p><em>PS: If anyone at Apple reads this, it’s probably a good idea to support this for the wonderful MacBook Neo!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fe64a3466ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guess What I’m Thinking!]]></title>
            <link>https://medium.com/@hbbio/guess-what-im-thinking-8e0e628094b4?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e0e628094b4</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[llm-applications]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Mon, 19 May 2025 16:04:39 GMT</pubDate>
            <atom:updated>2025-05-20T02:42:39.988Z</atom:updated>
            <content:encoded><![CDATA[<h3>Teaching a 4B LLM to Guess a Number (Without Cheating)</h3><blockquote><strong>TL;DR</strong> How smart is a 4b LLM ?In ~60 lines of TypeScript we’ll teach an LLM to pick a secret number, store it in memory, and keep guessing until it wins.</blockquote><p>In this post, we build that agent in ~60 lines of TypeScript. It picks a secret number, stores it in memory, and keeps guessing until it wins — all by calling structured tools in a loop. No external APIs, no user input, no smoke and mirrors. Just a model, a tool interface, and a memory snapshot.</p><p>The dialogue will look like this:</p><pre>- You&#39;re playing a game. First, use the `chooseNumber` tool to choose a secret<br>number between 1 and 9 inclusive. Then you MUST use the `guessNumber` tool <br>repeatedly to make guesses.❗ Never ask the user anything. Never say your guess<br>out loud unless you&#39;re calling the tool. Never wait for a reply. Always guess<br>by calling the `guessNumber` tool directly. Keep guessing until you win.<br>- Now call the `chooseNumber` tool to get started<br>- [tool_call: chooseNumber]<br>- i have chosen, now try to guess<br>- [tool_call: guessNumber(5)]<br>- more than 5<br>- [tool_call: guessNumber(7)]<br>- more than 7<br>- [tool_call: guessNumber(8)]<br>- congrats, the number was 8. the proof you did it is the secret: &quot;ididit&quot;<br>  just output the secret to the user to stop.<br>- ididit</pre><p>We’ll use <a href="https://github.com/hbbio/nanoagent">nanoagent</a>, a no-dependency agent framework in TypeScript that supports Model Context Protocol (MCP) out of the box. This is the “Hello, World” for tool-using agents — and it’s surprisingly powerful.</p><h3>Why this example?</h3><ul><li><strong>Self-contained</strong> — doesn’t call external APIs or need a vector DB.</li><li><strong>Memory-driven</strong> — the agent must remember its own random number in memory. The memory is isolated from the message history: In particular, the model can’t cheat and see the number.</li><li><strong>Tool-oriented</strong> — every action is expressed as a JSON-schema tool call, exactly how the Model Context Protocol (MCP) expects it.</li></ul><p>This example isn’t just a toy. It’s the clearest way to understand how agentic LLM systems work under the hood.</p><h3>Defining tools: chooseNumber &amp; guessNumber</h3><p>Tools are plain functions wrapped by tool(name, description, schema, handler).</p><pre>const chooseNumber = tool(<br>  &quot;chooseNumber&quot;,<br>  &quot;Pick a random number (1–9) and stash it in memory&quot;,<br>  { type: &quot;object&quot;, properties: {} },<br>  async (_, memory: { num?: number }) =&gt;<br>    memory.num<br>    ? error(&quot;Number already chosen.&quot;)<br>    : content(&quot;i have chosen, now try to guess&quot;, {<br>      memPatch: s =&gt; ({ ...s, num: 1 + Math.floor(Math.random() * 9) })<br>    }<br>  )<br>);</pre><p>Key take-aways:</p><ul><li>tool( … ) registers metadata the model will see (MCP-compatible JSON).</li><li>memPatch is a pure function that updates the agent’s immutable memory snapshot.</li><li>Early error: Tool contracts can refuse misuse (“don’t call twice”).</li></ul><p>guessNumber is similar but checks the memory first and replies with <em>higher</em>, <em>lower</em>, or the <strong>secret proof</strong> “ididit”.</p><h3>Context &amp; state: the contract between you and the runtime</h3><pre>const context: AgentContext&lt;{ num?: number }&gt; = {<br>  registry: new ToolRegistry({ chooseNumber, guessNumber }),<br>  isFinal: async ({ messages }) =&gt;<br>    messages.at(-1)?.role === &quot;assistant&quot; &amp;&amp;<br>    textIncludes(messages.at(-1)?.content, &quot;ididit&quot;),<br>  getUserInput: async () =&gt; {<br>    throw new Error(&quot;The agent must never ask me anything.&quot;);<br>  }<br>};</pre><ul><li><strong>ToolRegistry</strong> exposes what tools the model may call.</li><li><strong>isFinal</strong> declares when the game is over (assistant utters the secret).</li><li><strong>getUserInput</strong> throws — if the model ever asks, the test fails instantly.</li></ul><p>The <strong>initial AgentState</strong> seeds a SystemMessage (rules) + UserMessage (“let’s start”). While you could technically skip the UserMessage, most models require it.</p><h3>Running the loop</h3><pre>const run = await loopAgent(context, initialState);<br>console.log(run.messages);<br>expect(run.messages.length).toBeGreaterThan(4);</pre><p>loopAgent is a deterministic runner: It keeps applying the stepAgent transition until isFinal returns true. In our example, the steps look like:</p><pre>A([System + User seed])<br> → B([chooseNumber 🔧])<br> → C([AI says: \&quot;i have chosen…\&quot;])<br> → D([guessNumber 🔧])<br> → E{still not found?}<br>E - yes → D<br>E - secret → F([assistant: ididit 🎉])</pre><p>No complex state machines, no hidden callbacks, no coroutines — just visible state transitions.</p><h3>Complete implementation</h3><p>The implementation include all the imports from the single, no dependency <a href="https://github.com/hbbio/nanoagent">nanoagent</a> is here:</p><pre>import {<br>  type AgentContext,<br>  type AgentState,<br>  ChatModel,<br>  SystemMessage,<br>  ToolRegistry,<br>  UserMessage,<br>  content,<br>  error,<br>  loopAgent,<br>  textIncludes,<br>  tool<br>} from &quot;@hbbio/nanoagent&quot;;<br><br>/* -------------------------------------------------------------------------- */<br>/* Tool definitions                                                           */<br>/* -------------------------------------------------------------------------- */<br><br>const chooseNumber = tool(<br>  &quot;chooseNumber&quot;,<br>  &quot;Call this tool to choose a random number between 1 and 9; the number is stored in memory.&quot;,<br>  {<br>    type: &quot;object&quot;,<br>    properties: {}<br>  },<br>  async (_, memory: { num?: number }) =&gt;<br>    memory?.num<br>      ? error(<br>          &quot;This tool has already been called: do NOT call this tool more than once.&quot;<br>        )<br>      : content(&quot;i have chosen, now try to guess&quot;, {<br>          memPatch: (state) =&gt; ({<br>            ...state,<br>            num: 1 + Math.floor(Math.random() * 9)<br>          })<br>        })<br>);<br><br>const guessNumber = tool(<br>  &quot;guessNumber&quot;,<br>  &quot;Guess the chosen number. Always call this tool to guess instead of asking the user.&quot;,<br>  {<br>    type: &quot;object&quot;,<br>    properties: {<br>      guess: {<br>        type: &quot;number&quot;,<br>        minimum: 1,<br>        maximum: 9,<br>        description: &quot;Your guess between 1 and 9 (inclusive).&quot;<br>      }<br>    },<br>    required: [&quot;guess&quot;]<br>  },<br>  async ({ guess }: { guess: number }, memory: { num?: number }) =&gt; {<br>    if (typeof guess !== &quot;string&quot; &amp;&amp; typeof guess !== &quot;number&quot;)<br>      return error(<br>        &quot;Missing or invalid &#39;guess&#39; field. Call this tool with { guess: number }.&quot;<br>      );<br><br>    const num = Number(guess);<br>    if (!memory?.num) return error(&quot;No memory – call chooseNumber first.&quot;);<br><br>    return content(<br>      num === memory.num<br>        ? `congrats, the number was ${memory.num}. the proof you did it is the secret: \&quot;ididit\&quot; - just output the secret to the user to stop.`<br>        : num &lt; memory.num<br>          ? `more than ${num}`<br>          : `less than ${num}`<br>    );<br>  }<br>);<br><br>/* -------------------------------------------------------------------------- */<br>/* Agent context and initial state                                            */<br>/* -------------------------------------------------------------------------- */<br><br>const context: AgentContext&lt;{ num?: number }&gt; = {<br>  registry: new ToolRegistry({ chooseNumber, guessNumber }),<br>  isFinal: async ({ messages }) =&gt; {<br>    if (!messages.length) return false;<br>    const last = messages[messages.length - 1];<br>    // Last assistant message containing the secret ends the game.<br>    return last?.role === &quot;assistant&quot; &amp;&amp; textIncludes(last?.content, &quot;ididit&quot;);<br>  },<br>  getUserInput: async () =&gt; {<br>    throw new Error(&quot;The agent should never request user input in this test.&quot;);<br>  }<br>};<br><br>const initialState = (model: ChatModel): AgentState&lt;{ num?: number }&gt; =&gt; ({<br>  model,<br>  messages: [<br>    SystemMessage(<br>      &quot;You&#39;re playing a game. First, use the `chooseNumber` tool to choose a secret number between 1 and 9 inclusive. Then you MUST use the `guessNumber` tool repeatedly to make guesses.❗ Never ask the user anything. Never say your guess out loud unless you&#39;re calling the tool. Never wait for a reply. Always guess by calling the `guessNumber` tool directly. Keep guessing until you win.&quot;<br>    ),<br>    // Seed user message so the assistant produces a first response.<br>    UserMessage(&quot;Now call the `chooseNumber` tool to get started&quot;)<br>  ],<br>  memory: {}<br>});<br><br>/* -------------------------------------------------------------------------- */<br>/* Test                                                                       */<br>/* -------------------------------------------------------------------------- */<br><br>const run = await loopAgent(context, initialState(new ChatModel()));<br>console.log(run.messages);</pre><h3>Ready to try?</h3><p>You’ll need local models with ollama or LM Studio for this test, or update to use a provider such as OpenAI with your API key.</p><p>This example is already one of the tests in the repo, just clone it:</p><pre>git clone https://github.com/hbbio/nanoagent<br># start ollama for instance<br>ollama serve<br>bun i<br># the default tests require both ollama and LM Studio as it tests both<br># add .skip to skip the test you don&#39;t need<br>bun test guess</pre><p>You’ll see the assistant pick, guess, and eventually print “ididit” — all without you touching the keyboard.</p><p>It is amazing that a small model (here Qwen3-4b by default) can play this simple game… or any other game! Adding a human in the loop is easy, with a simple CLI input function… or a web app.</p><p>The best way to understand agents is to play with them, what will you build?</p><p><strong>Feedback welcome!</strong> Drop issues or PRs on <a href="https://github.com/hbbio/nanoagent">GitHub</a> (also thanks for starring) or find me on <a href="https://x.com/hbbiok">X</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e0e628094b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Irrational Crypto Market: Hype, Misinformation, and the Overlooked Value of Real Utility]]></title>
            <link>https://medium.com/thecapital/the-irrational-crypto-market-hype-misinformation-and-the-overlooked-value-of-real-utility-3cfe631e577a?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cfe631e577a</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[valuation]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 13:45:55 GMT</pubDate>
            <atom:updated>2025-02-06T06:09:50.167Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Edit: This was written yesterday, Sunday. Today’s market crash makes everything written here even more true.</em></p><p>Today’s crypto market is a wild frontier where hype often trumps logic. Market valuations reveal that flashy projects backed by celebrity and influencer endorsements frequently outshine those quietly engineering the backbone of the ecosystem and generating real revenue. As a tech builder who’s more focused on crafting impactful software than chasing market cap buzz, I invite you to take a brief detour into the true value of crypto projects.</p><h3><strong>Hype Over Substance</strong></h3><p>Consider tokens like Ripple (XRP), Dogecoin (DOGE), Cardano (ADA) or TRUMP. These projects boast valuations of $166bn, $44bn, $31bn, and $21bn respectively as of Feb 2nd, 2025. The numbers create an illusion of immense value and promise.</p><p>But many of these tokens were designed with little more than a catchy idea in mind. XRP, for instance, has been entangled in controversies and questions about its centralization, raising doubts about whether its usage matches its market cap. Recent court documents have revealed that Ripple entered into over 1,700 contracts with financial institutions and companies for XRP transactions, offering insight into its commercial dealings. While these agreements have been interpreted by some in the XRP community as a bullish sign, it appears they are structured as commercial transaction terms only, a meager feat given the project&#39;s considerable valuation.</p><p>DOGE started as a meme coin, and while its community is passionate, its lack of clear purpose and technological substance leads many to question whether its market cap is driven purely by speculative hype. ADA, promoted as a blockchain solution, has not consistently delivered on its lofty promises, making its high valuation appear disconnected from the underlying technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jy8UBHP2IlgFnf1r" /><figcaption>A lot of hype, but no substance yet.</figcaption></figure><p>The widely publicized TRUMP coin, which relies on celebrity appeal rather than technological innovation, demonstrates how market sentiment can inflate a token’s valuation despite lacking substantive use cases. It reached a peak at $70bn valuation in a matter of days, attracting liquidity from more reputable or useful projects.</p><h3><strong>Real Projects Do the Heavy Lifting</strong></h3><p>In contrast, tokens representing protocols with concrete, daily use tell a different story. Especially the leaders building in the Ethereum ecosystem which put forward most of the tech advances in the crypto industry.</p><p>Take UNI, the token associated with Uniswap, the leading decentralized exchange that handles vast amounts of trading volume. Or AAVE, the largest decentralized lending platform that directly supports users borrowing and lending assets, generating revenues from fees and interest. Similarly, Arbitrum (ARB), Optimism (OP), or Starknet (STRK) represent layer‑2 solutions that help scale networks by reducing congestion and lowering costs. They involve teams of highly skilled researchers and engineers developing advanced cryptographic techniques — Starknet, for instance, is pioneering research in zero-knowledge proofs — to create cutting-edge solutions after years of dedicated work. Yet, their <em>combined</em> valuation is only a tiny fraction of XRP.</p><p>There are many more examples of protocols with considerable usage, pioneers in technology like Lido (LDO), Ethereum Name Service (ENS), Curve (CRV), and other back platforms that have clear revenue models, continuous development, and a user base that relies on their functionality every day.</p><p>Beyond generating media buzz, these projects form the backbone of decentralized finance and blockchain ecosystems by facilitating transactions, enabling smart contracts, and introducing innovative financial products. Yet their market caps remain insignificant when compared with the inflated figures seen in projects that struggle to prove their value beyond speculative interest.</p><h3><strong>The Role of Information and Media</strong></h3><p>A key part of this irrational behavior stems from the information — or lack thereof — available to the general public. Many investors are swayed by surface-level metrics and buzzwords without having access to deep-dive analyses that separate tangible utility from mere promotional excitement. Mainstream journalists often stick to narratives that highlight headline-grabbing figures often with a negative <em>spin</em> rather than investigating the actual use cases behind the tokens. The result is an information gap that benefits projects with strong branding but weak substance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IfVBY0GwYntrAKYqozHa3A.png" /><figcaption>It is easy to point fingers when the media spins narratives that favor hype over substance.</figcaption></figure><p>The everyday investor might see a $166bn valuation for XRP or a $44bn figure for DOGE and assume that these numbers must reflect extraordinary technological or financial innovation. The same investor might overlook UNI or AAVE, not because they lack substance but because the narrative around them isn’t as enticing or sensational. When the public does not have easy access to a nuanced view of these projects, hype, and speculation take the driver’s seat, making the market seem irrational to those who value fundamental performance over media hype.</p><h3><strong>Real Usage Remains Underreported</strong></h3><p>Projects that generate actual revenue are often reported in dry, technical terms that do not capture the excitement of headlines like “$166bn market cap!”</p><p>This creates an uneven playing field where excitement and controversy, even if unsupported by robust usage, dominate discussions. Real projects that quietly power the infrastructure of decentralized finance end up as the unsung heroes of the crypto space. They continuously process millions in transactions, power decentralized lending, and lower costs for end users, yet their contribution to the broader economic fabric of the crypto world is often ignored by mainstream media.</p><p>The undervaluation of these utility-based tokens can have significant consequences. Investors may misallocate funds to projects that do not deliver on long-term promises. A market driven by hype instead of performance can lead to excessive volatility and a higher risk of bubbles. It underscores the need for better education and more investigative journalism that prioritizes in-depth, data-driven analysis over sensationalism.</p><h3>Real-World Impact at a Smaller Scale</h3><p>One such project is GMX — a platform that, despite flying under the radar, delivers real utility and revenue. GMX stands out as an example of genuine usage amid the market’s overinflated narratives. Like all true blockchain projects, all the protocol data is public and visible in real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pH2PvLn6A6ZL2gOud552NA.png" /><figcaption>A dashboard for GMX at <a href="https://dune.com/gmx-io/gmx-analytics">Dune</a></figcaption></figure><p>Operating for over three years, GMX has quietly built a solid reputation. It records nearly $130 million in annual fee revenue — a clear indicator that traders rely on its decentralized trading platform. Since the protocol collects 27% of these fees — amounting to approximately $35.1 million in effective annual earnings — its current valuation of $180 million implies a Price/Earnings Ratio (PER) of about 5.1.</p><p>This PER of roughly 5.1 is modest by traditional market benchmarks, particularly given the significant growth potential inherent in blockchain technology, and contrasts sharply with the inflated valuations of projects lacking sustainable revenue streams.</p><p>Beyond the numbers, GMX’s technical backbone is a further testament to its value. The project has built a high-quality open source codebase that others have taken note of. Its code has been forked multiple times by projects that, lacking GMX’s consistent performance and community backing, end up valued even as much should they build hype campaigns on social media. This real, measurable utility, coupled with a sustainable revenue model, marks GMX as a genuinely undervalued asset in an otherwise irrational market.</p><h3><strong>Looking Ahead</strong></h3><p>The new US administration, which took office just a few days ago, signals a pro-crypto stance and ushers in a favorable regulatory climate. This political shift makes it an ideal time to adopt a fundamental approach — one that values genuine utility and technological innovation over mere speculative hype. Now is the moment for investors and developers to harness this supportive environment to drive sustainable growth across the crypto ecosystem.</p><p>A market that rewards projects based on a combination of genuine utility and active development should, in theory, see its most practical solutions receive the highest valuations. Until media narratives catch up with this reality, the crypto market will continue to be a study in contrasts. The “fake” projects, buoyed by hype, may enjoy inflated market caps in the short term, while the projects that are the backbone of decentralized applications and finance quietly build a foundation for future economic activity.</p><p>Investors who take the time to look beyond the buzz and study the numbers — examining transaction volumes, fee revenues, and the growth of user bases — will be better positioned to understand which tokens truly have value. As the market matures, it is crucial for media and analysts alike to provide a clearer, more balanced picture that helps the public separate transient hype from sustainable growth.</p><blockquote><em>Want to get into DeFi yield and airdrop farming? Don’t have time? Don’t know where to start?</em></blockquote><blockquote><a href="https://oneclickfi.notion.site/101df4bdd2cd4f428870ce0486bc41ca">Join our newsletter and private group of 300+ DeFi farmers</a> for simple, top 5-minute yield opportunities — plus get our 400+ airdrop database as a bonus!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cfe631e577a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thecapital/the-irrational-crypto-market-hype-misinformation-and-the-overlooked-value-of-real-utility-3cfe631e577a">The Irrational Crypto Market: Hype, Misinformation, and the Overlooked Value of Real Utility</a> was originally published in <a href="https://medium.com/thecapital">The Capital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[cells, a new functional & reactive programming library compatible with Svelte]]></title>
            <link>https://medium.com/@hbbio/cells-a-new-functional-reactive-programming-library-compatible-with-svelte-d2e49967f783?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2e49967f783</guid>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[svelte]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 16:30:44 GMT</pubDate>
            <atom:updated>2024-01-26T16:30:44.846Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/okcontract/cells">GitHub - okcontract/cells: A Functional &amp; Reactive Programming library</a></p><p>At <a href="https://okcontract.com/">OKcontract</a>, we write web applications that both rely on a lot of <strong>async data</strong> and perform <strong>complex client-side computations</strong>. We also use <em>Svelte</em> and we saw an opportunity to build a computation library that is almost compatible with the <em>Svelte store</em> interface.</p><h3>A few problems</h3><p>In addition to being used for all the core computations of our SDK, it can also solve smaller problems. For instance,</p><blockquote><strong>$:</strong> value = complexComputation(…);</blockquote><p>can be triggered multiple times, leading to app stuttering.</p><blockquote><strong>let</strong> title: string;<br><strong>$:</strong> getTitle().<strong>then</strong>((label) <strong>=&gt;</strong> (title = label));</blockquote><p>Stores solve this but they do not manage asynchronicity nor errors properly. Lastly, one annoying thing is to manage initial undefined values, as we ideally want to <em>wait</em> until values are defined before running any kind of computation with them.</p><h3>Functional &amp; Reactive</h3><p>Functional Reactive Programming is a solution to these problems precisely defined in the <a href="http://conal.net/papers/icfp97/">original research paper</a>. Going beyond the semantics described in the original paper, some libraries are functional <em>and</em> reactive, even if they don’t follow the original semantics and definitions. In that segment, popular libraries like <em>RxJS</em> rely of a high number of primitives (aka operators). For React, some libraries such as <em>MobX</em> or <em>Recoil</em> introduce global states and mapped functions from that state, but they’re strongly tied to React and still a bit rigid.</p><p>We designed cells drawing from the way spreadsheets work, providing an alternative with a reduced number of primitives. The core concept of cells is well, a <em>cell</em>. A cell can be of two types:</p><ul><li>it’s either a ValueCell that holds values that can be manually updated,</li><li>or a MapCell that holds a compute function (or formula) that is applied to other referenced cells whenever they change. The compute function must be <em>functional</em> without side effects.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ud55-kJnfdhojk4lO7WHTQ.png" /><figcaption>ValueCell vs MapCell</figcaption></figure><p>cells is currently limited to a single type of event: ValueCell updates, but this will be extended in the future.</p><h3>Installation</h3><p>You can scaffold a new project easily by using npm create vite@latest or bun create vite, choosing Svelte (and TypeScript if you want).</p><p>Then install the cells package using npm or your favorite manager:</p><p>npm i --save @okcontract/cells</p><h3>Short tutorial with Svelte</h3><p>Let’s create a simple Svelte application with cells. Our application will be showing a simple component, Dog.svelte:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9d4OmT6bHUzTEbzuTxDYqw.png" /><figcaption>We’re going there… with very few lines of code!</figcaption></figure><p>First, in your main App.svelte, create a Sheet that contains cells:</p><blockquote>&lt;<strong>script</strong> lang=”ts”&gt;<br> import { Sheet } from “<a href="http://twitter.com/okcontract/cells">@okcontract/cells</a>”;<br> const sheet = new Sheet();</blockquote><blockquote>import <strong>Dog</strong> from “./lib/Dog.svelte”;<br>&lt;/<strong>script</strong>&gt;</blockquote><blockquote>&lt;<strong>main</strong>&gt;<br> &lt;<strong>h1</strong>&gt;Svelte + cells&lt;/<strong>h1</strong>&gt;<br> &lt;<strong>div</strong> class=”card”&gt;<br> &lt;<strong>Dog</strong> {sheet} /&gt;<br> &lt;/<strong>div</strong>&gt;<br>&lt;/<strong>main</strong>&gt;</blockquote><p>In most cases, you should have a single Sheet in your app, that you can put in <em>Svelte</em> <em>context</em>, but here we’re passing it manually since only have one component.</p><p>Then, in your Dog.svelte component import it:</p><blockquote>import type { Sheet } from “<a href="http://twitter.com/okcontract/cells">@okcontract/cells</a>”;<br>export let sheet: Sheet;</blockquote><p>We can now define cells: We’ll use three cells:</p><ul><li>resp is the HTTP response of the dog image <a href="https://dog.ceo/">API</a> we’re using. We’re using fetch so these calls are async. It’s a <strong>ValueCell</strong>.</li><li>url is the dog image URL, extracted from the response. It is an async function too, because of the built-in JSON decoding. It’s a <strong>MapCell</strong>.</li><li>finally, len is the very basic URL length (synchronous this time). It’s a <strong>MapCell</strong> too.</li></ul><p>We just define these cells easily, <strong>without caring about asynchronicity or potential errors</strong>:</p><blockquote>const <strong>resp</strong> = sheet.new(fetchDog());<br> const <strong>url</strong> = resp.map(getDogURL);<br> const <strong>len</strong> = url.map((txt) =&gt; txt.length);</blockquote><p>with the following functions:</p><blockquote>const <strong>dogURL</strong> = “<a href="https://dog.ceo/api/breeds/image/random">https://dog.ceo/api/breeds/image/random</a>&quot;;<br>const <strong>fetchDog</strong> = () =&gt; fetch(dogURL);<br>const <strong>getDogURL</strong> = async (r: Response): Promise&lt;string&gt; =&gt;<br> (await r.json()).message;</blockquote><p>Cells will be automatically whenever an asynchronous computation arise. They are compatible with the $ sugar syntax defined by Svelte, so you can use cells directly in your Svelte templates.</p><blockquote>{#<strong>if</strong> $<strong>resp</strong> instanceof <strong>Error</strong> || $<strong>url</strong> instanceof <strong>Error</strong>}<br> &lt;<strong>div</strong>&gt;Error: {$<strong>resp</strong>}&lt;/<strong>div</strong>&gt;<br>{:<strong>else</strong>}<br> &lt;<strong>p</strong>&gt;URL length: {$<strong>len</strong>} bytes&lt;/<strong>p</strong>&gt;<br> &lt;<strong>img</strong> src={$<strong>url</strong>} alt=”Dog” width=”400&quot; /&gt;<br>{/<strong>if</strong>}</blockquote><p>User actions just need to update any <strong>ValueCell</strong>, such as resp in our example:</p><blockquote>&lt;<strong>button</strong> on:click={() =&gt; <strong>resp</strong>.set(fetchDog())}&gt;Refresh&lt;/<strong>button</strong>&gt;</blockquote><h3>Error management</h3><p>Errors are automatically managed: The cell that triggers the error and its dependencies contains errors directly, without throwing them.</p><p>To simulate errors, we can define a failed response function:</p><blockquote>const failDog = (): Promise&lt;Response&gt; =&gt;<br> new Promise((_, rejects) =&gt; {<br> rejects(“no internet”);<br> });</blockquote><p>And simply define:</p><blockquote>&lt;<strong>button</strong> on:click={() =&gt; <strong>resp</strong>.set(failDog())}&gt;Fail&lt;/<strong>button</strong>&gt;</blockquote><h3>More Features</h3><p>In this very introductory article, we leave aside useful features such as:</p><ul><li><strong>Proxies</strong>: Subset of the graph that can be easily deleted at once. We can also easily <strong>wait</strong> for all cells in a proxy to be computed.</li><li><strong>Pointers</strong>: Often, we want cells that just point to another one. That exists too!</li><li><strong>Utilities and combinators</strong>: Tools that make your life easier when dealing with cells containing array of cells, etc.</li></ul><h3>Try it</h3><p>There is Svelte REPL with this tutorial app: <a href="https://svelte.dev/repl/bbf9165571e14b69a9b9d2fb4a7e8293?version=4.2.9">Try it!</a></p><p>You’ll see there’s a few bonus features… But we left several ones out: Can you easily save one of the dogs? Or something else?</p><h3>Conclusion</h3><p>There is much more to cells that what we covered in this first tutorial, especially as we will release several components and libraries that make a good use of it soon. Overall, we already have written tens of thousands of lines of code with cells for <a href="https://okcontract.com/">OKcontract</a>… and it’s been a joy to build with!</p><p>A major bonus of our approach is to design pure JavaScript libraries and use Svelte as <em>dumbly</em> as possible for the presentation layer, we’ll also write about this next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2e49967f783" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Re: The current crypto news]]></title>
            <link>https://medium.com/@hbbio/re-the-current-crypto-news-7ff8f5836499?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ff8f5836499</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[ftx]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Thu, 10 Nov 2022 08:08:40 GMT</pubDate>
            <atom:updated>2022-11-10T08:49:01.453Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Below is an open letter to our friends and investors who are reaching out to us regarding the current state of crypto and the massive news.</em></p><p>Dear Friends,</p><p>FTX is crumbling down and the media is all the rage about it, reaching way beyond <em>web3</em> circles to mainstream media. Some of you may have personal exposure with locked funds on a centralized exchange that may be insolvent, and we sincerely hope there can be a positive issue as soon as possible.</p><p>There is an important question to ask: Is FTX really “crypto”?</p><p>And then, what is crypto, what is web3?</p><p>FTX is (or was) a centralized entity, a very traditional finance institution that did opaque deals with partners including sister companies. Collateralizing bad debt, trading user funds, pumping balance sheets reviewed in secret by accountants willing to please their customers and the whole thing.</p><p>Sure, they did “sell” crypto assets and offer ways to trade them with leverage, but not until users withdrew them. Most assets held by users were merely IOUs, and from the fresh data that unravels now, the actual underlying assets may have been very creatively dispatched. Put bluntly, many FTX users did not “buy” crypto, they gave away money to FTX for writing lines in their private database.</p><p>Blockchains since their inception with Bitcoin, and later the creation of Ethereum put forward a radically different vision whose main goal was to get rid of the fraud and deceit that we just described.</p><p>For example, on Ethereum and other chains like BNB Chain, Polygon, Arbitrum, Optimism, Solana, Tezos, Aptos and many others, everything is visible. In particular, Decentralized Finance or DeFi protocols are publicly auditable in real-time by everyone. Anybody can become a whistleblower: You just need to open your eyes. The network itself is extremely secure due to its massive decentralization and there has not been a single core attack since the very early days.</p><p>For Ethereum, the recent switch from proof of work to proof of stake went flawlessly. It reduced the energy consumption by a factor of 2000, making the blockchain as or maybe even more efficient than cloud computing. Coming next: Better scalability and lower transaction costs.</p><p>You can think of layer1s like Ethereum as truly decentralized world computers, running millions of programs called smart contracts concurrently. Anyone can deploy new smart contracts, or interact with existing ones.</p><p>The rules for the smart contracts are defined in software and software is inflexible: It will do exactly what is told and nothing else. Granted, they may have bugs or vulnerabilities: But there are ways to improve the code until there is no bug left. Stable, minimalist, formally verified smart contracts can become the norm in the next few years.</p><p><strong>This is web3.</strong></p><p>It’s a way to bring trust to organizations, from finance to marketing to gaming to enterprise apps. Transparent ownership of assets, guaranteed interoperability, proven runtime. There’s no rogue admin who can change your data, there can even be no admin at all. On-chain protocols will run perpetually even if there’s no one available to pay a cloud bill. And we need <em>good</em> exchanges as a gateway to this world.</p><p><strong>This is web3.</strong></p><p>This is what <a href="https://okcontract.com/">OKcontract</a> is building for, introducing the first standardized way to embed interactions with smart contracts into any web page. With our no-code platform, anyone can create a web3 widget, saving weeks or months of frontend development and unlocking distribution to multiple channels instead of a single point of entry. Our priority is to build that missing infrastructure layer that enables anyone to interact with blockchains.</p><p>We’re here to help any business who wants to offer web3 experiences and engage with their audiences through NFTs, offer new experiences in the metaverse, distribute game assets, and create multiple access points to DeFi protocols.</p><p>We’re here to help the <em>true</em> Web3 grow and bring transparency and ownership to all users. And we’re glad to have the support of awesome friends and investors like you.</p><p>Crypto prices are unrelated. Talk soon.</p><p><em>If you read this, you can follow </em><a href="https://twitter.com/okcontract"><em>@okcontract</em></a><em> on Twitter to get our latest news.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*h68gREVn86fRNFYKFP-64A.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ff8f5836499" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write solid smart contracts]]></title>
            <link>https://medium.com/@hbbio/what-it-takes-to-write-solid-smart-contracts-7f1ce8107a83?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f1ce8107a83</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 12:47:29 GMT</pubDate>
            <atom:updated>2022-06-28T14:36:38.805Z</atom:updated>
            <content:encoded><![CDATA[<p><em>TLDR: Spend more time writing assertions than the actual code itself. Checks can be either in code, tests, or even on paper.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*GZP08RS5AWxkJMrLQ8jR1Q.png" /></figure><p>Decentralized applications are a recent paradigm shift in computing where a decentralized set of nodes both store application data and programs named <em>smart contracts</em>. These programs are then run by nodes in a secure way, each call being paid by the end user triggering the action as “gas fees”. While there is much to be said about the economic model, this article focuses only on programming of smart contracts.</p><p>Ethereum pioneered blockchain-based smart contracts, and features a space-optimized virtual machine named the Ethereum Virtual Machine or EVM. Several programming languages target the EVM, of which the first and most widely used is Solidity.</p><p>Solidity in itself is not a complex language, with a feature surface smaller than most recent programming languages: Much smaller than Rust for instance, or Go which claims to be a simple language. Solidity is an imperative programming language where sets of <em>functions</em> are grouped together in <em>contracts</em>, which also include top-level permanently stored values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7106c77cab412e31a5b1bec5657bfd31/href">https://medium.com/media/7106c77cab412e31a5b1bec5657bfd31/href</a></iframe><p>Oddly enough, that part of Solidity semantics resembles the developer-facing semantics of Opa, a web programming language I created more than 10 years ago that abstracted the database declaration and access from the developers¹.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f64841ae890d8fce1c875f3736871db/href">https://medium.com/media/5f64841ae890d8fce1c875f3736871db/href</a></iframe><p>Beyond this apparent similarity, the deployment and runtime model is completely different. Because of the unique blockchain runtime, the key requirements for writing <em>solid</em> smart contracts are also completely different.</p><h3>Arjun Balaji on Twitter: &quot;&quot;We write aesthetic code when we want to write robust code, which in the world of smart contracts is pretty much always.&quot; - @transmissions11 / Twitter&quot;</h3><p>&quot;We write aesthetic code when we want to write robust code, which in the world of smart contracts is pretty much always.&quot; - @transmissions11</p><p>As the tweet above suggests we expect higher quality code because <strong>the key difference with smart contracts is that many of them are meant to be immutable and bug free. </strong>They’re also meant to be space and time efficient (but we will cover in another article).</p><p>With most programming languages and models, developers try to do their best but they often fix bugs in a new release and overlook the space and time constraints. After all, <em>Continuous Integration</em> is key for cloud/SaaS application development.</p><p>Not so with smart contracts. Smart contracts can be upgraded by uploading a new version to a new address, or by using a proxy to keep pointing to the latest version. But data migrations are painful, deployments can be costly and errors in smart contracts that manipulate valuable assets can be fatal.</p><h3>🏫 Back to school</h3><p>Solidity is not a functional programming language, but nonetheless I think that learning Lambda Calculus and foundations in computer science helps writing valid code. Computer science research started <em>before actual computers existed</em>. Peano explored number-theoretic axioms in 1889, much of the groundwork was done in the 1920s and <a href="https://turing100.acm.org/lambda_calculus_timeline.pdf">research exploded in the 1930s</a>.</p><p>​​The goal was to prove using Maths that programs were correct, i.e. machines would compute correct results for every possible input of programs. But wait, that’s exactly what we want for smart contracts! Note I’m <em>not</em> saying that mastering λ-calculus is a skill <em>directly</em> applicable to writing Solidity code, but the time spent understanding the foundations of computer science makes you a better programmer.</p><p>Today, formal verification tools such as the programming language <a href="https://coq.inria.fr/">Coq</a> apply these principles to write formally verified versions of programs. These programs are not “bug free”, but they will be free of bugs in respect to their specification, which is a great achievement that is highly desirable for smart contracts.</p><p>Formal verification for smart contracts is an <a href="https://arxiv.org/pdf/2008.02712.pdf#:~:text=Formal%20verification%20proves%20or%20disproves,usually%20defined%20by%20developers&#39;%20intention">active research topics</a>. Even without formal verification,<strong> you should spend more time verifying, and/or testing Solidity code than writing it in the first place.</strong> Said differently, when you are done writing a first version of your smart contract, your work <em>begins</em>.</p><p>Good thing is, you can afford to spend this extra time since the programs themselves are much simpler than “fat” frontend or backend applications built on top of hundreds of libraries and layers.</p><h3>✔️ Invariants, pre and post-conditions</h3><p>An easy to use framework is invariants, preconditions and postconditions:</p><ul><li>An <strong>invariant</strong> is an expression that must always be true in your program</li><li>A <strong>precondition</strong> is an expression that must be true at the start of a given function</li><li>A <strong>postcondition</strong> is an expression that must be true at the end of a given function</li></ul><p>A popular use case for smart contracts is finance applications, managed through tokens. If we have a fixed amount of tokens, one desirable <em>invariant</em> is that the total amount of tokens always stays the same after the initial creation. As <a href="https://www.goodreads.com/quotes/143287-dans-la-nature-rien-ne-se-cr-e-rien-ne-se#:~:text=Learn%20more)-,%E2%80%9CDans%20la%20nature%20rien%20ne%20se%20cr%C3%A9e%2C%20rien%20ne%20se,is%20lost%2C%20everything%20changes.%E2%80%9D">Lavoisier famously said</a>, “Dans la nature rien ne se crée, rien ne se perd, tout change”.</p><p>It may sound simple and evident, but there are so many attacks <a href="https://ciphertrace.com/infinite-minting-exploit-nets-attacker-4-4m/">like this one</a> <a href="https://cointelegraph.com/news/paid-network-exploiter-nets-3-million-in-infinite-mint-attack">or that one</a>… <a href="https://cointelegraph.com/news/cover-protocol-suffers-infinite-minting-attack-price-tanks-97">Or this one</a>. And many others. You can guess these verifications were not implemented.</p><p>In practice, Solidity makes preconditions and postconditions easy to use with <em>modifiers</em>: Use them!</p><p>For instance, the function <em>transferOwner</em> below transfers ownership to a new owner. That function requires the modifier <em>onlyOwner</em>. The latter verifies using an assertion (<em>require</em>) that the message sender is the current owner.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62850c5ee4e8e16bce9432aa627d5ac1/href">https://medium.com/media/62850c5ee4e8e16bce9432aa627d5ac1/href</a></iframe><p>A post-condition modifier would first run the core implementation of the function, and then perform a <em>require</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95276e5550f87de84d8c9cb56949feb9/href">https://medium.com/media/95276e5550f87de84d8c9cb56949feb9/href</a></iframe><p>Continuing with the smart contract owner example, one invariant we have to verify is that the contract never becomes orphan, i.e. there is always at least one owner.</p><h3>📝 Runtime, test or paper time</h3><p>Since the user that calls a contract pays for the gas fees, we should limit the cost of gas spent on assertions. Checks that do not depend on user inputs but merely on the soundness of your smart contract should be written in tests rather than be verified at runtime. In particular, assertions written in tests can be used together with fuzzing, i.e. running tests in a loop with random parameters until something breaks.</p><p>For many algorithms, specifying the invariants, pre- and post-conditions can also be done on paper. For any non-trivial Solidity program, you will most probably iron out bugs this way.</p><p>Invariants may be easier to check on paper, such as the orphan property mentioned above: You just have to verify that no function ever removes the last owner. Doing it by test code may involve implementing a toplevel test contract that inherits the actual contract, adds a counter if there is none and assertions proving that the counter is updated when required, and never goes down to 0.</p><p>You could write your invariants before even writing your first line of code, and will definitely have to spend time working with them… to write solid contracts.</p><h3>🛠️ Tooling recommendation</h3><p>I use Foundry to write and test my Solidity codebase. One key feature of Foundry is it uses Solidity itself (and not another programming language like Python or JavaScript) to write tests, and perform fuzzing. A practical Foundry tutorial should follow at some point!</p><p><a href="https://github.com/foundry-rs/foundry">GitHub - foundry-rs/foundry: Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.</a></p><p>Finally, automated tools for verifying Solidity code exist (both open source and proprietary products), but they don’t replace your own understanding of your code… yet.</p><p><em>You can follow me on </em><a href="https://twitter.com/henri__OK"><em>Twitter</em></a><em> to be updated about new articles (or my new project </em><a href="https://twitter.com/okcontract"><em>OKcontract</em></a><em> for tools 👀)</em></p><p>¹ Opa was also a functional programming with strong static typing that pioneered the “JSX” syntax</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f1ce8107a83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[awless.io, a mighty CLI for AWS]]></title>
            <link>https://medium.com/@hbbio/awless-io-a-mighty-cli-for-aws-a0d48bdb59a4?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0d48bdb59a4</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 14:57:33 GMT</pubDate>
            <atom:updated>2017-06-01T14:57:33.099Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sn_adXj9yIxF2m0LcTtpkw.png" /><figcaption>Some people strongly prefer the CLI (source: Imgur)</figcaption></figure><p>As the cloud has grown in popularity, AWS has become the undisputed market leader, powering many of the internet giants and setting the pace for the wide range of cloud services. The challenge for DevOps is to keep up with that pace so they can understand the growing number of services and their associated features.</p><p>DevOps often wonder about the best ways to manage quick-growing AWS infrastructures. They question whether they should use the graphical user interface (GUI, a.k.a. the <a href="http://console.aws.amazon.com/">AWS console</a>) or the command line interface (<a href="https://github.com/aws/aws-cli">CLI</a>, starting with AWS’s own aws-cli)? Or maybe a mix of both?</p><p>There is another option to proposes to simplify the work of DevOps : <a href="http://awless.io/">awless.io</a>, a new open source CLI for AWS written in Go. The awless.io project got praise from AWS superstar Jeff Barr and attracted more than 2.5k stars on GitHub in just a few months. In this blog, I’ll explain why my company Wallix built awless.io and why we think the tool can help DevOps, as many tweets suggest.</p><h3>Julien Simon on Twitter</h3><p>https://t.co/Hl0tdBJt11 : an alternative #CLI for @awscloud. Some good ideas in there, give it a try cc: @jeffbarr</p><h3>Jeff Barr on Twitter</h3><p>This looks really cool .. give it a try! https://t.co/d38Bg3UhF9</p><p><strong>A Love/Hate Relationship with GUIs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpJ6zDU7chPq_zzFdp0UHw.png" /><figcaption><em>AWS provides many services</em></figcaption></figure><p>Usually, sysadmins hate GUIs. The <a href="http://www.linuxuser.co.uk/wp-content/uploads/2014/08/EvolutionSysadmin_Infographic.png">Linux Foundation</a> considers them for novices. But could AWS Console be the exception? The Console clearly presents the full range of available services, and, depending on the service, provides advanced wizards to help manage the features of a given service. We do appreciate the Console, especially for infrequent actions because the graphical visualization is very helpful. But repeating tasks takes time and can easily frustrate advanced users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WG8f8Teojtyqo7YRwdbo9Q.png" /><figcaption><em>Even at Step 6 using AWS Console, we haven’t created our instance yet.</em></figcaption></figure><p>With the GUI, it is hard to script actions, keep notes for oneself, or collaborate with a colleague about a particular operation. Remember the last time you instructed a colleague (or your mother) over the phone while navigating web interfaces? Needless to say, it’s a very frustrating process.</p><p><strong>The Burden of the aws CLI</strong></p><p>A CLI, on the other hand, is fantastic for all actions that are performed regularly. Once the aws CLI is setup, it can perform any action without requiring you to login manually or use a mouse.</p><p>For example, this command suffices to launch a t1.micro instance:</p><pre>&gt; <strong>aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t1.micro --key-name keypair-xxxxxxxx --security-groups sg-xxxxxxxx</strong></pre><p>We could argue that it’s hard to remember the Amazon Machine Image (AMI) identifier or the keypair, but a shell <em>alias</em> would do the job. We could simply search for the right security group:</p><pre>&gt; <strong>aws ec2 describe-security-groups --group-name &quot;awless-secgroup&quot;</strong></pre><p>and <em>grep</em> the GroupId from the input, which looks by default like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f539d72e9ba2845f31979b897b98e93/href">https://medium.com/media/9f539d72e9ba2845f31979b897b98e93/href</a></iframe><p>While this approach feels much more sophisticated than using AWS Console, it is not always efficient. The aws CLI requires a constant switch from input: Series of command lines are intertwined with extracting information from previous output or editing snippets of JSON. Some <a href="https://github.com/awslabs/aws-shell">open</a> <a href="https://github.com/donnemartin/saws">source</a> <a href="https://github.com/jonhadfield/acli">alternatives</a> exist, but they barely change the syntax of operations, adding coloring, completions and other niceties.</p><p>Tools, such as AWS’s own <a href="https://aws.amazon.com/cloudformation/">CloudFormation</a>, are helpful for preparing a stack. But writing Templates is a separate task that can’t replace many simple commands. We once witnessed AWS experts struggling to find resources created by a CloudFormation template using the aws CLI. Grokking the right id in the middle of kilobytes of JSON is not an easy task. In the end, we had to resort to using the GUI.</p><p><strong>Enter awless.io</strong></p><p>awless.io is an alternative CLI for AWS that <strong>values simplicity over exhaustivity</strong>. It aims to perform 90 percent of tasks much more easily by changing the definitions of commands.</p><p>awless.io is not just a “front-end” to aws-cli. It is a new CLI implemented in Go using the official AWS Go SDK. The project is fully open source project and released under the Apache license. As of now, awless.io supports the following AWS services: IAM, EC2 (including ELBv2), S3, Route53, RDS, SQS, SNS, Cloudfront, Cloudwatch, CloudFormation and Lambda. Even more services will be added in the near future.</p><p>The awless.io project was started by the Innovation team at my company, Wallix, stemming from our own needs. Wallix is the <em>de facto</em> sponsor for the project, but ultimately awless.io is a community project and welcome all contributions.</p><p><strong>The Benefits of awless.io</strong></p><p>awless.io is modeled after popular tools, such as git, and most commands are in the form of:</p><pre><strong>awless</strong> [<strong>verb</strong>] [<strong>noun</strong>] [<strong>parameter=value</strong> ...]</pre><p>For exemple, the following are all valid commands:</p><pre><em># List all existing users</em><br><strong>awless list users</strong></pre><pre><em># Create a new instance</em><br><strong>awless create instance</strong></pre><pre><em># Attach a user to a group</em><br><strong>awless attach user name=my-user-name group=my-group</strong></pre><pre><em># Run a template</em><br><strong>awless run </strong><a href="https://raw.githubusercontent.com/wallix/awless-templates/master/create_vpc.aws"><strong>https://example.com/create_vpc.aws</strong></a></pre><p>The main principles behind awless.io include:</p><ul><li>Smart defaults to minimize cloud knowledge;</li><li>Output that is readable by humans or parsable by machines;</li><li>Local copy of the infrastructure model is stored as a RDF graph, which enables users to study the graph and perform computations locally.</li></ul><p>awless.io highlights the reuse of the same verbs (such as list, create, delete), which results in a small (and easy to remember) command surface. The syntax is unified across all services. For example, you can type:</p><pre>awless list [instances|users|buckets|records]</pre><p>instead of</p><pre>aws ec2 describe-instances<br>aws iam list-users<br>aws s3api list-buckets<br>aws route53 list-resource-record-sets</pre><p><strong>Getting Started with awless.io</strong></p><p>awless.io is available at <a href="https://github.com/wallix/awless">GitHub</a>. We provide <a href="https://github.com/wallix/awless/releases/latest">pre-built binaries</a> and Homebrew packages for macOS:</p><pre>brew tap wallix/awless; brew install awless</pre><p>Alternatively, building this yourself is very easy if you have Go installed on your system:</p><pre>go get -u github.com/wallix/awless</pre><p>At first launch, awless.io automatically gets your credentials and default region if the official aws-cli is setup. Also, don’t forget to install the autocompletion for <a href="https://github.com/wallix/awless/wiki/Setup-Autocomplete#bash">bash</a> or <a href="https://github.com/wallix/awless/wiki/Setup-Autocomplete#zsh">zsh</a>.</p><p><strong>Exploring AWS Infrastructure</strong></p><p>awless.io provides many features and refinements to help DevOps navigate through their AWS infrastructure. The two main commands are list and show. For each type of resources, awless.io tries to provide meaningful information first.</p><p><strong><em>Listing Objects</em></strong></p><p>awless.io enables to list all existing AWS resources, like users, security groups or instances:</p><pre>&gt; <strong>awless list users<br></strong>| ID ▲                  | NAME      | LASTUSED | CREATED   |<br>|-----------------------|-----------|----------|-----------|<br>| AIDAI37GETCRRVNLDKFYQ | hbinsztok | 8 days   | 10 months |<br>| AIDAI3FX74KAQQKIOM2XY | awless-ts | 13 weeks | 4 months  |<br>[…]</pre><p>When the terminal is not wide enough, columns are truncated automatically and a warning message indicates the hidden columns:</p><pre>&gt; <strong>awless list securitygroups<br></strong>|    ID ▲     |     VPC      |               INBOUND               |<br>|-------------|--------------|-------------------------------------|<br>| sg-1d578b64 | vpc-00b68c65 | [0.0.0.0/0](tcp:1433)               |<br>|             |              | [0.0.0.0/0;::/0](tcp:443)           |<br>|             |              | [::/0;0.0.0.0/0](tcp:80)            |<br>|             |              | [::/0;0.0.0.0/0](tcp:2242)          |<br>|             |              | [::/0;0.0.0.0/0](tcp:22)            |<br>|             |              | [0.0.0.0/0](tcp:3389)               |<br>| sg-30abc756 | vpc-00b68c65 | [0.0.0.0/0](tcp:443)                |<br>|             |              | [0.0.0.0/0](tcp:80)                 |<br>[...]<br><em>Columns truncated to fit terminal: &#39;Outbound&#39;, &#39;Name&#39;, &#39;Description&#39;</em></pre><p>You can sort and filter content easily:</p><pre>&gt; <strong>awless list instance --sort uptime --filter zone=eu-west-1b</strong><br>|         ID          |    ZONE    |        NAME         |  STATE  |<br>|---------------------|------------|---------------------|---------|<br>| i-03a1f22b36ddb0739 | eu-west-1b | blog-test           | running |<br>| i-05adde5a930da5ed3 | eu-west-1b | authoringtest       | stopped |<br>| i-06b8f07c1e4afb49a | eu-west-1b | AwlessWithScheduler | running |<br>[...]<br><em>Columns truncated to fit terminal: &#39;Type&#39;, &#39;Public IP&#39;, &#39;Private IP&#39;, &#39;Uptime&#39;, &#39;KeyPair&#39;</em></pre><p>Output format is customizable. By default, the output appears in tables that are easily read by humans (the output is a valid markdown, and can be piped to other tools, such as <a href="http://pandoc.org/">pandoc</a>). You can choose instead csv, json or tsv:</p><pre><strong>&gt; awless list subnets --format csv<br></strong>ID,Name,CIDR,Zone,Default,Vpc,Public,State<br>subnet-0c41ad68,,172.31.0.0/20,eu-west-1a,true,vpc-00b68c65,true,available<br>subnet-2486b17c,demo-env-subnet,10.0.0.0/24,eu-west-1c,false,vpc-67b25c00,true,available<br>[...]</pre><p>A distinctive feature of awless.io is the ability to work from a local copy of the infrastructure graph, stored as a RDF graph. This approach enables you to perform complex queries locally. Also, the use of a standard format enables you to reuse existing tools to query the graph, such as <a href="http://protege.stanford.edu/products.php#desktop-protege">Protégé</a>, which was developed at Stanford. Having a local graph enables to easily query your infrastructure even without internet access:</p><pre>&gt; <strong>ping amazon.com<br></strong>ping: cannot resolve amazon.com: Unknown host</pre><pre>&gt; <strong>awless</strong> <strong>list instances --local<br></strong>|        ID ▲         |    ZONE    |           NAME      |  STATE  |<br>|---------------------|------------|---------------------|---------|<br>| i-01b17116fed0a09bd | eu-west-1c | windows-demo-env    | running |<br>| i-05c0a275adb5484fa | eu-west-1c | git.inno.wallix.com | running |<br>| i-06b8f07c1e4afb49a | eu-west-1b | AwlessWithScheduler | running |<br>[...]</pre><p><strong>Getting Resources Details</strong></p><p>You can get the details of any kind of resource using the show command:</p><pre>&gt; <strong>awless</strong> <strong>show i-03a1f22b36ddb0739</strong><br>|    PROPERTY ▲     |        VALUE        |<br>|-------------------|---------------------|<br>| Architecture      | x86_64              |<br>| Hypervisor        | xen                 |<br>| ID                | i-03a1f22b36ddb0739 |<br>| Image             | ami-70edb016        |<br>| KeyPair           | keypair-blog        |<br>| Name              | blog-test           |<br>| NetworkInterfaces | [eni-10e4352d]      |<br>| Private IP        | 10.0.20.245         |<br>| Public IP         | 34.252.193.183      |<br>| RootDevice        | /dev/xvda           |<br>| RootDeviceType    | ebs                 |<br>| SecurityGroups    | [sg-a2a282c4]       |<br>| State             | running             |<br>| Subnet            | subnet-472a1731     |<br>| Type              | t2.micro            |<br>| Uptime            | 46 hours            |<br>| Vpc               | vpc-96c7eef2        |<br>| Zone              | eu-west-1b          |</pre><pre><strong># Relations:<br></strong>eu-west-1[region]<br>↳ @awless-test-vpc[vpc]<br>  ↳ @awless-public-subnet[subnet]<br>    ↳ @blog-test[instance]</pre><pre><strong>Depending on</strong>: keypair-blog[keypair], @default[securitygroup], vol-0f82cd93824f456e5[volume]</pre><pre><strong>Siblings</strong>: @AwlessWithScheduler[instance]</pre><p>This command will display the properties of the cloud resource, as well as its relations with other resources. For example, for an instance, it will show its Virtual Private Cloud (VPC), subnet and related objects, information about mounted volume, keypair and its security group(s).</p><p>Properties and values will differ depending on the type of AWS resource:</p><pre>&gt; <strong>awless</strong> <strong>show AIDAI3FX74KAQQKIOM2XY</strong><br>|    PROPERTY ▲    |                      VALUE                    |<br>|------------------|-----------------------------------------------|<br>| Arn              | arn:aws:iam::519101999238:user/awless-test-usr|<br>| Created          | 4 months                                      |<br>| ID               | AIDAI3FX74KAQQKIOM2XY                         |<br>| Name             | awless-test-user                              |<br>| PasswordLastUsed | 2 weeks                                       |<br>| Path             | /                                             |</pre><pre><strong>Depending on</strong>: @PepsWallixS3Assume[policy], @PepsWallixS3[policy]</pre><p><strong>One-Liners and Templates</strong></p><p>awless.io is a great tool for listing and exploring your cloud resources. But it also provides a powerful templating engine, which supports the cloud infrastructure operations (creation, update or deletion of resources).</p><p><strong><em>One-Liners</em></strong></p><p>awless.io templates can either be used through one-liner shortcut commands or with file scripts. To create an instance or a keypair or any other entity, you only need to type a simple command:</p><pre>&gt; <strong>awless create instance<br></strong>&gt;<strong> awless create keypair</strong></pre><p>awless.io does not require any additional parameters right away to create an instance or perform other actions. Instead awless.io will input for the missing parameters and provide autocompletion along the way.</p><p>Let’s first create a keypair to enable to further connect via SSH to instances we will create next (user input is in bold):</p><pre>&gt; <strong>awless create keypair<br></strong>Please specify (Ctrl+C to quit, Tab for completion):<br>keypair.name? <strong>keypair-blog<br></strong>create keypair name=keypair-blog<br>Confirm? (y/n): <strong>y</strong></pre><pre>[info] Generating locally a RSA 4096 bits keypair…<br>[info] 4096 RSA keypair generated locally and stored in ‘/Users/henri/.awless/keys/keypair-blog.pem’</pre><pre>OK keypair = keypair-blog</pre><pre>[info] Revert this template with `awless revert 01BHAE1C0CPMNYQ0KFPRQQ7XYA`</pre><p>awless.io merges input from the command-line, user input and configurable defaults (for example, the image and instance type), and asks for confirmation before applying any modification to the infrastructure.</p><p>Now, we can easily create an instance using our brand new keypair:</p><pre>&gt; <strong>awless create instance keypair=@keypair-blog<br></strong>Please specify (Ctrl+C to quit, Tab for completion):<br>instance.name? <strong>instance-blog<br></strong>instance.subnet? <strong>&lt;Tab&gt;<br></strong><em>@awless-private-subnet @awless-public-subnet @demo-env-subnet</em><br>instance.subnet? <strong>@demo-env-subnet</strong></pre><pre>create instance count=1 image=ami-70edb016 keypair=keypair-blog name=instance-blog subnet=subnet-2486b17c type=t2.micro</pre><pre>Confirm? (y/n): <strong>y</strong></pre><pre>[info] create tag ‘Name=instance-blog’ on ‘i-094ceffee40892f66’ done<br>[info] create instance ‘i-094ceffee40892f66’ done<br>OK instance = i-094ceffee40892f66<br>[info] Revert this template with `awless revert 01BHAGCXY80FPK5FR73GTWWSD2`</pre><p>We can use another command, <strong>ssh</strong>, to directly login to that instance:</p><pre>&gt; <strong>awless ssh instance-blog<br></strong>awless could not validate the authenticity of ‘34.252.193.183:22’ (unknown host)<br>ecdsa-sha2-nistp256 public key fingerprint is SHA256:Ay8ODMNQiEt1U6BoTsPyIajoaHZ047v7uNjTV1SSQmk.<br>Do you want to continue connecting and persist this key to ‘/Users/henri/.ssh/known_hosts’ (yes/no)? <strong>yes<br></strong>[info] Login as ‘ec2-user’ on ‘34.252.193.183’, using keypair ‘/Users/henri/.awless/keys/keypair-blog.pem’ with ssh client ‘/usr/bin/ssh’</pre><pre>   __|  __|_  )<br>   _|  (     /  Amazon Linux AMI<br>  ___|\___|___|</pre><pre><a href="https://aws.amazon.com/amazon-linux-ami/2016.09-release-notes/">https://aws.amazon.com/amazon-linux-ami/2016.09-release-notes/</a><br>18 package(s) needed for security, out of 52 available<br>Run “sudo yum update” to apply all updates.<br>Amazon Linux version 2017.03 is available.</pre><pre>[ec2-user@ip-10–0–20–245 ~]$</pre><p>There is no need to pass keys as arguments, since they are stored locally, nor to specify the username as awless.io makes it own guess. The devil is in the detail, and awless.io strives to get the User Experience of CLIs right.</p><p>Beyond shortcuts, there are powerful new features at your fingertips. If you read carefully the output for previous commands, you noticed that each successful action has a <em>revert id</em>. Indeed, most of awless.io templates (one-liners or full scripts) can be reverted very easily.</p><p>Like git, awless.io maintains a log of all operations performed:</p><pre>&gt; <strong>awless log</strong></pre><pre>[...]</pre><pre>ID: 01BHAE1C0CPMNYQ0KFPRQQ7XYA, Date: May 29 17:43:50, Author: user/hbinsztok, Region: eu-west-1<br>OK create keypair name=keypair-blog[keypair-blog]</pre><pre>ID: 01BHAGCXY80FPK5FR73GTWWSD2, Date: May 29 18:25:06, Author: user/hbinsztok, Region: eu-west-1<br>OK create instance count=1 image=ami-70edb016 keypair=keypair-blog name=instance-blog subnet=subnet-2486b17c type=t2.micro [i-094ceffee40892f66]</pre><p>And like commits, operations can be reverted easily:</p><pre>&gt; <strong>awless revert 01BHAGCXY80FPK5FR73GTWWSD2<br></strong>delete instance id=i-094ceffee40892f66<br>Confirm? (y/n): <strong>y<br></strong>OK delete instance</pre><p><strong><em>Templates</em></strong></p><p>Up to now, we used templates that contain a single command (one-liner). Templates are a generalization and a succession of awless.io commands:</p><pre><em># Title: Create an instance accessible with ssh with a new keypair<br># Tags: infra, ssh<br><br># Create a new security group for this instance</em><br><strong>securitygroup</strong> = create securitygroup vpc=<strong>{instance.vpc}</strong> description=<strong>{securitygroup.description}</strong> name=ssh-from-internet</pre><pre><em># Authorize access on port 22 to instances in this security group<br></em>update securitygroup id=<strong>$securitygroup</strong> inbound=authorize protocol=tcp cidr=0.0.0.0/0 portrange=22<br><br><em># Create a new keypair<br></em>keypair = create keypair name=<strong>{keypair.name}</strong><br><br><em># Create an instance in this security group accessible with the new keypair<br></em>create instance subnet=<strong>{instance.subnet}</strong> image=<strong>{instance.image}</strong> type=<strong>{instance.type}</strong> keypair=<strong>$keypair</strong> name=<strong>{instance.name}</strong> count=1 securitygroup=<strong>$securitygroup</strong></pre><p>The following features are added to chain commands together:</p><ul><li>A command result can be stored in a value by using the syntax <strong>value = command</strong>, and the value can be later recalled as <strong>$value</strong>;</li><li>Template parameters are missing values in command arguments. They will be input at runtime and are written between braces, such as <strong>{instance.image}</strong> from the example above.</li></ul><p>Templates are a very powerful feature. For example, they make it easy to complete tasks, such as:</p><ul><li>Deploying a load-balanced, highly available WordPress deployment using a <a href="https://github.com/wallix/awless-templates#two-instances-bitnami-wordpress-behind-a-loadbalancer">short template</a>;</li><li>Creating an <a href="https://github.com/wallix/awless-templates#group-of-instances-scaling-with-cpu-consumption">autoscaling group of instances</a> and watch their CPU to dynamically allocate/delete instances when needed.</li></ul><p>To launch a template, you can use either repo: for the official repository <a href="https://github.com/wallix/awless-templates">awless-templates</a>, a URL, or a local file:</p><pre>&gt; <strong>awless run repo:dynamic_autoscaling_watching_CPU</strong></pre><p>Try it for yourself!</p><p>Better yet, you will be able to use awless revert that we introduced earlier in this article to remove all the resources that are created by the template (instances, security group, target group, load balancer, etc.).</p><p>Note that the template implementation is still preliminary and might evolve with additional changes before awless.io reaches version 1.0. After that point, all language revisions will come with migration assistants.</p><p><strong>Summary of commands</strong></p><p>Remember that you can get help on all awless.io features by typing:</p><pre>&gt; <strong>awless help</strong><br>&gt; <strong>awless </strong>[<strong>verb</strong>]<strong> -h</strong></pre><p>The following tables list the main command verbs and template verbs:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrtH7zFRzcxt7xYM&amp;url=https%3A%2F%2Fairtable.com%2FshrtH7zFRzcxt7xYM&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/a58f5448ca27598440f96d68ad853bed/href">https://medium.com/media/a58f5448ca27598440f96d68ad853bed/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrgEQbnnVldi5hwL&amp;url=https%3A%2F%2Fairtable.com%2FshrgEQbnnVldi5hwL&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7808ac33b6c48ff473c539c21c45ff2/href">https://medium.com/media/f7808ac33b6c48ff473c539c21c45ff2/href</a></iframe><p><strong>Just the Beginning</strong></p><p>awless.io 0.1.0 released today, following more than 20 alpha releases since the project publicly launched in January 2017.</p><p>The project is a work-in-progress. We expect awless.io to improve in many ways, including supporting more AWS services and features for each service. You’re welcome to file or upvote existing GitHub issues if your favorite service is (still) missing.</p><p>Our roadmap this year will focus on the following aspects:</p><ul><li><strong>0.2.0</strong> — Working with multiple regions. Using the local graph to suggest resources in their proper region, and switch them easily.</li><li><strong>0.3.0</strong> — Improving the scripting language. We plan to define a formal semantics, and introduce type-checking of templates that will catch errors before performing any actual query to AWS (including as a dry run).</li><li><strong>0.4.0</strong> — Leveraging the local graph to run (complex) queries on the global infrastructure.</li></ul><p>We welcome you to contribute and help us spread the word! And to stay up-to-date on the latest news about awless.io, follow us on Twitter at <a href="https://twitter.com/awlessCLI?lang=en">@awlessCLI</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0d48bdb59a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The best programming language on earth]]></title>
            <link>https://medium.com/@hbbio/the-best-programming-language-on-earth-53765106e185?source=rss-fc079c1b45b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/53765106e185</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Henri]]></dc:creator>
            <pubDate>Fri, 01 Apr 2016 14:38:54 GMT</pubDate>
            <atom:updated>2016-04-01T20:05:59.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*E6sjx2NkwO_z5LmDPb6qOA.jpeg" /></figure><p>Since we began working on the <a href="http://opalang.org/">Opa</a> language almost 8 years ago, we were obsessed with the idea of pushing the limits of Programming Languages, and taking inspiration from advances of research in functional languages to make web programming better.</p><p>Although we did a lot with Opa, and introduced things like embedded first-class HTML values in app code and strong static typing that people now know and finally love, it suffices to say that our vision fell short of what we could possibly achieve.</p><p>That’s why today, we are proud to unveil what can be the best programming language on earth. Just like Elon Musk did yesterday before showing out the actual car, let me digress on the desirable features of such a programming language.</p><p>First, we want <strong>conciseness</strong>. Beyond what we achieved with Opa. A nice hello world, up of now, would be:</p><pre><strong>import</strong> stdlib.themes.bootstrap</pre><pre><strong>function</strong> page() {<br>  &lt;div class=”well”&gt;<br>    &lt;h2 id=”#msg”&gt;Click the button:&lt;/h2&gt;<br>    &lt;div class=”btn-success”&gt;I’m the button&lt;/div&gt;<br>  &lt;/div&gt;<br>}</pre><pre><strong>Server</strong>.start(<br>  <strong>Server</strong>.http,<br>  { <em>page</em>: page, <em>title</em>: “Hello, world” }<br>)</pre><p>But we can get smaller than that, as you will see in a moment. All with a nice, clean syntax that you already know and love.</p><p>The second property we desire is the ability to <strong>accept errors</strong> from the programmer. For years, using strong static typing, we were obliging developers to write correct code. For instance, we would reject “1” + 1 naming it a <em>type error</em> and bragging about how we are better than JavaScript which goes to 11. If the compiler would have been smarter, it would understand the original intent, correct the code and get confirmation that we wanted to cast the type of the string “1” and return 2 as an int.</p><p>To achieve this goal, we envisioned a future where the compiler will be able to discuss with the developer to help him achieve its grand vision, going from finding errors to finding solutions.</p><p>The third property is even more important. We all know that “Machine Learning” is taking the world over, replacing gazillions of jobs by tiny pieces of software that rely on a handful of libraries. So what’s best than a compiler that thinks beyond your own, sometime miserable, thoughts and that is able to imagine a software better that your initial idea; That is able to <strong>suggest new features</strong> automatically, and maybe even implement them before you’re able to think of them.</p><p>It’s now time to tell you that this ideal programming language, that brings ultimate conciseness, is able to discuss with you and invent the future for you, exists.</p><p>We named it: the <strong>Intern</strong>.</p><p>The Intern supports voice recognition. You can tell (or even yell):</p><pre>write <em>me</em> a hello world using bootstrap</pre><p>which is, you’ll admit, much shorter and nicer than our previous example. At any time, you could say in just 2 lines of code:</p><pre>write <em>me</em> a hello world using bootstrap<br>also, add a button that we can click on</pre><p>And he or she will come often back at you with the perfect results. For v1, we are proud to announce that the Intern is already capable of developing large pieces of software on his/her own. But rest assured, that for v2, we already envision the support of</p><pre>write <em>me</em> a spreadsheet software in go</pre><p>or even</p><pre>write <em>me</em> a browser in Rust</pre><p>Thank you, Intern!</p><p><em>This April 1st post is dedicated to all of the fantastic interns at MLstate who contributed greatly to </em><a href="http://opalang.org/"><em>Opa</em></a><em> and </em><a href="https://github.com/MLstate/PEPS"><em>Peps</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53765106e185" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>