|
View:
New views
15 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Re: Scala vs FanOn Wed, Jul 9, 2008 at 12:02 AM, Adriaan Moors <adriaan.moors@...> wrote:
Yep, it is scala-debate! I had read Bracha's paper, it seemed so obvious...and to be totally honest, I was not impressed much, partly because I had thoughts in the same lines before that... I can't say about the other paper, I will have to read (and understand! it).
Now, Wadler's slides are so much fun! (not "fan") Interesting pointers Andriaan! Thanx Christos -- __~O -\ <, Christos KK Loverdos (*)/ (*) http://ckkloverdos.com |
|
|
Re: Scala vs FanNo, not Wadler, Pierce's slides are what I meant! (bad memory...) I came across them recently and I too recommend them...
On Wed, Jul 9, 2008 at 12:15 AM, James Iry <jamesiry@...> wrote: See also "Types Considered Harmful" (http://www.cis.upenn.edu/~bcpierce/papers/harmful-mfps.pdf) by Benjamin Pierce of "Types and Programming Languages" fame. The paper is not so much about hybrid or gradual typing. Instead he talks about using contract systems to supplement type systems at the point where types move beyond your type system's abilities. -- __~O -\ <, Christos KK Loverdos (*)/ (*) http://ckkloverdos.com |
|
|
Re: Scala vs FanChristos, et al,
+1 on Ben's slides. i'm totally unconvinced about lenses as a programming paradigm, but as a device to explore language+type theoretic approach to design problems it is about as perfect as you can hope for. And, his slides are masterful. Best wishes, --greg On Tue, Jul 8, 2008 at 2:22 PM, Christos KK Loverdos <loverdos@...> wrote: No, not Wadler, Pierce's slides are what I meant! (bad memory...) I came across them recently and I too recommend them... -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com |
|
|
Re: Scala vs Fan"What a change of heart from you Ricky!"
I think there's value in dynamic languages. They seem great for new programmers to learn in, and they let you ride roughshod over quality, which sometimes you're ok with. For instance, I wrote a little elisp today that lets me hibernate my computer without leaving emacs, and I didn't have to consider what the type of Windows' shutdown /h command is, or what emacs' shell-command procedure returns (or in this case, even whether it runs synchronously or asynchronously). Also, as Wadler has mentioned, even good typesystems sometimes don't support features that let your known-good code typecheck, so you'd want to step out of them sometimes. When I started looking at Haskell after learning enough Lisp to be dangerous, I tried porting (lambda (f x) (f f x)), a primitive combinator useful for writing recursive lambdas, to Haskell and found it impossible. A year on, I still can't understand Cale Gibbard's explanation of the port of that to Haskell, though I can understand why it doesn't type-check. Dynamic languages are also great breeding grounds for syntax - a good challenge for static languages is to provide as 'natural' syntax as dynamic languages while still promoting correctness. But on the other hand, a language without static types is only half a language - like how cars tend to go faster on roads than through fields, programmers can work at a higher level of abstraction when programming with types. The better the typesystem, the faster the cars. Broken analogy alert. Ultimately, the syntax for a static language can be better than a dynamic language, because there is more information around. E.g., consider how QuickCheck in Haskell gets given the Arbitrary instances by the environment, based on the type of the function passed to check. (my terminology may be askew here) ..Then there's the people who don't know what static typing is. Groovy's homepage says it supports static typing, yet int i="hello" compiles (and fails at runtime) in Groovy. [snipped rant about Groovy] 2008/7/8 Tony Morris <tmorris@...>:
|
|
|
Re: Scala vs FanI would love to see a representation of a loose-typed? or dynamically typed scala-like scripting language. It should be very similar to Scala, but with no hand-waving for types. This would be a faster way to create scripts and small prototypes. The language should be similar enough that it can be refactored into pure Scala for type-safety and speed. |
|
|
Re: Scala vs Fanjherber wrote:
> I would love to see a representation of a loose-typed? or dynamically typed > scala-like scripting language. It should be very similar to Scala, but with > no hand-waving for types. This would be a faster way to create scripts and > small prototypes. The language should be similar enough that it can be > refactored into pure Scala for type-safety and speed. > > > True story: A few years ago (early days of Groovy) during an infatuation with dynamic languages I became frustrated with Groovy's syntax inconsistencies and sought to design something better. Coming across Scala I decided that its syntax would make a much better basis for a scripting language - it had already solved many of the issues that plagued Groovy at the time (and for all I know still do). I even went so far as to write a simple interpreter that could script Java objects using a Scala-like expression syntax that included named and anonymous functions. (I didn't know about parser combinators then so it was painfully coded by hand). Thing is, the more about Scala I learned and the better I understood it, the less I wanted a dynamic language and the more I wanted Scala itself. So I switched my (spare-time) focus from dynamic languages to Scala and have not looked back. At least for the sort of programming I like to do: Scala (including it's type system) is the best available tool for the job. --Andrew P.S. I now realize that what drew me to the dynamic languages I was learning were features of Functional Programming that were absent from Java (my day-job language for most of the last decade), not dynamic languages per se. |
|
|
Re: Scala vs FanErik Engbrecht wrote:
> I think it does have an advantage in some situations. One of my > personal struggling points with Scala (and to a lesser extent Java, C++, > and pretty much all other statically typed languages) is that expressing > partially formed ideas is much harder. The Scala compiler likes to > point out too many of my errors, when I just want to see if it > "generally seems to work" before putting all the additional effort in to > make the code correct. This is particularly painful when I need to > abstract over types. I heard this argument before, but I don't quite understand it. Could you provide an example that would illustrate your approach? What do you mean with "generally seems to work" in this context? Thank you, Ingo |
|
|
Re: Scala vs FanThanks for all the responses.
So one differentiator in Scala's favour appears to be its rigorous type-parameterisation (generics) support. But no comments on Fan's build and deployment-related features (which I thought most interesting). One feature I didn't mention, which it sounds like many who responded might value, is Fan's 'concession'[1] to those who want the option of doing dynamic programming: When you access a field or method using the "." dot operator the compiler does type checking. But you can also use the "->" dynamic call operator to skip type checking... The "->" operator is really just syntax sugar for invoking the 1 http://www.fandev.org/doc/docIntro/Tour.html#dynamic On Tue, Jul 8, 2008 at 3:11 PM, Rob Dickens <arctic.bob@...> wrote: Dear list, |
|
|
Re: Re: Scala vs FanGreetings Rob,
since I mostly work on web-related software, I already have a "pod", the WAR. I never was too keen on Java as a platform for standalone apps... Cheers, Viktor
On Wed, Jul 9, 2008 at 11:28 AM, Rob Dickens <arctic.bob@...> wrote: Thanks for all the responses. -- Viktor Klang Rogue Software Architect |
|
|
Re: Re: Scala vs Fan>> When you access a field or method using the "." dot operator the compiler
>> does type checking. But you can also use the "->" dynamic call operator to >> skip type checking... The "->" operator is really just syntax sugar for >> invoking the Obj.trap method which by default uses reflection to call a >> method or access a field. But you can also override the trap method to >> handle dynamic calls in imaginative ways. Or, one could just use structural typing ... (and still get contractual type-checking?) At least, wrt ->. It would be nice to have [easy] library support to do the latter... raw Java reflection isn't much fun to play with. |
|
|
Re: Re: Scala vs FanOn Sun, Jul 27, 2008 at 12:15 PM, Paul Stickney <pstickne@...> wrote:
>>> When you access a field or method using the "." dot operator the compiler >>> does type checking. But you can also use the "->" dynamic call operator to >>> skip type checking... The "->" operator is really just syntax sugar for >>> invoking the Obj.trap method which by default uses reflection to call a >>> method or access a field. But you can also override the trap method to >>> handle dynamic calls in imaginative ways. > > Or, one could just use structural typing ... (and still get > contractual type-checking?) It would be really nice to have a way to tell Scala to infer the structural type, as in OCaml, but you'd have to ask for it. If it didn't look so much like line noise, I'd suggest def foo( x : { _ }) = { } or something? -- David |
|
|
Re: Scala vs Fan> P.S. I now realize that what drew me to the dynamic languages I was
> learning were features of Functional Programming that were absent from > Java (my day-job language for most of the last decade), not dynamic > languages per se. Funny, I have had the exact same experience! I wonder how many of us do. |
|
|
Re: Scala vs Fan> Genericity enables two-level type solutions.
What is a "two-level type" solutions > i've demonstrated repeatedly that > features like reflection come for free > from two-level type-based solutions. Where can i find this? |
|
|
Re: Scala vs FanDavid,
That's ironic. i was just working on a solution to the challenge Martin issued based on a problem given by Corky M. regarding scalable abstractions for a lambda calculus evaluator. i'm using a two-level-type based solution. One way to approach two-level type analysis is via grammars. If you think of a type specification as essentially analogous to the specification of a grammar then two-level types treat every non-terminal as a type parameter in a parametric specification of a data type. An example might help. Here's a scala specification for Conway games. trait Games { case class Game( left : List[Game], right : List[Game] ) } This can be seen as approximately equivalent to Game ::= ( Game*, Game* ) Now, we using the two-level approach, we can rewrite the above grammar as ParametricGame[G] ::= ( G*, G* ) RGame ::= ParametricGame[RGame] or in scala trait ParametricGames { type G case class Game( left : List[G], right : List[G] ) } object Games extends ParametricGames { type G = Game } Best wishes, --greg On Sun, May 3, 2009 at 8:07 PM, David Ford <dford@...> wrote:
-- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com |
|
|
Re: Scala vs FanDavid,
gmail misinterpreted my keystrokes and that went out uncompleted. Here's the rest. object Games extends ParametricGames { type G = Game val Zero : G = Game( Nil, Nil ) } This gets more interesting when you have a language that has variables/names as a core component, as you find in the lambda calculus or the π-calculus. Here's a simple variant of the π-calculus. P[N] ::= 0 N?(N*)P[N] N!(P[N]*) *N P[N] | P[N] N[P] ::= @P In scala we would write trait Processes { type Nominal abstract class Process case class Termination case class Input( subject : Nominal, objekts : List[Nominal], continuation : Process ) case class Output( subject : Nominal, objekt : List[Process] ) case class Dereference( subject : Nominal ) case class ParallelComposition( components : List[Process] ) // n-ary instead of binary version } trait Names { type Agent case class Transcription( agent : Agent ) } object ReflectiveProcess extends Processes with Names { type Nominal = Transcription type Agent = Process val Zero : Process = Termination } To see that this is reflective notice that we have a way to turn code into data (Transcription) and a way to turn such data back into code (Dereference). In 2005 at ETAPS i described the details of this version of the π-calculus and it's corresponding Hennessey-Milner logic. You can find the details here and here. i have also recently written a blog entry about how this version supports a truly remarkable comm rule. Please note that -- while this particular variant of the π-calculus is interesting in its own right --
Best wishes, --greg On Sun, May 3, 2009 at 10:28 PM, Meredith Gregory <lgreg.meredith@...> wrote: David, -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |