Live data from Hacker News

Scala: The Static Language that Feels Dynamic (Bruce Eckel)

artima.com

51–60 of 65 posts

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#51
post #10

Earlier quoted context omitted.

The Scala team have plans afoot to target LLVM and .NET too.

Do they have actual plans though? There has been talk of .NET support since the beginning. Basically I wouldn't hold my breath.

See http://greedy.github.com/scala/

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#52
post #46

Earlier quoted context omitted.

I only have one complaint about Clojure. It is very unfortunately named. Closures, the programming construct, and Clojure are too similar sounding. If I could rename Clojure and GIMP I'd do so in a heartbeat.

I actually like that both Clojure and Scala have names that otherwise don't mean something else. This unambiguity means you can more easily search for related pages and get more meaningful data out of Google Trends. Java will bring up some coffee references and the island in Indonesia. Python is, well, obvious. Just as two examples. I'd much rather everything not also be something else. GIMP is actually appropriate b…

Scala is actually a really bad name for trying to google it. http://en.wikipedia.org/wiki/Scala

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#53
post #30

I believe JVM now supports some restricted form of class re-definition at run time in debug mode. But it is quite limited. This is probably old hat for JVM hackers, I do not keep myself updated on the Java/JVM side of things. I came across Sun's (now Oracle's?) open-source(GPL) fork of the JVM that allows for changing class internals on the fly. The following analogy comes to mind DCE VM : JVM :: DLR : CLR I quote: T…

I'm not familiar with the DCE VM, but DLR is a library on top of the CLR, not a different version of the CLR.

It is a library on top of the CLR, but it cannot function without CLR-specific capabilities.

For example DynamicMethod, which represents a method reference that can be created at runtime and garbage-collected when no longer in use; similar to the lightweight method handlers in JSR 292.

That said, modifying existing classes on top of the CLR is not possible, unless it inherits from something like ExpandoObject, but you can pull the same trick in Java (though not as easily until JSR 292 comes out).

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#55

Gosu has the same dynamic feel in a statically typed JVM language, with much less complexity. (I should mention Fantom too, although I'm much less familiar with it.) Artima appears to have gone all-scala-all-the-time at some point in 2010. Weird.

Followed up your suggestion of Gosu, which I hadn't heard about before. Looks interesting but this feature comparison chart is hilarious: http://gosu-lang.org/comparison.shtml

It's the first time I've seen "not lisp" as a checkbox feature. :)

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#56
post #46

Earlier quoted context omitted.

I only have one complaint about Clojure. It is very unfortunately named. Closures, the programming construct, and Clojure are too similar sounding. If I could rename Clojure and GIMP I'd do so in a heartbeat.

I actually like that both Clojure and Scala have names that otherwise don't mean something else. This unambiguity means you can more easily search for related pages and get more meaningful data out of Google Trends. Java will bring up some coffee references and the island in Indonesia. Python is, well, obvious. Just as two examples. I'd much rather everything not also be something else. GIMP is actually appropriate b…

Actually, there is a digital signage platform named 'Scala.' At my workplace, this can cause endless confusion among non-technical people.

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#57
post #18

Earlier quoted context omitted.

Putting XML literals in the language just feels wrong. On the other hand, they've turned out to be damn useful when you're writing the back end for a web application.

It was a mistake. A better effort would have been to implement a first-class Macro system a-la Lisp. You can see here that Nemerle supports macros and makes dealing with XML like relatively painless as if it were built in: http://nemerle.org/About/#ID0E6G Macros for the win.

I'm curious how much you've actually used Haskell's templating system.

It is my understanding that a good macro system in a statically typed langauge is still an open research problem. I remember hearing that the Racket research group was still working on it for their typed Racket system, and that it was, at least as of a year ago, not possible to directly port macros from the standard language over to the typed language.

I also remember hearing that template Haskell is a relatively primitive macro system that very few Haskell developers currently actually use, but I'm not an expert in this area.

Scala is already cutting edge in a lot of ways. Expecting them to innovate in such a difficult and untrodden area on top of what they've already done is asking a little much, especially considering that it is meant to be a practical and not a research language.

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#59

Earlier quoted context omitted.

Agreed. Macros and reader macros ;-)

Let me know when you figure out how to statically type check those. You could publish a paper or two, I'm sure.

And we did! Check out: http://blog.racket-lang.org/2011/03/languages-as-libraries-p...

Re: Scala: The Static Language that Feels Dynamic (Bruce Eckel)

#60
post #57

Earlier quoted context omitted.

It was a mistake. A better effort would have been to implement a first-class Macro system a-la Lisp. You can see here that Nemerle supports macros and makes dealing with XML like relatively painless as if it were built in: http://nemerle.org/About/#ID0E6G Macros for the win.

I'm curious how much you've actually used Haskell's templating system. It is my understanding that a good macro system in a statically typed langauge is still an open research problem. I remember hearing that the Racket research group was still working on it for their typed Racket system, and that it was, at least as of a year ago, not possible to directly port macros from the standard language over to the typed lang…

This comment on Typed Racket isn't correct. Lots of macros work just fine in Typed Racket, and XML literals would certainly be among them [1]. The macros that don't work yet are the most complex ones, like the one implementing an entire class system with Java and Beta style inheritance (both!).

[1] In Racket, we typically use s-expressions rather than XML literals.

Post reply on HN