News for hackers. Stuff that matters.
Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @08:53AM (#6689257)
Looks really cool! Oh, it runs on the JVM. Hm, too bad.
Re:Frege: A JVM pure functional programming language in the ... by waterlion on Thursday November 07, 2013 @09:40AM (#6689520)
What would you prefer? A language that doesn't need a runtime, like C? A language that has only one available runtime, like node.js? A language that has a choice of runtimes but there are incompatibilities between them like Python or Ruby? A language that has a choice of runtimes from a choice of vendors like Java?
Re:Frege: A JVM pure functional programming language in the ... by gngeal on Thursday November 07, 2013 @10:22AM (#6689765)
"A language that doesn't need a runtime, like C?"

The language perhaps doesn't, but most actual programs do. I'm definitely not going to write my own standard library just because I can.

Re:Frege: A JVM pure functional programming language in the ... by waterlion on Thursday November 07, 2013 @10:40AM (#6689924)
I wasn't advocating one choice or another. It's just the person I replied to just said "JVM ugh", which isn't necessarily reasonable.
Re:Frege: A JVM pure functional programming language in the ... by Peaker on Thursday November 07, 2013 @05:35PM (#6692938)
A "Runtime" and a "standard library" are different things. There are a lot of (annoying to install) libraries for C.
Re:Frege: A JVM pure functional programming language in the ... by gngeal on Friday November 08, 2013 @11:21AM (#6697046)
http://en.wikipedia.org/wiki/Microsoft_Windows_library_files...

Now what could the "RT" part possibly mean?

Re:Frege: A JVM pure functional programming language in the ... by Peaker on Sunday November 10, 2013 @04:35AM (#6705872)
MS are unique in calling their C library a "Runtime library". Commonly, a support system that does GC and other automatic management for managed languages is called a "runtime", and the various common functions available to C program are called a "standard library". The difference is that in C, you can write a program that uses none of the standard library at all, whereas a managed program will use the "runtime" for doing anything at all.
Re:Frege: A JVM pure functional programming language in the ... by tomkludy on Thursday November 07, 2013 @09:47AM (#6689561)
I'd like something running on the CLR. Not because I think the CLR is very special; just because I really like Haskell but I have to work within a large ecosystem of existing .NET code.
Re:Frege: A JVM pure functional programming language in the ... by callmecosmas on Thursday November 07, 2013 @09:50AM (#6689582)
Why not F#?
Re:Frege: A JVM pure functional programming language in the ... by tomkludy on Thursday November 07, 2013 @12:03PM (#6690524)
I've been playing with it some. It's nice, but I still prefer Haskell. I want to be able to separate pure from impure code, but F# doesn't seem to enforce that. (Unless I'm missing something?)
Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @12:45PM (#6690899)
It doesn't. In fact, F# feels like it started off as a fairly pure functional language but some Microsoft PM said "it has to support every API in .NET" and so a lot of OOP stuff was bolted on the side. It feels like 2 different worlds in one language. You can easily get by never using the impure stuff but it's still there, taking up space.
Re:Frege: A JVM pure functional programming language in the ... by MichaelGG on Thursday November 07, 2013 @06:13PM (#6693168)
F#'s design was almost completely handled by Don Syme, in MS Research Cambridge. It is highly unlikely some PM jumped in and insisted it must do things.

The OOP part is rather coherent; I'm not sure what's bolted on - any examples? In fact, things like object expressions do parts of OOP even better than Java/C#. Overall the syntax for OOP is rather concise and neat.

Having proper interop with .NET and hence the OOP is ... pretty key to making a successful .NET language. Otherwise you lose one major point of being able to use .NET libraries.

Re:Frege: A JVM pure functional programming language in the ... by Touche on Friday November 08, 2013 @12:24PM (#6697570)
> The OOP part is rather coherent; I'm not sure what's bolted on - any examples? In fact, things like object expressions do parts of OOP even better than Java/C#. Overall the syntax for OOP is rather concise and neat.

I'm saying I'm not sure why the OOP exists at all. Someone else pointed at that OCaml has those elements as well, and maybe that's the reason. Just in my own use, I never felt the inclination to use the OOP at all, and their existence felt like this part of the language that I didn't understand, didn't want to understand, but was there nonetheless.

Re:Frege: A JVM pure functional programming language in the ... by shadowfox on Thursday November 07, 2013 @03:10PM (#6692056)
F# has its origins in OCaml which has the same set of properties (ability to write impure code and has an object system, albeit one that not many people use). F# replaced that object system with the .NET one.
Re:Frege: A JVM pure functional programming language in the ... by pacaro on Thursday November 07, 2013 @11:46AM (#6690419)
A good question, remember Don Syme and Simon Peyton Jones even work in the same building...
Re:Frege: A JVM pure functional programming language in the ... by icefox on Thursday November 07, 2013 @09:53AM (#6689604)
> A language that has a choice of runtimes from a choice of vendors like Java?

That is like saying that we should developer Windows apps because you can always deploy using wine on other systems.

Re:Frege: A JVM pure functional programming language in the ... by waterlion on Thursday November 07, 2013 @10:20AM (#6689757)
I'm not sure what you're saying.

If you're calling into question the portability of Java, then I can run the same bytecode on Windows, Mac, Linux, the browser (in theory) and, with a little transpiling, my Android.

If you're saying that that priority of decision drivers is backward, then I disagree:

If you want to develop a Windows app you start by saying "I want to develop something on Windows because my clients/customers run Windows". Then you work out how to do it on Windows.

If you start out saying "I want to write an app that does X" then you have the freedom to choose what balance of priorities affect you, including whether or not portability matters.

Re:Frege: A JVM pure functional programming language in the ... by chc on Thursday November 07, 2013 @01:58PM (#6691565)
I believe he's trying to criticize Java for being owned by Oracle. The implication appears to be that alternative implementations are just compatibility layers for Oracle's technology like WINE is for Windows.

(For the record, I don't particularly agree with this. It seems like you could level the same criticism at nearly any language that has one person or stable group controlling it — for example, you could just as validly call Rubinius "WINE for Ruby".)

Re:Frege: A JVM pure functional programming language in the ... by lmm on Thursday November 07, 2013 @09:13PM (#6694008)
Do the MRI people own Ruby trademarks and patents? Did they use them to torpedo a free Apache implementation of Ruby?
Re:Frege: A JVM pure functional programming language in the ... by chc on Friday November 08, 2013 @03:24AM (#6695134)
IIRC Harmony was scuttled primarily because of OpenJDK — Harmony's major corporate sponsor switched its support to OpenJDK, and shortly thereafter the Harmony committee unanimously agreed to put the project in the attic. I don't think Oracle ever actually went after Apache.
Re:Frege: A JVM pure functional programming language in the ... by lmm on Friday November 08, 2013 @05:07AM (#6695405)
Nope. Oracle denied Harmony a TCK license, meaning they had no license to Java patents (and trademarks). IBM switched to OpenJDK because of this.
Re:Frege: A JVM pure functional programming language in the ... by icefox on Friday November 08, 2013 @09:46PM (#6700459)
Bingo :)

> A language that has a choice of runtimes from a choice of vendors like Java?

At least historically it wasn't much of a choice and I wouldn't put it past Oracle to continue in this fashion.

Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @09:49AM (#6689577)
A runtime that can be used for a wide-variety of types of applications. JVM can really only be used for writing web servers and possibly daemons.
Re:Frege: A JVM pure functional programming language in the ... by Bostwick on Thursday November 07, 2013 @10:54AM (#6690033)
And building Twitter [1], and big-data next-generation databases [2], and android apps, and desktop apps, and big data [3], and as a platform for new languages (Clojure, Scala, Frege), and many more applications.

Really, the JVM can be used for anything that _computers_ can be used for, and it does so in a way that the code is runnable across all major platforms and still maintains a top-5 language performance spot, even beating C/C++ in some specific cases.

Why do you feel that the JVM is limited in its applications as a development platform?

[1] http://blog.redfin.com/devblog/2010/05/how_and_why_twitter_u... [2] http://www.datomic.com/about.html [3] http://hadoop.apache.org/

Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @11:21AM (#6690225)
> And building Twitter [1],

Web server.

> and big-data next-generation databases [2]

Daemon.

> and android apps

No, Android doesn't have a JVM.

> and desktop apps

If you say so, I see very few of these in production.

> and big data

Daemon.

> Why do you feel that the JVM is limited in its applications as a development platform?

You can't write cli applications in a JVM language because the start-up time is too slow. Which means you can't compose scripts that call Java apps.

This is not just 1 type of application, it's the most important type of application by far. It's fundamental to how Unix operates. With Java you can't write small applications that do one thing well, you have to write big applications that are going to run for a very long time.

This is useful for things like web servers and daemons, but otherwise it sucks. It's why I can't get excited about JVM languages.

Re:Frege: A JVM pure functional programming language in the ... by Bostwick on Thursday November 07, 2013 @12:17PM (#6690650)
> You can't write cli applications in a JVM language because the start-up time is too slow. Which means you can't compose scripts that call Java apps.

You're right. In the case of small, fast applications designed to be called as part of shell scripts, the JVM does suffer start-up costs. Some testing on my personal machine shows the JVM to be 2x to 8x slower than a comparable Ruby or Python script in startup time. [1] Depending on the script, that startup time may or may not acceptable, and if the script runs for longer than a second, which is entirely possible for anything that goes beyond the local machine, the JVM will get progressively faster.

> This is not just 1 type of application, it's the most important type of application by far.

This needs more explanation. I've used Unix for many years, and I've definitely bought in to its philosophy of small and composable; It's a philosophy that in many ways mirrors functional programming. However, in my opinion, the most important type of application varies considerably by person. For you, the small, single-purpose applications may be what you use most.

And I agree, if you're programming for the Unix platform, the JVM would not be the best choice. Unix was built on C. A program that builds on that platform is probably a better choice.

But there are many more applications out there, and for any command-line program that operate in a time domain longer than 10 seconds, the JVM startup costs are mostly eliminated. This time-domain is very plausible for a command that operates on medium-scale databases or anything with network connectivity.

It's silly to completely dismiss an entire platform because it is not the absolute best choice for a single domain of programs.

I'm curious: What do you do where the short-lived, composable Unix functions are the most important programs?

[1] https://gist.github.com/bostwick/8ee1d4df9c7743f9efed

Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @01:20PM (#6691210)
I think we simply approach software different. I feel that small, composable applications should be the default, and I nearly always start off this way. I've been involved in projects from writing a specialized version of cp, ETL processes, to developer focused but consumer-facing web applications and the first interface I write to anything I do is as a small cli application that works well with standard unix tools.

When you embrace this philosophy it doesn't particularly matter how good a language's ecosystem is, you have all of unix to interop with. For example, I don't care if a language has a good JSON parsing because jq[1] exists and is probably faster and easier to work with than just about any language's built in tools, even better than JavaScript itself.

With JVM you can't participate in writing software this way. Everything must revolve around the JVM and it's ecosystem.

[1]http://stedolan.github.io/jq/

Re:Frege: A JVM pure functional programming language in the ... by cgh on Thursday November 07, 2013 @02:37PM (#6691866)
I'd even say daemons are a stretch. Having multiple JVMs running at once would crush a lot of systems.

The JVM and the Java ecosystem are basically all about long-running backend services. It's funny when you consider Java's roots as a simple language designed to enhance web pages.

Re:Frege: A JVM pure functional programming language in the ... by Mikeb85 on Thursday November 07, 2013 @10:57AM (#6690052)
Really? Plenty of apps run on the JVM (everything from enterprise apps to games to IDEs etc...). I'm no JVM evangelist (I use Haskell with the GHC), but this is just a false statement.
Re:Frege: A JVM pure functional programming language in the ... by cgh on Thursday November 07, 2013 @02:28PM (#6691801)
"Enterprise apps" generally means "enterprise web apps", not standalone, deployed applications.

I've never seen a AAA game written in Java. The non-deterministic GC is a dealbreaker as is the speed and space constraints of eg consoles.

The OP is generally correct: the JVM is a niche technology in a way. The Java ecosystem basically specialises in web apps and backend ESB-type stuff (shuttling data very quickly between heterogeneous applications). Of course, this is a very big, well-paying "niche" so it's not something to be afraid of.

Re:Frege: A JVM pure functional programming language in the ... by jlgreco on Thursday November 07, 2013 @03:25PM (#6692143)
I'd say that minecraft is in the realm of "AAA" profit and userbase, though not "AAA" budget or graphics.

That is the only example I can think of though, and it is certainly a stretch. (also their X-Box version isn't Java)

Re:Frege: A JVM pure functional programming language in the ... by profquail on Friday November 08, 2013 @09:06AM (#6696025)
Java doesn't need to have a non-deterministic GC. The Real-Time Specification for Java [1] has resulted in a number of JVM implementations designed for low-power, embedded devices; these implementations use a deterministic GC to provide hard real-time guarantees, and the devices they run on are less powerful than the game consoles from even a couple of generations back.

[1]: http://en.wikipedia.org/wiki/Real_time_Java

Re:Frege: A JVM pure functional programming language in the ... by kasey_junk on Thursday November 07, 2013 @10:27AM (#6689809)
and Android apps...
Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @10:49AM (#6689987)
Android doesn't run JVM.
Re:Frege: A JVM pure functional programming language in the ... by kasey_junk on Thursday November 07, 2013 @11:08AM (#6690118)
Not technically, but practically speaking, you compile to JVM code & then it gets translated. This makes targeting the JVM & Android trivial.
Re:Frege: A JVM pure functional programming language in the ... by sanxiyn on Thursday November 07, 2013 @11:47AM (#6690430)
Runtime code generation doesn't work on Android. This means all the reverse dependencies of cglib, for example. That is huge part of JVM ecosystem.
Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @11:15AM (#6690181)
It's not trivial, this is why there are no JVM languages that really run well on Android.
Re:Frege: A JVM pure functional programming language in the ... by biafra on Thursday November 07, 2013 @01:57PM (#6691558)
What do you mean by that?

I would say compiled Scala runs well on the Dalvik VM.

All languages that do not need to generate (or load) class files at runtime should work well on Android. And that is because Dalvik does not run class files.

Re:Frege: A JVM pure functional programming language in the ... by Touche on Thursday November 07, 2013 @02:11PM (#6691673)
So then why don't we see more non-Java Android apps in the wild? We can only go off of open source apps, I've looked at quite a bit of those and have ran across only a couple that don't use Java.
Re:Frege: A JVM pure functional programming language in the ... by waterlion on Thursday November 07, 2013 @10:20AM (#6689760)
Give an example.
Re:Frege: A JVM pure functional programming language in the ... by voxfrege on Thursday November 07, 2013 @02:14PM (#6691693)
If you don't need the JVM, you don't need Frege either, because there is Haskell.

The whole point of the Frege project is to make up (insofar this is possible for a single person who is not SPJ) for the missing Haskell-JVM port.