HNHacker News
TopNewBestAskShowJobs

shangaslammi

354 karma · joined February 1, 2011

submissionscomments
shangaslammi··on GCC is C++17 Complete
Is there a good, terse primer on the features and coding idioms/best practices of C++17 for someone who was proficient in C++98 but hasn't touched the language in years?
shangaslammi··on Cisco to lay off about 14,000 employees
It's kind of strange that massive layoffs like these result in a stock uptick. At least for me it's a sign that the company is probably unhealthy and that its value is going to go down in the future.
shangaslammi··on Typed Python: new Mypy release
Eh? MyPy already implements generics. It would be a pretty useless type system otherwise since you couldn't give precise types to e.g. lists of ints.
shangaslammi··on Toki Pona: a human language with 120 words
The creator of toki pona seems to be a fan of the Finnish language. Several of the words are loaned directly (although without umlauts) and keep their original Finnish meaning.

At a glance: älä, kala, -kin, nenä, nimi, sama, sinä are exact Finnish words and "pimeja" is a slight alteration of "pimeä". Kiwen, lipu, linja and walo are probably Finnish inspired as well.

Another common trend seems to be using a simplified and shortened forms of the phonetic spelling of English words such as "ale" (all), "en" (and), "insa" (inside), "jaki" (yucky), "jelo" (yellow), "kama" (come), "ken" (can), "kule" (color), "lukin" (looking), "mani" (money), "mi" (me), "mun" (moon), "nanpa" (number), "pata" (brother), "suwi" (sweet), "tawa" (towards), "toki" (talking), "tu" (two), "wan" (one) and "wile" (will).

Slightly distorted, but still close: "anpa" (under), "kulupu" (sounds like a Japanese transliteration of group, グループ), "pilin" (feeling), "sewi" (ceiling) and "sike" (circle).

This actually helps a lot in memorizing the vocabulary. :)

shangaslammi··on The New Haskell.org
Ah, right, sorry. I completely misread your post.

I guess there's something funky in the unicode handling on the site.

shangaslammi··on The New Haskell.org
You need to use curly braces in single-line do-expressions:

    do { line <- getLine; putStrLn line }
shangaslammi··on The New Haskell.org
Yeah, the online REPL is definitely not very useful or intuitive yet.

As it says, you can evaluate a single line Haskell "expression" and top-level declarations (like the sieve example) are not expressions. In addition, the sieve example declares an infinite list so there's no sensible way to print it.

You can fix all the above by using a let-expression on single line and only evaluating a finite part of the list using the 'take' function.

    let { primes = sieve [2..]; sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p /= 0] } in take 10 primes
shangaslammi··on Rovio lays off 110 people as Angry Birds hype fades
At least here in Finland it is much, much easier from a regulations perspective for a company to fire a bunch of people all at once rather than just few at a time.
shangaslammi··on How to pair socks from a pile efficiently?
I fold each pair of socks into each other when I put them into the washing machine and then unfold them when hanging up to dry. All pairs stay together, no sorting necessary.
shangaslammi··on 1.85% of Steam users run Linux
Vista gets security updates until 2017.
shangaslammi··on 1.85% of Steam users run Linux
I'm not sure what you are trying to imply. :)

Vista (at least after the first service pack) is a solid OS. I still run it on my gaming PC (which also dual boots to Ubuntu) and I don't see any reason whatsoever to "upgrade" to W7 or W8.

