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 ← ∵…
Uiua: A minimal stack-based, array-based language
91–100 of 107 posts
Re: Uiua: A minimal stack-based, array-based language
#92This 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.
That glyph panel is pretty neat because it also serves as a language reference and you can ctrl+click into the documentation pages.
Re: Uiua: A minimal stack-based, array-based language
#93Hmm, 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.
(Also, this language supports the "simple words" approach but autoformats to the glyphs for final "readability".)
Re: Uiua: A minimal stack-based, array-based language
#94I 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 ← ∵…
That's some dedication! You can indeed get the maximum item in an array with `/↥`. Here is my fizzbuzz solution: ( https://uiua.org/pad?src=fizzbuzz%20%E2%86%90%20%28%0A%20%20... )
Re: Uiua: A minimal stack-based, array-based language
#95Earlier quoted context omitted.
I'm always wondering what kind of people prefer this syntax to more classical syntax
Hot take: people who don't touch type.
Emoji is not just for tap-typing/swipe-typing mobile users. (Also, I think it is really handy as developer to learn your local emoji IME: including emoji in test data is really handy for checking unicode safety in your applications and regularly using any IME at all while in your applications helps you test some accessibility issues that might affect users that must use an IME for there language such as CJK languages and Braille writers and more. English software developers get to overlook a lot of how languages around the world work and can easily break accessibility needs with bad assumptions and it is great that emoji are a grand field leveling tool to bring those experiences to us English speaking developers in a way we can easily "read"/"write".)
Re: Uiua: A minimal stack-based, array-based language
#96Earlier quoted context omitted.
That's a good start! I'm not exactly great with array langauges myself, but I think it's simpler to fill an array with □"Fizz", one with □"Buzz", one with □"FizzBuzz", then create another indexing array and use pick: ⍉[∵(□$"_"+1)⇡100 [⍥.99□"Fizz"] [⍥.99□"Buzz"] [⍥.99□"FizzBuzz"]] +∵(×2=0◿5+1)⇡100 ∵(=0◿3+1)⇡100 ≡⊡ ⍉ There are probably a few more simplifications experienced array programmers can apply.
https://code.jsoftware.com/wiki/NYCJUG/FizzBuzz gives a solution in J of: FB=:((0 i.~15 3 5|]){::'FizzBuzz';'Fizz';'Buzz';":)"0 FB i.100 I unfortunately don't know enough J or Uiua to be able to translate that Perhaps someone else can step in!
Re: Uiua: A minimal stack-based, array-based language
#97What an interesting and pleasing little language! I like the use of non-ASCII Unicode glyphs and symbols for some functions/commands. It makes me wonder why (since we now have rich graphical user interfaces as opposed to monochrome ASCII command-line dumb terminals that were prevalent in the mid-early history of computers) more languages don't support those. On a related note, I think it would be interesting to resea…
Of course, as such things go, APL's appeal fell as the mainframe world settled on EBCDIC or ASCII (depending on if you were an IBM shop or not) as a "universal" character encoding and also as saving punch card space was less of a problem as other storage systems became more prominent.
Uiua seems a fun "emoji-native" take on "your grandmother's" APL. (BQN is generally cited as among the first "Unicode-native" in the APL family. Beyond the stack language changes as neither APL nor BQN are stack languages, Uiua swaps some niftier emoji-based choices for operators that feel fresher and less "ancient math hieroglyphics" and little bit more "texting your modern friend who in this case is a computer" hieroglyphics.)
Re: Uiua: A minimal stack-based, array-based language
#98Oh hey, I made this. Cool to see it at the top of HN!
Re: Uiua: A minimal stack-based, array-based language
#99I'm a big fan of stack-based languages conceptually, but they always seem to fall flat when it comes to basic reading comprehension. APL has the same issue, as does J. Factor did improve on this a little bit by eschewing the symbol fetish but it was still very difficult to rapidly scan the code for functionality. I'm not convinced the approach shown here is a good pairing with the human brain.
I'm always wondering what kind of people prefer this syntax to more classical syntax
Lisp beats APL by a few years though, so there it really depends on whether you value lisp's seniority or APL's connection to math notation traditions more when judging how "classical" a language syntax is.
Re: Uiua: A minimal stack-based, array-based language
#100What an interesting and pleasing little language! I like the use of non-ASCII Unicode glyphs and symbols for some functions/commands. It makes me wonder why (since we now have rich graphical user interfaces as opposed to monochrome ASCII command-line dumb terminals that were prevalent in the mid-early history of computers) more languages don't support those. On a related note, I think it would be interesting to resea…
Speaking of ancient hieroglyphs, there is a long lineage of symbol-based languages and it is interesting to follow their ebb and flow over time: APL is one of the oldest languages, existing alongside contemporaries like COBOL. In the ancient mainframe era when everything was up for grabs and few things felt set in stone (including character encodings and the format of punch cards, and the sorts of keyboards used to p…
It feels like there really is something special about how the combination of all the little things make it more than the sum of its parts. On a language level therews a stack + absence of operator overloading + simple array model to make it easier to reason about. On an interface level there is word-based input with autoformatting, and a zero-install web-based interface with reminder tooltips and clickable links.
The examples are a lot easier for me to read through than with other array languages I've tried. And I've seriously tried both Dyalog and BQN! I think they're brilliant, but something just refuses to click in my brain for them.