<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Julia Community 🟣: ShalokShalom</title>
    <description>The latest articles on Julia Community 🟣 by ShalokShalom (@shalokshalom).</description>
    <link>https://forem.julialang.org/shalokshalom</link>
    <image>
      <url>https://forem.julialang.org/images/hNwBH1X-ojs-dtdZZGjWkKGIUkdpqO9pQFyN-6pmvhE/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L3VzZXIvcHJvZmls/ZV9pbWFnZS8xNDQ2/LzEzNWRhODc2LTZj/NWYtNDlhNS04YzU0/LTExMGYwZTcwOTFj/Ni5qcGVn</url>
      <title>Julia Community 🟣: ShalokShalom</title>
      <link>https://forem.julialang.org/shalokshalom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.julialang.org/feed/shalokshalom"/>
    <language>en</language>
    <item>
      <title>Rethinking how we talk about types</title>
      <dc:creator>ShalokShalom</dc:creator>
      <pubDate>Tue, 05 Sep 2023 10:04:06 +0000</pubDate>
      <link>https://forem.julialang.org/shalokshalom/rethinking-how-we-talk-about-types-ana</link>
      <guid>https://forem.julialang.org/shalokshalom/rethinking-how-we-talk-about-types-ana</guid>
      <description>&lt;p&gt;I once told my fiance about type systems. &lt;/p&gt;

&lt;p&gt;She is a math nerd who considered studying AI as a dedicated course.&lt;/p&gt;

&lt;p&gt;As someone with almost no programming background, she was curious about what that part of her study would look like. &lt;/p&gt;

&lt;p&gt;So, I told her all I thought I knew about programming languages. &lt;/p&gt;

&lt;p&gt;As we came to talk about type systems, I went into the different benefits of both systems. &lt;/p&gt;

&lt;p&gt;Boldly expecting, I had convinced her that type systems are important, that dynamic types are for lazy people, and that static typing is super necessary.&lt;/p&gt;

&lt;p&gt;She dared to point out the obvious. &lt;/p&gt;

&lt;p&gt;"Why wouldn't you use both?"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://forem.julialang.org/images/zd_9-bf4RDzX0ywgN9FO8kkHSW3ACxxJVy8E_0DAWUk/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzL2pw/NGVwNjBsbmRjM3Z0/eno1MHVpLmdpZg" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/zd_9-bf4RDzX0ywgN9FO8kkHSW3ACxxJVy8E_0DAWUk/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzL2pw/NGVwNjBsbmRjM3Z0/eno1MHVpLmdpZg" alt='Little girl shrugs the shoulders and asks "Why not both"' width="350" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I mumbled something together, not having an answer to it.&lt;/p&gt;

&lt;p&gt;Most people could say, you need your entire code to be typed, to benefit from it. And I can agree to a certain degree, although I think the answer is more nuanced than this. &lt;/p&gt;

&lt;p&gt;Not any architecture needs types. And spreading types around at anything that &lt;em&gt;could&lt;/em&gt; be typed, is just no different than the primitive action hero, that shoots with his Gatling gun at anything that moves like a lunatic.&lt;/p&gt;

&lt;p&gt;We call ourselves computer scientists. &lt;br&gt;
Artists. Craftsman. &lt;/p&gt;

&lt;p&gt;But, more often than not, we ignore science.&lt;br&gt;
I did ignore science. &lt;/p&gt;

&lt;p&gt;I did not even consider consulting it. &lt;br&gt;
Type systems are just a requirement. &lt;/p&gt;

&lt;p&gt;We have to deal with it. &lt;br&gt;
Thankfully, somebody destroyed my worldview. &lt;/p&gt;

&lt;p&gt;They have conducted the studies, that I didn't bother to look up. ¹&lt;/p&gt;

&lt;p&gt;And the results were, as scientific studies tend to do, surprising to me. &lt;/p&gt;

&lt;p&gt;Dynamic typing is not more prone to typing errors in production code.&lt;/p&gt;

&lt;p&gt;I add that types are still awesome. They help us to shape an architecture, and they help us with refactoring code. &lt;/p&gt;

&lt;p&gt;But they do not prevent type errors.&lt;/p&gt;

&lt;p&gt;So how did I fall for this fallacy? &lt;/p&gt;

&lt;p&gt;Since everybody around me claimed, that dynamic typing is lame.&lt;/p&gt;

&lt;p&gt;Classic mouth-to-mouth propaganda. &lt;/p&gt;

&lt;p&gt;So why I am writing this blog post?&lt;/p&gt;

&lt;p&gt;I come from a background of functional programming languages. &lt;/p&gt;

&lt;p&gt;Elm, as an example, is such a language, and it has inspired me in more than one way. &lt;/p&gt;

&lt;p&gt;One aspect, that has initially surprised me first, and then convinced me ultimately, is that they avoid using the term 'functional programming' at all. &lt;/p&gt;

&lt;p&gt;Stunning. Isn't that one of the main benefits of the language?&lt;/p&gt;

&lt;p&gt;Well, it turns out, only from my perspective. &lt;/p&gt;

&lt;p&gt;Classic case of organizational blindness. &lt;br&gt;
Within the small niche of functional programmers, sure.&lt;br&gt;
That would be a benefit. &lt;/p&gt;

&lt;p&gt;But the average programmer?&lt;br&gt;
Is turned off by it. &lt;/p&gt;

&lt;p&gt;And the average newbie?&lt;br&gt;
Doesn't even know, what it is. &lt;/p&gt;

&lt;p&gt;So the association with that term does not interact well with the people that we look out to get on board. &lt;/p&gt;

&lt;p&gt;I propose, that we do the same thing with our type system.&lt;/p&gt;

&lt;p&gt;Language does exist to express oneself - and to communicate.&lt;/p&gt;

&lt;p&gt;In this case, with a human.&lt;/p&gt;

&lt;p&gt;One of the core accusations that people bring up against common object oriented languages, is that they can't allow them to adapt smoothly to changing business requirements. &lt;/p&gt;

&lt;p&gt;Things change quickly, and the code that represents that isn't capable of doing so as well. &lt;/p&gt;

&lt;p&gt;Are we the same, just on a social level?&lt;br&gt;
Do we talk, without considering the refreshing context?&lt;/p&gt;

&lt;p&gt;I am talking about dynamic typing. &lt;/p&gt;

&lt;p&gt;Julia is not a typical dynamically typed language.&lt;br&gt;
It has some of the most advanced type systems that I know.&lt;/p&gt;

&lt;p&gt;And the current way of communication is underselling that. &lt;/p&gt;

&lt;p&gt;Not only does multiple dispatch characterize the nature of Julia, but also the architecture of Julia code is defined by it. &lt;/p&gt;

&lt;p&gt;From a certain level of complexity onward, multiple dispatch is the way we abstract code. &lt;/p&gt;

&lt;p&gt;Basically everything above simple functions. &lt;/p&gt;

&lt;p&gt;And since types come hand-in-hand with multiple dispatch, does that level of complexity never lack types.&lt;/p&gt;

&lt;p&gt;The design of Julia and its multiple dispatch system marries complexity and types in a seamless, almost magical way.&lt;/p&gt;

&lt;p&gt;The definition of types feels substantial and it comes with associated intent.&lt;/p&gt;

&lt;p&gt;So simple code will always be simple, and complex code will always be maintainable.&lt;/p&gt;

&lt;p&gt;The type inference helps with the transition, from one world to the other. It's almost seamless, and types become just like any other language feature. &lt;/p&gt;

&lt;p&gt;It is anyway my conviction, that we talk about types system of languages as if they were some sort of overarching characteristic because we failed to implement them properly.&lt;/p&gt;

&lt;p&gt;For decades.&lt;/p&gt;

&lt;p&gt;I think Julia is the first language, that did this right. &lt;br&gt;
Raku is close and does miss the global type inference. &lt;/p&gt;

&lt;p&gt;Still, looking at the Julia homepage, I see that Julia is only a dynamically typed language. &lt;/p&gt;

&lt;p&gt;I think that's selling the language under its value. &lt;br&gt;
It takes one of the most exciting aspects of the language and hides it behind a word, that is widely regarded as a absurdity.&lt;/p&gt;

&lt;p&gt;Why would we choose a word, that lets the people shut down in their head, once they hear it?&lt;/p&gt;

&lt;p&gt;A lot of people immediately shove it internally into the category of toy languages.&lt;/p&gt;

&lt;p&gt;Dynamic typing is not for serious developers. &lt;br&gt;
No matter how true that may be, or not:&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;It's a PR disaster. &lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
So what do we call it?&lt;/p&gt;

&lt;p&gt;Other languages, like Ruby and Python, call themselves now gradually typed. &lt;/p&gt;

&lt;p&gt;As we know, Julia has a far more advanced type system than that. Implemented from the ground up. Impacting performance.&lt;br&gt;
Providing very good inference. Used very widely in common code.&lt;/p&gt;

&lt;p&gt;So the term 'gradually typed' is misleading as well. &lt;/p&gt;

&lt;p&gt;We look for a descriptive name, one that is reflective of the properties of our system, and one that is associated with positive affirmations. &lt;/p&gt;

&lt;p&gt;The reason why Elm stopped talking about functional programming was because it hid the essential idea that Elm embodied. &lt;/p&gt;

&lt;p&gt;And instead of changing the perception of dynamic typing (much fun with that), I would just suggest talking about it in some fashion, that truthfully expresses the core identity. &lt;/p&gt;

&lt;p&gt;I would suggest rethinking, how we talk about features, and take Elm and others as an example.&lt;/p&gt;

&lt;p&gt;Let's talk about our awesome type system.&lt;/p&gt;

&lt;p&gt;Let's hear your suggestions ;)&lt;/p&gt;

&lt;p&gt;¹ &lt;a href="https://www.infoq.com/presentations/dynamic-static-typing/"&gt;https://www.infoq.com/presentations/dynamic-static-typing/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>launch</category>
      <category>typing</category>
    </item>
  </channel>
</rss>
