Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
just have the unicode consortium provide a lookup table of every word in every language and then pattern match on that

easy peasy

Adbot
ADBOT LOVES YOU

mystes
May 31, 2006

Kazinsal posted:

it won't understand word counts on logographic alphabets that don't use word separators, but then again, neither do humans

Cybernetic Vermin
Apr 18, 2005

any level of committal to the "unix philosophy" would have had one of the first programs be one that takes a dfa, some simple declarative actions one can take on state entry, and runs it on its input. forming the actual implementation of stuff like wc, cut and even grep.

the real unix philosophy is writing a new incompatible dumb program for every dumb thing though.

Nomnom Cookie
Aug 30, 2009



animist posted:

it's a young field with a bunch of money being pumped into it so that a lot of computer touchers can invent trendy new ways to do the exact same things, but worse

give it time imo, either the field will mature or civilization will end, problem solved either way

I don’t see how it’s going to mature if nobody ever evaluates their design in hindsight. sure, it happens sometimes, or privately, but in general knowledge formation about what works and what doesn’t is more evolutionary than intentional

Nomnom Cookie
Aug 30, 2009



Cybernetic Vermin posted:

any level of committal to the "unix philosophy" would have had one of the first programs be one that takes a dfa, some simple declarative actions one can take on state entry, and runs it on its input. forming the actual implementation of stuff like wc, cut and even grep.

the real unix philosophy is writing a new incompatible dumb program for every dumb thing though.

is this the thread that I bitched about generic declarative frameworks last night, or was that a different one. anyway thanks for being an example of what happens when a programmer marinates in yak shaving for so long that they start thinking yak shaving is the point

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Athas posted:

I've deigned to measure the performance of my program suitably for presentation here.

Who writes like that? The entire website reads a bit like a parody.

Also, everybody knows a good wc has to run on the GPU.

probably :thejoke:, but for those who missed it:

https://futhark-lang.org/blog/2019-10-25-beating-c-with-futhark-on-gpu.html

Notorious b.s.d.
Jan 25, 2003

by Reene

Internet Janitor posted:

the current context is lisp, the language whose strongest exponents like to believe sprang fully-formed from the head of john mccarthy and has always had every feature ascribable to any programming language. a language which, for some, will always be a priori superior for all tasks irrespective of any measure of its fitness

like many tasks, it's perfectly adequate to the task of writing a decent 'wc'

there's just no particular reason to favor it for this task

Notorious b.s.d.
Jan 25, 2003

by Reene

animist posted:

lol no static types

common lisp has extensive static typechecking, just nobody ever uses it, aside from like, performance optimization on tight loops.

opt-in type systems are not terribly useful

Notorious b.s.d.
Jan 25, 2003

by Reene

TheFluff posted:

does U+2028 LINE SEPARATOR count as a newline?
for that matter, does U+0085 NEXT LINE? that one is even in ascii

posix defines these things for itself, so, no, neither one counts

Kazinsal posted:

for the most part it'll handle word count of non-english languages using latin-ish alphabets just fine. it won't understand word counts on logographic alphabets that don't use word separators, but then again, neither does coreutils wc

coreutils wc has full unicode support and supports logographic alphabets, to the extent that it understands multibyte characters

Kazinsal posted:

it could do that if we threw in full utf8 handling and started considering what constitutes a character instead of counting words in our command line word counting program

gnu coreutils wc does exactly this

bsd and macos wc don't, but, well, those are bad unix systems anyway

Soricidus posted:

there isn’t even a single universally accepted way to count words in english. the idea that you can solve the problem in the general case with a trivial program is laughable

no one pretended to solve it in the general case. word counting is an approximation at best.

the main use of wc is to get a line count, so even the name of the utility is dumb

Zlodo
Nov 25, 2006
it seems like the purpose of wc is kinda lovely

CPColin
Sep 9, 2003

Big ol' smile.
I tend to use the WC for processing my core dumps

Nomnom Cookie
Aug 30, 2009



Zlodo posted:

it seems like the purpose of wc is kinda lovely

yes wc is a computer program

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

CPColin posted:

I tend to use the WC for processing my core dumps

Cybernetic Vermin
Apr 18, 2005

Nomnom Cookie posted:

is this the thread that I bitched about generic declarative frameworks last night, or was that a different one. anyway thanks for being an example of what happens when a programmer marinates in yak shaving for so long that they start thinking yak shaving is the point

not this thread and not going to bother going through your post history to figure out what you're passive-aggressively accusing me of

Nomnom Cookie
Aug 30, 2009



Cybernetic Vermin posted:

not this thread and not going to bother going through your post history to figure out what you're passive-aggressively accusing me of

being an example of what happens when a programmer marinates in yak shaving for so long that they start thinking yak shaving is the point

Cybernetic Vermin
Apr 18, 2005

Nomnom Cookie posted:

being an example of what happens when a programmer marinates in yak shaving for so long that they start thinking yak shaving is the point

i have never yak-shaved in my life though

Nomnom Cookie
Aug 30, 2009



Cybernetic Vermin posted:

i have never yak-shaved in my life though

lol

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Internet Janitor posted:

just have the unicode consortium provide a lookup table of every word in every language and then pattern match on that

easy peasy

that's basically what icu actually does for word breaking. it has rules, lookup tables for exceptions to those rules, and then a chinese dictionary.

Cybernetic Vermin
Apr 18, 2005

Plorkyeran posted:

that's basically what icu actually does for word breaking. it has rules, lookup tables for exceptions to those rules, and then a chinese dictionary.

automatic tools i don't think are expected to go all that way though, unicode defines "simple boundaries" for e.g. regexes: http://unicode.org/reports/tr18/#Simple_Word_Boundaries

