NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Uiua – A stack-based array programming language (uiua.org)
ErikSchierboom 4 days ago [-]
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.

snthpy 3 days ago [-]
This looks really nice! I've taken a few runs at APL, J, K, BQN, ... and this looks the nicest so far.

I love the unicode glyphs and the color coding which makes it much more readable. I might take a look at the Exercism track.

I wonder if this might make for a nice embedded array DSL in order languages? In particular could this compile into numpy or Jax expressions?

junon 4 days ago [-]
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 4 days ago [-]
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 4 days ago [-]
> stack-based array language

OpenGL did it first. :)

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 19:48:03 GMT+0000 (UTC) with Wasmer Edge.