Hacker Newsnew | past | comments | ask | show | jobs | submit | AndreasFrom's commentslogin


Reasonable people might disagree, but I think that what they say there doesn't answer the question at all. Cock means rooster in English too, after all, but somehow the name doesn't get used.


`const` is for compile-time constants where something like `let` in Rust can be used for values generated on the fly. The latter is immensely more powerful and actually provides the described benefits like guaranteeing that data is not changing under your feet.

Edit: While `const PI = 3.1415…` is threadsafe, it's not very useful in comparison to runtime-immutability :)


Yes, the guarantees provided by true immutability are not met by "const". I wrote the note loosely using the author's expectations and advantages of immutability, not the exact definition. But thank you for letting me clarify.

Also I just noticed with Go's Unicode support we can write `const π = 3.14..` if we really wanted.


Bryan O'Sullivan commented that https://mobile.twitter.com/bos31337/status/47356953136621158... and Graydon Hoare referenced it in his post on Swift http://graydon2.dreamwidth.org/5785.html


Yup, that's what I heard (obviously 3rd hand). Second like is very useful as I've not had a chance to look at the swift docs yet.


I've written a lot of LaTeX and ConTeXt in Vim with one sentence per line without any problems.


I also follow this convention. One sentence, then new line. It looks a little janky, but when you run it through pandoc or whatever, it yields the way you would want.


Mobile? Wouldn't that be even harder?


On iOS front, there are a few native code compilers available for Java, like RoboVM and Codename One.

On Android, there is the issue Clojure is still a bit fat and uses too much reflection during startup. ART might make it harder as it is a AOT native compiler.

On WP, there are currently no efforts for Java support, other than maybe via ikvm.net. Or Clojure-CLR.


Tried compiling Clojure->Scheme->C?


Not yet, but the Clojure->Scheme and Clojure->native(LLVM) do look appealing.

However I tend not to like having layers between language and final execution target, as it increases debugging headaches.


You're right and they're not currently a goal:

"Non-goals: make channels completely lock-free (this would significantly complicate implementation and make it slower for common cases)"

http://talks.golang.org/2014/go1.3.slide#8


Clojure, like Java, has primitives. And I don't understand why you'd include it anyway, as functions are the primary form of abstraction in Clojure.


As you acknowledge yourself, whether Haskell makes you think or not relies on what you're trained to read.


Yes, you're right that Haskell is probably easier to read for someone with the mathematical background. But I'm referring to the cognitive overload incurred when you try to optimize it, thinking about list creation costs, then stream fusion to avoid it: most physicists or mathematicians will cringe at the thought of having to think about these "computer sciency optimization stuff". As opposed to this, a crude tool such as Cython or C or even Fortran allows one to just "skip thinking" about these and still have fast enough code.

Haskell is great if you want to expand your CS knowledge, but not if your math/physics/engineering problem is already so complicated that it uses up all your available brain cycles and working memory and you just can't squeeze thinking about language-specific optimizations too. I guess this is why it's only used by companies like Galois and such that are already neck deep in advanced CS problems and used to thinking about them all the time.


There is a saying: first make it work, then make it work fast. The problem with doing the second in imperative languages is that you need to pull all your working code apart and rewrite it. Haskell separates the "make it work" from the "make it work fast".


Except that no one actually thinks about that stuff when writing actual vector code. Trust me, I have written several real time 3D reconstruction algorithms (such as SLAM) in Haskell and was not thinking about stream fusion at all.


But I'm referring to the cognitive overload incurred when you try to optimize it, thinking about list creation costs, then stream fusion to avoid it

That's not true. This article is about a library that works as a drop-in replacement of the default list processing functions in the Prelude. Eventually, it may be possible that these functions will be put into the Prelude itself. This would allow naive users to get all the performance gains from stream fusion without ever knowing it's happening. All of the "cognitive overload" is taken care of by the researchers who developed this technique and the library authors who implement it.


> Yes, you're right that Haskell is probably easier to read for someone with the mathematical background.

I am quite taken by Haskell, and I have the whopping mathematical background of two introductory courses from my institute of mathematics.

> But I'm referring to the cognitive overload incurred when you try to optimize it, thinking about list creation costs, then stream fusion to avoid i

The author didn't need to know what stream fusion was; all they did was import a library... it might as well have been called import MagicallyOptimizingPrelude and it would have the same effect.


Wow, I used this website for my school-assignment on GUIs a couple of years ago. It's funny to see it again.


I think the size of the bar is actually ms/x so because Riot.js does more x's in the same period of time, the bar is shorter.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: