Live data from Hacker News

Uiua: A minimal stack-based, array-based language

uiua.org

61–70 of 107 posts

Re: Uiua: A minimal stack-based, array-based language

#61

This is actually pretty neat. But I'm having a hard time understanding how to ergonomically write with glyphs. What's the intended workflow. Remembering a bunch of shortcuts to get ⌕ instead of just typing `find` seems harder to read and write. Edit: I think I understand from the language tour. You're supposed to write the ascii names like `find` then running the program converts built-ins to glyphs.

Other way would be to have a dedicated keyboard

Re: Uiua: A minimal stack-based, array-based language

#62

This is exciting because it looks like BQN, but BQN had some unfortunate syntax in a few places. Edit: I'll be specific. Stranding required a special character in BQN '‿', but appears to be just '_' in Uiua.

Hmm, '‿' looks much nicer to me than '_' ... /s

Re: Uiua: A minimal stack-based, array-based language

#63
post #4

My recent exposure to array programming languages came via a podcast called The Array Cast[1] Not affiliated, just recommending. The regular co-hosts appear to each be experienced with various array languages such as J, APL, etc. They don't get deeply technical, but it's a nice introduction, especially on explaining the appeal. A recent episode had Rob Pike (UTF-8, Go, etc.) on to talk about his array based calculato…

Our upcoming episode is an interview with Kai Schmidt, the creator of Uiua. It will be published this weekend. It turns out that Kai is a fan of the ArrayCast and it was his introduction into array programming.

Ah, awesome, really looking forward to it!

Re: Uiua: A minimal stack-based, array-based language

#64

This is actually pretty neat. But I'm having a hard time understanding how to ergonomically write with glyphs. What's the intended workflow. Remembering a bunch of shortcuts to get ⌕ instead of just typing `find` seems harder to read and write. Edit: I think I understand from the language tour. You're supposed to write the ascii names like `find` then running the program converts built-ins to glyphs.

It's basically "the auto-formatter takes care of it, and integrated highlighting makes it easy to remember what each glyph does until it's memorized". Imagine if gofmt or prettier actually replaced built-in function names.

Re: Uiua: A minimal stack-based, array-based language

#65

Hmm, so ⌊×10[⍥^999] yields a list of numbers, but ⌊×10[⍥^1000] yields an audio clip. That's somewhat unexpected. The ^ above stands for the 3-dot cube dice glyph, which gets eaten by the HN backend, so it's ^ instead.

This is shows that you cannot make a language in the vacuum. There are other places and services that you need to integrate with and the use of these glyhps is making it harder.

I think using simple words: find, reverse, etc. is probably a better option.

Re: Uiua: A minimal stack-based, array-based language

#66
post #22
post #3

Earlier quoted context omitted.

BQN is also easier to get started. It's the only array language I ever tried because of that. Uiua seems to be inspired by BQN but it's also a stack-based language (BQN isn't).

It seems heavily inspired by BQN, even the style of the web page.

Correct:

> The main language that inspired Uiua is BQN. While I had heard about APL before, BQN was my first real exposure to the power of the array paradigm. I think the language is an astounding feat of engineering. Marshall is both a genius and a great communicator.

https://www.uiua.org/docs/design

Also, a week ago there were only two contributors to the project: 1000+ by kaikalii, and this single commit by Marshall:

https://github.com/uiua-lang/uiua/pull/1/files

Re: Uiua: A minimal stack-based, array-based language

#67
post #26

Earlier quoted context omitted.

If (and I grant, this is a big if ) you are used to them, the symbolic nature of APLs allows to discuss code fragments (and even entire* algorithms) using inline elements instead of as separate interspersed blocks. The difference between scanning algol-style and apl-style code is a little like the difference between scanning history books and maths books: on one hand, one must scan the latter much more slowly (symbol…

APL people often point to the definition of "average" as evidence for its economy of expression: +/÷≢ They make the argument "the word 'average' has more symbols than its definition, so why not just use the definition inline as a tacit function?" There's some elegant beauty in this that I'm sympathetic to. However, I think it's fundamentally flawed for one big reason, which in my opinion is the core of the unreadabil…

> Humans think in words, not letters

In some languages, e.g. Chinese, each symbol means more than a single letter would in a latin alphabet. These languages to me are just a bit more like that.

Re: Uiua: A minimal stack-based, array-based language

#68

This does look quite nice. I always felt that the operator precedence / association rules in other stack languages were by far the most difficult thing to get used to, not the nonstandard symbols. This appears more inviting in that regard. I do have to question the choice of right-to-left (array language) evaluation order. I've personally always preferred left-to-right (stack language) evaluation. I feel like right-t…

See https://lobste.rs/s/qygnov/uiua_concatenative_array_programm...

Re: Uiua: A minimal stack-based, array-based language

#69
I had no experience with array languages and decided to give it a try. It took me 4 hours to write FizzBuzz using only Uiua docs for help:

  # create an array of number 1-100
  ns ← ∵(+1)⇡[100]
  # make a copy of it in a string form "1"-"100"
  nsStr ← ∵(□$"_") ns
  # every i % 3 == 0 is replaced with "Fizz", everything else is ""
  f ← ∵(□▽∶ "Fizz" =0◿3) ns
  # every i % 5 == 0 is replaced with "Buzz", everything else is ""
  b ← ∵(□▽∶ "Buzz" =0◿5) ns
  # every i % 3 == 0 && i % 5 == 0 is replaced with  "FizzBuzz", everything else is ""
  fb ← ∵(□▽∶ "FizzBuzz" × =0◿5∶ =0◿3 .) ns

  # combine them into a 2D array
  gs ← [nsStr f b fb]

  # run a columnwise map
  # |  pick the greatest string of each column
  # |  |
  ⍉ ≡ (⊡⊢⇌⌂.) ⍉gs
Inability to use maximum function with arrays of different sizes is a bummer, I had to workaround it with grade and pick.

Re: Uiua: A minimal stack-based, array-based language

#70

The usage of symbolism is neat, but it wasn't intuitive that I had to evaluate it from right to left as opposed to left to right.

If we're using this comments section as an informal feedback page, +1 to that. My mental model of stack-based languages are imperative, and it's strange when lists of actions read in reverse order. I may as well write a preprocessor that switches terms from RTL to LTR, as well as stick to spelling out the full names of operators, and see how far I get before I see why the original author made these decisions.
Post reply on HN