iirc that's what java regexes uses

Bloody
Mar 3, 2013

Nomnom Cookie posted:

I agree that cat *.butt | wc -l is cool but also cat butt is not a silver bullet.

it’s been almost 50 years. where’s the history of Unix philosophy, its successes, its failures. why is programming so relentlessly forward looking

https://www.aosabook.org/en/index.html is the only thing i have seen that is reflective

also has some great reads in it, i recommend it unironically

Nomnom Cookie
Aug 30, 2009



Bloody posted:

https://www.aosabook.org/en/index.html is the only thing i have seen that is reflective

also has some great reads in it, i recommend it unironically

tyvm that's exactly what I was looking for

redleader
Aug 18, 2005

Engage according to operational parameters

Notorious b.s.d. posted:

bad unix systems

but you repeat yourself

redleader
Aug 18, 2005

Engage according to operational parameters

Bloody posted:

https://www.aosabook.org/en/index.html is the only thing i have seen that is reflective

also has some great reads in it, i recommend it unironically

is there anything like this for like SOAs/microservices? postmortems of why a system was designed in some way, what worked and what didn't, etc?

FamDav
Mar 29, 2008

redleader posted:

is there anything like this for like SOAs/microservices? postmortems of why a system was designed in some way, what worked and what didn't, etc?

it's your company's coe aggregator op

animist
Aug 28, 2018
there's academic papers which can be informative, esp. if they're diagnostics of real systems

like this is a neat article although it's partly sales copy

Soricidus
Oct 21, 2010
freedom-hating statist shill

redleader posted:

but you repeat yourself

shaggar alt spotted

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
c++ https://travisdowns.github.io/blog/2019/11/19/toupper.html

pseudorandom name
May 6, 2007

macros

Soricidus
Oct 21, 2010
freedom-hating statist shill
cpp is so bad. lol at still using #include and #define well into the 21st century

The_Franz
Aug 8, 2003

Soricidus posted:

cpp is so bad. lol at still using #include and #define well into the 21st century

modules are finally a thing in c++20, but it's gonna be a while before the tooling catches up and makes them usable

animist
Aug 28, 2018
I thought there was a hullabaloo about those being terrible

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
they’re differently terrible than #include and #define and such

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
people sure are Mad about objc_direct, huh.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Plorkyeran posted:

people sure are Mad about objc_direct, huh.

well yea it means cracking apps by swizzling -isRegistered to always return YES is harder

Xarn
Jun 26, 2015

eschaton posted:

they’re differently terrible than #include and #define and such

suffix
Jul 27, 2013

Wheeee!
this was a fun read in an eldritch horror kind of way

https://www.jsoftware.com/papers/50/

quote:

Ken was showing some slides — and one of his slides had something on it that I was later to learn was an APL one-liner. And he tossed this off as an example of the expressiveness of the APL notation. I believe the one-liner was one of the standard ones for indicating the nesting level of the parentheses in an algebraic expression. But the one-liner was very short — ten characters, something like that — and having been involved with programming things like that for a long time and realizing that it took a reasonable amount of code to do, I looked at it and said, “My God, there must be something in this language.” Bauer, on my left, didn’t see that. What he saw or heard was Ken’s remark that APL is an extremely appropriate language for teaching algebra, and he muttered under his breath to me, in words I will never forget, “As long as I am alive, APL will never be used in Munich.” And Dijkstra, who was sitting on my other side, leaned toward Bauer and said, “Nor in Holland.” The three of us were listening to the same lecture, but we obviously heard different things.

i'm convinced apl works much like magic in your average fantasy novel - some person of old has discovered a combination of 7 arcane runes with a certain effect and you can incorporate that in your own spell program, maybe even tweak a rune or two

animist
Aug 28, 2018

suffix posted:

this was a fun read in an eldritch horror kind of way

https://www.jsoftware.com/papers/50/


i'm convinced apl works much like magic in your average fantasy novel - some person of old has discovered a combination of 7 arcane runes with a certain effect and you can incorporate that in your own spell program, maybe even tweak a rune or two

it's just numpy but every library function is a randomly-selected Unicode symbol

Athas
Aug 6, 2007

fuck that joker

suffix posted:

this was a fun read in an eldritch horror kind of way

https://www.jsoftware.com/papers/50/


i'm convinced apl works much like magic in your average fantasy novel - some person of old has discovered a combination of 7 arcane runes with a certain effect and you can incorporate that in your own spell program, maybe even tweak a rune or two

They call these combinations "idioms", make huge lists of them, and even make the APL interpreter detect them and dispatch to specialised implementations.

Vomik
Jul 29, 2003

This post is dedicated to the brave Mujahideen fighters of Afghanistan

Athas posted:

They call these combinations "idioms", make huge lists of them, and even make the APL interpreter detect them and dispatch to specialised implementations.

do they have to be written with finnish characters

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
the idiom in question is probably something like +\-⌿'()'∘.=

In K it would be
code:
+\-/"()"=\:
Step by step:
code:
  "add(1;sub(3;4))"                / start with a string
"add(1;sub(3;4))"

  "()"=\:"add(1;sub(3;4))"         / compare characters in a string with each of ( and )
(0 0 0 1 0 0 0 0 0 1 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1)

  -/"()"=\:"add(1;sub(3;4))"       / subtract the ) vector from the ( vector
0 0 0 1 0 0 0 0 0 1 0 0 0 -1 -1

  +\-/"()"=\:"add(1;sub(3;4))"     / take a running (scan) sum
0 0 0 1 1 1 1 1 1 2 2 2 2 1 0
The only thing that is at all exotic is having "scan" as a primitive. It's a very useful cousin of reduce.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply