[HN Gopher] Uiua - A stack-based array programming language
       ___________________________________________________________________
        
       Uiua - A stack-based array programming language
        
       Author : ksp-atlas
       Score  : 49 points
       Date   : 2025-01-03 23:11 UTC (23 hours ago)
        
 (HTM) web link (www.uiua.org)
 (TXT) w3m dump (www.uiua.org)
        
       | junon wrote:
       | Love the design. Though it begs the question, is this a toy
       | (which is totally valid and okay) or is there something
       | practically useful about this over more "conventional" code? What
       | are the use cases, other than code golf situations?
        
         | MrEldritch wrote:
         | I primarily use it as a toy, but it's also come in genuinely
         | handy for me as a scripting language and calculator (but a
         | calculator that also works with strings). The terseness isn't
         | really a code-golf thing; once you're familiar with the glyphs
         | (which are really a fairly well-chosen set of powerful
         | algorithmic primitives) it makes it more straightforward than
         | any conventional language I've worked with to just Implement An
         | Algorithm, with no boilerplate or fluff. Arrays with array
         | broadcasting, combined with Uiua's stack combinators, are just
         | a really flexible and general tool for expressing how data
         | flows through a program, and the glyphs make it possible to
         | (once you're used to them) translate those flows into code very
         | naturally and smoothly.
         | 
         | It's difficult for me to express just how fun Uiua can be to
         | use. It's rather like one of those Zachtronics games - both in
         | that figuring out how to fit your task into the array-
         | programming model can be a bit of a puzzle sometimes, and in
         | that once you've done that it's an extremely quick and non-
         | frustrating process to make it work. The pure essence of what
         | makes programming enjoyable, for better and for worse. There's
         | also just a lot less plumbing and documentation-reading
         | involved; the flexibility and terseness of the glyphs means
         | that a lot of things you might have to call out to a standard
         | library for in other languages you can Just Write because the
         | entire implementation could easily be of length comparable to
         | the name. (There's also a lot less plumbing and documentation-
         | reading involved because there's only, like, four Uiua
         | libraries anyway. Less to plumb together. Like I said, what
         | makes programming enjoyable, for better and for worse.)
         | 
         | (Why Uiua and not, like, APL? I actually find APL enormously
         | more difficult to read, due to the syntax - APL glyphs have two
         | context-dependent readings, depending on whether they're being
         | used as an binary infix or a unary prefix, and figuring out how
         | the parse tree breaks down when squinting at a sea of glyphs is
         | painful. It's like a whole language of garden path sentences.
         | Uiua glyphs have fixed arity and always mean exactly one thing;
         | so there's twice as many glyphs, but parsing by sight-reading
         | is way more straightforward.)
        
       | Archit3ch wrote:
       | > stack-based array language
       | 
       | OpenGL did it first. :)
        
       | ErikSchierboom wrote:
       | I love Uiua mostly because it's a very different, but incredibly
       | programming model (if you don't know APL/J/BQN or another array
       | language). It's also quite a polished language IMHO, with clear
       | design choices, great docs and a lovely online editor at
       | https://www.uiua.org/pad
       | 
       | Together with some other people, I've built a Uiua track on
       | Exercism: https://exercism.org/tracks/uiua/ It has 90+ exercises
       | which makes for a lot of fun content.
        
       ___________________________________________________________________
       (page generated 2025-01-04 23:02 UTC)