Byron Gibson | 1 Oct 2010 01:14
Picon

Command line mode for Scala .jar installer?

Hi all, just getting started with Scala (and Lift).  Does
scala-2.8.0.final-installer.jar have a command line mode, or just the
graphical installer?  I'd like to use it to install Scala on a
headless linux server if possible.

Thanks,
Byron

--
Remember, if it’s in the news don’t worry about it. The very
definition of news is “something that almost never happens.” When
something is so common that it’s no longer news — car crashes,
domestic violence — that’s when you should worry about it.  - Bruce
Schneier

Kenneth McDonald | 1 Oct 2010 02:03
Picon
Favicon

Re: Scala Joe - a profile for regular Joe

I'm sorry, I somewhat omitted some of my case when I first wrote.

I did not mean to imply that static type checking was _only_ good for performance reasons. It can also considerably enhance code correctness, as several others have pointed out.

However, as with most things, there comes a point of diminishing returns. Trying to statically check __too__ much leads to a very complex and difficult to understand type systems.

IMHO, Scala is at the verge, if not slightly over the line, for this limit.

Again, I'll say; a language like Groovy which permits type declarations (I realize Groovy decls are not checked at compile time, but that's a detail), while allowing "duck-typing" when necessary, would be appropriate. My belief is that most programmers would declare 90%+ of their types, greatly reducing errors and potentially increasing runtime speed. Most of the rest of the type errors would be easily caught by unit tests. A trivial fraction would escape into a release product--small enough, IMHO, to make up for the increased productivity and ease of use of a "mostly static" type system.

Until we have such a language (if ever) such discussions will, unfortunately, be rather academic. However, one thing I'm willing to say without qualification, and as someone who spent much of a Ph.D. doing functional languages, including O'Caml, Haskell, Concurrent Clean, etc: The current type system for Scala is too scary for most programmers, and to the extent that it is emphasized, will scare off support.

Wish that weren't the case,
Ken McDonald


On Sep 30, 2010, at 5:47 PM, Russ Paielli wrote:



On Thu, Sep 30, 2010 at 2:13 PM, Kenneth McDonald <kenneth.m.mcdonald <at> sbcglobal.net> wrote:

One final note. My experience with Python has convinced me that compile-time type-checking is _vastly_ overrated. 90%+ of my type errors in Python are revealed in simple testing, and the remainder aren't typically difficult to track down. I have great respect for the work Martin Odersky et al have done, but I question if it's really necessary. I wish this topic didn't suck away so much really superior talent.


Python is great for getting something out the door fast (as you said about Perl), but as others have said, it is not very good for maintainability (for larger projects at least).

I am converting some of my own Python code to Scala. Part of the process is declaring method argument types, of course. I had always assumed that would be simple, but sometimes it is not. In some cases, figuring out the argument types in my own code is a non-trivial problem. But I now realize that just having those types explicitly declared reduces confusion and improves readability considerably. In fact, if the return type of a method is not trivially clear, explicitly declaring it also improves readability.

Russ P.

-- 
http://RussP.us
sledorze | 1 Oct 2010 02:08
Picon

Re: Can't compile Scala for Android SDK Tools, revision 7


Hi!
I run out in the same problem but can't find the references you gave in my
xml;
here are the interesting bits:

            <apkbuilder 
                    outfolder="${out.absolute.dir}"
                    basename="${ant.project.name}"
                    signed=" <at> {sign.package}"
                    verbose="${verbose}"> 
                <file path="${intermediate.dex.file}" /> 
                <sourcefolder path="${source.absolute.dir}" /> 
                <nativefolder path="${native.libs.absolute.dir}" /> 
                <jarfolder path="${external.libs.absolute.dir}" /> 
                <extra-jars/> 
            </apkbuilder> 

and

        <aaptexec executable="${aapt}"
                command="package"
                manifest="AndroidManifest.xml"
                resources="${resource.absolute.dir}"
                assets="${asset.absolute.dir}"
                androidjar="${android.jar}"
                outfolder="${out.absolute.dir}"
                basename="${ant.project.name}" /> 

Any help is welcome!! (I am *still* totally noob at ant)

--

-- 
View this message in context: http://scala-programming-language.1934581.n4.nabble.com/Can-t-compile-Scala-for-Android-SDK-Tools-revision-7-tp2534044p2783041.html
Sent from the Scala - User mailing list archive at Nabble.com.

Paul Phillips | 1 Oct 2010 02:31

Re: Fully-qualified class name in multiple variable initialization causes compiler error

On Thu, Sep 30, 2010 at 03:42:43PM -0700, Erik Bruchez wrote:
> Is the path notation not *meant* to be supported, or is it just not 
> possible support it?
> 
> It certainly is confusing.

I'm sure there didn't seem to be much point in implementing complete 
parsing for the type parameters in patterns, since patterns are checked 
at runtime and all the types are gone.  For the most part, no matter 
what you're putting in there you could as easily have put [_].

The future is more interesting because I expect to make more type 
information recoverable via pattern matching, now that there's more out 
there to recover.  So as soon as there is something more useful than a 
"convenience cast" to be done we can modify the parser.

--

-- 
Paul Phillips      | The important thing here is that the music is not in
Future Perfect     | the piano.  And knowledge and edification is not in the
Empiricist         | computer.  The computer is simply an instrument whose
pal, i pill push   | music is ideas.  -- Alan Kay

Michael Swierczek | 1 Oct 2010 04:08
Picon

Re: Scala Joe - a profile for regular Joe

