Goal is a programming language created in 2022 by Yon Fernández de Retana.
#1702on PLDB | 2Years Old |
git clone https://codeberg.org/anaseto/goal
Goal is a K-like language that brings in ideas from Perl and BQN and is written in Go.
/ Handle command-line arguments: script name + optional file.
(2<#ARGS)and:error"USAGE: goal wordstats.goal [file]"
/ Read STDIN or filename given by last argument; lowercase everything.
src:_ 'read?[1=#ARGS;STDIN;*|ARGS]
/ Get all words (Unicode letters + dashes).
words:rx/[\p{L}-]+/[src;-1]
/ Print number of words; number of distinct words; five most frequent words.
say(#words;#dw:?words;5@!>dw!=%words)
Feature | Supported | Example | Token |
---|---|---|---|
Regular Expression Syntax Sugar | ✓ |