Turn on thread page Beta
    • TSR Group Staff
    Offline

    20
    ReputationRep:
    TSR Group Staff
    I was looking at Transmit for Mac today, but they want £23 for it. :lolwut: It's a FTP/SFTP client, and yet it costs more than Lion? Crazy...
    Offline

    2
    ReputationRep:
    (Original post by Dez)
    I was looking at Transmit for Mac today, but they want £23 for it. :lolwut: It's a FTP/SFTP client, and yet it costs more than Lion? Crazy...
    Jesus christ :eek:
    Offline

    0
    ReputationRep:
    (Original post by Chrosson)
    Java has problems? :zomg:

    It looks interesting and I may try it one day, but I was put off by a demo a friend did for me showing the compilation time for a simple program...let's just say it wasn't nippy.
    I'm not saying Java is a bad language to use, I'll be using Java in situations where Java is better suited to it in conjunction with Scala for the other bits. It's a supplement, not a replacement.

    Doing some searching on performance vs Java, I cam accross this in a Stack Overflow thread:

    Scala makes it very easy to use enormous amounts of memory without realizing it. This is usually very powerful, but occasionally can be annoying. For example, suppose you have an array of strings (called array), and a map from those strings to files (called mapping). Suppose you want to get all files that are in the map and come from strings of length greater than two. In Java, you might

    Code:
    int n = 0;
    for (String s: array) {
      if (s.length > 2 && mapping.containsKey(s)) n++;
    }
    String[] bigEnough = new String[n];
    n = 0;
    for (String s: array) {
      if (s.length <= 2) continue;
      bigEnough[n++] = map.get(s);
    }
    Whew! Hard work. In Scala, the most compact way to do the same thing is:

    Code:
    val bigEnough = array.filter(_.length > 2).flatMap(mapping.get)
    Easy! But, unless you're fairly familiar with how the collections work, what you might not realize is that this way of doing this created an extra intermediate array (with filter), and an extra object for every element of the array (with mapping.get, which returns an option). It also creates two function objects (one for the filter and one for the flatMap), though that is rarely a major issue since function objects are small.

    So basically, the memory usage is, at a primitive level, the same. But Scala's libraries have many powerful methods that let you create enormous numbers of (usually short-lived) objects very easily. The garbage collector is usually pretty good with that kind of garbage, but if you go in completely oblivious to what memory is being used, you'll probably run into trouble sooner in Scala than Java.

    Note that the Computer Languages Benchmark Game Scala code is written in a rather Java-like style in order to get Java-like performance, and thus has Java-like memory usage. You can do this in Scala: if you write your code to look like high-performance Java code, it will be high-performance Scala code. (You may be able to write it in a more idiomatic Scala style and still get good performance, but it depends on the specifics.)

    I should add that per amount of time spent programming, my Scala code is usually faster than my Java code since in Scala I can get the tedious not-performance-critical parts done with less effort, and spend more of my attention optimizing the algorithms and code for the performance-critical parts.
    Original thread is here: http://stackoverflow.com/questions/5...nce-and-memory

    What I drew from that is that, yes, it's slower, but in larger projects, there's also a tradeoff between the amount of code that needs to be written to get a decent answer, as indicated in the last paragraph.

    Combined with the fact that there is some integration between the functional programming capabilities among other things means that I'm willing to give this a shot.
    Offline

    21
    ReputationRep:
    Wonderful, the Birmingham riots have supposedly led to the Apple Store being broken into and looted. There goes my appointment to get my phone repaired :|
    /firstworldproblems
    Offline

    16
    ReputationRep:
    :teehee: Perhaps its a sign?
    Offline

    2
    ReputationRep:
    I believe a PC world got looted in Tottenham in the excitement recently, with computers being sold for £20 (or so I read on TSR).
    Not surprised the Apple store got hit tbh. Bit like a jewelers shop.
    Offline

    0
    ReputationRep:
    (Original post by Gofre)
    Wonderful, the Birmingham riots have supposedly led to the Apple Store being broken into and looted. There goes my appointment to get my phone repaired :|
    /firstworldproblems
    I literally facepalmed at John Humphreys this morning. so bloody aggressive for no good reason.

    *yes, I AM a Radio 4 listener, it's the only thing worth listening to in the mornings. DEAL WITH IT!!!
    Offline

    2
    ReputationRep:
    (Original post by Tathrim)
    I'm not saying Java is a bad language to use, I'll be using Java in situations where Java is better suited to it in conjunction with Scala for the other bits. It's a supplement, not a replacement.

    Doing some searching on performance vs Java, I cam accross this in a Stack Overflow thread:



    Original thread is here: http://stackoverflow.com/questions/5...nce-and-memory

    What I drew from that is that, yes, it's slower, but in larger projects, there's also a tradeoff between the amount of code that needs to be written to get a decent answer, as indicated in the last paragraph.

    Combined with the fact that there is some integration between the functional programming capabilities among other things means that I'm willing to give this a shot.
    Lol, I was joking. I'm well aware of some of the shortcomings of Java.
    Cheers for the link though, quite interesting. I suppose that's always the trade off - as you move up the abstraction tree things become easier to write but slower to run. Asm -> C -> Java all show this pattern and I suppose a language like Scala (and haskell...and I suppose pretty much anything supporting higher order functions natively) is the next step up the tree.
    Offline

    0
    ReputationRep:
    (Original post by Gofre)
    Wonderful, the Birmingham riots have supposedly led to the Apple Store being broken into and looted. There goes my appointment to get my phone repaired :|
    /firstworldproblems
    Don't worry it'll be mysteriously up and running again by opening time tomorow. :ninja:
    Offline

    21
    ReputationRep:
    (Original post by Jake9)
    Don't worry it'll be mysteriously up and running again by opening time tomorow. :ninja:
    Which, the store or the phone?
    • TSR Group Staff
    Offline

    20
    ReputationRep:
    TSR Group Staff
    This looks really legit: http://london.craigslist.co.uk/mob/2536072357.html :rolleyes:
    • PS Helper
    • Wiki Support Team
    Offline

    14
    PS Helper
    Wiki Support Team
    ^ Hahaha :teehee:

    ----

    Virgin Media are down (again), I'm just going to blame it on the rioters even though it's not their fault :hand:
    Offline

    0
    ReputationRep:
    (Original post by Gofre)
    Which, the store or the phone?
    Was referring to the store, but nvm.

    also

    Liverpool Apple Store has taken all their products of the shelves:



    http://gizmodo.com/5829203/liverpool...ts-off-display
    Offline

    1
    ReputationRep:
    My latest purchase:
    Spoiler:
    Show
    Offline

    21
    ReputationRep:
    (Original post by Jake9)
    Liverpool Apple Store has taken all their products of the shelves
    Yeah pretty sure they're doing anywhere in the country that could potentially be at risk of rioting, they've definitely done it in Manchester and Birmingham.

    (Original post by alexsheppard11)
    My latest purchase:
    Spoiler:
    Show
    Very nice, what model is that?
    Offline

    2
    ReputationRep:
    Oh yes just what I've been waiting for.

    (Original post by Jake9)
    Was referring to the store, but nvm.

    also

    Liverpool Apple Store has taken all their products of the shelves:



    http://gizmodo.com/5829203/liverpool...ts-off-display
    Oh wow

    (Original post by alexsheppard11)
    My latest purchase:
    Spoiler:
    Show
    How much did that set you back?


    And in other news
    http://techcrunch.com/2011/08/09/suck-it-sms/
    Offline

    1
    ReputationRep:
    (Original post by Gofre)
    Very nice, what model is that?
    (Original post by wizard710)
    Oh wow

    How much did that set you back?
    £50 on ebay.

    Spoiler:
    Show
    It's a single core PowerMac G5, going to strip it out!
    Offline

    0
    ReputationRep:
    Guys, Broken screen or loose connection?
    http://t.co/MPedrqs
    Offline

    2
    ReputationRep:
    (Original post by Kenny_uk)
    Guys, Broken screen or loose connection?
    http://t.co/MPedrqs
    My vote is broken screen fwiw.
    Offline

    1
    ReputationRep:
    (Original post by Kenny_uk)
    Guys, Broken screen or loose connection?
    http://t.co/MPedrqs
    broked
 
 
 
Poll
How are you feeling in the run-up to Results Day 2018?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.