So I thought I'd try out my #awk skills and do #adventofcode day1 in that at well, and it turned out surprisingly succinct and nice ๐ I really like this.
@RL_Dane @benjaminhollon
https://gist.github.com/sotolf2/a7cbc76fdf36afeeedb1233a858737ca
@RL_Dane @benjaminhollon
https://gist.github.com/sotolf2/a7cbc76fdf36afeeedb1233a858737ca
R. L. Dane :debian: :openbsd:
in reply to Sotolf • • •It's funny how familiar and yet how different awk feels coming from shell and Perl.
The fact that it just instantiates and array out if thin air is kinda scary ^__^
Of course, Perl does this if you don't use `use strict;', but I consider that barbaric. ๐
Not sure what asort() does. I think you've mentioned this before. It's not in standard awk, and the gawk manual was pretty terse.
Sotolf
in reply to R. L. Dane :debian: :openbsd: • • •Yeah that, and the stringly typed thing is a bit scary, even though it kind of makes sense for what it does.
Yeah, it's a gawk extension, and it's basically array sort, and not standard awk ๐
R. L. Dane :debian: :openbsd:
in reply to Sotolf • • •Not sure about the begin/end thing, but you can structure it any way you want if you implement your own read loop.
> I feel too stupid for perl ๐
Aw, give yourself some credit. Perl isn't *hard*, just different
> strongly typed
IIRC, there's really only a couple types, scalars and arrays
> array sort
That's what I thought it was. gawk manpage was so terse ๐
Sotolf
in reply to R. L. Dane :debian: :openbsd: • • •Yeah the man pages are a bit very terse ๐ I found it in the awk book ๐
The hardest thing about perl is that it lets me be too clever, and it's hard to keep from doing clever things in it, because it is quite cool ๐ and then I suffer for it afterwards ๐
R. L. Dane :debian: :openbsd:
in reply to Sotolf • • •Sotolf
in reply to R. L. Dane :debian: :openbsd: • • •R. L. Dane :debian: :openbsd:
in reply to Sotolf • • •I say that with respect and fear. X'-D
If you like Forth, you gotta check out #uxn / #uxntal, if you haven't done so already.
Just imagine a vm assembler based on the ideas and values of Forth, implemented in very simple (~2k SLOC) C & SDL
Sotolf
in reply to R. L. Dane :debian: :openbsd: • • •https://merveilles.town/@neauoire/109440241763796691
Devine Lu Linvega (@neauoire@merveilles.town)
MerveillesDevine Lu Linvega
in reply to Sotolf • • •There's a bunch of folks doing AoC in uxntal. That's too hard for me tho.
R. L. Dane :debian: :openbsd:
in reply to Devine Lu Linvega • • •What's AoC?