shangaslammi··on Steam Removes Game 'Order Of War: Challenge' From User Libraries
While "Order of War: Challenge" might have been sold separately at some point (I'm not sure), I think that most players (like me) were those who bought the original "Order of War" and got "Order of War: Challenge" as a free add-on.
shangaslammi··on Steam Removes Game 'Order Of War: Challenge' From User Libraries
The article claims incorrectly that the game had 18 single-player missions. The FAQ linked from the article is for the game "Order of War". "Order of War: Challenge" is a completely separate, multi-player-only game that had its servers shut down and was removed from Steam. The original "Order of War" is still available (http://store.steampowered.com/app/34600/).

In addition, the "Challenge" add-on was given free to those who bought the original game.

This is a complete non-issue as far as Steam is concerned (the complaint about publishers shutting down multi-player servers is certainly valid). There is nothing that you could do with the game even if you still had it in your Steam library.

shangaslammi··on Linux-ng
Or perhaps "Not GNU".
shangaslammi··on Abstractions for the Functional Roboticist
The slides as PDF: http://acowley.github.io/NYHUG/FunctionalRoboticist.pdf
shangaslammi··on The Deal That Makes No Sense
Yes, but the effect of ecosystem lock-down is huge compared to 5-6 years ago. It's not about who makes the best phones or phone-OS anymore. People are invested in their respective app ecosystems and all their photos, contacts, documents etc. are in Apple's or Google's cloud.

I'm not saying that Microsoft doesn't have a chance at all but I think the odds are against Windows phones ever reaching a significant market share no matter how much capital and R&D they stack behind it.

shangaslammi··on The Haxl Project at Facebook [pdf]
These are Simon Marlow's slides from his ZuriHac 2013 talk about Facebook's Haskell DSL for concurrent queries.
shangaslammi··on Why the world needs Haskell
The important bit isn't the Maybe-types, but all types that are _not_ Maybe.

If types aren't non-nullable by default then any function parameter or return value can potentially be null and a robust program practically needs to have null checks _everywhere_. Otherwise, when your program throws a NullPointerException you'll have no way to know where that null originated from.

In Haskell, the types guarantee that you never ever have to check for null (in fact, you can't even) unless the function's type explicitly allows for the possibility of having a null. In addition, you have several ways to compose function calls that might return null in such a way that you don't have to check for each null case separately.

shangaslammi··on Why the world needs Haskell
Scala doesn't really provide much of what is mentioned in the article.

It still has nullable types, side-effects aren't tracked in the type-system (so any function can potentially do anything) and the presence of sub-typing has several unpleasant consequences, for example: lack of full type-inference, generally more complex type signatures than in Haskell and having to deal with covariance vs contravariance.

shangaslammi··on Dynamic Languages are Unmaintainable
I would also argue that you can get the benefits of a static type system with hardly any cost. Usually when people talk about dynamic vs static typing they imagine something like Ruby or Python vs Java, but there's no reason why you can't have a high-level, expressive language with static types.

All you need is a sophisticated type-system and smart type-inference that works everywhere (not just locally) and you'll be able to be just as productive as with today's popular dynamic languages but get all the benefits of static verification.

shangaslammi··on Why I am so excited about Clojure
The thing with infix operators is not about being C-like, but rather about mathematical expressions looking like they do in actual mathematics (not to mention that each term potentially adds another level of nesting).

At least I've personally found that doing linear algebra, physics calculations or anything with more complex equations in Lisp-like languages is a huge pain.

shangaslammi··on Confessions of a Ruby Developer Whose Heart was Stolen by Scala
The same thing in Haskell:

    cycle seq = circular where circular = seq ++ circular
(or if you want to really golf it)

    cycle = fix . (++)
Ok, to be fair the Scala code is a bit more generic as it works for any abstract sequence, but still, Scala's syntax is awfully heavy compared to Haskell.

That's one reason I still prefer Haskell even though Scala is easier to sneak into enterprise projects thanks to JVM. Not to mention that Haskell gives stronger static guarantees and has a more sophisticated type inference system.

shangaslammi··on Google’s “Conversational Search” Goes Live On Chrome
Agreed. Lip reading via the camera would be much nicer to use (although probably an order of magnitude more difficult). :)
shangaslammi··on Dart Is Not the Language You Think It Is
Wait what? "Adding types will not prevent your program from compiling"

So even if you type-annotate everything, you will never get compile-type type errors? That makes the whole thing seem completely pointless.

shangaslammi··on Achron, time shifting RTS
The great thing is that the time-altering mechanics actually work really well and they even managed to make a user-friendly UI for what is arguably a rather complicated concept.

However, the actual RTS part is woefully mediocre and has problems such as bad unit AI and bad path-finding. At least this was my impression of v1.0. I guess I should take another look one of these days and see if the numerous patches have improved things.

shangaslammi··on Learn a Programming Language Faster by Copying Unix
Not at all. You can start doing I/O in Haskell without knowing anything at all about monads by just treating the do-syntax as an imperative DSL.

In fact, Bryan O'Sullivan (who wrote Real World Haskell) just held a tutorial session on Haskell a couple of weeks ago where people completely new to the language implemented simple Unix tools like "wc". I don't think monads were mentioned at all.

shangaslammi··on Dropbox Bug Can Permanently Lose Your Files
I've also had files zeroed out on a few occasions. I run Dropbox over a wide variety of machines and while this is completely anecdotal, the zero update has always come from one of my Ubuntu machines, which leads me to believe that this is specific to the Linux version of Dropbox.

Also, I had several occurrences throughout 2011 but so far hadn't lost anything during 2012, so either something has been fixed or I've just been lucky. :)

So, if you've noticed zero length files lately, can you check the timestamp on the last update? Is it recent or over a year ago? You can also go to that date in your event log in the Dropbox web UI and see what was happening around that time.

shangaslammi··on 0.3 - 0.2 == 0.2 - 0.1 is falsy. Which language gets this right?
In Haskell, decimal literals can be inferred as any Fractional type (including Rational, which is precise), but they default to Double if there is no context that dictates otherwise.

    Prelude> 0.3 - 0.2 == 0.2 - (0.1 :: Rational)
    True
Above, we explicitly declare one of the literals as Rational, and the rest are inferred as having the same type (since the standard library does not allow you to do arithmetics or comparisons between discrepant types).
shangaslammi··on Are Those Spidery Black Things On Mars Dangerous?
You mean like http://techland.time.com/2012/04/18/crab-computing-the-futur...
shangaslammi··on Planetary Annihilation - A Next Generation RTS by Uber Entertainment Inc
Well, why not? Isn't this the ultimate way for regular consumers to "vote with their wallet"?
Page 1 of 3Next →