Union Types have been accepted for PHP 8 - <AUTHOR> https://wiki.php.net/rfc/union_types_v2 <comment><USER2> When I started programming a few years back, I was told that PHP is legacy tech and a terrible language I should avoid like a plague. After years of battling with Node.js on the backend, I took a closer look at modern PHP and the Laravel framework and I was amazed by how good the developer experience was. The language itself feels like a lite version of Java. I believe everyone starting on web development should know PHP. It's hugely deployed, it has a very mature and rich ecosystem and it's a great language to build your side project/business without spending your time on meaningless tasks. Don't be driven by FOMO like I was, there's no such thing as a "perfect programming language". Every language has it's quirks and that's fine. PHP might be old and boring but it helps you get things done faster than using the new coolest language.

<comment><USER3> PHP has come a long way, and nowadays it's in the same category as Python. Worse in many ways, but better by other, like the type declarations and their (runtime) enforcing.

Yet there are still many ugly sides to PHP, and Laravel illustrates most of them. There is so much magic that IDE can't follow: some classes have a `__call()` magic function that redirect methods calls to other instances. Some functions return values of varying types, with no common interface.

I've worked with several PHP frameworks, and Laravel is by far the worst. Its awful documentation plays a big role in this (no real reference doc, just a tutorial ; no links to classes or function in the doc ; the API doc is a joke ; the acclaimed "laracasts" are useless for serious work). The fact that this framework is dominant in the PHP community is worrying.

<comment><USER4> Laravel is popular because it allows you to setup your project very quickly.

And then the trouble starts. Remember what properties your models had? No? Well so doesn't your IDE. There is just too much magic going on to keep things maintainable.

If you like a framework like Laravel you should go with Symfony instead. But don't use annotations. Keeps things separated so you and your colleagues can find routing and database information at logical places instead of all over the place in classes.

<comment><USER5> Laravel, from my own experience is full of deep rooted magic, and assumptions. Also it throws SOLID out the window.

We use Symfony at work and we turned off the annotations package, use XML mapping for our models.

Of course, Symfony and Doctrine do have some frustation points.

<comment><USER6> I have the same experience. Laravel is way too magical for me.

I use Symfony for quite some time and at one point I stopped using Doctrine data mapper. The DBAL and the query builder are enough.

<comment><USER5> If it were up to me, it would all be SQL queries. Maybe even use the library I rebuilt - [https://github.com/ellisgl/GeekLab- GLPDO2](https://github.com/ellisgl/GeekLab-GLPDO2)

</comment></comment></comment></comment></comment></comment><comment><USER7> Whether you love it or hate it, it's cool that the PHP project has come so far. I know a lot of people still use PHP every day, so it's good to see the language continues to improve. I imagine a significant percentage of web services are still PHP based to this day.

<comment><USER8> Over 30%, thanks to Wordpress.

<comment><USER9> Facebook, Wikipedia

<comment><USER10> I believe that Facebook is fully transitioning to hacklang

[https://hacklang.org/](https://hacklang.org/)

<comment><USER11> Doesn't that count as a PHP dialect?

<comment><USER12> Depends on what you mean by "dialect." I believe complete backwards compatibility with PHP is no longer a goal of Hack.

</comment></comment></comment></comment></comment></comment><comment><USER13> It's nice to start out typeless during problem domain discovery and proof of concept phase then quickly introduce types when you better understand the problem. This change will help that phase transition with enforcement right in the runtime as opposed to simple doc block annotations.

<comment><USER14> "Bad programmers worry about the code. Good programmers worry about data structures and their relationships."

― Linus Torvalds

Discussion: [https://news.ycombinator.com/item?id=4560334](https://news.ycombinator.com/item?id=4560334)

<comment><USER13> Yes. We want to spend as little time as possible on code so we can quickly find the data structure that best solves the problem we have yet to understand.

      // I know nothing. Not sure what types would work best...
      public function method($data)

      // I know more
      public function method($data array)

      // More
      public function method($data array|false)

      // Even more
      public function method($data array|false) : int

      // Ah. Okay. I understand the problem domain and have proper data structures to solve it
      public function method($data array|false) : int|float

Notice the type system never got in our way. We organically grew into the type system as our understanding of the data evolved.

</comment></comment></comment><comment><USER15> I wonder how stock PHP is stacking up to Hack both from the dimensions of efficiency, safety, and productivity these days.

<comment><USER13> The Hack HHVM JIT is typically more performant than standard PHP 7. However, that is more of an apples to oranges comparison of JIT vs Non-JIT than Lang to Lang comparison.

That said, PHP 7 has squeezed most of the performance from the language and the low hanging fruit is gone.

However, PHP 8 looks to bring a standard JIT to PHP [1]. I'd guess that once that happens Hack / HHVM may no longer have any advantage.

[1] [https://hub.packtpub.com/php-8-and-7-4-to-come-with-just- in-...](https://hub.packtpub.com/php-8-and-7-4-to-come-with-just-in-time-jit- to-make-most-cpu-intensive-workloads-run-significantly-faster/)

<comment><USER16> Just to add (you didn't say otherwise), PHP on HHVM is EoL'd [https://hhvm.com/blog/2018/09/12/end-of-php-support- future-o...](https://hhvm.com/blog/2018/09/12/end-of-php-support-future-of- hack.html).

<comment><USER17> _" PHP on HHVM is EoL'd"_

True that you shouldn't expect large existing PHP projects to run. But, the syntax is close enough that for net new projects, it's essentially PHP.

</comment></comment></comment></comment><comment><USER18> This is one bad feature among many good decisions, but bad nonetheless. The language will have yet-another-way to do type-erasure/autoboxing that will have to be tracked down, in the interest of removing boilerplate when multiple types are desired to be coerced. Type safety is recognized as valuable by the PHP core voters on one hand, and waved away by the other.

Imagine the fun!

<?php

function callit(float $numI) {

        $numB = $numI || ($numI/2);

        echo gettype($numB)."\n";

        $numF = ($numI/2);

        echo gettype($numF)."\n";

        return some($numB);

}

function someType(int|float $numX):int {

        echo gettype($numX)."\n";

        return $numX;

}

$ret = callit(2);

echo gettype($ret)."\n";

<comment><USER19> That's why you do this instead:

<?php declare(strict_types=1);

Your code would flag an error in the IDE and throw a TypeError exception.

</comment></comment><comment><USER20> This is cool! I wish tools like postgres had them too.

<comment><USER21> Do any relational databases have them? I've never understood why not. They go through the trouble of providing a mechanism to formally model your data schema, but if your data involves things that can be one thing or another, they totally punt and ask you to find a way to hack it on top via ORMs or similar. Why not model everything in Postgres such that users can issue requests against their actual data model and Postgres can make it fast, instead of building a shim layer between the data model surface and Postgres (shim layer = ORM, in case it wasn't obvious) that can only generate queries that are likely more difficult for Postgres to optimize for lack of missing type information.

<comment><USER22> > _Do any relational databases have them? I've never understood why not_

For one, because they need a fixed binary representation for the type, to persist it on disk. In a programming language yoi do things in memory, so you don't have that issue...

Still, you could have had union types, or even coerce everything as string, as SQLite does, but it would be bad for performance as they'd need an alternate representation.

<comment><USER21> > For one, because they need a fixed binary representation for the type, to > persist it on disk. In a programming language yoi do things in memory, so > you don't have that issue...

Memory and consequently programming languages also requires a fixed binary representation. How you represent data is orthogonal to its storage medium-- you can write application memory to disk and read it back in, no problem (e.g., swap).

> Still, you could have had union types, or even coerce everything as string, > as SQLite does, but it would be bad for performance as they'd need an > alternate representation.

The problem doesn't go away by moving support out of the database and into the application; it only makes it worse insofar as the application is limited in its optimizations. At the end of the day, the real world has sum types, applications use them, and they are encoded into databases--they simply aren't encoded _well_ and the database isn't giving you any correctness guarantees as it does for product types (i.e., structs, records, etc).

<comment><USER22> > _Memory and consequently programming languages also requires a fixed binary > representation_

Already covered that.

Programming languages can save their data as unions or structs, and take the minimal hit to switch on the type.

DB's persisting data on disk can do the same but will take a much bigger hit.

> _How you represent data is orthogonal to its storage medium--you can write > application memory to disk and read it back in, no problem (e.g., swap)._

The costs are not orthogonal to the storage medium however.

> _The problem doesn 't go away by moving support out of the database and into > the application_

On the DBs side, it does go away. The DB only has to guarantee what it says it supports (only store one specific type in a column). So for the DB implementors, that's a great invariant for their implementation ease and performance.

<comment><USER21> > Already covered that.

Where? I didn't see it.

> Programming languages can save their data as unions or structs, and take the > minimal hit to switch on the type. DB's persisting data on disk can do the > same but will take a much bigger hit.

Yeah, of course. Disk is more expensive across the board. Same applies for storing ints, but databases don't punt on that. And anyway, the sum types still exist in the schema, they are just implicit, as hoc spectacles built on the fly by the user. So you're still dealing with performance issues, but they're worse.

> On the DBs side, it does go away. The DB only has to guarantee what it says > it supports (only store one specific type in a column). So for the DB > implementors, that's a great invariant for their implementation ease and > performance.

This applies to every feature for every tool. You don't have to solve the problem if you just put it on your users.

Of course, tools have charters, and the relational axiom is that users shouldn't have to manage their own storage and retrieval layer, but rather they should declare a data model and interface with it and the RDBMS would make search and retrieval fast and correct. Sum types are necessary in data modeling, so it fits clearly and neatly into the charter.

<comment><USER22> > _Where? I didn't see it._

"For one, because they need a fixed binary representation for the type, to persist it on disk. In a programming language you do things in memory, so you don't have that issue..."

The crucial difference I point is "persist on disk" vs "do it in memory", not in the "binary representation". Both running programs and DBs have one, but one absolutely needs to be persisted on disk, whereas live program memory doesn't.

> _This applies to every feature for every tool. You don't have to solve the > problem if you just put it on your users._

There's also the fact that it might not be a problem just an easy cop-out from the user.

In which case it's better to force your users into the more formal and rigid structure, and have them rethink their model, than turn the DB into an "anything goes anywhere" store.

<comment><USER21> > The crucial difference I point is "persist on disk" vs "do it in memory", > not in the "binary representation". Both running programs and DBs have one, > but one absolutely needs to be persisted on disk, whereas live program > memory doesn't.

Right, I agree, and my point was it doesn't matter. Disk vs memory is a red herring. The same principles apply to both and the fact that disk is slower applies as much to product types as it does to sum types. In fact, sum types are represented as product types, but the system enforces invariants about the structure.

> There's also the fact that it might not be a problem just an easy cop-out > from the user.

That's a nope from me. Tools exist to solve problems. If a tool purports to solve a problem but only does it halfway, it warrants criticism or observation.

> In which case it's better to force your users into the more formal and rigid > structure, and have them rethink their model, than turn the DB into an > "anything goes anywhere" store.

RDBMSs are literally forcing their users into a _less_ formal structure. You can't rethink your model and make them go away (they are fundamental data modeling primitives), you can only find ways to hack product types to represent them, but you have to do all the work to make them fast and you probably just have to give up on verifiable safety altogether.

And how do you get from "sum types" to "anything goes data store"? Are you sure you understand the debate?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER23> It was long ago I worked with PHP, before PHP 5. Is typing enforced with PHP these days? Or is it more like type hints, as in Python?

<comment><USER24> For classes it's enforced since PHP 5. For scalars you get to chose between enforcement or type coercion for callers on a per-file basis.

However, as with other dynamically typed and interpreted languages, all of this is happening at run-time, so one of the biggest benefits of strong typing (type checking at compile time) doesn't apply.

<comment><USER21> You can statically type check a dynamically typed, interpreted language. Python via Mypy and Typescript being two examples.

<comment><USER25> Unfortunately, PHP doesn't ship a tool for this (and it's hard due to the way autoloading works). So PHP's typing is slightly less useful than e.g. TypeScript.

<comment><USER26> Tooling is not the issue here, nor is autoloading.

ISO C and C++ doesn't provide tooling, nor should any language. Tooling is better handled by third parties and implementers. Language should be focused on application and execution of the language. Unfortunately for PHP the language and implementation are tightly coupled as is Java and Swift.

A well constructed modern PHP project using composer has the tooling needed to statically validate. Personally I use PHPStorm but I also use IntelliJ for Java and Android. There are others out there as well.

Autoloading used correctly is no more than Java using a package line or namespace.

I find no problem with TypeScript and others. I however have a 10+ million line code base of PHP that predates TypeScript and others and needs to get a viable transition path. This gets things closer with real type errors at runtime. That is way better than my mainframe COBOL counterparts who have no path forward at the level of modern code.

<comment><USER25> Tooling inside IDEs is somwhat useful. But being able to just run a compiler- like CLI tool to tell you if there are type errors in your program is much more useful still, since you can run it in pre-commit hooks and on the CI. As far as I know, a tool which can do this _without_ requiring extensive configuration and without throwing false positives does not exist yet for PHP.

As for the "language shouldn't provide tooling" argument: You picked C / C++ as a positive example for this. Those are standardized languages which evolve at a glacial pace. For most of their use cases, this is a good thing. But I'd say PHP's faster evolution over the last decade was the right thing for that language. Other modern language projects seem to follow a strategy of a single standard implementation with extensive tooling pretty successfully (e.g. Go, Rust, Swift, ..).

</comment></comment></comment></comment></comment></comment><comment><USER27> Now please do this for Golang :)

</comment><comment><USER28> Before the usual avalanche of posts criticising some PHP 4 features, the union types look like a nice way to formalise something that is commonly used and very useful.</comment>


How to Avoid Mediocre Co-Founders - <AUTHOR> http://ycombinator.posterous.com/how-to-avoid-mediocre-co-founders-0

<comment><USER2> I think this is very very important.

I'm myself suffering having made such a move. I get things done very fast, my cofounder doesn't. It makes me more tired every day, as I see that every problem that arises (or anything new that has to be created, administrated) will eventually end up on my shoulders. I do the programming, administration, legal work, financing etc... Everything we sell, all our intellectual property was created by me.

Also in our business plan (which he spent like 4-5 months working in it), we should already be ultra profitable right now. But guess where we stand. And this journey already takes over 1 1/2 years.

I guess it's time for a change soon. I wish I would have been much more careful choosing whom to start my business with.

<comment><USER3> There's often cultural pressure to take a co-founder. Don't listen to it. You are different, and what's worked for others is only a suggestion; never a rule.

Everyone should know that each partnership has one who works harder and brings more. You have to know, going in, that it might be you and how you would feel about it.

Finally, it's not your partner's fault the business plan isn't panning out; they never do. They exist to help you clear your thoughts, not to predict the future.

<comment><USER2> I don't have any problem with the business plan not working out as intended, but spending so much time on it, and then having nothing at the end, this is what I have a problem with it.

I would have rather seen him spending the time on selling our product.

</comment></comment></comment><comment><USER4> Nice generalization that doesn't address the question of just what constitutes an A-player vs. B,C, and Losers and why I should think that an A-player in one situation will continue to be an A-player in another or if, given the right incentives, whether a B,C,Loser can become an A-player.

<comment><USER5> If you look at another and think "he is better than me at x,y,z" and you feel jealous, and want some type of retribution or revenge, you are a B player.

The A-player makes their skill or activity look easy and isn't conceited about it, they are primarily trying to out-do themselves. They aren't trying to add some egotistical emotional experience to themselves via the startup process.

A B-player won't want an already successful, serial entrepreneur as a co- founder. They want the glory. They want to own any success, even it is another's, with which they'll aim to claim.

Also, B-player investors are those that follow other investors, they can't make an investment decision on their own, so they follow the A-players and pretend to be A, but they're not.

<comment><USER6> "If you look at another and think "he is better than me at x,y,z" and you feel jealous..."

If you look at another an think of how that person being better at x,y,z would make them a huge asset to your company, you just might be an A player.

</comment></comment></comment><comment><USER7> If A players hire A players and B players hire C players, how do the B players ever get hired?

Yes, I'm being facetious. But even fortune-cookie level business advice should pass basic sanity checks like this one.

<comment><USER8> By fooling A players into thinking they're As? Hard, but I'm sure it happens.

However most of it might be convincing Bs they are Cs ... and what happens after that is not pretty for the hiring B, I suspect.

One likely characteristic of Bs is less than total honesty, with self and others.

</comment></comment><comment><USER9> This post boils down to 'Avoid Hiring Mediocre Co-Founders by Hiring Good Ones'. Every day I learn something new here.

</comment><comment><USER10> If you want to know what kind of player you are, think about how you respond to difficult situations or poorly done work. If you feel anger or kind of OK with it, then you're all but A player.

On the other hand, if you feel an urge to do the best possible move then you end up doing the work yourself, eventually turning into a star, or you hire these who can do better then you. That way you get the A score.

</comment><comment><USER11> That seemed full of pretty bland "corporate" words until the last paragraph (of the quote) - which makes the point well.</comment>


A geek meets the Ikea Lillabo Train Set - <AUTHOR> http://www.jgc.org/blog/2010/01/more-fun-with-toys-ikea-lillabo-train.html <comment><USER3> Fascinating and depressing at the same time. Posts like this make me think I'm in the wrong job as if asked to write a similar program, I'd have no idea where to start. JGC labels this as a "small program", like it was knocked up on a whim :(

<comment><AUTHOR> It was knocked up on a whim, and it is small, but don't be depressed: it wasn't easy...

I had to bang my head against the trigonometry to get it all correct. Although I know the rules of trig, I always have a hard time applying them in the real world because I have a hard time imagining the shapes involved. Ended up drawing little pictures of what was doing on.

<comment><USER4> I think it would be quite interesting to know more about how you approached this problem for solution, than the solutions presented by the program itself .. I didn't really get much of the details about how you'd sorted through this from your post .. perhaps a followup topic?

Its really great, btw .. I play with this toy with my son on a regular basis, and found myself just a few days ago wondering what is the maximum number of shapes we can build with the set .. okay, this got a bit screwed up by the addition of another mini-set gifted to my son by a friend, so there is room for improvement in my thinking now that I've learned what you have discovered. Nice job!

<comment><AUTHOR> I tried to explain how it works in the comments in the code. Probably worth reading them in detail as they do explain the algorithm used.

My thought process was something like this (over a number of days grabbing time when I could):

Emulate a human selecting pieces and clicking them together. Model pieces as straight lines of the right length. There are two important things: how long the line is and how much it modifies the angle at which the next piece will join. Thus all I need is to keep track of the position of the end of the last piece added and the angle.

Spend a while figuring out the trigonometry and getting that code working correctly. To generate the permutations I realized that the process could be split into three parts:

1\. Always place the bridge. Since there's one just add it at the end.

2\. Separate the straights and curves. Generate all the permutations of clockwise and anticlockwise curved pieces. To do that I used the trick of all 12-bit binary numbers between 0 and 2^12-1.

3\. Then insert the straight pieces between the curved pieces in all places possible.

Feed each possible track layout into code that builds the track and check that the end pieces match up. Add code to eliminate end pieces that join impossibly (come from the wrong angle), add code to remove duplicates caused by rotation and reflection.

Once I got that working I then wrote code in Processing to draw a pretty picture.

<comment><USER5> You might be able to speed it up considerably by adding

2a. Continue with next iteration unless the turning number of the sequence of curves is a whole number.

You add 1/8 to the turning number for each clockwise curve and subtract 1/8 for each CCW (for numerical stability you would rather add of subtract 1 and check for multiples of 8).

</comment></comment></comment></comment></comment><comment><USER6> I just noticed that the bridge can be divided into two parts. Have you thought about how many new track patterns you can create if you allow some of the pieces to be elevated and use the two separate parts of the bridge as slopes onto and off of the elevated track?

<comment><USER7> There are special ramp pieces you are supposed to use for that purpose and bridging blocks that allow you to elevate regular track. I've never heard of this brand but it used to be called "Brio" when I was a kid, <http://brio.knex.com/>

<comment><USER8> I have a box full of brio from my childhood at home - and, yeh, they did have blocks to let you make raised track.

(it was a pain though because it was easiest to build the bridges first - <USER2> then just as you laid the last piece of track a trip/wobble/stumble collapsed the raised bits :P)

</comment></comment></comment><comment><USER9> My son got a similar train track when he was little but with a lot more pieces. I wanted to write something similar but never got around to it. One twist is that his set has several sets of forks and some pieces to make an elevated track that can double as a bridge. I'm going to look through the program and see if I can add these types of pieces. We always just made up the tracks as we went and quickly learned to follow some rules so the track would loop but not reverse the train because we had 2 sets of trains. It became a contest between my wife and I to see who could come up with the coolest layout. It was lots of fun.

</comment><comment><USER10> I've got a whole crate full of Brio wooden trains from when I was a kid, including up/down pieces. I bet if I modified this software to work in three dimensions it could build millions of configurations with the parts I've got. Could be fun.

<comment><USER11> My brothers and I have split our massive compiled collection of Brio for our kids. It makes me sad that the company is no more. I've heard bad knockoffs are now available in discount stores, but they don't fit the original track.

<comment><USER12> Since when has Brio ceased to be a company?

They're on the internet and I've seen Brio trains in toy departments each year -- bought some extensions for my own kids a few years ago, too.

</comment></comment></comment><comment><USER13> I've been using jashkenas' ruby processing for a simple gui: <http://wiki.github.com/jashkenas/ruby-processing> . Processing is a pleasure to use once it's liberated from java syntax.

</comment><comment><USER7> If anyone's interested in more complex wooden train sets... <http://www.woodentracks.com/CTGY/Toy_Train_Sets.html>

</comment><comment><USER14> I've got the same train set at home. I also bought the extra parts with the fork an extra brigde, trestles, and tunnel. Sounds like I've got a new project to help me learn processing.

</comment><comment><USER15> Awesome. I'd bet most parents reading this have two sets. You should update your post with all the other possible configurations. How many 3 and 4 leaf clovers can you make?

</comment><comment><USER16> How many shapes could you form with 2 of these train sets? I think each one costs just $10 or so.

<comment><USER17> $20

The $10 set is smaller.

</comment></comment><comment><USER18> I've also started messing around with Processing. I've been using it to generate some simple art.

</comment><comment><USER19> This is simply amazing, John. I wonder what you could do with two sets...</comment>


Anonymous targets indefinite detention bill - <AUTHOR> http://www.tgdaily.com/security-features/60237-anonymous-targets-indefinite-detention-bill

<comment><USER2> Anonymous lists the names of Portman's children in the attack.

I don't have much problem with the "attack," which mainly lists Portman's public information.

But his children are innocents and vulnerable, and it's beyond the pale to involve them. People with an interest in this issue are not the only people who read the web. Sometimes knowing a name is all you need to social engineer a crime.

Don't do this, it's wrong.</comment>


Our Amsterdam startup partnered with Virgin Mobile - <AUTHOR> http://blog.soocial.com/2011/08/12/soocial-and-virgin-mobile-to-spice-up-address-books-in-australia/

<comment><USER2> That's awesome news, but I would love to hear some more details of how you orchestrated this. How did you get in touch with them initially? Were they very receptive right from the start?

</comment><comment><USER3> Great work spif! Congrats!

</comment><comment><USER4> Great news, congrats!

<comment><USER5> Thanks.</comment></comment>


Students suggest digital 'Magna Carta' - <AUTHOR> http://www.bl.uk/my-digital-rights/vote-now

<comment><AUTHOR> Lots of the suggestions scare me.</comment>


Too Many Programming Languages - <AUTHOR> http://sapan.svbtle.com/dealing-with-a-plethora-of-programming-languages <comment><USER2> >Then we could all write in our favorite languages and make sure the code is transplied to Lisp - just a thought.

I read this as:

"There are too many programming languages. Why can't everyone just use Lisp?"

I laughed a little to myself due to the Lisp user stereotype of parading Lisp around as every programmer's savior. Did it come off that way to anyone else? I don't mean to offend, as I rather enjoy Lisp too. But I felt the premise of the article was "all code should transpile to other code" and I ended up reading it as "all code should be Lisp".

Maybe that was the intended humor. Maybe humor wasn't intended. Either way, I got a laugh out of it.

There are a ton of libraries/wrappers use to run X code in Y language or middle-men. Rubypython [一] comes to mind. While it doesn't fully cover the problem it's a start. However is that method the one we want to use? Does a better method even exist or is a better method even possible?

[一] [http://rubypython.rubyforge.org/](http://rubypython.rubyforge.org/)

<comment><AUTHOR> Lol, OP here, I guess in an indirect way that's how it came off. I don't really think everyone should write in Lisp, but rather that we all should be able to write interoperable code, and one suggested solution is a tree like structure - which happens to be Lisp. Maybe a Unix pipe type construct would be better? Just some thoughts on a lazy Thursday afternoon.

</comment></comment><comment><USER3> This doesn't work because there are a number of semantic distinctions layered even on top of Lisp-like syntax tree, and all those languages have different semantics. Common Lisp, Scheme, Clojure, and Arc are all Lisps, but you can't use code written in one of them inside a different one.

The way you get language interoperability is to define a common data format and a common way of indicating which code will execute next. A number of standards do this - platform ABIs, C calling conventions, LLVM/JVM/.NET bitcode, RPC frameworks like gRPC/Thrift/CapnProto/MessagePack/JSON-RPC/Avro - but they're all lower level than you would normally want to program in.

</comment><comment> c-rack Projects like zproto [1], by using the "Universal Code Generator" GSL [2], have maybe already found the "common denominator" you are looking for.

[1] [https://github.com/zeromq/zproto](https://github.com/zeromq/zproto)

[2] [https://github.com/imatix/gsl](https://github.com/imatix/gsl)

</comment><comment><USER4> I suggested something similar to this a while back: [http://www.halfbakery.com/idea/Tech_20Spec_20Plugins](http://www.halfbakery.com/idea/Tech_20Spec_20Plugins)

</comment><comment><USER5> Here's a crazy thought: we already have a common denominator -- IPC.

You _can_ write part of your program in Java and other part of it in Python. But the cost of transmitting messages is considered too high most of the time.</comment>


Ask/Suggest HN: Social coding with game mechanics - <AUTHOR>

After spending some time on Stack Overflow, and seeing the extremely fast error->fix->commit cycles on PyPy development, I wondered, wouldn't it be great if there was a place where fixes, tests, merges, and documentation of a collaborative open source project was peer reviewed and awarded with Karma? With Stack Overflow using their points in their Careers section, there is even more incentive for people to contribute. I can imagine extremely fast development of complex software with this. Some details like who maintains the head branch etc., have to be worked out, but what do people think? Does something like this exist? Will someone try it out? <comment><USER2> One of the more, genuinely great ideas i have seen on this site. I recently bought a domain name that would actually be perfect for this idea. Gitpush.com(i was building a git php deplyment platform).

Why don't you try the idea out?

</comment><comment><AUTHOR> For some ideas, I just found an old Twitter conversation about using pull- requests: @KentBeck:What would happen if github applied game mechanics more explicitly? i realized i collect un-applied pull requests as a kind of currency. ([http://twitoaster.com/kentbeck/what-would-happen-if- github-a...](http://twitoaster.com/kentbeck/what-would-happen-if-github- applied-game-mechanics-more-explicitly-i-realized-i-collect-un-applied-pull- requests-as-a-kind-of-currency/))</comment>


Lines of code that changed everything - <AUTHOR> https://slate.com/technology/2019/10/consequential-computer-code-software-history.html <comment><USER2> I love seeing this stuff, history and culture tied together with breadcrumbs to dive deeper if you want.

I always think of Quake 3's mythical inverse square root formula: [https://www.beyond3d.com/content/articles/8/](https://www.beyond3d.com/content/articles/8/) for history and [https://betterexplained.com/articles/understanding-quakes- fa...](https://betterexplained.com/articles/understanding-quakes-fast-inverse- square-root/) for some explanation.</comment>


R.I.P. Ruby Hash Rocket Syntax 1993-2010 - <AUTHOR> http://blog.peepcode.com/tutorials/2011/rip-ruby-hash-rocket-syntax <comment><USER2> In related news, Hashrocket (the consultancy) is alive and well, with no intentions of changing our name to Hashcolon. <http://hashrocket.com/>

In fact, like almost everyone else in our space we're looking to hire => <http://hashrocket.com/jobs>

<comment><USER3> Rebranding to "Colon" just isn't as sexy.

<comment><USER4>
        :sex

Sex symbol, or colon sex?

<comment><USER5> Reference: <http://www.bash.org/?925050>

</comment></comment></comment></comment><comment><USER6> I have to say I cried a little bit when I read this - it seems that Matz et al are trying to make the language unparseable.

(Of course, perhaps I'm more sensitive than most, having actually written an Ruby lexer - <http://github.com/jasonl/eden> \- which made me deal with the dusty, hidden corners of the Ruby grammar.)

<comment><USER7> Only ruby will be able to parse Ruby ;-)

Ruby is just showing its Perl roots.

<comment><USER8> Given that the hashrocket came from Perl to Ruby primarily, and that it changed to look more like Python, I'd say you're wrong :)

<comment><USER7> Well, the pun was not about the => operator, but about Ruby becoming "less parseable". As they say: "Only perl can parse Perl" ;-)

So => is the "hashrocket" operator? I can't find any reference to this name besides this: <http://www.ruby-forum.com/topic/152544>

<comment><USER8> I suppose. It goes well with the spaceship operator <=>.

<comment><USER9> Now we need to find a meaning for |=| so it can be the Tie Fighter operator.

</comment></comment></comment></comment></comment></comment><comment><USER10> also says this syntax is compatible with python which is not really true. if you have this in python:

        {
          key: "value",
          dr_nic: "The Comedian",
          ttl: 42
        }

python will expect there to be a variable called 'key', one called 'dr_nic', and one called 'ttl'. If you intend to do

        d['ttl']

you'll need to create a hash using a literal string

<comment><USER11> You don't necessarily have to create a hash using a literal string. You can also do this:

        dict(
            key="value",
            dr_nic="The Comedian",
            ttl=42
            )

...but that is a bit different syntax.

<comment><USER12> It will also make your code drastically slower.

<comment><USER13> Slower than what alternative?

<comment><USER14> Slower than my_dict = { "foo": 1, "baz": 2 }

I was unaware that there was a difference in performance, but a quick timing check shows that it takes about twice as long to create a dictionary with 7 items using dict() than using {}.

It makes sense when I stop to think about what the code would have to do, though.

<comment><USER13> You're right; I'm seeing dict() with explicit kwargs taking 3 times as long as a literal. My unscientific and non-rigorous benchmarks tell me that the construction and unpacking of the kwargs in the dict() call are the cause of most of the slowdown.

With the time it takes to assign with a literal normalized to 1, I'm seeing dict( __kwargs) (with kwargs created before the benchmark) take 2 and dict(key_1=val_1, key_2=val_2 _, etc._ ) take 3.

<comment><USER11> Unpacking kwargs is pretty much equivalent to building a dict. The major slowdown is 1) looking up dict and 2) calling a function:

        >>> def dict1():
        ...     {"a" : 1, "b" : 2}
        ...
        >>> from dis import dis
        >>> dis(dict1)
          2           0 BUILD_MAP                2
                      3 LOAD_CONST               1 (1)
                      6 LOAD_CONST               2 ('a')
                      9 STORE_MAP
                     10 LOAD_CONST               3 (2)
                     13 LOAD_CONST               4 ('b')
                     16 STORE_MAP
                     17 POP_TOP
                     18 LOAD_CONST               0 (None)
                     21 RETURN_VALUE
        >>> def dict2():
        ...     dict(a=1, b=2)
        ...
        >>> dis(dict2)
          2           0 LOAD_GLOBAL              0 (dict)
                      3 LOAD_CONST               1 ('a')
                      6 LOAD_CONST               2 (1)
                      9 LOAD_CONST               3 ('b')
                     12 LOAD_CONST               4 (2)
                     15 CALL_FUNCTION          512
                     18 POP_TOP
                     19 LOAD_CONST               0 (None)
                     22 RETURN_VALUE

Given that, I'd assume that the overhead doesn't grow as the dict grows.

<comment><USER12> As python runtimes/JITs get better and better, the literal version could get relatively faster, since static assertions can potentially more easily be made about it; whereas the global 'dict' could be replaced with anything, requiring much more sophistication.

Say you use a dict in a non-mutating manner, it is made up of string literals only, and you construct it within a loop; it could be able to be pulled out as an invariant, the same could be true of the function-call case, but potentially not as easily.

<comment><USER15> In optimizing a dynamic language, the problem of a symbol being replaced like this is no big deal; it's all but the expected norm, and inline caching ought to take care of it.

On invariant code motion: it tends not to be a big win because programmers usually move obvious big code out of loops explicitly. They do that because relying on a compiler optimization to do it is unpredictable; you may accidentally trigger a wall in your optimizer's ability to analyze your code as it grows more complex over time.

But we really are arguing over small potatoes here.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER16> Am I reading this right that it only applies if your hash key is a symbol? So really, the hash rocket isn't dead?

<comment><USER17> Ruby 1.9 still uses hash rocket. I'm using RoR3 on 1.9.2 and I haven't changed any of my hashes.

I guess if you want to save some key strokes and you use symbols as keys you can use the new syntax.

The other cool/different thing about Hash in 1.9 is that it preserves order.

</comment></comment><comment><USER18> In case anyone doesn't get it, the comic (and its lapel button), the yellow words to the left, and the phrase "The Comedian" are a reference to the fantastic graphic novel Watchmen.

<comment><USER19> I couldn't figure out why no one was commenting on this aspect of the post, and all the effort that must have gone into its creation. Maybe folks are just so used to topfunky's blog posts being works of art (see the archives for more examples) that they've come to take it for granted.

</comment></comment><comment><USER20> Am I the only one who thinks adding more syntax is a bad thing?

<comment><USER21> It's fairly terrifying what an accretion of these sorts of options did to Perl, and I say that as someone who does a lot of Perl5 coding and enjoys it.

It would be one thing to just have a new symbol that was a drop-in alternative to what works now. But in this case you have a _sometimes_ alternative, so you need to remember a new rule, if only to be able read other people's code. That cognitive cost outweighs any keystroke benefit IMHO.

<comment><USER22> oh really?

Are you a Ruby dev?

If so, is your concern based on the impact this has on you personally, or is it based on concern for some mythical other dev who might have problems with the additional "cognitive cost"?

I've been a developing in Ruby now for about 4 years, I think this (the new syntax) is absolutely the right thing to do

</comment></comment></comment><comment><USER23> :) Matz eventually implemented my 2002 proposal. See <http://virteal.com/RubyLanguage>

</comment><comment><USER24> This is one of the more upvoted Ruby stories I've seen on HN in some time, and it's a little bit disappointing. Sensationalism and inaccuracy are all it takes these days, eh?

<comment><USER25> I'm hoping that the story is upvoted more for the artistry of the post, The Watchmen reference and the plead to move to 1.9 and less for the argument of hashrocket vs. colon syntax.

But, given the chance HN will always fan the flames of the argument that lies within.

</comment></comment><comment><USER26> Though Ruby 1.9 itself doesn't agree ;-)

      [03:17:49 ~]$ irb
      ruby-1.9.2-p0 :001 > { a: 10 }
      => {:a=>10}

</comment><comment><USER27> I prefer the "hash rocket" (I call it the fat comma), because it looks nicer when you have a hash with keys of varying length. Compare:

        {
            foo: 'bar',
            hello_world: 'OH HAI',
        }

to

        {
            foo         => 'bar',
            hello_world => 'OH HAI',
        }

If you try to do that with colons, it goes all wonky:

        {
            foo         : 'bar',
            hello_world : 'OH HAI',
        }

<comment><USER28> It's debatable whether aligning the mapping operator - be it a colon or a hash rocket - is a good idea to begin with. The point has been made in the past that if you edit the map so that the longest key changes, you'd have to realign all other entries too. For code versioning, e.g., in shared development, this creates unnecessarily large diff's. For instances, patches become more difficult to read, because they include lines that haven't actually changed content-wise, just layout-wise.

<comment><USER27> _For code versioning, e.g., in shared development, this creates unnecessarily large diff's. For instances, patches become more difficult to read, because they include lines that haven't actually changed content-wise, just layout- wise._

Well, no.

Here's an example. File a:

        {
            foo         => 'bar',
            hello_world => 'OH HAI',
        }

File a with a long key added, let's call it b:

        {
            foo              => 'bar',
            hello_world      => 'OH HAI',
            longlonglonglong => 1,
        }

Then we do a diff:

        $ diff -uw a b
        --- a	2011-01-06 08:51:55.725595229 -0600
        +++ b	2011-01-06 08:51:52.285595452 -0600
        @@ -1,4 +1,5 @@
         {
             foo         => 'bar',
             hello_world => 'OH HAI',
        +    longlonglonglong => 1,
         }

So see, that's not a problem.

</comment></comment></comment><comment><USER29> When I was looking at the page, I noticed that the example:

{

      key: "value",

      dr_nic: "The Comedian",

      ttl: 42

}

didn't seem to use the :symbols I know but omitted the colon.

Turns out, it somehow works:

> a = {my_key: "my_value"}

=> {:my_key=>"my_value"}

Has this always been there? It's kinda weird because that way they look like regular variables O_o

</comment><comment><USER30> Cool. Now why doesn't PHP join the crowd and do this with arrays already?

<comment><USER31> I absolutely agree. The PHP array instantiation syntax is atrocious... I really dislike '=>'. While they're at it they might as well replace array() with [] and/or {}.

<comment><USER30> Yep, array() is the icing on the cake. Why is the most common data structure in the language instantiated with a function?

I could probably rant on PHP syntax all day long, but it's too off topic here.

<comment><USER32> array() isn't a function, it's just PHP array literal syntax.

        $x = array("a" => 100); // legal
        $y = my_func("a" => 100); // illegal

<comment><USER33> Yeah, call_user_func('strlen', 'hello world') works but call_user_func('array', 'hello world') does not. But for ugly syntax, it's hard to beat the $ sigil being required everywhere for no reason at all (unlike Perl where it actually did something).

<comment><USER34> $vars remind me of programming mIRC.

</comment></comment></comment></comment></comment></comment><comment><USER35> I think they won't be removing hashrocket anywhere before 2.0, so you may use whatever you like better.

<comment><USER36> I think people are misunderstanding the title (which is not meant to be taken literally). They won't be removing the hashrocket ever, since (surely) they don't plan to limit hash keys to symbols only. The syntax only works in limited cases (namely symbols without spaces).

<comment><USER37> Which makes me wonder...why do it all if it is just for a limited case. Seems to make the code less understandable (to me) and it seems an unnecessary change to the language (to me).

</comment></comment></comment><comment><USER38> Now if only you could change

list.sorting = {:name => 'ASC'} to list.sorting = {:name: 'ASC'}

<comment><USER39> I'm not familiar with the particular 'sorting' thing you're doing, but if the first things works, then the second should work in 1.9 if you use the correct syntax -- you have an extra colon. It should be: list.sorting = {name: 'ASC'}

</comment></comment><comment><USER40> Now if only more gems were 1.9 compatible.

<comment><USER41> I've been using 1.9 for a year now but I haven't come across any incompatible gems yet!

</comment></comment><comment><USER42> Interesting to see this convergence of syntax. Unfortunately, it's not true that you don't have to learn a "new syntax." As often with Ruby libraries, the devil is in the subtleties.

This does not work (although I think it could):

{"foo bar": 'b'}

but this does:

{:"foo bar" => 'b'}

Without being truly JSON compatible, it's only moderately useful.

One annoyance of Ruby for me has always been that many libraries, such as Rails, allow for symbols or strings interchangeably - but only in "most" cases, often leading to head banging in the other cases.

More intrigue: the syntaxes are also mixable

{foo: 'bar', "add-a" => 'dash', :'or a' => 'space in a symbol'}

is valid.

<comment><USER43> Who would put a space inside the key name for an item in a hash?

I'm confident it's commonly understood best practice (among many languages at that) to use an underscore (_) in lieu of spaces in such things.

I agree that the quirks themselves are odd, but the matter of using a key with a space in it really stood out.

<comment><USER44> It's really common, actually. A symbol can actually have spaces in it:

:"Some Text" is a perfectly valid symbol.

ruby-1.9.2-p136 :001 > h = {:"Some Text" => 123} => {:"Some Text"=>123} ruby-1.9.2-p136 :002 > h[ "Some Text".to_sym ] => 123

<comment><USER45> You _can_ do it, but is it a good idea? What it implies to me is that at some point in your program, you're constructing symbols from arbitrary strings which aren't known ahead of time. This sounds like a recipe for disaster given that symbols aren't garbage collected.

</comment></comment></comment></comment><comment><USER46> syntax is rad, ask any pure mathematician.

</comment><comment><USER46> lol aka javascript circa 1920

<comment><USER47> On the contrary, I wish javascript had more Rubyisms.

Don't you get sick of typing function(){..} when just {..} would do?

<comment><USER48> It sounds like you'd love CoffeeScript

<comment><USER47> I would love it if it the browser could run it natively. But if we're replacing browser language, can I just have plain Ruby?</comment></comment></comment></comment>


Can Email Be Responsive? - <AUTHOR> http://alistapart.com/article/can-email-be-responsive <comment><USER2> "Love it or hate it, there's no denying the popularity of HTML emails."

The question should be with whom are they popular. I think people who get emails don't care if they are HTML or plain text. Text savvy people might be very opposed to HTML mails.

The best way to achieve responsive design is to not use a design at all. Plain text especially with format=floated is responsive. If you use HTML, use only to highlight things you want to highlight and avoid huge graphics or graphics at all.

The idea of using more then one column, which I have seen sometimes, is beyond weird for me.</comment>


PHP 7.0.0 released - <AUTHOR> https://secure.php.net/archive/2015.php#id2015-12-03-1 <comment><USER2> Unlike the other day, this is an actual release.

<comment><USER3> Yes. This was the post I expected to see that other day.

I'm so happy. Now just to get my projects onto PHP7.

</comment></comment><comment><USER4> and nobody cares

<comment><USER5> Careful not to cut yourself with that edge</comment></comment>


A clock for technology haters - <AUTHOR> http://clock.msurma.net

<comment><USER2> <http://news.ycombinator.com/item?id=3913719></comment>


Forensic Investigation – The Shocking State of Privacy in Safety Apps - <AUTHOR> https://parachute.live/blog/forensic-investigation-the-shocking-state-of-privacy-in-safety-apps <comment><USER2> FYI, this post is essentially an advertisement. The one app found to be the "good" one which doesn't share data is also the same company that did the research and published the report, which means they could have manipulated any number of data points to get the result that favors them, such as the criteria for what a "top 20" app is, the number of apps to analyze (20), etc.

Feel like it should be disclosed in the title; maybe my fault, but I got pretty far into reading this before realizing it was essentially an ad.

<comment><AUTHOR> Thanks so much for taking the time to look at this. I absolutely understand your concerns and I would be equally skeptical if I was reading this. Ultimately, anyone is free to repeat this analysis independently and see for themselves. Everything presented in our report is evidenced, recorded and cross-checked very extensively over a long period of time in anticipation of this. You'll also notice that we try to include as many references as possible to independent analyses and articles

Re manipulation of app pool, we searched very extensively both on our own and using outside services like AppFollow and AppFigures to get global rankings and these really were the top 20 we could find. You'll see that by the last one, we are reaching single-digit ratings, so we capped it at that. There are some other apps that match the "safety" keyword, but are not relevant to this study. For example an enterprise app for managing OSHA reports or a passive police scanner. If you can point us to an app that should be on the list, we will happily update this

Re more disclosure, this definitely should be read critically and with the understanding that we are one of the people in the space. From my point of view, I see the word "Parachute" on the URL, nav bar logo and author before getting to the title of the blog post. If you have a suggestion on how to better elucidate this, please let me know. We do believe that companies have the right to shine light on something, even if it's in the space in which they operate, but the reader should be fully aware of this at all times

<comment><USER3> >If you have a suggestion on how to better elucidate this, please let me know.

Put it in the actual text. I don't necessarily look at urls, navbars, logos, authors.

Prefixing the text with something like the following would go a long way: _Notice: This analysis was performed by Parachute, one of the companies competing in this space. We tried to keep it fair and balanced, regardless, and invite the readers to fact-check our statements and data, which we have made available as well._

<comment><AUTHOR> Done! Thanks so much for suggesting!

</comment></comment></comment></comment><comment><USER4> I don't think this is at all shocking when there's no public awareness, no laws against it outside the EU, no consumer recourse, and no indication that anyone wants to fix it.

<comment><USER5> Europa is fighting for privacy at least since the 80s with the ratification of its data protection convention and one might believe it to be "an EU thing" because neither the USA nor China care much about it, but there are many other countries that agree and established such laws. Look no further than Argentina, Senegal or Singapore for examples in your region of the world. I believe it is of utmost importance that people understand this "protection of personal data" is not some annoying european law that forces ad-tech to make cookie-banners, it is literally the title of article 8 in the Charter of Fundamental Rights of the European Union. It is, for us, a fundamental human right, and you should demand that it is one of yours, too.

</comment></comment><comment><USER6> I found an advertising SDK inside the factory installed AVG "antivirus" Android app that could: #Determine the users location #access the phones text- to-speech API's and view any custom words added by the user #access and read anything the user copied/pasted to/from pasteboard (clipboard) #Record audio from the phones microphone

<comment><USER7> FYI if you're making a list you need to put two newlines after each item, otherwise all the items gets squished into one line. Properly formatted:

#Determine the users location

#access the phones text-to-speech API's and view any custom words added by the user

#access and read anything the user copied/pasted to/from pasteboard (clipboard)

#Record audio from the phones microphone

</comment></comment><comment><USER8> They are misusing the term "Forensic" which is the application of a science for the purpose of law. Did they do this to further a criminal or civil action? It seems they just did some testing - maybe they have the "investigation" part correct.

</comment><comment><USER9> I'm not seeing a lot of insight in this article or how the analysis was done. Also, the use of the term forensic bothers me. Does the author understand the meaning of the word? Where's the crime?

</comment><comment><USER5> From Parachutes privacy policy:

> GDPR: _Parachute's privacy practices exceed the level set by GDPR and > similar legislation. Because Parachute does not install any cookies and does > not use any tracking, analytics, marketing or advertising services, it is > does not need to display any annoying privacy-related forced consent popup > notices._

This is just sad. Ad-tech is pulling all its strings to push public opinion against pro-privacy legislation and you take their story for a ride towards self promotion. Let me reword this for you:

\----

GDPR: Parachute believes strongly in the privacy practices set by GDPR and similar legislation but is neither incorporated in any nation with such laws, nor does it subjugate itself to a legal framework of adequacy, with the sole exception of this privacy policy. Privacy Shield Certifications are a scam anyway. Parachute offers a direct contact for privacy related issues, but does not accept the authority of your local data protection agency.Please note that with the ToS you accept the governing Law of the State of New York, and with our second "legal text privacy policy" you explicitly authorize the export of personal information to the USA.

AdTech: The Parachute app does not use any tracking, analytics, marketing or advertising services, including persistent cookies, which would require additional explicit consent. If you are wondering why there is no annoying privacy-related consent gathering popup, that is because we believe in privacy and data minimization and only use what is absolutely essential to provide our service.

Essential Third Party Services: ...</comment>


Show HN: Painless CSS: Learn CSS from First Principles - <AUTHOR> https://www.painlesscss.com/ <comment><USER2> Congrats on launching. Looks exhaustive.

Quick question, I've seen quite a few sites and emails where these meme gifs are being used.

Do these work?

I personally find them distracting.

</comment><comment><USER3> I'm about to start learning css/web stuff and have been overwhelmed with the mass amount of tutorials out there. How is this one, as objectively speaking as possible? I'd only be interested in the book, so what makes this worth $20?

(My background is in physics, and I'm currently programming mostly functional stuff with C++ and Python, if it matters.)

<comment><USER2> You might also like these:

[https://developer.mozilla.org/en- US/docs/Web/CSS](https://developer.mozilla.org/en-US/docs/Web/CSS)

[https://developers.google.com/web/tools/chrome- devtools/begi...](https://developers.google.com/web/tools/chrome- devtools/beginners/css)

[https://rachelandrew.co.uk/css/](https://rachelandrew.co.uk/css/)

[https://cssgrid.io/](https://cssgrid.io/)

</comment></comment><comment><USER4> Looks cool! I like the fresh approach.</comment>


NYC Job Opportunity: CTO of GoodCrush - <AUTHOR>

GoodCrush started in 2007 as an intra-Princeton, Valentine's Day program drawing nearly 30% of Princeton's student body within 24 hours of its launch. Now, GoodCrush provides web-based and mobile anonymous matching services to all college students. GoodCrush has just received pre-seed funding from an NYC VC firm and was selected for FirstGrowth VN: http://www.reuters.com/article/pressRelease/idUS150853+10-Sep-2009+PRN20090910.
GoodCrush is looking for someone passionate about the idea and its potential join the NYC-based team full-time in the CTO/lead developer role for at least 8 months to manage web development, a/b testing, and the integration of mobile development (which we may contract out). The CTO will have a large degree of autonomy and decision-making in what will be an incredibly exciting venture. We are open to working in PHP, Ruby, or Python. Prior social network, Facebook connect/app, LDAP, Google Maps API, and mobile development experience are strong pluses but not necessary. If you or anyone you know are interested or interested in more information, please let me know.
Best, Josh email@example.com <comment><USER2> FYI, people here are generally averse to title accouterments such as 'rockstar'</comment>


Everything we draw should be alive by default - <AUTHOR> https://vimeo.com/64895205#t=47m20s <comment><AUTHOR> Stop Drawing Dead Fish Bret Victor [http://worrydream.com/](http://worrydream.com/)

I encourage watching the entire video, but I linked to the last part which may encourage you to do so</comment>


A Note about Freeware - <AUTHOR> http://www.arachnoid.com/freeware/index.html

<comment><USER2> I like this post. It is exactly right. This is sort-of like... Red Hat vs Cent OS. Cent OS is essentially the freeware version of red hat. Yes yes OSS bla bla bla. However, why are companies not pursuing cent? its free. Hell its orders of magnitude cheaper than RH.

The answer is "freeware". Cent is freeware. When you need THEIR support, its freeware. When you want a feature, its freeware. When you want someone to spend an hour looking through forums and give you an answer to your problem, its freeware. So many large companies see the value of getting Red Hat.

In the end freeware works just as well as OSS, adware, etc. Its just a different business model. In many cases it makes sense, in many its useless.

Heres an interesting one though. It strikes me by surprise. League of Legends uses a freemium business model. You play the game, earn IP to buy characters/runes. You can pay money to buy the characters faster. You can pay money to buy skins, which offer NO ADVANTAGE. So basically there is zero crippled functionality when not paying them, However they will plow through your money much faster than WoW ever would if you want to keep up with their very fast release of characters (1-2 per month) especially if you are a casual gamer. What would you call this model??? Is it still freemium? Maybe careware?</comment>


Alcohol 'more harmful than heroin' - <AUTHOR> http://www.bbc.co.uk/news/uk-11660210 <comment><USER2> Here's some background. Nutt initially released this scale in 2009 and was sacked by the government over it:

[http://www.timesonline.co.uk/tol/news/uk/health/article68947...](http://www.timesonline.co.uk/tol/news/uk/health/article6894710.ece)

Several other members of the drugs advisory board resigned in protest. It's a typical case of the government asking scientists to come up with evidence and then refusing to see the evidence when it is presented. "You got us the wrong evidence! Get us another truth!"

At the bottom of this article, you can find the suggested classifcation by harm:

<http://news.bbc.co.uk/1/hi/6474053.stm>

Of course, the point is not to ban alcohol, but to have a more mature debate about drugs (and possibly to unban relatively harmless drugs such as LSD, Ecstasy, Cannabis...)

<comment><USER3> This is the first time I see LSD and Ecstasy put together in a harmless group together with marijuana. Am I brainwashed or are you wrong? I mean, I've smoked dope and nothing bad ever happened. But a friend of mine took ecstasy once and blew his kidneys (he's waiting for a donor now).

<comment><USER4> The problem with this is that if you are to buy illegal drugs such as exstacy, you cannot verify its purity. This is another argument for legalization - quality control. I am saddened by what your friend is going through. There is no way to know what he was actually sold. The scientists are rating the actual drug. What you get on the street is a coin toss.

<comment><USER5> I'm not a user, but have friends who do. If you do as well, encourage them to play safe, and test the material: [http://dancesafe.org/health-and- safety/adulterant-screening-...](http://dancesafe.org/health-and- safety/adulterant-screening-kit-instructions)

<comment><USER6> this is a good idea, but it makes it attractive to buy larger amounts of a known safe pill... which makes you much more vulnerable to a dealer rap if you get caught. Just another example of the insanity of our current policy.

</comment></comment></comment></comment></comment><comment><USER7> PDF of Nutt's previous 2007 Lancet review here: [http://science.iowamedicalmarijuana.org/pdfs/safety/Nutt%20R...](http://science.iowamedicalmarijuana.org/pdfs/safety/Nutt%20Rational%20Scale%20Drug%20Harms%20Lancet%202007.pdf)

The chart with the ranking is on the 4th page.

I can't find the most recent Lancet article mentioned in the article.

My concern with these rankings is that they don't seem to control for the number of people using the drug. Alcohol kills more people and has higher social costs largely because it's used by more people. However, for an individual user, crack or heroin is far more harmful than alcohol. So saying "alcohol is more harmful than heroin" might confuse some people. Also, if those drugs were legalized, their use might go up, thereby moving them higher up according to Nutt's rubric.

I would like to see a ranking that compares the damage these drugs do to an individual person. For instance, is it worse for your health to get intoxicated on a weekly basis with alcohol, or marijuana?

<comment><USER2> _Also, if those drugs were legalized, their use might go up, thereby multiplying their negative impact on society._

Actually, all available evidence points to the fact that legalising drugs like heroin actually decreases their usage. Would you suddenly take up heroin if it was legal? Do you know anyone who would?

This may be one of the scales you're looking for, btw:

[http://en.wikipedia.org/wiki/File:Rational_scale_to_assess_t...](http://en.wikipedia.org/wiki/File:Rational_scale_to_assess_the_harm_of_drugs_\(mean_physical_harm_and_mean_dependence\).svg)

Also, worth pointing out, with respect to "amount of usage", that drugs like Ecstasy see millions of users every weekend... and yet only a handful of deaths per year (generally involving multiple drugs and/or several-days-long binges). A pretty sterling safety record, I'd say.

<comment><USER8> _Actually, all available evidence points to the fact that legalising drugs like heroin actually decreases their usage. Would you suddenly take up heroin if it was legal? Do you know anyone who would?_

I wouldn't use heroin if legal, but it's possible that the next generation, not being subject to mass anti-drug marketing campaigns, would use it in higher numbers.

The question is whether that matters, and that's a debate that's hard to have in an environment of politically motivated and emotionally charged scare campaigns.

<comment><USER9> Legalising doesn't mean the end of anti-... campaigns. You can still see a lot of "don't drink too much" / "don't drink and drive" / "drinking kills families" kind of stuff, even though drinking is perfectly legal.

<comment><USER10> Yes, but you also see plenty of ads about how cool it is to drink alcohol. Do you think legal heroin would be any different?

<comment><USER11> Yes. I think nobody here argues that heroin should be legalized. But for lighter drugs legalization should clearly include ban on their advertisement (or, in fact, provision that tax revenue from their sale be spent on anti- advertisement)

<comment><USER12> Heroin should be legalized. What I put in my body is my business.

<comment><USER13> Until you are breaking into somebody's house to get money to fund the addiction. Unfortunately, heroin is so addictive and so quick to build tolerance, that this is a very possible scenario.

The ideal scenario involves legalizing much more research about the drug so we could find a way to "have our cake and eat it, too." I imagine there are some smart scientists who could find a way to create a non-addictive heroin-like substance. As an example, just adding a small bit of naltrexone (an opioid antagonist) to opioids seems to reduce the build up of tolerance. I can't find the company who is doing clinical trials on a drug combining the two right now, but you can see [1] for an overview of combining an antagonist with an opioid.

[1] <http://pain-topics.org/pdf/OpioidAntagonistsForPain.pdf>

<comment><USER14> Addiction and dependency are separate issue when dealing with drugs. I am physically dependent on opiates. When I was a child I was hit by a truck and bashed up pretty good. It pretty much ruined my neck. Anyway, in the absence of my medication I don't jump to the I need to commit a crime to get it nor would I. Addiction is a psychological phenomenon in which the user becomes consumed with the drug and will do anything to get it, it is a compulsive disorder and has nothing to do with the actual drug. If Alcohol where illegal an therefore prohibitively expensive you would see the same behavior among addictive personnel with Alcohol. Just because someone is physically dependent whether an abuser or not does not mean that they exhibit addictive personality traits.

I don't know about the legalization of Heroin, crack and Crystal Meth, I don't know enough about them to form a factual based opinion on their legalization, but I do believe without a doubt that Opium, Marijuana and Coca should be legalized immediately. The possession of a plant being illegal is ridiculous and the fear mongering around these weaker formed was unfounded in the first place.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER15> That ranking is pretty ridiculous.

 _Prof Nutt told the BBC: "Overall, alcohol is the most harmful drug because it's so widely used._

 _"Crack cocaine is more addictive than alcohol but because alcohol is so widely used there are hundreds of thousands of people who crave alcohol every day, and those people will go to extraordinary lengths to get it."_

By that logic it's also more harmful to drive a car than to cut open your chest, pull out your heart and eat it?

<comment><USER2> The point of the study is the government should address drugs based on the problems they do represent, not on the problems they might perhaps theoretically some day represent.

Alcohol and tobacco do kill tens of thousands of people every year. Ecstasy and LSD and Cannabis kill maybe a dozen people every year all together, and usually in combination with other drugs. Yet there are considerably fewer resources allocated to fighting alcohol and tobacco use than the latter.

<comment><USER16> actually LSD and cannabis has never killed anybody ever.

just saying

<comment><USER17> Citation needed.

<comment><USER18> The burden of responsibility is on the person claiming that it is responsible for death. LSD, the substance, has not killed anyone. Someone is welcome to disprove this.

<comment><USER19> The _effects_ of LSD, the substance, certainly have.

The substance itself does not cause an "overdose" and the same is true of cannabis (at least for any ingestible amount), but it would be disingenuous to claim they have not caused deaths.

</comment></comment></comment></comment></comment></comment><comment><USER20> Multi-Criteria Decision Analysis (MCDA), which Nutt used, is a tool for decision making, not something "sophisticated" to generate scientific evidence! It cannot estimate a drug's harm. Alcohol is wide-spread and deserves a discussion for that reason alone, but Nutt is not presenting "evidence" or anything new. MCDA is heavily prone to selection bias in picking criteria and weights. It is an extremely subjective process and is used when two or more decisions closely compete to give some _pseudo-quantitative_ separation. When you structure the problem in which one alternative scores very high, the analysis didn't add a single ounce of value.

Here is the original paper:

[http://www.crimeandjustice.org.uk/opus1714/Estimating_drug_h...](http://www.crimeandjustice.org.uk/opus1714/Estimating_drug_harms.pdf)

[http://en.wikipedia.org/wiki/Multi- criteria_decision_analysi...](http://en.wikipedia.org/wiki/Multi- criteria_decision_analysis)

<comment><USER2> _Multi-Criteria Decision Analysis (MCDA), which Nutt used, is a tool for decision making, not something "sophisticated" to generate scientific evidence!_

I have not read the papper, but informing public policy ("decision making") seems to be what this study is trying to do.

<comment><USER20> I'm not sure what you mean by "informing public policy", but if the paper was to inform, they would provide summary of facts and facts only. The paper says it is trying to estimate drug harms using some set of arbitrary "harm parameters". I am saying you can't objectively estimate harms with an MCDA analysis. You're not going to get anything objective out of this unless you're framing it against an exact set of decisions you have to make. All you're going to do is find one group's interpretation. Although MCDA is systematic, and a lot of it including the ranking is generated automagically once you have everything set, overlaid with some "sophisticated" (Nutt's words in the interview) overtones, it is entirely subjective.

If you wanted, I could give you an MCDA showing cocaine is more harmful to society just by tweaking a few criteria a tiny bit. I could add a practicality criteria in that drinking alcohol is a cultural practice in many places, or I can separate two forms of drinking, responsible drinking and irresponsible drinking. There are so many ways to slice it that if you don't have specific decisions you're evaluating against, the whole analysis is useless.

</comment></comment></comment><comment><USER21> Another interesting article from 2009 by the ever excellent Ben Goldacre:

[http://www.badscience.net/2009/06/this-is-my-column-this- is-...](http://www.badscience.net/2009/06/this-is-my-column-this-is-my-column- on-drugs-any-questions)

This describes pretty concisely how governments might choose to use or not use evidence about drug harm and the reasons for doing so:

 _Drugs instantiate the classic problem for evidence based social policy. It may well be that prohibition, and the inevitable distribution of drugs by criminals, gives worse results for all the outcomes we think are important, like harm to the user, harm to our communities through crime, and so on. But equally, it may well be that we will tolerate these worse outcomes, because we decide it is somehow more important that we publicly declare ourselves, as a culture, to be disapproving of drug use, and enshrine that principle in law. It's okay to do that. You can have policies that go against your stated outcomes, for moral or political reasons: but that doesn't mean you can hide the evidence, it simply means you must be clear that you don't care about it._

</comment><comment><AUTHOR> Just a heads up: there is a bit of politics with this story. The author was the head of the government advisory board that suggested changing the ratings (and thus penalties) of some drugs, but the subject was too dangerous to tackle politically. He criticised the government and got fired. A year later he publishes this report.

The Guardian's coverage ( [http://www.guardian.co.uk/society/2010/nov/01/alcohol- more-h...](http://www.guardian.co.uk/society/2010/nov/01/alcohol-more-harmful- than-heroin-crack) ) knows that this report is likely to be attacked politically (regardless of merit) so it's no surprise they are using adjectives to cut off this attack. Note their use of words like "authoritative" and "respected" early in the article.

</comment><comment><USER22> Drunk driving kills between 15 to 10 thousand people each year in the U.S. That's about 3x the lives lost from 911--every single year.

<comment><USER7> Tobacco use kills 443,000 Americans each year.

Source: [http://www.cdc.gov/tobacco/data_statistics/fact_sheets/healt...](http://www.cdc.gov/tobacco/data_statistics/fact_sheets/health_effects/tobacco_related_mortality/)

For perspective: <http://www.meh.ro/wp-content/uploads/2010/09/meh.ro5415.jpg>

<comment><USER23> That's "1 of every 5 deaths in US due to smoking," I've submitted it now:

<http://news.ycombinator.com/item?id=1856015>

Now how is then smoking less harmful than using some other substance? Or is the evaluation skewed somehow?

<comment><USER24> I'm pretty sure that data is about ten years old, but otherwise it's correct. Overall drug use kills about 1 in 3 Americans.

</comment></comment></comment></comment><comment><USER25> Shrooms and LSD are safer then steroids and tobacco? Who knew?

<comment><USER26> People who use shrooms and LSD.

<comment><USER25> The "man's" propaganda got to me: <http://www.youtube.com/watch?v=P0zgIzqgxFU>

</comment></comment></comment><comment><USER27> There is no chance that this chart is accurate for the US. Crack and heroin are together directly responsible for a ridiculously high percentage of gang violence and other inner-city problems, and crystal meth has destroyed many small rural towns throughout the south and midwest.

More explanation of their methodology would be nice, especially given their use of data from the Netherlands, which has a very progressive drug policy.

<comment> Tuna-Fish Drug-related gang violence isn't caused by drug use, it's caused by drug policy. Changing the policy so that it no longer creates ridiculously huge profit opportunities around the drugs in question does make the problems go away.

<comment><USER28> This argument drives me crazy. You think the drug pushers are gonna say "ah shucks. no more profit in drugs. guess I better go to college and get a real job."

Trust me, they will find something else to exploit. Kidnapping in Bogota comes to mind. Crime won't go down.

<comment><USER29> Probably many would find something else, and that's a problem - but surely it can't be used as justification for not changing the policies. Legalization should happen gradually and with some kind of amnesty outreach program. But even if not: Crime like robbery would likely spike, but unless gangs quickly find a replacement product that's in similarly high demand (if there was one, wouldn't they already be serving it?) I imagine cutting off their easiest source of income would fairly quickly reduce their power to attract new members, purchase weapons, etc.

<comment><USER30> And even more quickly, since it takes a LOT more money, reduce their ability to bribe cops and judges.

</comment></comment></comment></comment></comment><comment><USER31> This was on the news this morning complete with stock footage of adults drinking socially in the pub - but the problems with alcohol are around ultra- cheap alcohol bought in supermarkets.

</comment><comment><USER32> So is this an argument for legalizing heroin or for bringing back prohibition?

<comment><USER33> I haven't followed it, but he seems to be trying to open up the debate.

Prohibition didn't work out too well, but anti-smoking campaigns in many countries seem to be somewhat effective. So a gentler approach just may work, if you're willing to accept that it probably takes a century before you can ban the substance.

<comment><USER34> Gentler approach? Anti-smoking _is_ reaching prohibition like levels in most countries. You're banned from smoking everywhere to the point you're banned from smoking in your own vehicle if someone else is present regardless of whether or not the passengers smoke themselves.

IIRC here in Canada it's illegal to smoke in a work vehicle, it's illegal to smoke in your own vehicle if you have a passenger under 18. You can't smoke within X-feet of a building entrance. They're trying to make it illegal to smoke in your own home if you have anyone under 18 living there.

I really don't see this as a gentle approach. I'm a non-smoker, I don't give a crap where people smoke and I see this illegalization of smoking to be severely harmful to our society. Given the link between certain genes and smoking, why not make autism illegal? I mean it's harmful to the users and is harmful to society by costing us billions in unearned wages and medical costs.

I'm sick of this nanny state bullshit. At the rate governments are regressing, we will be at full prohibition before we ever see marijuana or LSD legalized.

<comment><USER35> > I'm sick of this nanny state bullshit.

People have been sick of smoke for years. It was never sustainable that a minority should be allowed pollute the environment of everyone else. Any politician who campaigned to bring back smoking in these places would fail spectacularly. Get used to it.

<comment><USER36> OTOH you have to keep in mind these movements are organized by a few people, and not the entire society suddenly rising against the evils of passive smoking.

<comment><USER33> At least in the Netherlands, in my social circle, anti-smoking laws are _very_ welcome. Like any issue, it's championed by a few people; and yes, there are people who oppose it. But as far as I can see, there's quite a bit of acceptance, both by non-smokers and smokers.

</comment></comment></comment></comment></comment></comment><comment><USER36> I never seen a family destroyed by tobacco, but I've seen families destroyed by cocaine. I don't understand how someone could put those two together.

<comment><USER37> I think if you look a little you'll find that plenty of families have been 'destroyed' by the effects of tobacco.

<comment><USER36> How so? In the sense that the smoker is all messed up in the hospital bringing pain to his relatives, sure.

But I don't think people sell their mom's furniture to buy marlboro, and haven't seen moms chaining their kids to their beds to stop them from going out smoking.

<comment><USER37> I suppose it depends on your definition of 'destroyed', then. Personally, any kid of mine who I would consider chaining to a bed would be in rehab without a second thought -- on the other hand, smoking seems so innocuous that before you know it they're dying of lung cancer and you can't do anything about it...

They aren't really comparable, if you ask me -- I get your point. All I'm saying is that some people can recreationally use all kinds of drugs (alcohol, meth, crack, whatever) and others can't. Smoking will just straight up kill you. So IMO, in terms of 'damage to society' smoking is way further up there than most illegal drugs.

</comment></comment></comment></comment><comment><USER38> sure but the ld50 of those drugs are higher than alcohol

<comment><USER33> Possibly, and the ld50 of beer is definitely higher than that of vodka. What are you trying to say? I don't think the amount ingested is very interesting here...

<comment><USER38> ld50 is for alcohol, be it in beer or vodka or rum</comment></comment></comment>


Colorado Sells $19M of Cannabis: 10% Goes to Schools and Crime Drops 10% - <AUTHOR> http://themindunleashed.org/2014/06/colorado-sells-19-million-cannabis-march-1-9-million-goes-schools-crime-10.html

<comment><USER2> > Crime Drops 10%

[State] makes [something once illegal] no longer illegal, crime drops [percentage of crimes that were of type [something once illegal]]

<comment><USER3> Marijuana offenses are not typically reported to the police as, or classified by police as: homicide, sexual assault, robbery, aggravated assault, burglary, larceny, theft from a car, theft of a car, or arson. (I.e., the crimes that have dropped by 10%.)

So no.

</comment></comment><comment><USER4> I think there is a mistake in the article. The $19M is total since January 1st not just in March.</comment>


The Practical Guide to Finding the Right Designer - <AUTHOR> http://blog.framebench.com/find-the-right-designer-for-your-next-big-thing/

<comment><USER2> It is indeed hell of a job headhunting for the right designer. This looks like a great starting point. Well written !!

<comment><AUTHOR> Thanks! All ears to knowing more tips on how to find great designers.</comment></comment>


You Can Be Prosecuted for Clearing Browser History - <AUTHOR> http://m.thenation.com/article/208593-you-can-be-prosecuted-clearing-your-browser-history

<comment><AUTHOR> I find it particularly abhorrent that laws like Sarbanes-Oxley are being used to prosecute normal citizens, when they were clearly intended for corrupt corporations..funny how we have so many laws on the books intended to stop repeat criminal behavior, but they keep getting used on citizens for reasons unrelated to the original intent (sneak and peek being the other one on my mind)

Also, this story is another harrowing reminder of "don't talk to the police."</comment>


Scaling a 2000-node Hadoop cluster on EC2/Ubuntu with Juju - <AUTHOR> http://markmims.com/cloud/2012/06/04/juju-at-scale.html

<comment><USER2> Interesting article, shame they throttle it so hard. I wonder if you could either do a competition for the compute time or donate it to the charity of choice to the best contribution / patch that cycle.

</comment><comment><USER3> Woah</comment>


Reading minds with deep learning - <AUTHOR> https://blog.floydhub.com/reading-minds-with-deep-learning/ <comment><USER3> While the results are really cool, they're not perfect, and seemingly even the best companies working with deep learning are still not getting it right every time. It makes me wonder if this technology will ever be useful for these tasks... I mean would you be willing to use BCIs even if they made small errors from time to time?

<comment><USER4> There is a lot of variance in error rate in biological human nerves as well. Certainly a lot of people on the low-end of the bell curve could benefit.

Interesting to consider whether a 'filter' could be made for people with parkinson's that would drop tremor noise while preserving intentional actions. Perhaps with robotic exosleeves tremor could be offset/counteracted - <USER2> eventually we could input the filtered signal back into the nerve.

<comment><USER5> That would be a fantastic application, however it would differ slightly in that it would not be a BCI (as in a traditional brain computer interface), but a device within the brain that impeded certain signals being sent to motor neurons that it detected were Parkinsonian. This would involve directly manipulating the output of the brain to the body itself, and require some serious bio-mechanical hardware!

<comment><USER6> This hardware already exists as an implantable electrode and is used in really hard cases.

It is a competitive inhibitor and additionally stimulates dopamine release.

As for putting something like that in spinal cord or motor centers, very risky surgery. Much more than cranial stimulator one. If this device fails in such a simple way as being jostled, you die.

</comment></comment></comment></comment><comment><USER7> I think BCIs are super exciting. Humans have such high bandwidth in terms of input; tons of information is interpreted by our nervous system every second. Yet in terms of output, we are relatively poor; we can only type a few words a minute! This article suggests we could one day work 'like digital octopuses' but I'm naturally dubious, do you think it's possible as CTRL-labs propose that we could entirely rewire our nervous systems' output to let us operate computers as if we had multiple hands?

<comment><USER8> I'm a bit of a contrarian on this issue. If you look at how you type you actually spend more time thinking about what to say rather than typing it out.

I think language is extremely high bandwidth. We're bottling up extremely complex, abstract thoughts into a few symbols.

<comment><USER9> One possibility is that the BCI will allow powerful interaction of the sort simply not possible now based on using brain activations as supervision for understanding material in a way which transports those extremely complex abstractions into the computer in a software-understandable way: [https://www.reddit.com/r/reinforcementlearning/comments/9pwy...](https://www.reddit.com/r/reinforcementlearning/comments/9pwy2f/wbe_and_drl_a_middle_way_of_imitation_learning/)

To give a quick random example: imagine the BCI records your global activations as you read that Reddit post about deep learning augmented by EEG/MRI/etc data; a year later while reading HN about something AI, you want to leave a comment & think to yourself 'what was that thing about using labels from brain imaging' which produces similar activations and the BCI immediately pulls up 10 hits in a sidebar, and you glance over and realize the top one is the post you were thinking of and you can immediately start rereading it. And then of course your brain activations could be decoded into a text summary for the comment which you can slightly edit and then post...

</comment></comment></comment><comment><USER10> Curious about differences in brain waves for desire versus intent. I might desire to say something awful to that person who just honked at me, but I probably shouldn't - and right now wouldn't. Would a BCI system be able to tell the difference?

<comment><USER5> Haha, that's a fantastic point! And in order to get anywhere closer to making such differentiations, surface EEG S (used for the results into his article) would surely not suffice. The technology and results we are collecting currently are just scratching the surface, though I'd suspect if a BCI was capable of detecting intent of such complexity as the situation you described, it would also probably have the capacity to know whether it was something you planned to act on or not.

</comment></comment><comment><USER11> If you connect a computer to a brain which element is the more sophisticated processing device?

The brain.

If you want high-fidelity cheap BCI don't bother with fancy sensors, galvanic skin response is enough. The trick is to use the high-powered processor to do the heavy lifting. You use hypnosis and create a simple feedback loop to calibrate e.g. one channel per finger and one per thumb. That gives you 8 data lines and a clock/ack signal. An eight-bit parallel port from your mind to your computer. You can now come out of trance and "type" by thinking at the machine in a certain way (no imaginary keyboard) and your verbal thoughts appear on the screen. Other output modalities are possible. It's fucking trivial, if you'll pardon my language.

It's ridiculous to connect a computer to a brain and then concentrate on the _computer_ , rather than the brain, to develop control and communication systems. It's a bit like trying to move your bicycle using a skateboard.

But the greater problem with focusing on the CPU rather than the brain is that it reinforces a world that doesn't demand much personal growth to use powerful tools. BCI where the computer does the work relieves the user of learning how to operate his or her own brain. BCI-by-hypnosis requires the user to learn enough self-operation to be able to go into a light trance and learn a simple motor pattern, and the meta-lesson "side effect" is more valuable and more important than the ability to interact with computers with greater facility.

(BTW, I doubt this would ever be a mass-market product, because you're not just selling a peripheral at that point...)

\- - - -

edit: Folks, I'm gonna ask that you please not downvote me on this one without saying something about why. I've never been able to get anyone to listen or take me seriously on this particular subject, and frankly that sucks. I know this works but _no one cares_ and it's frustrating. So, again, please, if you think this is worth a downvote can you please take a minute and tell me why?

<comment><USER12> That's cool! Have you actually done this? What clock rate can you achieve?

<comment><USER11> I forgot to mention in my main reply, I _did_ set up a binary Boolean signal system as part of my exploration of hypnosis years ago. At first it was finger twitching, but then later the system was arm twitches, right for affirmative, left for negatory, non-response meant I[1] was framing the query in a way that precluded an unambiguous y/n answer. I made use of this "comm channel" for years, occasionally friends would remark on my odd arm twitches, eventually they "wore off" in the sense that I didn't need them anymore.

Anyhow, this is what I meant about "trivial". These days you could wear e.g. a Fitbit on each arm and "Ta-da!" you've got a BCI. You wouldn't even have to stop by RadioShack (RIP) or wire up IMUs to an Arduino.

[1] At a minimum you have to postulate three "entities": the perceive, the conscious mind, and the unconscious mind, for the model to make sense. In the above "I" the conscious mind is posing queries to "me" the unconscious mind, and I'm not mentioning the Perceiver at all.</comment></comment></comment>


"Kotlin in Action" Book from Manning Is in MEAP - <AUTHOR> https://www.manning.com/books/kotlin-in-action <comment><AUTHOR> If you'd like to get a 50% discount on the book, you can use the coupon code 'mljemerov'.</comment>


Rust for C++ programmers – part 1: Hello world - <AUTHOR> http://featherweightmusings.blogspot.co.nz/2014/04/rust-for-c-programmers-part-1-hello.html

<comment><USER2> God, I hate the single quote character.

Perhaps I've been conditioned by decades of languages with balanced quotes (for strings etc), plus some OCD, I can't stand an open '.

<comment><USER3> > &'static str

I'm hoping there's a more...friendly way to write that (I'm assuming that's for literals).

Edit: ~str, see: [https://github.com/mozilla/rust/wiki/Rust-for-CXX- programmer...](https://github.com/mozilla/rust/wiki/Rust-for-CXX-programmers)

<comment><USER4> The friendliest way to write it is to simply not and let the compiler infer it.

<comment><USER5> That is in fact the best way... until it's not. If I understand correctly (and I may not), there are times when you _have_ to write it.

<comment><USER6> You're correct; at the moment function signatures have to be written in full.

(This may be relaxed slightly in future, that said, it's very _very_ unlikely to be loosened to full Haskell-style whole-program inference.)

</comment></comment></comment></comment></comment><comment><USER7> I like this article. It's short and easy for the target audience and has enough content to let C++ developers start to understand Rust. It also hints at and leaves unexplained other features in the language, piqueing the curiosity of the reader.

</comment><comment><USER8> > You don't need the `return` keyword in Rust, if the last expression in a > function body (or any other body, we'll see more of this later) is not > finished with a semicolon, then it is the return value. So `foo` will always > return "world". The `return` keyword still exists so we can do early > returns. You can replace `"world"` with `return "world";` and it will have > the same effect.

Is this a bit brittle for a language which is expected to have applications in safety/security-critical coding? It's not hard to imagine side-effecting last expressions with discarded return values being turned into (effective) return statements by an omitted semicolon. Maybe the type system or other bits of the language would prevent this?

<comment><USER9> The type system generally prevents this, because you get a type error if the function return type is not as it's declared. More generally, it's not good Rust style to ignore return values, and dropping a type that should not be ignored (e.g. an error) causes the compiler to emit a warning.

<comment><USER10> > _it 's not good Rust style to ignore return values, and dropping a type that > should not be ignored_

If I remember correctly, much of OpenSSL is not written in "good C style" either. Considering that we're talking about "a language which is expected to have applications in safety/security-critical coding", it seems like a legitimate concern.

<comment><USER9> I knew I would get someone calling me out on "it's not good Rust style". This style is _enforced_ by warnings for important types, such as errors.

The semicolon thing is repeatedly brought up as a possible source of errors, and I had concerns about it too at one point, but I've never seen it lead to a single one. There are just too many other safeguards. First of all, you get warnings on unused results for important types (for example, errors). Warning on dropping errors covers the hazards for crypto (and I can go into more detail here if wanted). Second, it's extremely unlikely that changing the return type from unit to something else won't cause a type error later down the line. For instance, returning a unit value from a function declared to return non-unit gives you a type error.

<comment><USER11> > This style is enforced by warnings for important types, such as errors.

How do you inform the compiler that a type is important? You might not be using the standard Result type.

<comment><USER9> You use an attribute, "#[must_use]".

I haven't seen code not use the standard Result type, and I don't think it's likely. First of all, it's generic, so you aren't forced into a set of errors or an interface that you have to conform to—there's no reason not to use it. Second, there's strong pressure to use Result: all of the standard libraries use that type, so you'd have to write a lot of code to convert back and forth between your own error type and Result if you wanted to create your own for some reason. It'd also be less convenient from an import point of view: you'd always have to import your custom Result everywhere, whereas Result is always available right there in the prelude. Plus, you get really convenient "try!" macro sugar if you use Result. All of this means that you'd really have to go out of your way to not use Result, and my experience matches this.

</comment></comment></comment></comment></comment></comment><comment><USER12> How do you format the arguments passed to println? Do you have to make new types just to do that?

<comment><USER13> [http://static.rust- lang.org/doc/master/std/fmt/index.html#fo...](http://static.rust- lang.org/doc/master/std/fmt/index.html#formatting-parameters)

`println!("{:04d}", 1);` prints "0001". Is that what you're asking?

<comment><USER14> I think that's what he is asking. Full details at [http://static.rust- lang.org/doc/0.10/std/fmt/index.html](http://static.rust- lang.org/doc/0.10/std/fmt/index.html)

By the way, the Rust docs look nice, but finding this was harder than it should be. After searching for 'println', I got at [http://static.rust- lang.org/doc/0.10/std/index.html?search=P...](http://static.rust- lang.org/doc/0.10/std/index.html?search=Println), which led me to [http://static.rust- lang.org/doc/0.10/std/macros/macro.printl...](http://static.rust- lang.org/doc/0.10/std/macros/macro.println.html), which says as good as nothing. The other search results ([http://static.rust- lang.org/doc/0.10/std/io/stdio/fn.println...](http://static.rust- lang.org/doc/0.10/std/io/stdio/fn.println.html) and [http://static.rust- lang.org/doc/0.10/std/io/stdio/fn.println...](http://static.rust- lang.org/doc/0.10/std/io/stdio/fn.println_args.html)) are similarly uninformative. It would have helped if the text _" For more information, see std::fmt and std::io::stdio"_ on that first page had hyperlinks. Now, I had to search for _" std::fmt"_ and wade through a sea of results to get at that first page.

<comment><USER4> Macro documentation is a little bit... off at the moment. :/</comment></comment></comment></comment>