Hacker Newsnew | comments | show | ask | jobs | submit | amadiver's commentslogin

Pretty neat. Mirah is to Java as CoffeeScript is to JavaScript?

Looks very similar to ActionScript 2, with shades of Scala. Really neat looking language.

Anyone know where the `param: Type` (i.e., parameter name colon type) convention came from? I've seen it more frequently lately, and I wonder if it's easier to parse than Java's `Type param` (or my favorite: `param Type`)?

-----


I actually officially asked Jeremy Askenas if I can use the phrase "Mirah is the Coffeescript of Java". He gave me his blessing.

The param:type notation I largely just stole from Scala, but it seems (in my novice opinion) easier to parse as well. It also fits better with optional type declarations, which we have in the case of interface impl or class extension (easier to omit syntax on the RHS than on the LHS for a typical parser).

-----


And oops...that's Ashkenas. Sorry, Jeremy :)

-----


I'm not sure if it's where the 'param: Type' idiom is where it came from originally, but its use in Mirah almost certainly descended from its use in Haskell and ML. Scala also uses it, and its use there is definitely ML/Haskell-inspired. (Haskell technically is 'param :: Type', since ':' is the cons operator, but it's basically the same thing.)

Since languages like Haskell and ML (and Scala, to a lesser extent) do type inference, type annotations are often unnecessary, and so having the type listed after the name probably makes more sense in that context: what's important is the name, and variable-specific type hints are usually there for the compiler, not the human reader. The exception is functions, which very often get type definitions just because it's very helpful to have that information as a human. Since ML/Haskell-like languages have multiple function definitions and rely on pattern matching, the postfix type notation fits in very well:

    func :: type1 -> type2
    func a = ...
    func b = ...

-----


Interesting...and the point about "the name" being the most important thing is really insightful. That's exactly true.

-----


Pascal uses the "param : type" syntax, although I'm not sure it's the first language to do so. I believe it's older than ML. It's funny to "see this more frequently lately" as it's a really old convention. What's old is new again, I guess...

http://en.wikipedia.org/wiki/Pascal_(programming_language)#P...

-----


ML type annotations use that syntax, so it's probably the grandaddy of them all.

It's easier to parse if your type syntax uses juxtaposition. "Some int" is a valid type, so it would make "<type> <var>" harder to parse. It's hard to tell when the type ends and the variable name starts without backtracking.

-----


It's common in statically typed functional languages and an old notation. I believe a key motivation is the analogy between a Set and a Type. Then saying x : Int is like similar to saying x ∈ Z, x is an element of the integers.

-----


`param: Type` is from Pascal

-----


That would be my bet, especially since Java, especially since 1.1, reminded me so much of [Turbo] Pascal in C++ clothing, so it only seems natural to borrow another Pascal-ism.

But Pascal stole from Algol. Nothing new under the sun...

-----


Excited to see how this is integrated with Magpie

-----


I think you approached this article with a different set of expectations than I had. It felt like a personal essay early on for me. I don't think it's meant to be an empirical distillation of the ways in which a few cultures are different from one another. I found it to be elucidating in the way that a standup comic might be (I recognize the pattern, but never thought of it concretely; e.g., 'Guys always leave the seat up.') Maybe you have a more broad exposure to different cultures than I have.

A wiki on cultural differences is a really good idea, though.

-----


I expect to burn some karma for this, but there's another extant pocket of optimization driven development: banner ads. If there is such a thing as a "good" banner ad, I'm referring to those (unobtrusive, non-autoexpanding, subtle animations resulting from interaction [no seizure-inducing manic blinking]). Good banner ads use almost no bandwidth (15k-40k) and go easy on the user's processor. They are built for big companies who care about their reputation and trafficked by platforms that respect the user.

I don't get to build as many of them as I once did, but they're incredibly fun little puzzles to solve. Cramming largish photographs, animation, copy (including fonts, which usually result in the bulk of filesize), and animation into such a tiny package is no small feat, and requires a lot of time (the productivity tradeoff Jacques referred to) and tons of little optimization tricks you need to spend a few years collecting and perfecting, like:

* becoming a vector artist. Sometimes its necessary to have a partially transparent image, which means 32 bit PNGs, which are super expensive. Flash allows you to create vector masks (vector illustrations are incredibly size efficient), which means you can use a PNG-8 or JPG and mask out the areas that need to be transparent. Which means getting really good, and fast, at tracing outlines. The next level being

* learning how to do photo-realistic illustrations. In the old days of 12k for a banner, I did a lot of car banners, which meant a lot of car illustrations that needed to look exactly like the photos. Even then, you'd have to reuse your assets a lot, in creative ways, in order to make the filesize. (Like using a tire illustration for the windshield [by scaling and masking]).

* writing really tight code. In the early days, our basic animation engines were a few KB, but you could rewrite your own using only the chunks of code you needed, and save a few K. My newest library is about 800 bytes and is powerful enough to use on most of my banners.

* learning that people really aren't as detail oriented as you might think, and blurs, rotations, tints, and speed are usually all the tools you need to make a convincing animation

-----


That's quite interesting. Now whenever I see a banner ad I will involuntarily start thinking about this.

-----


Is your only basis for feeling that people that like CoffeeScript don't "get" JavaScript the `class` syntax? If that's the case, it's a minor feature of CoffeeScript. I'd say the rest of the features it offers fall on the dynamic/functional side of things more than the strong+static typed/classical OOP side ( list comprehensions, splats, treating everything as an exression, etc.).

-----


> It doesn't but JavaScript and Skilled js devs can!

You might be overestimating the differences between Flash and JS here -- especially when you add HTML5 into the mix. What's to stop a skilled JS dev from playing <audio> when the user hits a page, burning processors with a few autoplaying <videos>, after forcing the user to sit through an interminable, animated <js/css3/svg> 'loading' screen? At that point, it's up to our own good tastes to decide how to wield that kind of power.

-----


I don't understand what your saying. What if JavaScript devs use HTML5 tools to purposely create poor experience as witnessed in Flash apps?

Then their site doesn't get return visitors and starts dying, just like Flash is.

-----


I'm saying kind of the opposite -- JS/HTML/CSS and Flash are now more similar than they are different. It's not the platform that's the problem. It's what you can do with (and how you can abuse) the platform.

-----


If you're running Flash content on a page, Flash is going to be running an event loop at the SWFs frame rate, even if it's not actually doing anything. JS, on the other hand, can be totally idle when it's not running any code.

Most JS use is sparing and lightweight and more about interaction than action/animation. Most Flash use is heavy-handed, ham-fisted, and overbearing, done more for cosmetic effect than additional function. Is this a part of the technology? No, but it certainly is nurtured by the differences between the development environments — Flash is still sold as an animation studio! What's more, JS gets to manipulate the DOM directly, giving it a much nicer relationship with the typical web experience than Flash, which is effectively a replacement for the DOM.

-----


>Most JS use is sparing and lightweight

Have you used Twitter or Facebook on resource constrained machines? Even on latest nightly builds of Chromium it's painful on my Dell Mini netbook.

The point is that you can use Javascript do just about everything you can do in Flash. And Adobe CS6 will almost certainly contain some tools to help you use your existing Flash assets in a pure JS+HTML+CSS environment. So the animation studio for Javascript doesn't exist yet, but we're talking about the near future where it will and it will be just as obnoxious as Flash (but much harder to block from consuming CPU.)

-----


The new Twitter really is the worst, and it's not just the Javascript. They've got that hovering topbar with an RGBA shadow and gradient background, which I've personally verified as being a source of much of the slowness on browsers that support these things. You can test it for yourself in any Webkit browser or FireBug — just disable those two CSS properties, and new Twitter feels immediately snappier.

Imagine what Gmail would be like if they went overboard with CSS.

-----


In case anyone's scared away by the format, it's an accessible, three-page, quick read. And it's really interesting. The author's approach of blending language survey with language construction is a strategy I've recently employed, and I've grown more as a programmer, more rapidly, because of it.

-----


I'm curious as to why you don't see Anon's actions as mob justice? Or if you do, why that's okay?

-----


Throwing around the term 'mob justice' is as meaningless as calling someone a 'freedom fighter.' Your freedom fighter is someone else's traitor/rebel/terrorist. I'm sure that Mubarak things that the Egyptians in the streets are trying to apply 'mob justice.'

-----


From where should a justice system derive its just powers?

Why is mob justice any worse than a justice system that allows people to be held indefinitely with out charge?

Why is mob justice any worse than a system that allows secret evidence which cannot be questioned or examined by the accused?

Would altering or abolishing a system that allows people to be held indefinitely with out charge be a good thing?

Either the justice system approves of this, or the rules of the system prevent it from taking action, either way it's broken.

-----


"Why is mob justice any worse"

As long as we're going all Socratic, why does the question of which is "worse" even matter?

We know what mob rule looks like. It's a failure state of human governance. Supplementing an imperfect system that can be metaphorically likened to mob rule with actual mob rule is not progress. I am not advocating for peacefully standing by while being beaten; I'm saying this is a bad tactic.

If you are concerned about injustice in the world, you can't make a more just world by committing your own injustices. No two people agree on how bad an injustice is; even if you think such things can be objectively measured somehow it is obvious that people in the real world don't agree on those objective measurements. Group A hits for 1 point, Group B measures that as a 2 point injustice and strikes back with a 2 point injustice of their own, Group A sees that as a 3 point injustice and strikes back with 3, and so on forever, until someone breaks the cycle. No amount of retaliation will ever make the society of A and B just, even though in my hypothetical example both sides are acting with perfect restraint and proportionality. (As you might imagine, this is the most unrealistic assumption my model makes.) However you intend to get to a just society, that's not it.

-----


If you are concerned about injustice in the world, you can't make a more just world by committing your own injustices. No two people agree on how bad an injustice is

Your second statement is at war with your first. Clearly, people can compare injustices, or else there would be no such thing as "more just". They don't have to be able to assign scores to injustices, they just have to reason that an injustice they can't choose can be replaced by one they can choose. That's pretty much how justice works.

Your example was also shit. While it is common to escalate injustice as a game strategy, that's neither a hard rule nor how it's usually done. In my experience, pardons are far more common, and are in fact closer to theoretical optima. Eventually, someone breaks the cycle (pretty unjust, right?), and the injustices in the world dramatically reduce. And then there's all the undervaluations of injustice you ignored - the traditional justification for secrecy.

-----


"Your second statement is at war with your first."

You missed the switch to differing valuations between two different people, it seems. You spoke as if either we're only talking about one person doing the comparison or you've casually assumed there is the objective metric I explicitly mentioned in play. No contradiction.

"Your example was also shit."

And you're just looking for reasons to tear something apart without doing the hard work of examining what was actually being said. Your nits are irrelevant to my point. I didn't give a treatise on the full value of how to create justice in the world, I'm speaking to the example at hand of how "Anonymous" retaliated and how people are applauding it when they shouldn't be. No wonder you consider it "shit", you're not even willing to grapple with what I said. You haven't fairly valuated it in the first place.

-----


You missed the switch to differing valuations between two different people, it seems.

No, I refuted the importance of it. My point was that while there might not be a universal, metric, objective measure of injustice agreed to by all involved, we don't actually need one to make social decisions (funny how three of the four qualifiers I used are essentially the same). Near Pareto efficiency exists for justice, and beyond that, numerous partial orderings have been developed over the millenia, based on perceived necessary conditions for the existence of societies.

Your nits are irrelevant to my point.

Then I must have misunderstood your point. It seemed to me that you claimed retaliation is always unjust and perfectly proportional retaliation is one-upmanship, and I don't agree at all. Since that's how I saw your argument, that's what I replied to.

-----


"Then I must have misunderstood your point."

You still are. The core point is different people will measure things differently. The point is that what Person A sees as a minor injustice that he committed against B, B sees as a major injustice because it happened to him. There's an old quote attributed to Mel Brooks where I found it online, though the core quote has been around longer than that: "Tragedy is when I cut my finger. Comedy is when you fall down an open manhole cover and die." That's the part of my point you're missing (and I do not think merely disagreeing with), people valuate injustices that happen to them much higher than things that happen to other people, let alone their enemies. Part of why I think you can't be disagreeing with it is this is undeniably true; people are not neutrally scrupulously fair on any level when it comes to their own possessions or desires. Everybody carries around an enormous self-bias, for various reasons, not all of them even bad.

Yes, society has come to some basic agreements, but that's not relevant to my point. I explicitly stated that retaliation isn't always unjust, and for another I also explicitly said that while each side perceived its retaliation as just the net effect is an unjust spiral. The perceptions are not the same on all sides. Every major conflict in the world is between a righteous and holy side that only commits justifiable and regrettable retaliation against the bad guys who inexplicably engage in acts of pure, unadulterated evil just for the fun of it and just won't leave us alone... and this describes the beliefs of both sides. Sticking the happy side of this label on "our side" with Anonymous is not something I'm ready to do, not ready to overlook the means to their ends, however wonderful the ends may be.

And none of this is a refinement of or a contradiction of anything else I've already said, just trying to lay the same basic point out yet more clearly.

-----


people valuate injustices that happen to them much higher than things that happen to other people

That doesn't matter. Sure, people do disagree on things that involve them personally, but they aren't the only ones acting. Very often, people make judgements about matters that may later involve them or people they empathize with, on either side. These future people may or may not have had previous experience with the thing, but all that is required for them to act so as to lower expected injustice is that they empathize with someone on both sides. This act can be both unjust and reduce injustice, as long as the process is ongoing (so that the expected injustices and participants materialize).

-----


> From where should a justice system derive its just powers?

One possibility is where a plurality of constituents agree either on a course of action, or believe an individual is qualified to act in their best interest. Obviously, this system has flaws (what happens when an elected person behaves selfishly?), but I'd argue it's more fair, in general, than a self-selected group executing their own agenda. We can't vote Anon out of power if we happen to stop believing their actions are just.

> Why is mob justice any worse than a justice system that allows people to be held indefinitely with out charge?

It's not, but are you insinuating that it's okay to subvert an unjust justice system using any means necessary? Or any means that work? Or am I reading into this? I don't think the US justice system is so broken that it needs to be fixed by extralegal means, but maybe I'm naive.

> Would altering or abolishing a system that allows people to be held indefinitely with out charge be a good thing?

Altering that system would be a great thing! Abolishing it, I believe, would not. If you're suggesting anarchy as a viable replacement, I'm honestly curious if you can point to any examples of large-scale anarchy that worked well? Again, I might be reading too much into your question, and you might have meant simply replacing it with another system that is not anarchy.

Thanks for your reply.

-----


Why have people downvoted fletiz's response to -1? I don't necessarily agree or disagree with it (I'm staying neutral in this discussion), but please - stop downvoting replies that you disagree with. This response, as far as I can see, was reasonable and considered.

-----


I've never understood the idea that downvoting a comment for disagreeing with it is bad. Anyway, I also disagree that it's reasonable and considered. The comparisons are flip and cheap and build in false alternatives. Not all methods of altering or abolishing unjust systems are laudable, and finding anonymous to be reprehensible is compatible with agreeing that some of their targets are reprehensible also.

-----


Downvoting for disagreeing is bad because your brain already does that for you, and very well at that. Votes regulate eyeballs, and should be awarded to comments that give you new insights, not ones that reaffirm your existing prejudices.

If you disagree with a comment that attempts to give thought to the issue at hand, please explain why you believe those thoughts to be wrong. This will force you to consider their thoughts and help others do so as well.

-----


It's no biggie, the reaction is quite what I expected given Plato's parable of the Cave.

http://www.youtube.com/watch?v=d2afuTvUzBQ

-----


When talking about mob justice, don't just select for the mobs you like. Consider the brown shirts, the KKK, and other mobs, who also carried out there own versions of justice.

-----


What they didn't isn't "okay" not in any way shape or form.

-----


I used to work for the internet arm of Condé in NYC in the mid aughts. The cafeteria was amazing; they'd have some big-deal chef in each week to work a lunch shift (though people would usually smoke instead of eating). The women there were also incredibly attractive -- it helped having Vogue in the same building. I have no idea what their San Francisco offices are like, but if they're anything like New York, it makes working there almost worth it. ...

almost...

-----


By... uhh... how many Experience Points?

-----


It's not experience points, but Gold, and you can buy anything with it.

-----


Anything, except love.

-----


Me love you long time!

-----

More

Applications are open for YC Summer 2015

Guidelines | FAQ | Support | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: