Earlier quoted context omitted.
I disagree. Every time I tried to put together an app with any of Common Lisp, Scheme or Smalltalk I found myself fighting idiosyncrasies unrelated to my app. Obviously it can be done, but the advantage of using those languages start to diminish. It's not about popularity, it's about practicality. I found making Java web applications unpractical in a similar way although I haven't tried enough.
This is an example of an anecdotal piece of evidence, and without a close examination of the "idiosyncrasies" and your definition of "practical", it is difficult to have a discussion. I recognize, though, that people have different opinions on what language is most familiar/useful to them, and at the end of the day, people get work done and make money, whatever they use.
Why I love Smalltalk
31–38 of 38 posts
Re: Why I love Smalltalk
#32The syntax is quite unique to Smalltalk. The message, otherwise known as “method call” in other languages, is called show: (including the colon) and it takes an argument. self also uses this method call syntax. However this syntax can get quite confusing, see this example from http://en.wikipedia.org/wiki/Self_(programming_language) valid: base bottom between: ligature bottom + height and: base top / scale factor. Sm…
So, what would the syntax be in Io? Like this? valid := base bottom between(ligature bottom + height, base top / scale factor)
Also instead of between method with two args you could also create an and message/method:
valid := base bottom between(ligature bottom + height) and(base top / scale factor)Re: Why I love Smalltalk
#33The syntax is quite unique to Smalltalk. The message, otherwise known as “method call” in other languages, is called show: (including the colon) and it takes an argument. self also uses this method call syntax. However this syntax can get quite confusing, see this example from http://en.wikipedia.org/wiki/Self_(programming_language) valid: base bottom between: ligature bottom + height and: base top / scale factor. Sm…
Thank you, I wasn't familiar with Io before
Some quick examples:
10 repeat("Hello world" println)
(y
More example Io code can be found here: http://iolanguage.com/about/samplecode/Re: Why I love Smalltalk
#34Earlier quoted context omitted.
I don't think that's fair. Being able to implement if doesn't mean that the entire remainder of the system is built without any conditional instructions anywhere in its implementation. (The point, after all, isn't some sort of mystical purity; it's that if you can implement if then you can probably also implement whatever other control structures you happen to fancy. Which you can.)
To implement a usable if , you need to tie it to some form of logical branching. Haskell can tie it to pattern matches. C compiles them to conditional jumps in asm. The asm jump instructions are implemented in hardware. The meat of the if definition lies in how you tie it to whatever form of conditional behavior your language has. This is missing from the article. Smalltalk (presumably) has a form of logical branchin…
It uses dynamic binding.
In Java it would look like something this (but it's less useful without proper closures):
abstract class Bool {
void ifTrue(Runnable f, Runnable g);
}
class True extends Bool {
void ifTrue(Function f, Function g) {
f.run();
}
}
class False extends Bool {
void ifTrue(Function f, Function g) {
g.run();
}
}
Then, given a variable Bool b;
the if-then-else becomes b.ifTrue(new Runnable() {
public void run() {
System.out.println("It's true!");
}
}
, new Runnable() {
public void run() {
System.out.println("Not true!");
}
}
);
It's a bit more verbose, though...Re: Why I love Smalltalk
#35Earlier quoted context omitted.
To implement a usable if , you need to tie it to some form of logical branching. Haskell can tie it to pattern matches. C compiles them to conditional jumps in asm. The asm jump instructions are implemented in hardware. The meat of the if definition lies in how you tie it to whatever form of conditional behavior your language has. This is missing from the article. Smalltalk (presumably) has a form of logical branchin…
> Smalltalk (presumably) has a form of logical branching in it somewhere. To finish the if, just pick one. It uses dynamic binding. In Java it would look like something this (but it's less useful without proper closures): abstract class Bool { void ifTrue(Runnable f, Runnable g); } class True extends Bool { void ifTrue(Function f, Function g) { f.run(); } } class False extends Bool { void ifTrue(Function f, Function…
Re: Why I love Smalltalk
#36Earlier quoted context omitted.
Since you are hung up on "objective analysis," what objective evidence do you have that this claim is true? In any case, here is an objective problem: Common Lisp does not include a standard for regular expressions. That isn't anecdotal and it isn't misplaced blame and it isn't an unnamed idiosyncrasy. It's a failure within the CL standard to include one of the most powerful tools around for text processing--a tool t…
I am no Lisp expert by a longshot, but when I want regular expressions, I use this library: http://www.cliki.net/CL-PPCRE (available for easy install via quicklisp) Since I like to pick on Perl... This library's logic is, as it happens, allegedly faster than Perl's regular expressions. That probably is not difficult to do, since Perl is interpreted, whereas most CL implementations are a both interpreted and compiled:…
I know the lisp community stands behind Edi Weitz and I respect him, but compared to Python's "Batteries Included" or Perl's standard regular expression library, your solution is problematic. Consider: Weitz's library is just one of five possible regular expression libraries listed on Cliki! Why did you choose his? Weitz's library isn't even the top choice! Are the others broken? Unreliable? Do I have to try them all?
Now, I realize such simple questions as these may not be "breaking new ground in programming theory," but a lot us just want a turn-key solution that works everywhere; the sort that sysadmins use everyday to keep companies humming and the internet buzzing.
That's the definition of "practical" that I'm hung up on.
If I want to do command line text processing with pipes--and many do--how does lisp help me more than Awk? Awk is brilliant in its problem space; it's fairly standardized; it's guaranteed to be everywhere. Choosing Awk or Perl or Python is practical--not being a slave to fashion (trapped in the popularity contest you allude to)
I think you know this, and I think you know just how practical Python/Perl/Awk/Ruby are, which is why you subtly changed your argument from "practical" without qualification to "managing huge and complex problems" by the end of your response, even though the parent specifically includes hobby programming in his classification of "practical" problems.
I think it's cool that you've done "web, database, scripting, 3D game programming, etc" in lisp and can even think in lisp. And I admire your willingness to battle past CL's 1000+ page spec and then the sea of competing libraries to find the one you like and are willing to debug yourself if something is broken.
But that doesn't invalidate all the other tools--it just means there can be more than one way to do it.
Re: Why I love Smalltalk
#37Earlier quoted context omitted.
Since you are hung up on "objective analysis," what objective evidence do you have that this claim is true? In any case, here is an objective problem: Common Lisp does not include a standard for regular expressions. That isn't anecdotal and it isn't misplaced blame and it isn't an unnamed idiosyncrasy. It's a failure within the CL standard to include one of the most powerful tools around for text processing--a tool t…
I am no Lisp expert by a longshot, but when I want regular expressions, I use this library: http://www.cliki.net/CL-PPCRE (available for easy install via quicklisp) Since I like to pick on Perl... This library's logic is, as it happens, allegedly faster than Perl's regular expressions. That probably is not difficult to do, since Perl is interpreted, whereas most CL implementations are a both interpreted and compiled:…
Sturgeon's Law applies so its no good picking on just Perl libraries here!
There are few libraries that have any quality and a general lack of consistency and interoperability between them with the notable exception of packages like Moose.
Please see Task::Kensho which is a list of recommended CPAN modules: http://search.cpan.org/dist/Task-Kensho/lib/Task/Kensho.pm
Re: Why I love Smalltalk
#38Earlier quoted context omitted.
I am no Lisp expert by a longshot, but when I want regular expressions, I use this library: http://www.cliki.net/CL-PPCRE (available for easy install via quicklisp) Since I like to pick on Perl... This library's logic is, as it happens, allegedly faster than Perl's regular expressions. That probably is not difficult to do, since Perl is interpreted, whereas most CL implementations are a both interpreted and compiled:…
I'm sorry, but this doesn't address what I said. I know the lisp community stands behind Edi Weitz and I respect him, but compared to Python's "Batteries Included" or Perl's standard regular expression library, your solution is problematic. Consider: Weitz's library is just one of five possible regular expression libraries listed on Cliki! Why did you choose his? Weitz's library isn't even the top choice! Are the oth…