News for hackers. Stuff that matters.

zephyz

Re:What Monoids teach us about software on Wednesday September 13, 2017 @02:33PM (#15241199)
I did. I left it out for two reasons: - the comment asked for a "simpler" explanation and associativity isn't a specially simple concept if you are not familiar with it and does not really help understand the core idea of a monoid. - in practice, monoid associativity isn't checked. Most type system aren't able to express it. Therefore, whenever you encounter a monoid you have no guarantee that it is indeed associative.
Re:What Monoids teach us about software on Wednesday September 13, 2017 @01:55PM (#15240777)
You have a value of a certain type.

You have another value of the same type.

If there exist a function (let's call it "combine") that combines those two values and emits a third value of the same type.

AND

There exists a value of this type that does nothing when used as argument to this "combine" function.

then your type is a monoid. (basically)

Re:The LaTeX Fetish (2016) on Monday August 14, 2017 @02:26PM (#15011125)
I'm surprised the author does not mention another reason that've heard in favour of using Latex: scale and predictability.

A LaTeX Document will always behave the same whatever its size and content. Whereas word processors may unexpectedly change formatting without anyone noticing, for example in the case where you share a file with someone and this person update the text and sends it back. The text written might not belong to the same formatting family as the rest of the text but shares the same appearance and this change will go unnoticed until the original owner changes the appearance of the formatting family.

Not to mention versionning. Having your thesis in Latex in a git repo will consistently work. Whereas you will struggle sharing a single .docx file across multiple system or even different word versions. And you lose any possibility to roll back, inspect the history or show diffs.

Re:Programming languages aren’t a zero sum game on Monday July 10, 2017 @04:20AM (#14734194)
Too bad this as just a rant. There are some interesting statements to make about programming language features that come from this title.

For example one can contrast languages that choose to have total type inference at the price of some other features.

Typically Idris or Scala do not have complete type inference. But they have other features instead (dependent types/subtyping) Those trade offs make it feel like programming language features are a zero sum game where every feature you choose to have in you language will limit another aspect of it.

Re:ShiftJS – Swift to JavaScript transpiler on Monday August 15, 2016 @07:26AM (#12289716)
Why didn't they fork the actual swift compiler that does all the lexing, parsing, syntax checking, type checking, SIL generation, LLVMIR generation, and add a final phase that compiles to JS?

This whole project seem like a lot of duplicated, wasted (and error prone) work

Re:Ask HN: Get into PLT with no CS degree on Friday July 29, 2016 @01:51PM (#12188535)
Good point. Thank you!

Ask HN: Get into PLT with no CS degree

Hi, Here is the situation: I've received a letter from my uni saying I cannot continue my studies there. I love the theory of programming languages and I've been studying on the side books about type theory, compilers, programming languages, category theory, topos and proofs (TAPL and Software foundations form B. Pierce, Introduction to category theory by Harold Simmons, papers on DOT/scala)I...

( Read More... | 3 comments | 5 points | on HN )
Re:Apple files final response in San Bernardino iPhone case on Wednesday March 16, 2016 @02:46AM (#11295474)
Your behaviour exactly illustrates the equivalent between the two: arbitrary social pressure against what is, I would argue, better for humanity.

Thankfully, we have strong smart influencal people taking a stand for us,humans. And we should appreciate that.

And I don't think I'm risking too much by saying that dodging an authoritarian surveillance regime is better for humanity.

Finally, I understand that people dying is scary, but let me put things in perspective for you: Should the death of a finite number of people put at risk 7 billions lives and the lives of their children for centuries?

Edit: few -> finite

Re:Null Object Pattern in Swift on Thursday November 12, 2015 @03:29AM (#10551966)
It's like the author doesn't know what he's doing.

Why would you ever want to maintain such code when the language already solves all that for you with optional chaining and flatMap?

Re:Should I use a Swift struct or a class? on Saturday July 04, 2015 @12:09PM (#9830540)
This post is basically saying "I don't understand programming and I won't even try"
Re:The next version of DuckDuckGo on Monday May 05, 2014 @05:00PM (#7701223)
If I disable meanings in the settings I see video and picture results. Is that the intended behaviour?