Hacker Newsnew | comments | show | ask | jobs | submit | cschneid's comments login

It even happened the other night on The Nightly Show - an otherwise wildly liberal show opened their panel with a recommendation that Tsarnaev should be raped in prison.

The amount of vengeance in the american system, at the total exclusion of anything else disgusts me. See-also the torture that is super-max [1].

[1]: http://www.nytimes.com/2015/03/29/magazine/inside-americas-t...

reply


White males being raped in prison does not figure very high in the liberal agenda. The prison rape elimination act was a result of lobbying by conservative and Christian groups.

reply


I have been using spock for a 2-3 end point website. It's good. Very simplistic form of web framework (along the lines of sinatra).

The docs should be a bit better, with some examples of how to use the database and session features. I couldn't figure out how to get the database pool to work with Persistent (a db mapper library).

I bet its obvious to somebody with more knowledge of the type system extensions used, but I gave up after playing with it for an hour or two.

-----


Did you look at https://github.com/agrafix/funblog ? It shows how to use Spock with persistent.

-----


Amazingly in depth post!

I'm sad when programming languages have to reach for new keywords and syntax to add features.

`function*` is difficult to google for, and doesn't have any human readable hints for somebody to understand.

-----


JavaScript is constrained by backwards compatibility. That’s why the ideal solution, the keyword `generator`, wasn’t possible.

-----


This can't be about backwards compatibility. If it was, they wouldn't have been able to add 'yield, 'await' etc.

I don't agree the keyword "generator" would have been ideal. It wouldn't work when using 'enhanced object literals' [1], where you can declare a method without even using the keyword "function". In this case, if you want the method to be a generator, you can just put an asterisk in front of its name, so it's consistent with the "function*" syntax.

[1] https://babeljs.io/docs/learn-es6/#enhanced-object-literals

-----


FYI, "yield" has been a reserved word since ES5 and "await" is becoming reserved in ES6 (for eventual use in ES7): https://mathiasbynens.be/notes/reserved-keywords

It seems like a word must be reserved for at least one ES version prior to it being used.

-----


What about the "yield" keyword?

-----


It's only valid as a keyword within the `function*` block, so the parser can treat it as an identifier elsewhere. I haven't read the detailed spec, so I'm not sure that this is the standard behavior, but this would be a way to preserve complete backward compatability.

-----


Yes, that’s how it works. `yield` is only reserved in ES5 strict mode. But due to it only being a keyword inside generators, there are no problems in non-strict mode.

-----


Why do you think the current syntax is more backwards-compatible? Vanilla ES5 parsers complain loudly when seeing "function *".

-----


It's the other way around. ES6 needs to support loading ES5 content. They can't make 'generator' a keyword because it was a perfectly fine variable name in ES5.

-----


You are right. My bad.

-----


That would be considered "forward-compatible".

-----


which is strange, considering the `async` keyword in upcoming versions.

-----


AFAICT, `async function` is OK, because you combine a keyword with something that is contextually turned into a keyword. With a single non-keyword that isn’t possble. For example, the following code (a hypothetical ES6 anonymous generator expression) could be an ES5 function call followed by a code block.

    generator (a, b, c) {
        ···
    }

-----


That's why it wasn't included in the ecmascript 6 draft. In es6, "async" and "await" are future-reserved keywords. It's kind of a process of marking variables named "async" as deprecated. The spec authors have to balance compatibility with making the language pleasant to use.

-----


Is there even any situation where "async function(..." or "generator function(..." is currently valid syntax?

-----


I don't think googling is much of an issue here. Unless you're talking about the very first occasion that someone sees "function*", then OK, they can't google for that easily... But they can google "function with astersik" or something and they'll find out it's called a "generator", and use that in future.

-----


An unpopular opinion on a post about JavaScript maybe, but C#, Python, and others have implemented generators with no extra syntax because of an actual type system aside from "object, number, string, bool".

-----


I keep tax and similar docs on dropbox inside a truecrypt encrypted disk. Suitable level of security for my needs, and I like that its synced across a few systems (including one that is separately backed up).

-----


Good article. I like these articles that discuss haskell from a practical engineering point of view, rather than the bleeding-edge researchy point of view.

Even if I disagree with some of his style, its a cool way to get a starting point and begin getting a feel for what good haskell code looks like, and how to lay out an application.

-----


Also a good tutorial for getting a good feel what good Haskell code looks like and how to lay out an application is the howistart tutorial[0].

0: http://howistart.org/posts/haskell/1

-----


The downside of using (.:) is that it is used heavily in other libraries (Aeson for instance) in a very different context (field accessors, similar in look to json's `:`).

-----


Its riding the haskell bandwagon to some degree. By borrowing ideas from category theory they have some really nice abstractions in practical code. But then it gets more confusing so you want to loop back and see what the actual definition of a "monoid" is, or understand "functors". Even if haskell's idea of functor isn't 1 to 1 with category theory's.

-----


The only thing I can think of that's wrong with Haskell's functors is that they're more specifically endofunctors, or am I missing something else?

-----


And Hask is arguably not a proper category

-----


Can you expand on this? I'm genuinely curious.

-----


My understanding is that it's not a proper category due to the presence of Bottom - https://wiki.haskell.org/Bottom

> Bottom is a member of any type, even the trivial type () [...] If it were not, the compiler could solve the halting problem and statically determine whether any computation terminated

You can imagine function composition and identity don't work too well on things that never complete.

-----


Ah yes, you're right. I always forget about bottom.

-----


This is by far my favorite bit of documentation. I have to go look it up every time a manager or client starts asking for localization to justify my high estimates on how long it'll take.

-----


Sorta yes. In order of wild-west to stable, it's:

Hackage - live packages get uploaded and released fast

Stackage - a rolling tested release. It promises that all packages will compile together. (There are a few flavors of this).

and now LTS Haskell. A snapshot of Stackage that doesn't roll very quickly (every 3 months). It won't do upgrades to packages at all, except for bug fix & patch releases. So your own application code can pull down the LTS today, and again tomorrow, and be relatively sure that everything will work the same.

-----


Can somebody give me the background here? What is a FTDI FT232s?

It appears to be a fairly low level USB controller chip? Is this chip (or its ilk) in every kind of usb device? What is the impact of this?

Most of this article dives in with a fair bit of preexisting knowledge - can somebody fill me in?

-----


FT232 is USB to serial port adapter chip. Typical application of these chips is anything that has to be connected to USB but does not warrant full-featured USB implementation. This includes various interface cables and converters, (low-cost or specialized) test and measurement equipment and large amounts of various (semi-)custom electronics (both hobbyist and industrial).

In essence, FTDI's chips are the go to solution for adding USB support when you don't want to spend too much time on it. I would argue that today there are better and cheaper alternatives, but FTDI was probably the first vendor of such chips with reasonable documentation and software support.

-----


It's a USB-serial chip. The most common device I can think of that it shows up in is USB modems.

-----

More

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

Search: