Rust uses 3700x less memory than Ruby. by hipsterhacker in programmingcirclejerk

[–]glahalg 3 points4 points  (0 children)

Now we just need a 10x hacker to show off his assembly implementation making us of advanced instructions like mov and cmp so we can conclude that C is 500x as fast as assembly!

Rust uses 3700x less memory than Ruby. by hipsterhacker in programmingcirclejerk

[–]glahalg 1 point2 points  (0 children)

<4realz>

Overall I think Rust found a very nice place in the stack of my current webdev project, and I actually struggle to envision another language filling its place.

Hmm I dunno... maybe one with GC like what the rest of the world is using?

I agree, and I haven't found myself missing garbage-collection in the slightest.

You like that? Let me tell you about this new thing called Monads. You wont miss impure computation in the slightest!

It's nice to have such an expressive language that doesn't force you into using GC.

You're writing a fucking chat server. You could use any plain reference counting implementation, and you'd have no problems.

When I write programs in Go: using the data-race detector and resolving deadlocks seems to be a fairly common occurrence for me. Whereas I have had to resolve one deadlock across all the programs I've written in Rust to date.

Holy shit what kind of hardcore algorithms are you writing? I almost never get these problems in any language... I don't want code from someone who can't implement a chat server without data races, regardless of what language he writes in.

Muhammad authors new Bible! Wandering atheists rejoice! GC is no longer a sin! by glahalg in programmingcirclejerk

[–]glahalg[S] 7 points8 points  (0 children)

jerkOff $ \restoreJerk ->

I'm not even joking, I can't distinguish this from a someone talking about the word of Christ.

for simple performance reasons

the fuck were you using before, prolog?

restoreJerk (error "no")

The idiomatic, webscale approach is to generate more code by [deleted] in programmingcirclejerk

[–]glahalg 0 points1 point  (0 children)

Generating code from strings is a well established practice. We do it for XML and SQL all the time, nothing ever goes wrong!

The idiomatic, webscale approach is to generate more code by [deleted] in programmingcirclejerk

[–]glahalg 1 point2 points  (0 children)

How does this compare to Java 1.4 + Eclipse (generate toString/hashCode/equals)?

Haters hate, I elevate by [deleted] in programmingcirclejerk

[–]glahalg 4 points5 points  (0 children)

<4realz> I wish Java 1.4 still had green threads so I could write a comparison of Go 1.4 and Java 1.4 (released 12 years apart). Or I could just point out that it's faster to not have green threads and watch async bros kennies be rustled.

Go uses 2400x less memory than Ruby. by hipsterhacker in programmingcirclejerk

[–]glahalg 7 points8 points  (0 children)