On Thu, Sep 30, 2010 at 8:03 PM, Kenneth McDonald
<kenneth.m.mcdonald@...> wrote:
>
> Again, I'll say; a language like Groovy which permits type declarations (I
> realize Groovy decls are not checked at compile time, but that's a detail),
> while allowing "duck-typing" when necessary, would be appropriate. My belief
> is that most programmers would declare 90%+ of their types, greatly reducing
> errors and potentially increasing runtime speed. Most of the rest of the
> type errors would be easily caught by unit tests. A trivial fraction would
> escape into a release product--small enough, IMHO, to make up for the
> increased productivity and ease of use of a "mostly static" type system.
> Until we have such a language (if ever) such discussions will,
> unfortunately, be rather academic.

If I understand what you're writing there, I think Perl6 fits the
requirement.  As you may know, it carries the Perl name but is not
backwards compatible with other versions of Perl.  One of the new
features is optional type declarations and I believe it's supposed to
do type checking if you explicitly declare a type.   But right now
Perl6 is only a language specification with a few separate
implementations in various stages of completion.

I'm not that bright, and I've seen plenty of code on these mailing
lists that baffles me.  On the other hand, I have the books
"Programming Scala" by Venkat Subramaniam and "Programming in Scala"
by Martin Odersky, Lex Spoon, and Bill Venners and they give me a lot
of hope for the future wide use of the language because they're
phenomenally well done.    I was especially nervous about the book
co-written by Odersky, I worried that people brilliant enough to
design a language would have a hard time explaining the concepts to
average developers.   But it's the best book on software that I own,
and everything is explained clearly with great examples.  None of it
is that difficult to understand.

Between the books and the helpful communities on the forums and
mailing lists I'm hopeful for Scala.

-Mike

Kenneth McDonald | 1 Oct 2010 04:36
Picon
Favicon

Question:What "should be" the semantics of nongreedy regexes?

I'm writing an object oriented wrapper around the regex library (http://github.com/KenMcDonald/rex),
and it has two boolean matching operators: regex ~= string returns true if the given regex matches the
string anywhere along its length, while regex ~~= string returns true iff the regex matches the string
exactly and completely.

Now the question (I'll use standard regex notation here, if I remember it correctly :-) ): What about a case
like "a*?" ~~= "aaa". In other words, a nongreedy match of "a", 0 or more times, against "aaa". Should this
succeed or fail? My intuition says it should succeed, but there's case to be made for saying it should
fail--with nothing after "?" looking for a match, one could contend that the match is successful and
complete at the first empty string, and therefore the match as a whole should fail.

I'm not really looking for a philosophical debate here :-), just opinions on what would be most useful in
real life.

Thanks,
Ken

Rex Kerr | 1 Oct 2010 05:05
Picon
Gravatar

Re: Question:What "should be" the semantics of nongreedy regexes?

People are used to standard regexes:

scala> """a*?""".r.findFirstIn("aaa")                
res0: Option[String] = Some()

so the answer is that it the match should fail.  (Or people will be surprised by the behavior of this "regex".)

Also, greedy * is both more efficient than backtracking *, and you can build what you really want out of greedy * and other operations, if you want something that matches a terminal a also:

scala> """(a+)|(a*?)""".r.findFirstIn("aaa")
res24: Option[String] = Some(aaa)

On the other hand, there's less point redoing regex the same way again than there is in providing an alternative, so since you seem inspired to provide an alternate style of regex, you might want to use an alternate default rule.  (For example, you could convert the regex into a packrat-style parser (with backtracking).)

  --Rex


On Thu, Sep 30, 2010 at 10:36 PM, Kenneth McDonald <kenneth.m.mcdonald-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org> wrote:
I'm writing an object oriented wrapper around the regex library (http://github.com/KenMcDonald/rex), and it has two boolean matching operators: regex ~= string returns true if the given regex matches the string anywhere along its length, while regex ~~= string returns true iff the regex matches the string exactly and completely.

Now the question (I'll use standard regex notation here, if I remember it correctly :-) ): What about a case like "a*?" ~~= "aaa". In other words, a nongreedy match of "a", 0 or more times, against "aaa". Should this succeed or fail? My intuition says it should succeed, but there's case to be made for saying it should fail--with nothing after "?" looking for a match, one could contend that the match is successful and complete at the first empty string, and therefore the match as a whole should fail.

I'm not really looking for a philosophical debate here :-), just opinions on what would be most useful in real life.

Thanks,
Ken


Lex | 1 Oct 2010 05:12
Picon

Re: Command line mode for Scala .jar installer?

You can download a tar.gz file and extract it. Just add the bin
director to the PATH. If you are messing with a headless linux server
you know what to do.

On Thu, Sep 30, 2010 at 7:14 PM, Byron Gibson <fbg111@...> wrote:
> Hi all, just getting started with Scala (and Lift).  Does
> scala-2.8.0.final-installer.jar have a command line mode, or just the
> graphical installer?  I'd like to use it to install Scala on a
> headless linux server if possible.
>
> Thanks,
> Byron
>
> --
> Remember, if it’s in the news don’t worry about it. The very
> definition of news is “something that almost never happens.” When
> something is so common that it’s no longer news — car crashes,
> domestic violence — that’s when you should worry about it.  - Bruce
> Schneier
>

William Uther | 1 Oct 2010 07:05
Picon
Picon
Favicon

Digest mode?

Hi,
  Is there a digest mode for this mailing list?  I looked for one, but couldn't find it.

Cheers,

Will     :-}

Florian Hars | 1 Oct 2010 08:11
Picon

Re: Scala keywords and idioms naming

Am 30.09.2010 10:29, schrieb Paul Phillips:
> I think you can call them anything you want

But "call by name" has been the accepted term for this kind of parameter 
passing since before most people on this list have been born, no? 
(http://www.masswerk.at/algol60/report.htm section 4.7.3.2)

- Florian.


Gmane