On Monday 12 November 2007 06:47, hlovatt wrote:
> @Jon,
>
> I would like to see more type inference added to Java, something along
> the lines that Scala or Fortress does. I am not sure about the
> extensive inference common in functional languages; I find the error
> messages poor.

The error messages in functional languages vary wildly from implementation to 
implementation. In fact, the languages themselves largely dictate how bad the 
error messages can get: the more expressive the type system the more easily 
it can be misled. Consequently, it is common to add type declarations when 
writing OO code in OCaml, for example.

Scala's error messages are good but its inference capabilities are poor: worse 
than SML, OCaml, F# and Haskell.

> In fact I have suggested extensions including more inference already:
>
> http://www.artima.com/weblogs/viewpost.jsp?thread=182412

My preference would be to simply forget about Java completely. I'd rather see 
a modern functional programming language on the JVM with none of that 
baggage. F# has done a good job of providing interoperability with 
existing .NET libraries via OOP and active patterns.

Is the motivation of tweaking Java simply that existing Java programmers might 
find it easier to learn a new language that looks similar?

> Changing subject: an example of the expression problem that is
> pertinant to discussing computer languages is if you write a parser
> for a language and then want to expand the language at a latter date.
> In this case you might need to expand the number of expressions to
> cope with new language features. I note that there is currently much
> work on Haskell to remove this 'closed world' limitation from that
> language, so I assume I am not alone if finding 'closed worlds' a
> problem.

You might like to look at how camlp4 solved that problem for OCaml by 
providing an extensible grammar so that users can add syntax extensions to 
OCaml. However, I'm not sure that has any practical applications beyond 
writing macros systems for languages with non-trivial syntax (which is why 
camlp4 does it).

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to