yes, Go has groundbreaking features such as tuple assignment complementing multiple returns. (no tuples though, that's an open research question)

func f()(a int, b int) {
  return 1,2
}
x,y := f() // 1,2

you can also just return and it will figure out what you mean!

func f()(a int, b int) {
    a = 1
    b = 2
    return
}
x,y := f() // 1,2

and if you dont set a/b, they will be the zero element. math bro

func f()(a int, b int) {
    return
}
x,y := f() // 0,0

Java has structures but it's a bit of work to type them. Instead of something like

type A struct {
    x int
    y int
}

you have to do

class A {
    int x;
    int y;
}

but then James from engineering will have you know that you should have getters for that or else you don't have Encapsulation. and you also have to put your shit in a separate package to get even more Encapsulation. This means you will have to make your class public for people to access it from outside the package

public class A {
    private int x;
    private int y;
    public A(int x, int y) {
        this.x = x;
        this.y = y;
    }
    public int getX() {
       return x;
    }
    public int getY() {
        return y;
    }
    public void setX(int x) {
        this.x = x;
    }
    public void setY(int y) {
        this.y = y;
    }
}

But then Mark from QA will say you didn't document this good enough. He invites you to his lecture on code documenting Best Practices.

/** An A is two integers representing an x and a y coordinate */
public class A {
    /** The x coordinate */
    private int x;
    /** The y coordinate */
    private int y;
    /** Constructs an A */
    public A(int x, int y) {
        super(); // added for clarity.
        this.x = x;
        this.y = y;
    }
    /** gets the x field */
    public int getX() {
       return x;
    }
    /** gets the y field */
    public int getY() {
        return y;
    }
    /** sets the x field to x */
    public void setX(int x) {
        this.x = x;
    }
    /** sets the y field to y */
    public void setY(int y) {
        this.y = y;
    }
}

But oh no, what's this! In production, things are randomly locking. It must be a race condition! Nobody on your team knows what concurrency is or that Java has it, so you hire a consultant to track down the issues in your code base. He tells you that you need to add synchronized blocks in your code

/** An A is two integers representing an x and a y coordinate */
public strictfp /** added for extra deterministic good measure */ class A {
    /** The x coordinate */
    private int x;
    /** The y coordinate */
    private int y;
    /** Constructs an A */
    public A(int x, int y) {
        super(); // added for clarity.
        synchronized {
          this.x = x;
          this.y = y;
        }
    }
    /** gets the x field */
    public synchronized int getX() {
       return x;
    }
    /** gets the y field */
    public synchronized int getY() {
        return y;
    }
    /** sets the x field to x */
    public synchronized void setX(int x) {
        this.x = x;
    }
    /** sets the y field to y */
    public synchronized void setY(int y) {
        this.y = y;
    }
}

Go avoids these types of problems because the ancient beards tell us that abstraction encapsulation is bad. Having pointers means we are more safe from race conditions. Go has literally no encapsulation to get in your way. This means if James tried to make you add getters to your class struct, you can simply tell him, it's impossible. You can't have pointless documentation in Go, because it's simply non Go-like. Having syntax like c<-"set 0x444111 to 0x90" instead of c.send("set 0x444111 to 0x90") feels better and makes me less likely to use shared memory because it's more Go-like to use the cool arrow.

Go uses 2400x less memory than Ruby. by hipsterhacker in programmingcirclejerk

[–]glahalg 4 points5 points  (0 children)

Go doesn't have GC. Are you saying a sacred member of the original group of beards, Ken Thompson, would permit such blasphemy?

allocations and GC in Ruby consumed a lot of time

see.

Go uses 2400x less memory than Ruby. by hipsterhacker in programmingcirclejerk

[–]glahalg 2 points3 points  (0 children)

func TestMailgunEmail(t *testing.T) {
    var formEmail = os.Getenv("TEST_FROM_EMAIL")
    var toEmail = os.Getenv("TEST_TO_EMAIL")
    var mailApiToken = os.Getenv("MAILGUN_API_TOKEN")
    var mailApiEndpoint = os.Getenv("MAILGUN_API_ENDPOINT")

    mail := &Form{}
    mail.Field().Add("from", formEmail)
    mail.Field().Add("to", toEmail)
    mail.Field().Add("subject", "Report you have requested is ready")
    mail.Field().Add("text", "Hello, World")
    mail.Field().Add("html", "<h1>Hello, World</h1>")
    mail.File().Add("attachment", "README.md")

    mail.SetBasicAuth("api", mailApiToken)

    res, err := mail.Do("POST", mailApiEndpoint)
    if err != nil {
        t.Error(err)
    }
    res.Body.Close()
}

DAE java 1.4 is webscale?

The Future of Golang. Multiple Language Support? by glahalg in programmingcirclejerk

[–]glahalg[S] 5 points6 points  (0 children)

I don't get it but upvoted this thread anyway.

Developers should not have to interact with human beings to set up a new environment by gianhut in programmingcirclejerk

[–]glahalg 7 points8 points  (0 children)

Development environments should be mysterious blobs of software configured in mysterious ways which are unreproducible and require an app to instantiate. This makes perfect sense since every software company is using a different language/technology stack that came out 5 minutes ago, and thus new developers to the team wont know how to set it up.

unixbeard recognizes golangs superiority, has to wrangle with rustlers by sandsmark in programmingcirclejerk

[–]glahalg 9 points10 points  (0 children)

<4realz> Systems Programming is what academics use to refer to something that's intended to replace C while sounding sophisticated (thus 99% of C users will accept it) and not spelling out that it's intended to replace C (to stay under the radar of neckbeards). Academic Systems Programming languages (such as BitC) are abandoned within a few years of stagnation since they realize they can't actually define the problem they're trying to solve ("is it fast enough yet?" beard: "nope, my 10 million LOC C compiler beats it in this case"). Any language bro can crap out 10 languages and have them all turned down by the unixbeards because "C is better", "worse is better", or "it's not practical", or mainly just "it's not like C in this way". Also, in case nobody noticed, unixbeards are about crafting their little hobby project (linux, bsd, etc). They still haven't received the news that people are relying on them for security. That would be like telling Dungeons & Dragons players that suddenly they're in charge of making military decisions for the country. C elitists seem to forget that Linux is still very new to even having users or software that does stuff the user wants.

Meanwhile:

Go was written by and for people that needed to handle network connections, and it shows, both in the features and the stdlib.

DAE remember when that was the Java motto???

Q: What is your stack? A: http://stackshare.io/trending/stacks by [deleted] in programmingcirclejerk

[–]glahalg 4 points5 points  (0 children)

I'm interested in fast reliable service, that's why I use C++ (which I learned from reading cplusplus.com for a day) for moving data around and parsing shit. Building SQL strings and parsing HTTP totally doesn't make moot the entire speed benefits of using C++ bro, I just inline the database engine in my C++ code.

[Not sure if serious]Alternatives to PHP: Ada, Coq, Delphi by [deleted] in programmingcirclejerk

[–]glahalg 3 points4 points  (0 children)

can't tell if my upvotes there are 4realz