- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scripting profiles for Scala.
I am looking for a scripting environment for designers who less
familiar with programming.
I really like Scala, but many people I have personally ask find Scala
features overwhelming. How difficult would it be to restrict Scala to
a subset of normal functionality. Say, removing "operator
overloading", parametrization, types, and pretty much leaving a
javaScript like features.
Maybe there is a framework out there that offers "limited profiles"
with a restricted subset of Scala features.










Re: Scripting profiles for Scala.
That's not quite right in general. Take programming education, for example. A classic error made by programming novices is to use advanced language features where simpler, basic features are adequate for the job. A language subset could conceivably be used to prevent that error.
Here's another example. Suppose you want to create a DSL for controlling a robot or a manufacturing process. This might be something beyond what an operator would use directly but could be used by a technician or engineer to set parameters, modes, or basic safety logic. Maybe it would be something that would only be changed under very strict conditions. You want it to be as simple as possible for safety reasons, yet still capable of doing what it needs to do. You don't want someone diddling with more advanced features than are needed, particulary if safety is an issue. A subset of the language could well be appropriate in that case.
--Russ P.
--
http://RussP.us
Re: Scripting profiles for Scala.
On Sun, Apr 3, 2011 at 2:46 PM, Lex <lexn82 [at] gmail [dot] com> wrote:
Re: Scripting profiles for Scala.
> I understand what you're saying, I just don't really think this will make
> the nay-sayers happy, since underneath all that 'dangerous stuff' still
> exists. I think these folks would be much happier with a different
> langauge, one in which they steal many concepts from Scala. However, feel
> free to prove me wrong!
It is not possible to convince everyone to use Scala or it's subset.
However it will be possible to capture many people who are would never
try Scala in the present form. Once they succeed, others will be
tempted more, providing a stream of new users to the language.
Right now the Scala community consists mostly of well-seasoned
programmers. And there are relatively few novice programmers. That
could all be changed.
> I'm of the opinion that all these vacuous arguments against Scala are
> nothing more than expressions of unfamiliarity and an unwillingness to
> be placed in the position of a beginner where once the person was an
> expert.
This is the perception of Scala by many people. We cannot argue if the
perception is true or false, because it will do nothing to change it.
I think what we are dealing here is a pure programmer's laziness. A
programmer sees a long list of features and has to say to him/herself:
am I really gonna learn of all of that?
Everyone who is into Scala has answered "YES" to that questions, many
of you have answered "HELL YES!". However not everyone has the same
level of programming abilities and free time to cover it all.
Personally, I find it difficult to use a language with features I do
not understand. What happens is I will either learn all the features
or abandon the whole thing. And I am not alone. There is a reason
people describe Scala as having an _overwhelming_ amount of features.
What's worse, it is a very consistent reason for abandoning the
language.
Exposing a limited set of functionality and enforcing it at the tool
level will make people feel "safe" that they only have to learn so
much. This would bring more novice users. Some people will stay on
that level, other's will advance to learn more, and eventually master
all of Scala.
Re: Scripting profiles for Scala.
> Exposing a limited set of functionality and enforcing it at the tool
> level will make people feel "safe" that they only have to learn so
> much. This would bring more novice users. Some people will stay on
> that level, other's will advance to learn more, and eventually master
> all of Scala.
>
This would be particularly useful for promoting Scala in education.
(The idea is not a new one--Racket has done this for years, and with
pretty good success.) The primary benefit is that beginners cannot
accidentally use a feature of which they are not aware. They'd get a
(hopefully intelligible) error message instead of code that is
technically correct but doesn't reflect their intention.
Right now, Python is viewed by quite a few people as an ideal language
for teaching programming. It is a scripting language with instant
feedback, it is simple enough that one can wrap its head around the
whole thing pretty quickly, and it has lots of libraries for graphics,
scientific programming, etc.
An "entry level" Scala subset would be a great alternative, and it
would draw more people into the Scala ecosystem. I think it could be
quite compelling. One would have access to the wealth of Java
libraries, which are often better than their Python counterparts, and
there is the upward migration path to full Scala.
Cheers,
Cay
Re: Scripting profiles for Scala.
On 04/04/11 10:48, Cay Horstmann wrote:
> Right now, Python is viewed by quite a few people as an ideal language
> for teaching programming.
Not wanting to throw fuel on the fire, but no serious teacher of
programming I know believes this (python is an ideal language for
teaching programming) to be true. The "teaching" of python is widely
regarded (according to my selection) as destructive to the educational
endeavour. I am very sympathetic to this view. Indeed, I can confidently
make certain guarantees about the result of teaching programming with
python.
Re: Scripting profiles for Scala.
I'd be interested in those "guarantees" if you care to briefly outline them.
If you google it, you will find that Python is regarded by many as a good language for teaching programming. See, for example,
http://www.stanford.edu/~pgbovine/python-teaching.htm
My intuition tells me that Python is probably a decent pedagogical language for elementary and high school but is probably not a great choice at the college level (except perhaps for non-CS students). Then again, my intuition could be completely wrong.
I recognize the limits of Python, but I also recognize that it *is* possible to write quality non-trivial code in Python that works correctly and gets the job done. I don't think it rots your brain -- at least not as bad as C++ does. (Then again, if it rotted my brain, I probably wouldn't realize it anyway, would I.)
--Russ P.
--
http://RussP.us
Re: Scripting profiles for Scala.
Ha ha, great example: "Run-time type errors rather than compile-time type errors"
Aside from that lunacy, most of his other reasons apply to Scala just as much, and often more so. You could point out the things that make Scala not a good language for teaching programming, but that would be special pleading -- no such negatives are mentioned for Python in this or similar one-sided accounts from Python fans. The very act of googling for such accounts incurs a damning level of bias.
Mighty faint praise.
-- Jim
Re: Scripting profiles for Scala.
It is probably the most approachable complex programming language I know, supporting a lot of the paradigms and techniques one needs to teach. To me it sounds ideal for the task.
My 10 year old started last year moving turtles happily in Kojo, with scala, easily evolved to loops and such and will soon be programming his NXT robot in a scala DSL... (soon as I find some time that is).
He doesn't understand, know or care about monads although he uses them regularly.
I don't see what the fuss is all about.
Lex - so you now want to take all the fun out of programing (had to say that) :)
Martin's levels give us the switches and we can recombine them in different profiles. I think it should all be in the compiler, much like you can tweak the java compiler today... Or a compiler plugin? The presentation compiler also ( I think they share a lot).
I think it is neccessary and I would volunteer to help with this if someone sets it up.
Thanks,Razvan
On 2011-04-04, at 5:35 AM, Jim Balter <Jim [at] Balter [dot] name> wrote:
Re: Scripting profiles for Scala.
I'm not quite sure why he said that, but I'm sure he's not claiming that run-time errors are preferable in general. I think he's just saying they are less confusing for beginner students. That's a pedagogical issue, not a CS issue.
Indeed. I have no particular reason to praise Python -- but I have no reason to dump on it excessively either. It is not my choice anymore now that I have discovered Scala, but you cannot deny that some fairly impressive things have been done with Python.
--Russ P.
--
http://RussP.us
Re: Scripting profiles for Scala.
Well, maybe you should read the articles you link to, as he was quite clear about it.
You're quite the master of the stunningly stupid strawman, Russ. Some fairly impressive things have been done in assembly language, too, but that has no bearing at all on anything being discussed here.
-- Jim
Re: Scripting profiles for Scala.
The funny thing is that Python is a large language with a raft of special cases and quirks and irregularities and special __...__ symbols, while being considerably weaker than Scala. At the same time, no one is calling for defining subsets to make features inaccessible in order to make it an ideal language for teaching programming, so perhaps such subsetting isn't really needed and isn't really the problem with the perception of Scala. And if that is what is needed, how would you go about teaching people how to use Scala's libraries, which depend on such features as implicits and generics? How would you make sure that those "hopefully intelligible" error messages only speak in the subset language? We have a lot of experience on this list with people asking how they got such-and-such a message or what it means, where the answer necessarily goes into quite a bit of detail about the type system. Consider the recent thread on Scaladoc's [usecase] that results in erroneous documentation. Of course that needs to be fixed, but it's just the beginning. Remember that both Racket and Python have been designed to be easy to learn from the very beginning -- that's not a feature that you can just tack onto a language as a plugin that limits what features people use.
Re: Scripting profiles for Scala.
Hi Cay,
I found your post interesting, and it would be a shame it if got lost in the noise here on this thread. Also, people should know that you are not just ranting idly. You are a computer science education professional, and I see that you've written at least 8 books on programming. If a subset of Scala were widely chosen as a pedagogical language, that would be a major coup for Scala itself.
--Russ P.
--
http://RussP.us
Re: Scripting profiles for Scala.
The goal of Racket, virtually from its inception almost 20 years ago, was to be a pedagogical tool. That would be a repurposing of Scala, and certainly would take more effort than "simply make a ScalaScript plugin that restricts the use of some features and be done with it". (I'm not Randall; the idea of creating such a subset Scala does not offend me. What does offend me are statements like that quote and the assertion that anyone who thinks there might be more to it is exhibiting "blind faith" and is "a hater".)
-- Jim