<?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 Piotr Chabelski on Medium]]></title>
        <description><![CDATA[Stories by Piotr Chabelski on Medium]]></description>
        <link>https://medium.com/@piotr.chabelski?source=rss-c9c17f3f5799------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fjQwpfjuQ4iXQAeUW2TOZg.jpeg</url>
            <title>Stories by Piotr Chabelski on Medium</title>
            <link>https://medium.com/@piotr.chabelski?source=rss-c9c17f3f5799------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:44:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piotr.chabelski/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[Exploring Scala CLI — the new scala runner]]></title>
            <link>https://medium.com/virtuslab/exploring-scala-cli-the-new-scala-runner-4b958245c2e0?source=rss-c9c17f3f5799------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b958245c2e0</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Piotr Chabelski]]></dc:creator>
            <pubDate>Wed, 22 Feb 2023 09:57:12 GMT</pubDate>
            <atom:updated>2023-02-22T09:57:12.916Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploring Scala CLI — the new scala runner</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTpmgLz70_pdb6oofcdGPQ.jpeg" /></figure><p>Some of you may have heard that as of <a href="https://github.com/scala/improvement-proposals/pull/46">SIP-46</a>, <a href="https://scala-cli.virtuslab.org/docs/reference/scala-command/">Scala CLI</a> is to become the new default runner that will replace the old <em>scala</em> script. Upon receiving this information, many questions arise. Namely, what is Scala CLI and what is it good for? What does this change mean for the Scala community? Or, as many everyday Scala users could probably ask — what even is the <em>scala</em> runner?</p><p>I will try to answer these questions in the following runthrough of the situation.</p><p>Please note that for the reader’s convenience, I will still differentiate the old runner as <em>scala</em> and the new runner (Scala CLI) as <em>scala-cli</em> for the purpose of giving examples in this post, unless otherwise stated. Please also note that the new runner is already available as <em>scala</em> under the <a href="https://scala-cli.virtuslab.org/docs/reference/scala-command/#testing-scala-cli-as-scala"><em>scala-experimental</em></a> installation at the time of writing this post.</p><h3>What is the <em>scala</em> runner?</h3><p>Since you are reading this, it is safe to assume you use Scala in some capacity in your life, be it for your job, university, pet project or any other environment. That means you probably also have the language installed on your local machine.</p><p>The average Scala installation gives you access to the following command-line applications:</p><ul><li><em>scalac</em> — the app used to interact with the Scala compiler</li><li><em>scalap</em> — the Scala class file decoder</li><li><em>scaladoc</em> — the command-line utility for generating Scaladoc</li><li><em>scala </em>— the runner we’re discussing in this article</li></ul><p>As the name implies, the <em>scala</em> runner is a command-line app which runs Scala code.</p><p>Given a simple <em>HelloWorld.scala</em> example:</p><pre>object Hello extends App {<br>  println(&quot;Hello world&quot;)<br>}</pre><p>Using the runner, you could run the file straight from the command line like this:</p><pre>scala HelloWorld.scala<br># Hello world</pre><p>Another commonly used feature would be entering the <em>repl</em>:</p><pre>scala<br># Welcome to Scala 3.2.1 (17.0.5, Java OpenJDK 64-Bit Server VM).<br># Type in expressions for evaluation. Or try :help.<br>#<br># scala&gt;</pre><h3>Why do we need a new runner?</h3><p>Until now, the <em>scala</em> runner used to be primarily a power user tool. Its full scope of usefulness was not widely known. Its features have been relatively limited, not offering much beyond launching the <em>repl</em> and running <em>.scala</em> files. To do anything non-basic with Scala, you would immediately have to turn to a build tool, like <a href="https://www.scala-sbt.org/">SBT</a> or <a href="http://com-lihaoyi.github.io/mill/">Mill</a>. And even when it comes to launching the REPL, most Scala coders have been using it from SBT, skipping the runner altogether. As a result, the utility has gradually been getting less and less attention. It seems like an unused opportunity since we are talking about an app installed along with the compiler on many Scala coders’ machines.</p><p>Scala CLI is meant to be a game changer, being the runner “with batteries included”, targeting not just power users but the whole Scala community.</p><h3>Scala CLI showcase</h3><p><a href="https://scala-cli.virtuslab.org/">Scala CLI</a> is a relatively new open-source command-line tool from VirtusLab, developed since mid-2021. Its core use cases include prototyping, education, scripting and single-module projects. It allows users to not just run their Scala code from the command line but also compile, package and much more.</p><p>Scala CLI is not meant to be a replacement for full-fledged build tools (like Mill or SBT), but is perfectly sufficient to act as one for simple projects consisting of a single module.</p><p>Beyond the JVM platform, the tool also plays nicely with <a href="https://scala-cli.virtuslab.org/docs/guides/scala-native">Scala Native</a> and <a href="https://scala-cli.virtuslab.org/docs/guides/scala-js">Scala.js</a>.</p><p>Its features are divided into sub-commands. Here is a list of some of the more important ones:</p><ul><li><a href="https://scala-cli.virtuslab.org/docs/commands/run"><em>run</em></a> covers the <em>runner</em> functionality</li><li><a href="https://scala-cli.virtuslab.org/docs/commands/test"><em>test</em></a> enables running tests</li><li><a href="https://scala-cli.virtuslab.org/docs/commands/compile"><em>compile</em></a> compiles the given inputs</li><li><a href="https://scala-cli.virtuslab.org/docs/commands/package"><em>package</em></a> allows the user to create a <em>jar</em>, a native binary or even a docker image</li><li><a href="https://scala-cli.virtuslab.org/docs/commands/fmt"><em>fmt</em></a> allows the user to format code, running <em>scalafmt</em> under the hood</li><li><a href="https://scala-cli.virtuslab.org/docs/commands/doc"><em>doc</em></a> enables the generation of API documentation</li></ul><p>More features are planned for the future, with things like publishing, Python, Spark and Markdown support being in the experimental phase.</p><p>There’s also <a href="https://scala-cli.virtuslab.org/docs/guides/ide">IDE support</a> for <a href="https://scala-cli.virtuslab.org/docs/cookbooks/intellij/">IDEA IntelliJ</a> and <a href="https://scala-cli.virtuslab.org/docs/cookbooks/vscode">VS Code with Metals</a>.</p><h3>Advantages Scala CLI has over the old scala runner</h3><p>Now, that’s all nice and good, but when it comes down to the actual <em>runner</em> functionalities, how is Scala CLI better than its predecessor?</p><h4>Simpler setup</h4><p>First, the setup is a lot easier. And I don’t just mean the language setup but the whole development environment. Normally, you would have to separately install the appropriate Java version, <em>scalafmt</em> (a Scala formatter used in a majority of projects) and other things, potentially including a build tool. Scala CLI does all that for the user.</p><p>Want to work with a particular Scala version other than the one available by default on your <em>PATH</em>? Nothing simpler. You can change it just by specifying it with an option.</p><pre>scala-cli -S 2.13<br># Welcome to Scala 2.13.10 (OpenJDK 64-Bit Server VM, Java 17.0.5).<br># Type in expressions for evaluation. Or try :help.<br>#<br># scala&gt;</pre><p>Similarly, picking a Java version doesn’t require downloading and installing it separately. The tool handles that as well.</p><pre>scala-cli --jvm 15<br># Downloading JVM zulu:15<br># Welcome to Scala 3.2.1 (15.0.9, Java OpenJDK 64-Bit Server VM).<br># Type in expressions for evaluation. Or try :help.<br># scala&gt;</pre><p>In fact, there is no need to install Java separately at all. It’s quite okay to let Scala CLI do it.</p><p><em>scalafmt</em> is built in as well, so no need to worry about that.</p><pre>scala-cli fmt .</pre><p>Providing a <em>.scalafmt.conf</em> file (configuration for <em>scalafmt</em>) isn’t necessary, either. If it’s not present, Scala CLI will assume default settings.</p><p>Separately installing a build tool is also optional unless you’re planning to build a multi-module project. And even then, nothing’s stopping you from using Scala CLI during the prototyping phase and then migrating once the need arises. The <em>export</em> sub-command makes it relatively easy to convert a Scala CLI project to Mill or SBT.</p><h4>Faster compilation times</h4><p>Scala CLI uses <a href="https://scalacenter.github.io/bloop/">Bloop</a> under the hood, which makes compilation times a lot faster.</p><p>It’s also one of the easier ways to interact with Bloop. So using Scala CLI’s <em>compile</em> sub-command may be favourable over calling <em>scalac</em> directly if you care about getting something compiled quickly.</p><h4>Introduction of using directives</h4><p>Scala CLI introduces the concept of <a href="https://scala-cli.virtuslab.org/docs/guides/using-directives"><em>using</em> directives</a>, which allows for defining configuration information in sources.</p><p>This means that things like dependencies or Scala version can be defined straight up in a Scala file without the need for a separate configuration file.</p><p>As an example, to define a simple <em>pwd.sc</em> script using Scala 3.2.1 and <a href="https://github.com/com-lihaoyi/os-lib"><em>os-lib</em></a> 0.9.0, you have to type:</p><pre>//&gt; using scala &quot;3.2.1&quot;<br>//&gt; using lib &quot;com.lihaoyi::os-lib:0.9.0<br>println(os.pwd)</pre><pre>scala-cli pwd.sc<br># Compiling project (Scala 3.2.1, JVM)<br># Compiled project (Scala 3.2.1, JVM)<br># ~/scala-cli-tests/demo</pre><p>This is particularly useful for replicating and reporting bugs, as the exact configuration and code used in a given build can be put in a single code block. Defining dependencies right in the source, where they are immediately used, speeds up prototyping as well.</p><p>Additionally, <em>using</em> directives can be used in any input accepted by Scala CLI, which enables applying it in creative ways. For example, nothing stops you from using them in a <em>.java</em> source:</p><pre>//&gt; using jvm &quot;16&quot;<br>public class Main {<br>  public static void main(String[] args) {<br>    System.out.println(System.getProperty(&quot;java.version&quot;));<br>  }<br>}</pre><pre>scala-cli Main.java<br># Compiling project (Java)<br># Compiled project (Java)<br># 16.0.2</pre><h4>Support for virtual sources</h4><p>Scala CLI has support for virtual sources, which means the input code does not necessarily have to be on your file system.</p><p>For example, it’s possible to run a <a href="https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists"><em>GitHub Gist</em></a>:</p><pre>scala-cli https://gist.github.com/Gedochao/9816a2d3ca2597a77dcf8a3d9bc398a2<br># Compiling project (Scala 3.2.1, JVM)<br># Compiled project (Scala 3.2.1, JVM)<br># Hello</pre><p>Or simply a URL:</p><pre>scala-cli https://gist.githubusercontent.com/Gedochao/9577c5c7b06cd655b80c5da93a2bf5d3/raw/4600ff9733678c2d36e864384c4cc45188459369/hello.sc<br># Compiling project (Scala 3.2.1, JVM)<br># Compiled project (Scala 3.2.1, JVM)<br># Hello</pre><p>However, please note that Scala CLI does not provide any sandboxing at the time of writing this article, so make sure that you trust any remote sources you decide to run.</p><p>There are also <a href="https://scala-cli.virtuslab.org/docs/commands/basics#input-formats">other options</a>, like <a href="https://scala-cli.virtuslab.org/docs/guides/piping"><em>piping</em></a> sources or process substitution.</p><h4>IDE support through BSP</h4><p>Scala CLI has <a href="https://scala-cli.virtuslab.org/docs/guides/ide">official support for IDEs</a> through <a href="https://build-server-protocol.github.io/">BSP (Build Server Protocol)</a>, working with IDEA IntelliJ and Metals (with Visual Studio Code or other editors supported by Metals). This allows you to use the runner from the comfort of an IDE’s graphical interface instead of having to use the command line for everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Lu3YWbS3T8pSCYo-p2yYg.gif" /></figure><h3>The new runner’s advanced features</h3><p>Some of the features delivered by Scala CLI were deemed a bit advanced for the average target user of the <em>scala</em> runner but are nonetheless available behind the <em>--power</em> launcher option.</p><p>A good example of such a power user feature is the <em>package</em> sub-command. It enables packaging code in various formats, like <em>JARs</em>, docker containers or native images.</p><p>For example, the following command packages a project to a <em>GraalVM</em> native image:</p><pre>scala-cli package Main.scala -o hello --native-image<br>./hello<br># Hello</pre><p>When <a href="https://scala-cli.virtuslab.org/docs/reference/scala-command/#testing-scala-cli-as-scala">installing Scala CLI as <em>scala</em></a>, you have to pass the <em>--power</em> flag as the first argument to the app (before even a sub-command).</p><p>And so, to achieve the same result with <em>package</em>, producing a <em>GraalVM</em> native image requires the following:</p><pre>scala --power package Main.scala -o hello --native-image<br>./hello<br># Hello</pre><p>It’s also possible to enable <em>--power</em> globally, allowing the new runner to always expose all of its features.</p><pre>scala config power true</pre><h3>Testing the new scala runner early</h3><p>As mentioned earlier, even though <a href="https://github.com/scala/improvement-proposals/pull/46">SIP-46</a> is still in its implementation phase, you can try the new runner early. You can do so by using the <em>scala-experimental</em> installation.</p><p>Currently, only two installation methods are supported, with more to come later.</p><h4>coursier</h4><pre>cs setup<br>cs install scala-experimental</pre><h4>brew</h4><pre>brew install virtuslab/scala-experimental/scala</pre><p>Alternatively, you can also install Scala CLI as <em>scala-cli</em> with one of its <a href="https://scala-cli.virtuslab.org/install">official installation methods</a>.</p><p>Try it out and report any issues to the <a href="https://github.com/VirtusLab/scala-cli">Scala CLI repository</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b958245c2e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/virtuslab/exploring-scala-cli-the-new-scala-runner-4b958245c2e0">Exploring Scala CLI — the new scala runner</a> was originally published in <a href="https://medium.com/virtuslab">VirtusLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Opportunities and pitfalls of running a serverless messenger app with Git]]></title>
            <link>https://medium.com/virtuslab/opportunities-and-pitfalls-of-running-a-serverless-messenger-app-with-git-8829171f472b?source=rss-c9c17f3f5799------2</link>
            <guid isPermaLink="false">https://medium.com/p/8829171f472b</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Piotr Chabelski]]></dc:creator>
            <pubDate>Thu, 17 Jun 2021 10:58:05 GMT</pubDate>
            <atom:updated>2021-06-17T10:58:05.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmGCpuk6kTybldAY0hNTRA.png" /></figure><p>These days work is all about efficient collaboration. With many of us working from home or in dispersed teams, messaging is our most used means of communication. For us as developers, the challenge is to communicate around the code we write without too many disruptions. We also want to make our discussions as relevant and connected to the essence of our work as possible: the messaging has to connect to our code.</p><p>As a software engineer, as you create an app, that creation process sparks discussions about its code — and this is a good thing. But all of us coders have different preferences and practices, and we also find different tools and methods that help us make our work easier and more efficient. However, despite these differences, there are a couple of tools that almost all of us install on our machines as soon as we start coding, regardless of our area of expertise.</p><p>One of those tools is <em>Git</em>. If you want to maintain your sanity while coding as part of a team, you inevitably need some version control system — and <em>Git</em> is the one everyone uses these days.</p><p>To quote the header from <a href="https://git-scm.com/">git-scm.com</a>, “<em>Git</em> is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.” That sounds a lot like a database to me. Indeed, a database familiar to every developer in the world, and already installed on their machines.</p><p>So why not use it?</p><h3>CodeTale as a case study</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xzh0MAa6XZ5rp_BdvUgcqQ.png" /></figure><p><em>CodeTale</em> is a code documentation/messenger app currently being developed by my team at VirtusLab. Long story short, we feed the tool with archived pull requests from a code repository and make it possible to view and continue the discussions directly in the coders’ IDE of choice (which can currently be either IntelliJ or VS Code). Instead of a code comment like, “don’t remove this or everything will break,” you can just rely on a conversation that’s associated with that line. And because it doesn’t clutter the code, discussions here can be more detailed and in-depth, e.g., explaining the reason for the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85NL4Rlq9bqE7aIpT8WLcg.png" /></figure><p>Instead of using a more traditional solution, like a client-server or P2P architecture, we are running with <em>Git</em>. Our backend is written in Scala, so we decided to rely on an existing Java library for interacting with <em>Git</em>: <a href="https://www.eclipse.org/jgit/">JGit</a>.</p><p>All of the data relevant to <em>CodeTale</em> — including but not limited to discussions and notifications — is stored as JSON files in a <em>Git</em> repository. All the user needs to do while setting up is create a repository on GitHub, GitLab, or Bitbucket. (They can also use an existing code repository, although having a dedicated branch is advisable, assuming that anybody will ever care to read the commit log.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zIC7EOs8eRr12u7ZAA08Q.png" /></figure><p>As a result of using <em>Git</em>, we don’t have to deal with the bottlenecks of peer to peer networking, either. <em>Git</em> helps with maintaining data consistency (although we have to put some extra effort into avoiding conflicts), and network security is mostly covered by the <em>Git</em> repository providers we support (although we still have to implement authentication with each of them separately).</p><h3>The pitfalls</h3><p>Although the functionalities of <em>Git</em> lend to our architecture quite nicely, it obviously wasn’t designed with a messenger app in mind, which made my team have to hack around a few of its limitations. Let me walk you through a couple of those.</p><h3>To see anything, you have to pull</h3><p>As an example of how <em>CodeTale</em> works, when a developer logs in and starts diving into the code, they see a new comment in a source file they have to modify as part of their current ticket. They use <em>CodeTale</em> to reply in the same discussion, asking the comment’s author about some detail. When they do this, <em>CodeTale</em> makes a git push operation, and the new comment lands in the appropriate JSON file in the remote <em>Git</em> repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebLAivmAc_H1rxtouMHdew.png" /></figure><p>Everything is smooth up so far, but now we’d like the other user to become aware of the reply and read it. But <em>Git</em>’s main purpose is to store data; it doesn’t offer any sort of push notifications out of the box. If you want to see its newest contents you have to initiate a git pull operation — and this is where the slope becomes a tiny bit steeper.</p><p>You see, git pull is not a particularly light operation. Whenever you call it as you code, there’s a noticeable lag before it concludes. To understand this, let’s do a quick breakdown of what it does under the hood.</p><p>The git pull command is actually an alias for calling two smaller, atomic <em>Git</em> operations in quick succession: a git fetch followed by a git merge FETCH_HEAD. The git fetch command downloads the newest changes from the remote, while git merge FETCH_HEAD merges (integrates) these changes into the current branch. What makes git pull an expensive operation is the <em>fetching</em> component of it. To get the data we really need — for example, a reply in a discussion the user took part in — we need to download all the changes that took place since we performed our last pull. In some cases, this can be a big data set.</p><p>In other words, we can only afford to pull so often. In a situation like this, how can you make your app responsive? Well, you have to hack around a bit to know when it makes sense to pull. We still git pull the whole repository every few minutes to be up to date, but anything beyond that requires a good reason.</p><p>One workaround we rely on is fetching single files. It’s expensive to git pull the whole repository, but downloading just one file is cheap. But you can’t just pull a single file with <em>Git</em>, so we rely on the version control provider instead. GitHub (as well as other providers supported by <em>CodeTale</em>) has <a href="https://docs.github.com/en/rest/reference/repos#get-repository-content">a REST endpoint serving just what we need — the contents of a single file</a>.</p><p>This helps us cut our costs: By looking at a file containing notifications for the current user, we know we should pull the newest conversations that are intended for them. Therefore, there’s a high probability that these conversations are relevant, so they should be able to see them now, and not in the next pull cycle.</p><p>(A limit of this architecture is that you have to keep checking for notifications, whereas in a client-server architecture you can just rely on the server notifying the client. But this is the only way to operate at this time.)</p><h3>Resolving Git conflicts is nobody’s favourite pastime</h3><p>We all know the main issue about collaborating with <em>Git</em>: conflicts. Whenever you code in your own branch and change something in a file touched by a teammate, there’s a high risk one of you will run into a conflict. <em>Git</em> is smart enough to automatically merge only if you modify different source files. Otherwise you have to go through the tedious process of manually finding the best way to merge the changes together. Hopefully the code is well covered with tests to keep you sane.</p><p>The main issue is that performing a git pull in the case of a conflict automatically starts merging (as mentioned above, it calls git merge FETCH_HEAD under the hood). The immediate consequences when run from the command line look something like this:</p><pre>$ git merge FETCH_HEAD<br>Auto-merging build.sbt<br>CONFLICT (content): Merge conflict in build.sbt<br>Automatic merge failed; fix conflicts and then commit the result.</pre><p><em>Git</em> uses conflict resolution markers to indicate where the conflict is so you can resolve it, which in turn means that the contents of the file at fault — build.sbt, in this case — are now an utter mess:</p><pre>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:build.sbt<br>scalaVersion := “2.11.12”<br>=======<br>scalaVersion := “2.12.12”<br>&gt;&gt;&gt;&gt;&gt;&gt;&gt; main:build.sbt</pre><p>As <em>CodeTale</em> treats <em>Git</em> as its single source of truth when it comes to message data, letting the local files enter such a state is unacceptable. We don’t want our users to have to resolve a conflict created by an untimely reply in the same source file. In other words, we have to prevent conflicts from happening at all, no matter what it takes.</p><p>The solution we use in <em>CodeTale</em> is crude, but functional. Here are the steps for adding a comment:</p><ol><li>Perform a git pull.</li><li>Try to save the changes, add them to <em>Git</em>, commit, and push.</li><li>If all went well, that’s it. However, in case of a failure, assume that a conflict happened, then revert the changes by doing a git reset --hard from the remote.</li><li>In the failure case, increase the retry counter and go back to Step 1 if there are any retries remaining.</li></ol><p>As you can see, the key is the <em>Git</em> hard reset (git reset --hard). It overwrites any differences the local repository has with the origin, effectively getting rid of the source of the conflict. Then it prepares the data to attempt to save the changes from the beginning. This means that the operation may have to retry a couple of times before it succeeds (or even fails, if the traffic in a source file is peaking and there are no retries left), but we’re still getting rid of the main issue.</p><p>Of course, the user may still break their own comments repository by committing changes manually — outside of our app — but that’s beyond our control.</p><h3>Conclusion</h3><p>As it’s clear for all to see, relying on <em>Git</em> in <em>CodeTale</em>’s architecture doesn’t come without a few problems of its own, but we definitely saved ourselves a big chunk of overhead that’s usually associated with a more traditional architecture of a messenger application. The effort necessary to deal with conflicts and the high cost of pulling the newest comments rule it out as a solution for high traffic live-chatting, but that has never been <em>CodeTale</em>’s purpose. Instead, its niche is discussing the code inside a developer’s IDE, similar to the way a code review is done on a pull request — and for that, <em>Git</em> fits right in.</p><p>For more information on how <em>CodeTale</em> works on the client side of things — i.e., in your IDE — check out <a href="https://medium.com/virtuslab/creating-intellij-plugin-with-webview-3b27c3f87aea">Rafał Mucha’s article on the matter</a>. And to try <em>CodeTale</em> itself, stay tuned to <a href="https://virtuslab.com/blog/">VirtusLab’s future announcements</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8829171f472b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/virtuslab/opportunities-and-pitfalls-of-running-a-serverless-messenger-app-with-git-8829171f472b">Opportunities and pitfalls of running a serverless messenger app with Git</a> was originally published in <a href="https://medium.com/virtuslab">VirtusLab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>