The conversation

Lessons learnedExperience excerpt · English

Then I tried writing a Common Lisp version

… Then I tried writing a Common Lisp version. Opening a file, iterating over lines, hashing words and getting 0 as default, and sorting are all reasonably easy in CL, but splitting a line into words is a whole project on its own. And getting a command-line argument requires implementation-specific facilities that aren't standardized by CL! At least string-downcase exists. It was a lark, so I didn't finish. (In Forth you'd almost have to write something equivalent to Knuth's Pascal, because it doesn't come with even hash tables and case conversion.) My experience with Smalltalk is more limited but similar. You can do anything you want in it, it's super flexible, the tooling is great, but almost everything requires you to just write quite a bit more code than you would in Perl, Python, Ruby, JS, etc. And that means you have more bugs, so it takes you longer. And it doesn't really want to talk to the rest of the world—you can forget about calling a Squeak method from the Unix command line. …

Original discussionForth: The programming language that writes itself168 source comments · at import
4

What was this responding to?

Parent context · original excerpt

BE

Why is it that languages like this don't scale? It's not the first time I see a powerful language that got forgotten. Other examples include SmallTalk and Common Lisp (tiny community). It is because some languages are "too powerful"? What does that say about our industry? That we're still not that advanced of a specie to be able to handle the full power of such languages? I say that because it seems languages that are "dumbed down" seem to absolutely dominate our world (Python, Ruby, JS, etc.)

Full original

Community replies 0

No community replies yet. Add your perspective.

Replies from the source 4

Direct replies available in this import. Original-language excerpts.

CO

The article in CACM that presents Knuth's solution [1] also includes some criticism of Knuth's approach, and provides an alternate that uses a shell pipeline: tr -cs A-Za-z $'\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed ${1}q (I converted a newline to `$'\n'` for readability, but the original pipeline from the article works fine on a current MacOS system) 1: https://dl.acm.org/doi/pdf/10.1145/5948.315654

Full original
IG

> And it doesn't really want to talk to the rest of the world—you can forget about calling a Squeak method from the Unix command line. You seem absolutely certain! Here's an example of a Pharo Smalltalk program call on the Ubuntu command line, with the calculation result written to stdout -- /opt/src/pharo-vm-Linux-x86_64-stable/pharo --headless nbody.pharo_run.image Include/pharo/main.st 50000000 -0.169075164 -0.169059907 https://benchmarksgame-team.pages.debian.net/benchmarksgame/... ~ Here's a corresponding Perl program -- https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Full original
IG

> You can do anything you want in it, it's super flexible, the tooling is great, but almost everything requires you to just write quite a bit more code than you would in Perl, Python, Ruby, JS, etc. Given that Smalltalk precedes JS by many years: if it is true, then it was not always true. Given that Smalltalk was early to the GUI WIMP party: if it is true, then it was not always true for GUI WIMP use.

Full original
EA

> splitting a line into words is a whole project on its own Is it[1]? My version below accumulates alphabetical characters until it encounters a non-alphabetical one, then increments the count for the accumulated word and resets the accumulator. (let (c accumulator (counts (make-hash-table :test #'equal))) (handler-case (loop (setq c (read-char)) (if (find c "ABCDEFGHIJKLMNOPQRSTUVWXYZ" :test #'char-equal) (push (char-downcase c) accumulator) (when accumulator (incf (gethash (coerce (reverse accumulator) 'string) counts 0)) (setq accumulator nil)))) (end-of-file () (when accumulator (incf (gethash (coerce (reverse accumulator) 'string) counts 0)) (setq accumulator nil)) (maphash #'(lambda (word count) (push (list count word) accumulator)) counts) (format t "~{~&~{~a ~a~}~%~}" (reverse (last (sort accumulator #'< :key #'car) (let ((n (second sb-ext:*posix-argv*))) (if n (parse-integer n)…

Full original
Continue on Hacker News

Respect different perspectives. Share concrete experiences.

Sign in to post, reply, repost, and quote.