6 comments

  • ethanlipson5 hours ago
    Futhark is really such a great idea. I&#x27;m not convinced that dependent types are worth the cognitive overhead in general, but it&#x27;s definitely worth it to include the length as part of the type information for dynamic arrays, e.g.:<p><pre><code> concat(Vec&lt;T, n&gt;, Vec&lt;T, m&gt;) -&gt; Vec&lt;T, n+m&gt; matmul(Mat&lt;T, n, m&gt;, Mat&lt;T, m, l&gt;) -&gt; Mat&lt;T, n, l&gt; head(Vec&lt;T, n+1&gt;) -&gt; (T, Vec&lt;T, n&gt;) </code></pre> This would have saved me so much headache debugging CUDA kernels and numpy!! I wish it were a first-class feature in those frameworks, and even general-purpose languages, but alas.
    • itishappy1 hour ago
      Here they are in Futhark:<p><pre><code> val concat [n] [m] &#x27;t : (xs: [n]t) -&gt; (ys: [m]t) -&gt; *[n + m]t val matmul [n] [m] [l] &#x27;t : (xs: [n][m]t) -&gt; (ys: [m][l]t) -&gt; *[n][l]t val head [n] &#x27;t : (x: [n]t) -&gt; t </code></pre> And here&#x27;s the pathological case (length cannot be determined at compile time):<p><pre><code> val filter [n] &#x27;a : (p: a -&gt; bool) -&gt; (as: [n]a) -&gt; *[]a </code></pre> Other pathological cases include conditionals and loops.
    • VorpalWay4 hours ago
      You can do this with templates in C++ and generics in Rust I&#x27;m pretty sure. I think the Eigen C++ library supports this. (I have yet to do a linear algebra heavy Rust project, so I can&#x27;t speak to the options that exist there.)
      • ethanlipson2 hours ago
        I&#x27;m talking about cases where the array size is not known at compile time. For example, say the user passes in a list of numbers as command line arguments. Then we have<p><pre><code> argv: Vec&lt;String, argc&gt; </code></pre> If I want to map these to ints, then I&#x27;d like a compile-time guarantee that the resulting array<p><pre><code> nums: Vec&lt;Int, argc&gt; </code></pre> is the same length as argv. Lean and Idris can do this, but AFAIK no commonly used languages can. But unlike general dependent types, these are not hard to wrap one&#x27;s head around and would save a lot of frustration, in my experience.
      • otabdeveloper44 hours ago
        Yeah, C++ arrays are literally that.
        • alpinisme3 hours ago
          Arrays are not dynamically sized though (handling runtime sizes) and don’t have efficient append&#x2F;concat. The point of the dependent types is that you can have the type system track that concat creates an M+N length vector, sort preserves length (and adds a sorted guarantee that slice preserves), etc. Sure you can do a lot with templates, but that’s advanced templates not just “C++ arrays” in a throwaway “literally that” way.
  • Ferret74464 hours ago
    It would be nice to not name your language after another language. (Yes I know it&#x27;s a script, that doesn&#x27;t change my point). I came here expecting something else.
    • echoangle4 hours ago
      TIL:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Runes#Runic_alphabets" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Runes#Runic_alphabets</a>
    • hmry1 hour ago
      Yeah, when naming your language, it&#x27;s important to keep mind the expectations of people seeing headlines about articles about your language on blog aggregation sites :^)<p>Now I&#x27;m thinking about &quot;Smalltalk by Example&quot; and &quot;Slang by Example&quot;
    • jgrowl3 hours ago
      Jackson Crawford&#x27;s youtube channel is very helpful academic source.<p>For those that don&#x27;t know, Futhark is comes from the first 6 letters of the runic alphabet (F, U, Þ, A, R, K)<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;@JacksonCrawford" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;@JacksonCrawford</a>
    • finaard2 hours ago
      Same here, I was very confused for a bit.
  • antran221 hour ago
    Was expecting to see some examples of how to read runes, but I am nonetheless equally satisfied.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elder_Futhark" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elder_Futhark</a>
    • CapricornNoble51 minutes ago
      Same. Thought I had a copy of Uthark [1][2] on my shelf too but alas I seem to have only retained Svartkonst [3] during the tragic downsizing of my library.<p>[1] <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;karlsson-thomas-uthark-nightside-of-the-runes-2002" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;karlsson-thomas-uthark-nightside...</a><p>[2] <a href="https:&#x2F;&#x2F;www.84cxrarebooks.com&#x2F;pages&#x2F;books&#x2F;090763&#x2F;t-ketola-thomas-karlsson&#x2F;uthark-nightside-of-the-runes" rel="nofollow">https:&#x2F;&#x2F;www.84cxrarebooks.com&#x2F;pages&#x2F;books&#x2F;090763&#x2F;t-ketola-th...</a><p>[3] <a href="https:&#x2F;&#x2F;www.miskatonicbooks.com&#x2F;product&#x2F;thursakyngi-iv-svartkonst-by-ekotu-hardcover-edition-import&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.miskatonicbooks.com&#x2F;product&#x2F;thursakyngi-iv-svart...</a>
  • fulafel3 hours ago
    Futhark is a glimmer of light in the wasteland of C&#x2F;C++ styled low level GPU languages.
  • rowanG0775 hours ago
    Futhark is pretty great! And I have to say that the maintainer is insanely quick. It has happened on more than one occasion that I reported a bug and it&#x27;s solved within the day. I have been using Futhark in prod for two years now and never had serious problems.
    • keyle4 hours ago
      Interesting, what do use it for if you can share?
      • rowanG0773 hours ago
        Optimization algorithms. The build in automatic differentiation is great!.
    • Reefersleep4 hours ago
      What is your use case?
  • guessmyname3 hours ago
    Couldn’t have chosen a more difficult (and ambiguous) name to pronounce, could you? It almost sounds like a curse that I often hear people say out in the bad streets of New York City.
    • antran221 hour ago
      Elder [0] and Younger [1] Futhark (or Fuþark) are the name of two runic writing systems used by Germanic and Scandinavian Vikings. The name Futhark is a combination of the first 6 runes &#x2F;f&#x2F;, &#x2F;u&#x2F;, &#x2F;ð&#x2F;, &#x2F;ɑ&#x2F;, &#x2F;r&#x2F;, and &#x2F;k&#x2F;. Similar to how you get the name &quot;alphabet&quot; from the first two letters of Greek&#x27;s writing system.<p>[0]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elder_Futhark" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elder_Futhark</a><p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Younger_Futhark" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Younger_Futhark</a>