Vindinium: An artificial intelligence programming challenge - <AUTHOR> http://vindinium.org/ <comment><USER2> If you're interested in this kind of thing and want a gentle introduction, I highly recommend CodeCombat [1], which offers both a single player version for learning the system and a multiplayer version for writing AI code.

[1] [http://codecombat.com](http://codecombat.com)

<comment><USER3> Can you recommend other resources and reading materials other than this? I would like more on top of the provided links thank you. OP's url have got me interested in AI now, but mainly for solving puzzles like this.

<comment><USER2> What you're asking for is actually pretty broad. A lot of CodeCombat can be played with traditional Game AI strategies to try and defeat the opponent. It's one subfields of AI I've done very little research in, so take what I say with a grain of salt, but it's my understanding that the best resources for learning Game AI are actual books on the subject. I would love for someone to prove me wrong, but I don't remember too many great online sources when I was trying to learn the it.

Before you start reading about different AI tactics, I would recommend just going through CodeCombat and trying out some of your own strategies. You'll get a much more intuitive sense for why things work, as well as how you would apply different strategies to your particular game.

</comment></comment></comment><comment><USER4> I saw this a while ago and thought that I would love to try playing this game as a human, so I could explore different strategies, or just have fun. Well, that is finally possible.

I just created LiveHumanBot – a "bot" that really just lets you, a human, type in directions to control your character. Here is its code, with instructions: [https://github.com/roryokane/vindinium-live-human- bot](https://github.com/roryokane/vindinium-live-human-bot). I fare pretty well against other bots: [http://vindinium.org/ai/p20qptiv](http://vindinium.org/ai/p20qptiv).

<comment><USER5> Now this is brilliant. I was thinking the same thing, "Man I'd like to play as a real person, before I build a bot." I feel silly now that I didn't think of building a software controller like you did. Also thanks for sharing the code. I'm gonna have to try it out.

</comment></comment><comment><USER6> This looks promising. Will this fill the hole in my soul that Google Ants left behind?

<comment><USER7> This doesn't have that magical "coordinate an army" feeling that the Ants contest had. :(

The rules are very simple -- you control a hero, and you fight other heros to capture mines which give you gold. You can trade gold for health in taverns.

Not too much strategic depth.

<comment><AUTHOR> I was also perplex the first time I entered this project. You would be surprise how this simple rules is already quite challenging. This game is fully observable and also determinist, which give way to make much more complex AI I think. I see it a bit like Chess: Pretty simple rules but there is still a fight to have the best AI in chess.

</comment></comment></comment><comment><USER8> Can anyone comment on general strategies that would be applicable to this game? Has anyone tried some kind of crazy machine learning stuff, or is it dominated by relatively simple algorithms?

<comment><AUTHOR> This game is fully observable and determinist so that is not the hardest situation. However there is still a lot of possible game states.

I've started an attempt to have a tree of all possible actions and using a minimax algorithm (with a score function + alpha-beta pruning) but this is not yet conclusive because I can't explore so much deep (was able to explore up to 20 next player decisions but that is just 5 moves of your hero).

I think this game is enough simple to try to have this approach but also challenging because there is still up to 5 possible actions per turn so it is a max of 5^1200 total of possible state for a game – a lot.

My current approach is now to try to have a minimax with pre-explored interesting path in the tree (e.g. all path which leads to tavern and mines), that is still a lot of computations.

<comment><USER9> > This game is fully observable and determinist

Off-topic, but are there any AI games which are not-observable and / or non- deterministic? That would be also a lot of fun!

<comment><USER10> theaigames.com has a risk-like game (with fog of war) and a poker competiton.

</comment></comment></comment></comment><comment><USER11> Is it normal for x to reference the vertical, and y the horizontal in such games?

Maybe I don't understand how they're normally represented. take this map: [http://vindinium.org/4mx1xu9j](http://vindinium.org/4mx1xu9j)

it returns the locations of the mines as: {(5, 9): u'-', (4, 9): u'-', (5, 0): u'-', (4, 0): u'-'}

So that top left most mine is 4,0 instead of 0,4 that I'd would expect.

It also has the location of my hero (althalus, right at the top left) as (0,1) vs my expected (1,0)

<comment><USER12> Maybe it's a (row,column) metaphor.

</comment></comment><comment><USER13> This looks really fun. Always wanted to participate in one of these. Good job on making it programming language agnostic :)

</comment><comment><USER14> I've found this great project some months ago.

I written a couple of robots which end up on this _robot runner_ [1] mainly as a toy project for trying the game with some friends.

[1] [https://github.com/eridal/Vindinium](https://github.com/eridal/Vindinium)

</comment><comment><USER15> Oh, neat to see this here! This was part of a local competition I participated in several months ago. Nice to see it has improved quite a bit since.

I'm far from knowledgable on AI stuff, but I found this a great way to learn about some very basics, like pathfinding.

</comment><comment><USER16> I would recommend having bot names be case sensitive, as well as a limit on how many a user can register. I really like the first use UX, and how easy it is to get started, but you can register as many names as you want.

</comment><comment><USER17> This reminds me of a the Student Starcraft AI Tournament: [http://www.sscaitournament.com](http://www.sscaitournament.com)

</comment><comment><USER18> Does someone here has already created a bot for the game ?

<comment><USER19> there are starter kits available on the site.

<comment><USER18> I don't ask for help, I just want to know if people are really trying to create a bot. Currently 90% of games are between only two AI. ("wolfie vs wolfie vs arthropod vs arthropod"). A competition like this one is much more interesting if there is a lot of players.

</comment></comment></comment><comment><USER20> Dude, this is awesome! I like it

</comment><comment><USER21> It would be nice if the Java library allowed you to simply download the .jar instead of forcing you to use maven. This is supposed to be a game, not some massive web-scale project.

</comment><comment><USER22> Over use of term "AI" is back. It's 80s all over again :). These kind of "challenges" are no where close to AI. They are just bit complex program whoes behavior is fully programmed by humans and they are only good at for very very specific "challange". These programs would be unable to hold a conversation with humans or read a newspaper and create their internal belief system. Stop calling these things "AI".

<comment><USER23> Video game bots have been called "AI" for decades now, it's a little late to dispute the term. The word "AI" doesn't imply "strong AI", there is "weak AI" as well: [https://en.wikipedia.org/wiki/Weak_AI](https://en.wikipedia.org/wiki/Weak_AI)

Also see the AI effect, where something is called "AI" until we actually solve it or understand it, then it is no longer called AI. "AI is whatever hasn't been done yet." [https://en.wikipedia.org/wiki/AI_effect](https://en.wikipedia.org/wiki/AI_effect)

</comment></comment><comment><USER24> Seems like something that Google or Microsoft would ask as an interview question. You have all day to complete it, on your laptop, but once done, no matter how much code it is, they want it transcribed from your computer onto a physical white-board, because the only thing they know how to read is white- boards. If you tell them they are crazy and try to end the interview right then and there, you are hired, because you have guts, and you know what can and cannot be done, and will not waste your time with jerks.

<comment><USER25> I don't get this. I could easily transcribe anything I could write in a day into a diagrammatic representation. Hell, I could do it for anything I could write given a large enough whiteboard. It might consist of complicated flow diagrams or fragments of mathematics, but it would convey the salient points. This seems like fanatical code worship, "code is the only appropriate representation for all analytic thought". Nonsense. Maths, state diagrams, uml, even prose are useful and in combination adequate languages.

<comment><USER24> I was making fun of how in love some interviewers are with the whiteboard. I can write great code, but not up on a damn whiteboard -- kina because I do this thing called "typing". Also I'm making fun of the absolutely ridiculous complexity of many of the 'brain teaser' type interview questions. IMO the correct response to a brain-teaser interview question is to talk out. Better yet, tell them BEFORE the interview you WILL walk out IF the try that route.

<comment><USER24> Typo: "Talk out" was supposed to be "Walk out". Looks like you only have limited time to edit or something, because it won't let me fix that. Somebody please ding my karma again, I'm trying to see if I can make it go negative.</comment></comment></comment></comment>


Ask HN: I'm a cs grad student seeking advice - <AUTHOR>

I'm currently enrolled in a master's program in computer science.  I'm in my second semester and things seem to be going well.  I've only been programming for a little less than 3 years, and I didn't earn a BS in computer science in my undergrad.  What I'm looking for is advice.
I am not a good programmer.  I have been improving a lot over the last year, but I feel a bit overwhelmed by the amount of things that I need to learn.  There are so many different skills I want to have, but I don't know where to start.
Here is my question to you: What are the three most critical skills that you all think are absolutely fundamental to programming?  I eventually plan to do web development, but the skills needn't be specific to that. <comment><USER2> 0\. Managing Complexity

1\. Mastery of multiple programming paradigms: know a systems language like C, a statically typed object oriented language like C++, Java or C#, a dynamically typed object oriented language like Python, Ruby, Smalltalk or Perl, a Lisp (Scheme is best for learning functional programming) and a statically typed functional language with type inference (OCaml, SML or Haskell)

2\. Great understanding of algorithms and data structures. Ability to look at a problem and see a clean algorithmic solution or data structures based solution where others see spaghetti and brute force. In addition to the obvious (algorithms classes, CLRS, Algorithm Design Manual) books, Jon Bentley's Programming Pearls contains many demonstrations of exactly that: use of data structures and algorithms as a way to write exponentially more performant, cleaner and more correct code.

3\. Understand systems: TCP/IP networking, I/O, parallelism and concurrency (know how to write multi-threaded code, how to perform asynchronous I/O), operating system and database internals, basics of hardware (pipelining/branch prediction, memory hierarchy, NUMA)

</comment><comment><USER3> 1\. Discipline.

2\. Motivation.

3\. Humility.

Explained:

1\. Logical thinking. Adherence to a scientific understanding of things. Ability to troubleshoot. These things require a disciplined mind.

2\. Technology moves fast. It's not what you know so much as how much you are willing and able to want to keep learning.

3\. Humility drives motivation. If you are never satisfied then you will continue to improve and seek the guidance of people better than you. Humility allows you to surround yourself with good people.

Overall, programming is about problem solving. But it takes the top 3 skills to solve a problem I think. Solving a problem does not necessarily mean you have to be smart, you just need to know how to approach it, who to ask, how,what,why to ask, and when it all comes down to it, just getting it done. A duct-taped working solution is better than no solution, and sometimes you need to be humble enough to accept this, motivated enough to move forward and iterate, and disciplined enough to actually learn your lessons and improve over time.

</comment><comment><USER4> Perhaps the following posts on Stack Exchange may help:

What should a CS grad know? [http://programmers.stackexchange.com/questions/16325/what- sh...](http://programmers.stackexchange.com/questions/16325/what-should-a-cs- grad-know)

Advice for nontraditional CS student? [http://programmers.stackexchange.com/questions/39243/advice-...](http://programmers.stackexchange.com/questions/39243/advice- for-nontraditional-cs-student)

Personally, I believe the most important language-agnostic skill for any CS/engineering graduate student is the ability to model problems and solutions with pen and paper before diving into the code. The theory lays the blueprint for the house. The code is the bricks.</comment>


The surprising pattern behind color names around the world - <AUTHOR> https://www.youtube.com/watch?v=gMqZR3pqMjg <comment><USER2> "blue, on the other hand, was fairly scarce before manufacturing."

..unless you look up?</comment>


Seth Godin: Thrash at the beginning [video] - <AUTHOR> http://the99percent.com/videos/5822/seth-godin-quieting-the-lizard-brain <comment><USER2> Interesting. This is about "Quieting the Lizard Brain". Seth created Yoyodyne. Yoyodyne Propulsion Systems is from Buckaroo Banzai. Buckaroo Banzai has Lizard references (Lectroids were lizards, Lizardo is last name of John Lithgow's character):

[http://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banz...](http://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension)</comment>


Show HN: my first IOS app, activities to do with your toddler - <AUTHOR> https://itunes.apple.com/us/app/active-play/id1265770839?mt=8 <comment><USER2> What are the in-app purchases? The App Store page doesn't show a list</comment>


Why Finish Books? - <AUTHOR> http://www.nybooks.com/blogs/nyrblog/2012/mar/13/why-finish-books/ <comment><USER2> I don't agree with this line of thinking, that the concept of the art in question lies entirely with the reader or viewer. If a piece of art (i.e. a book or painting) is conceived as a whole and executed as a whole, then finishing it is necessary to understanding and appreciating that piece of art.

If you are not enjoying a book, feel free to put it down. I have many times. But I don't pretend that I have formed a complete and valid judgment. I forfeit that when I fail to comprehend the work as a whole.

As for whether endings are "necessary" when you have enjoyed a book, it depends on how necessary the author intended it to be, not on whether (as the author was rightly, in my opinion, angered by) the reader felt he was "done." It's a bit like knocking the wings off a statue because you think it looks better that way. What you think looks better isn't the point. The statue was created that way because that's the way the creator wanted it created.

Personally, I think it is critical to read every word as the author intended. Otherwise you are appointing yourself as editor over their artistic imagination. You are in charge of your own time and enjoyment, but not the structure and content of their work.

<comment><USER3> The single most important book in my life is one I did not finish reading.

As a teenager I spend a few weeks reading Ivan Hortan's beginning C++ in depth. But, I skipped the last few hundred pages focused on the STL. I wanted to know the ins and outs of the language, but after that I had what I wanted and I moved on. And considering it's been 15 years and I have never seen a reason to go back and read that section or even write much C++ it was probably a wise choice.

Now you could argue that different rules apply to fiction, but the choice is the same. Do I risk continuing or should I quit and try something else and it's the authors job to convince you that the rest of the journey is still worth it. Feeling you can only judge what you finish is just the sunk cost fallacy in another form, they failed and it's ok to call them on it.

<comment><USER2> As mentioned in the other reply, "For reference works, or almost any type of nonfiction these days, nonlinear consumption makes a lot of sense." So for your engagement with Hortan's C++, it makes sense that you would take what you needed and not what you didn't.

But yes, I would argue that different rules apply to fiction. Completion is an essential part of the process. If you don't like the book, or don't want to finish, by all means don't finish! I've quit books for a number of reasons. If the book isn't holding your interest, that's - well, to say it's the author's fault is perhaps assigning blame where blame doesn't apply, but rather say that the fault is not yours. It's the job of the book to entertain, and while it may entertain some, it doesn't for you. You can put a book down in good conscience, certainly. But I disagree with the author's idea that finishing a book is purely optional.

</comment></comment></comment><comment><USER4> Appropriately enough, I read about half his article, thought "this is quite interesting, but I think I've got the message" and then stopped reading any more.

</comment><comment><USER5> A neat idea I've heard on this topic:

Suppose you read 20 books a year. With 50 years of life, that's 1000 more books in your lifetime. (Or 2000, or 5000).

Why waste a slot on a book that isn't useful? Many books, esp. modern non- fiction, are needlessly padded to fill a length requirement (since a 20-page "book" can't be taken seriously).

</comment><comment><USER6> I think the answer for this is different for fiction and non-fiction. If I don't finish a non-fiction book, I still sometimes consider it "read", if I have gotten the gest of it. This is especially true if the author goes into more detail towards the end of the book after making their point. Non- completed fiction books I usually don't recommend to friends.

<comment><USER7> Am I the only one who finds popular nonfiction books bloated? So often it seems like the core ideas could've been expressed in one or two insightful blog posts.

<comment><USER5> I just wrote a comment on the same! I completely agree. I feel there's a pressure to fill some artificial page count requirement.

I read "The Evolution of Cooperation" and it honestly could have been done in 30 pages. Instead, I foolishly suffered through 215 of them.

<comment><USER8> Hence the executive summary industry for biz books.

</comment></comment></comment></comment><comment><USER9> Ah, the vindication of Neal Stephenson! :)

Also: It's been a long time since I read Godel Escher Bach, so I cannot trust this for sure, but at the time I got the feeling there were hints that the book as such ended before the last page, the remainder was just there as filler.

<comment><USER10> Neal Stephenson might even have been more effective in some of his novels (I'm looking at you "Diamond Age" - a personal favourite nonetheless) if they had just stopped a chapter or so before the end.

I vote more for "What Happens Next" and less for the "Hollywood Ending".

Note: in keeping with the theme of the article, I didn't read the second half..

</comment></comment><comment><USER11> _"Or are there occasions when we might choose to leave off a book before the end, or even only half way through, and nevertheless feel that it was good, even excellent, that we were glad we read what we read, but don't feel the need to finish it?"_

I finish most books I start, but I choose what to read very carefully. However, I stop playing video games partially through all the time and feel little to no remorse over not finishing them.

<comment><USER12> I've felt this way playing Civilization V, which I recently picked up during the Steam sale. I played a campaign and felt that I got all there was to be had out of the game. Though, I am ignorant of many of the core mechanics and I'm sure it's a much deeper game than I'm giving credit for. I started a new campaign (to feel that I'm getting my money's worth), and still managed to sink a few hours into that, however.

</comment></comment><comment><USER13> I remember cheating on Umberto Eco's _Foucault's Pendulum_. If you've never read the book, it's spent in double and triple flashbacks: "To understand where I am now, I must tell you about that night in the observatory. // There I was, cowering in a telescope, and I thought back on all that had come before, especially the job as an editor that I used to have. // While I worked as a publisher I remembered how I first met Jacopo Belbo...". I suppose we would describe it as a stack data structure, you keep pushing a new "present" onto the end of the existing one.

So here's how I cheated. At one point the main character suddenly takes a trip off to Brazil, and I thought, "man, this is getting ridiculous. I bet if I just skip ahead to whenever he comes back from Brazil, I won't have missed much." It turns out that while I had missed some important things, like a new girlfriend who becomes a major player in the story, I saw enough of them afterwards to conjecture about what had happened in Brazil.

What's more interesting to me is the set of books that I keep returning to. I have probably read Zelazny's _Great Book of Amber_ (which is itself 10 novels) five or six times in my life, maybe more. It just captures me and takes me on a ride, each time.

<comment><USER14> There are very few books that pull off these mini-stories. I found the Arabian Nights (unabridged Burton version) to pull this off with amazing elegance. The characters usually use the mini-stories for some contrived example but the stories are very short, quick and on message and together the arabian nights is a solid read.

</comment></comment><comment><USER15> 50 pages into a rather short novel may be substantial enough; 50 pages of War and Peace only scratch the surface. I wasn't hooked in the first 50 pages of W&P, but I came to enjoy the book immensely in a few hundred.

I'm already saving plenty of time by picking what I read carefully.

</comment><comment><USER16> Moving from paper books to a kindle means my tolerance for poor quality writing has dropped massively. Instead of a few books waiting to be read and the need to hunt around bookstores for replacements I've got a dozen books I intend to read already at my fingertips and millions more a few minutes away online.

If I decide a book is not worth continuing (even if I spent money for it because the free sample was inconclusive) then I won't continue it. I'm too time poor to waste my life on bad books.

</comment><comment><USER17> I think the answer for this is different for fiction and non-fiction. If I don't finish a non-fiction book, I still sometimes consider it "read", if I have gotten the gest of it. This is especially true if the author goes into more detail towards the end of the book after making their point. Non- completed fiction books I usually don't recommend to friends.

</comment><comment><USER18> Perhaps not an argument for _finishing_ all books, but I personally will read quite deep into books I am not enjoying in a bid to not miss something good. For as many books I have hated the entire way through (or put down partway through), I have read at least twice as many that I came to love as late as 1/3 of the way through.

</comment><comment><USER19> Case in point, I picked up a novel by Thomas Pynchon when the Borders stores were closing down. I read about a third of it and thought 'OK I get it, I understand this guy's style'. If I had more time I could see myself enjoying the entire thing. Instead I sold it at a used book store last weekend.</comment>


Jq – A Command-line JSON processor - <AUTHOR> http://stedolan.github.io/jq/ <comment><USER5> jq is awesome, a real achievement.

At the same time it demonstrates everything that is wrong with traditional shells and what PowerShell gets so right.

jq is _not_ a "Unixy" tool in the sense that it should do one thing and do it right. jq implements its own expression language, command processor complete with internal "pipelines". Why would a tool need to do that? find is another utility that does many, many other things than to "find" items: It executes commands, deletes objects etc.

Consider this challenge that included parsing json, filtering, projecting and csv-formatting output: [https://news.ycombinator.com/item?id=9438109](https://news.ycombinator.com/item?id=9438109)

Several solutions uses jq - to good effect. But the PowerShell solution uses _PowerShell_ expressions to filter, sort and project items.

The problem is - at the core - that the traditional command tools are severely restricted by only being able to rely on a text pipeline convention. You cannot parse json and send the "objects" along to another tool. Well, you can, if the json tree is extremely basic - like 2 levels.

PowerShell also has a json parser tool: [https://technet.microsoft.com/en- us/library/hh849898.aspx](https://technet.microsoft.com/en- us/library/hh849898.aspx). It is called ConvertFrom-Json (follows the verb- noun convention) and is distributed as part of PowerShell (built-in if you want - but that's a misnomer for PowerShell modules).

It is extremely simple - it doesn't even take any parameters - it just converts a string (parses it as json) and outputs the object/objects which can be arbitrarily complex. It truly does only one thing. If you want to select specific properties, sort, group etc you do it with other PS tools like select (alias for Select-Object), sort (alias for Sort-Object), group (alias for Group-Object) etc. If you want to convert back to json you use ConvertTo-Json.

<comment><USER6> Depends how you look at it.

jq _is_ a "Unixy" tool in the sense that it should do one thing and do it right - and that 'one thing' is parse json data to output it in the desired format.

Awk, arguably one of the oldest unix tools, also has its own language. Would you consider it non-Unixy or is it grandfathered in due to age?

<comment><USER7> It's "Unixy" in that it has a short cryptic name!

Some times "one thing" happens to be a big thing that you have to do 100% or not at all, and doing it well requires a hell of a lot of complexity.

Does a XSLT processor do "one thing": processing XML? Does a DSSSL processor for doing "one thing": processing SGML? (Hint: It has a Scheme interpreter built into it!)

<comment><USER5> You raise some interesting points.

As I said, jq is impressive. It is a JSON processor that implements it's own functional language, complete with variables, function definitions, arithmetic, recursion. There is _no question_ that it is useful and will be the absolutely right tool for a number of jobs.

Likewise with awk. I really, really like awk. It is such an elegant solution to a common problem (text parsing and productions). It is _also_ a functional language.

XSLT is also a functional language. An XSLT processor is expected to implement a standard (as opposed to jq and awk) - but that's a minor difference.

It is when you are required to blend the disciplines that the limitations sneak up on you. In powershell it works the same regardless of whether I process data from JSON, from XML, from line-oriented text, from CSV, fixed columns or or from database queries. Sorting, grouping, comparing, mapping, presenting, converting - it is the same skill set.

That is not so say that something like PowerShell can or should replace tools like awk, XSLT or jq. It should not. Period.

But for tasks where one has to use several formats, the lack of a sufficiently strong inter-command protocol causes the tools to bloat and include functionality that has nothing to do with the core task. Consider, for example, why jq needs a "@csv" function (called a "format string") - <USER2> @html, @sh, @base64!

My claim is that those functions have nothing to do with JSON processing.

The equivalent in PowerShell is handled by ConvertTo-Csv, ConvertTo-Html, Out- String or the [Convert] class.

It really comes down to a n*m problem. jq is just one tool that implements csv or html formatting (m formats). There are n tools (jq, awk, xslt, ...). Should they all use the same rationale as jq and implement csv formatting? Or should they stay away from that and just concentrate on the core task.

In PowerShell the equivalent of jq - the ConvertFrom-Json cmdlet - <USER3> converts from JSON. Regardless of whether the objects were converted from JSON, line-oriented text, database queries, fixed columns, XML - the output formatting is handled by tools that are optimized for that.

If I'm dissing anything it is the limited inter-command protocol of traditional shells. In this day and age we process complicated structures that are not easily expressed in line-oriented plain text.

</comment></comment></comment></comment><comment><USER8> I've been using this for a couple months now. With httpie[1], it's become as essential to my work day as Grep.

[1] [https://github.com/jakubroztocil/httpie](https://github.com/jakubroztocil/httpie)

<comment><USER9> Wow, thanks for that link. I hadn't heard of httpie, but it looks pretty slick.

<comment><USER10> Isn't that the same as curl(1)?

<comment><USER11> Nope. HTTPie is much, much more focused than cURL (the CLI tool). It is exclusively an HTTP client designed primarily for interactive use. cURL, on the other hand, is meant to be used mostly non-interactively and is more of a general client for "URLs" (it also supports DICT, FILE, FTP, FTPS, GOPHER, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).

HTTPie's goal is user-friendliness, so it comes with features like built-in JSON support, output formatting, syntax highlighting, extensions, etc. Comparison of the two in one screenshot can be seen in the README:

[https://github.com/jakubroztocil/httpie#readme](https://github.com/jakubroztocil/httpie#readme)

(Disclaimer: I created HTTPie)

<comment><USER12> I use and love httpie but I start to regret that it's written in Python as the Python platform is a very very late adopter of modern TLS standards. Even today, in 2015, it's still a hurdle to use httpie with a SNI endpoint, and forget about it making it talk to a ECDSA-based endpoint like those exposed by the free tier of Cloudflare (so called "modern TLS"). I wonder how long it will take to HTTP2 to land.

I tried a random rewrite of httpie in Go and it worked perfectly with those endpoints, as expected, and Go is getting full HTTP2 with 1.5 in June. Too bad the rewrite was still feature incomplete, when I tried it.

<comment><USER11> The situation is not ideal but more recent versions of Python (2.7.9 and 3.4) have a much improved TLS support and things like SNI work out of the box.

For older Python versions there are some additional dependencies to be installed manually (will happen automatically in next version of HTTPie):

[https://github.com/jakubroztocil/httpie#sni-server-name- indi...](https://github.com/jakubroztocil/httpie#sni-server-name-indication)

As for HTTP/2, there is an experimental extension for now:

[https://github.com/jakubroztocil/httpie- http2](https://github.com/jakubroztocil/httpie-http2)

</comment></comment></comment></comment></comment></comment><comment><USER13> Love, _love_ jq...after awhile, I realized I was twisting my brain too much to get bash to do what it wasn't meant to do, but I got a lot of mileage of just playing with APIs because of how jq made it so easy. I came up with some fun lessons on how to use jq and other CLI-tools to tour the Spotify API [1] and to mash up images from Instagram [2]

[1] [http://www.compciv.org/recipes/data/touring-the-spotify- api/](http://www.compciv.org/recipes/data/touring-the-spotify-api/)

[2] [http://www.compciv.org/recipes/data/api-exploration-with- gma...](http://www.compciv.org/recipes/data/api-exploration-with-gmaps- instagram/)

(note: while I say that I like the command-line, I'm not die-hard enough to have stopped to learn awk, so take that fwiw)

</comment><comment><USER14> Using it for parsing AWS CLI responses, it's been a sweet tool to parse those JSON responses from AWS, most of the time I'd fire some python script to parse the data and now with jq I can keep most of the one-time scripts limited to bash only, if I need something more maintainable or longer living then I'll drop a script in python or ruby.

<comment><USER15> JmesPath is built into the AWS CLI.

You don't need separate JQ. See the --query option:

[http://docs.aws.amazon.com/cli/latest/userguide/controlling-...](http://docs.aws.amazon.com/cli/latest/userguide/controlling- output.html)

Check out [http://jmespath.org](http://jmespath.org) for details.

<comment><USER14> Only saw your comment today, thanks so much for this, I really overlooked this part from the docs.

</comment></comment></comment><comment><USER16> Lots of previous discussions about this on HN (for instance [0]) but still a sweet tool.

[0] [https://news.ycombinator.com/item?id=5734683](https://news.ycombinator.com/item?id=5734683)

</comment><comment><USER17> Jq is truly amazing swiss army knife for JSON viewing/processing in command line.

Btw, I've seen people posting this github link at least 10 times in the past. I thought HN filters dupes, what gives?

[https://hn.algolia.com/?query=http:%2F%2Fstedolan.github.io%...](https://hn.algolia.com/?query=http:%2F%2Fstedolan.github.io%2Fjq%2F&sort=byPopularity&prefix&page=0&dateRange=all&type=story)

<comment><USER18> I think it filters dupes within a certain time frame. You don't want important front-page news at a site being considered a dupe because something was big on the front page a year ago.

<comment><USER17> Gotcha. In this particular case though, it does feel like every few months someone will remind us there is this great tool some of us have been already using for 2 years now:)

<comment><USER19> FWIW, I hadn't heard of it before.

(actually that's a lie, I saw it mentioned in the CSV challenge thread. But that was just a few days ago, so the point still stands)

</comment></comment></comment></comment><comment><USER10> For a similar tool written in javascript, check out json ([https://github.com/trentm/json](https://github.com/trentm/json)). I use both.

</comment><comment><USER20> Love JQ, been using it for the past year. I'm very much looking forward to the regex support in 1.5.

</comment><comment><USER21> I love that it is written in C and not Go, or Rust, Java

</comment><comment><USER22> I know it is right on the linked page, but it is useful enough I think it deserves a direct link in any conversation:

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

</comment><comment><USER23> Compare: rl_json -- Extends Tcl with a json value type and a command to manipulate json values directly. The commands accept a path specification that names some subset of the supplied json entity. The paths used by [json] allow indexing into JSON arrays by the integer key.

[https://github.com/RubyLane/rl_json](https://github.com/RubyLane/rl_json)

</comment><comment> aggregator-ios For those on OS X, check out JSON Query: [https://itunes.apple.com/us/app/json- query/id953006734?mt=12](https://itunes.apple.com/us/app/json- query/id953006734?mt=12)

It's not nearly as powerful as jq, but for simple querying and downloading JSON (with POST body and HTTP headers), I find it quite useful.

Disclaimer: I built it.

<comment><USER24> "brew install jq"

</comment></comment><comment><USER25> I recently had to consume an xml service; it would've been great to have something like Jq for xml. For some reason I wasn't really interested in xml -> json conversion as a first step. I also found a bunch of xml cli tools, but they are older, had to learn things like XQuery (which actually few tools today seem to support).

<comment><USER26> Well there's XProc. But as with everything XML - you shouldn't really edit it by hand without proper editor support at the very least (preferably DTD/XML Schema aware).

<comment><USER25> I understand XML has namespaces, but I'm not sure what "edit by hand" means in this context. The tools I found previously were xqilla and xmlstarlet, but they seem pretty old and just not as convienient as Jq.

I still think there is space for an XML cli tool that is more convenient for the majority of common tasks working with XML, at simply treating the data as a hierarchical structure, without requiring an interface that is full fully- qualified/needs XSLT/etc..

</comment></comment></comment><comment><USER27> Nice. I made jipe[0] a while back to handle common troubleshooting tasks with streams of json objects. I still use it quite a bit. I didn't see anything about streaming in the jq docs.

[0] [https://github.com/dokipen/jipe](https://github.com/dokipen/jipe)

<comment><USER28> It does streaming. You can pass a stream of JSON objects through standard input and jq will process them on stream.

The master branch also has experimental support for JSON sequences.

</comment></comment><comment><USER29> This appears to be in FreeBSD ports already, so just

      pkg install jq

and you can have it :)

</comment><comment><USER30> We are using jq to parse JSON output from various API in shell scripts. It served us well even for large JSON strings. If you want to write small scripts and parse some JSON in it then jq is best fit.

</comment><comment><USER31> i love it so much.

i've used it for things like migrating between json schemas, and even converting normal json into elasticsearch bulk imports on the fly.

</comment><comment><USER32> How weird - I just started using this for some simple scripting against a rest interface. Its a great tool.

</comment><comment><USER33> I love JQ. I use it along with Ansible's AWS dynamic inventory script to manage my instances.

</comment><comment><USER34> No mention of jsawk in here? We use it quite a bit for shell scripts, works great.

</comment><comment><USER35> I appreciate jq and use it almost every day. At the same time, I recently had a task that was easier to do in Node.js. I had a file containing a JSON object with a structure like so: [ { }, { }, ... ] and I wanted to turn each object into a separate file.

<comment><USER36> That task is trivially accomplishable in jq. I have no clue why you say it's "easier" in nodejs.

        i=1
        for line in `echo '[{"a":"b"},{"c":"d"},{"e":"f"}]' | jq '.[]' -c`; do
          echo $line | jq '.' > jq_out_$i.json
          i=$((i+1))
        done

The above prints each element of the array to a file named by its index, including pretty-printing it.

If you use it every day, the above should have come to you easily enough.

</comment></comment><comment><USER37> Looks interesting. Given this json, [{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}], can it print it out as this: john,1 john,2 john,3 jane,4 jane,5 jane,6

<comment><USER38> Yes, kind of like so:

echo '[{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}]'| jq '.[]| "\\(.name), \\(.grades|.[])"'

<comment><USER37> Thanks! Now, it looks more interesting...

<comment><USER17> Based on @aquassaut's answer, I tweaked it a little, and this should do it.

echo '[{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}]' | jq -r '.[] | "\\(.name),\\(.grades|.[])"' | paste -sd' ' -

</comment></comment></comment></comment><comment><USER39> one of the most useful command lines tools in my toolbox these days - <USER4> you for all that have contributed to this masterpiece.

</comment><comment><USER40> I'm using it in bash scripts - it's a very good tool.</comment>


We are starting WebKit modularization - <AUTHOR> http://markmail.org/thread/fkiibwrwv3xporxx

<comment><USER2> _> We hope this will make it much easier to develop vendor-specific features._

DRM[1]? Flash/"ActiveX 2012"[2]?

We've seen a great deal of recent discussion about the harm vendor-specific CSS properties[3] and X- prefixed application protocol header fields[4] are causing. No two parties can agree on proposals for the HTML specification. Microsoft, Google, Apple and Mozilla all tend to disagree and we're stuck with vendor-specific browser features.

These are not good signs for the health of the Web.

[1] <http://news.ycombinator.com/item?id=3620432>

[2] <http://news.ycombinator.com/item?id=3620537>

[3] [http://lists.w3.org/Archives/Public/www- style/2012Feb/0998.h...](http://lists.w3.org/Archives/Public/www- style/2012Feb/0998.html)

[4] <http://tools.ietf.org/html/draft-ietf-appsawg-xdash-03></comment>


Out-of-Control Satellite Threatens Other Nearby Spacecraft - <AUTHOR> http://www.space.com/news/out-of-control-satellite-threatens-others-sn-100503.html

<comment><USER2> Month old news, e.g. here's an item from 3 days ago about the successful management of it's first "close encounter": [http://www.satellitetoday.com/st/headlines/Intelsat- Reports-...](http://www.satellitetoday.com/st/headlines/Intelsat-Reports-No- Service-Disruption-as-Galaxy-15-Passes-AMC-11_34236.html)

<comment><AUTHOR> Excellent - thank you.

I found this after looking at various items about orbital mechanics. Most of it I know, but I hadn't seen this piece of "news". I also searched here on HN to see if it had been submitted. I couldn't find it, I thought it was interesting, and hence I submitted it.

<comment><USER2> You're welcome. I _think_ it was reported but I'm not sure much note was made of it then on this forum.

It is quite interesting ... perhaps they made the satellite too redundant! I.e. the stabilization and service (vs. control) radio systems are working just fine but they can't talk to it or what they're trying to talk to got zapped. If this is at all likely to happen again (probably not), future satellites ought to have a deadman system to turn off the service radio system if they haven't been in contact with home for too long.</comment></comment></comment>


MIT Campus map - <AUTHOR> http://whereis.mit.edu/ Pretty sweet. <comment><USER2> Hacker News? In what way is this something "that gratifies one's intellectual curiosity." ( <http://ycombinator.com/newsguidelines.html> )</comment>


Picomath: self-contained math functions in 11 languages - <AUTHOR> http://picomath.org/ <comment><USER2> I didn't check them all, but I got 403 and blank pages when trying to access the python and C++ files respectively.

<comment><USER3> Also 403 for Python. The other page are blank because they use <script ... /> which is not correct and should be <script ...></script> but the code is here if you look at the source.

<comment><USER4> Thanks for noticing that! I've fixed the code and it should work now. (It was probably only a problem for IE, please let me know if it's still not fixed.)

<comment><USER3> It seems fixed but it was not a IE only problem, I'm using Firefox v5.

</comment></comment></comment></comment><comment><USER5> Pretty cool. The Ruby port is of questionable use, considering erf, gamma, etc. are already implemented in the Math module.

<comment><USER4> Newer versions of Python also contain implementations for gamma and erf. I implemented all functions in each language mostly for completeness, but I will add a note in the code snippet where the function is already provided by the language standard library.

</comment></comment><comment><USER6> I was just wondering, what would you use the gamma function for? I'm not that far enough in the mathematical field to know, so that's why i ask. Maybe a real world example? Thanks.

<comment><USER7> The gamma function shows up in a number of common probability distributions. For example, there is the gamma distribution, which is useful for modeling how long it will be until some random-ish thing happens: how long until some machine fails, how long until some extreme weather event happens. (Or something like that; I'm at the far borders of my field of expertise here.)

</comment></comment><comment><USER8> thanks for this. but why not make the c++ examples c? then both c and c++ users can use them (and other languages wrap them more easily). looking at a few examples, it shouldn't be too much work.

</comment><comment><USER9> No C? Seems like one would have done these in C instead of C++. Not that there is much to change, but it would suite a wider audience.

</comment><comment><USER10> Cool. It could be useful to add the incomplete gamma functions. They are used in calculating the chi squared distribution, and so come up in analyzing A/B testing.

</comment><comment><USER11> Great! I had been passively looking for a lua gamma function to replace one I had been using since lmathx can't be compiled on Windows. Passively found!

</comment><comment><AUTHOR> The site has been updated to fix the problem with the source being invisible.</comment>


Updated iOS device and OS version stats from Instapaper - <AUTHOR> http://www.marco.org/2011/08/13/instapaper-ios-device-and-version-stats-update

<comment><USER2> Funny that the two ipad models are dead even considering they've shipped more than twice as many original ipads. It would seem a full 50% of gruber's readers replaced their ipad's with the ipad 2. No wonder apple is crushing tablet sales.

<comment><USER3> >It would seem a full 50% of gruber's readers replaced their ipad's with the ipad 2.

What does Gruber have to do with this? Do you mean Marco?

<comment><USER4> He might have meant for you to replace "gruber's readers" as "Apple fanboys".

</comment></comment></comment><comment><USER5> Does anyone know of any other developers that have published these kind of stats?

I suspect that Instapaper was extremely popular with the techie/start-up crowd when it first launched but it has become quite well known in these last three years and I'm wondering if it has pushed through to your regular Joe consumer yet.

It would be great to get a couple more points of data so we can show that most people are using iOS 4 to help push forward the phasing out of iOS 3 support.

</comment><comment><USER6> I completely agree. Using 4.x today allows to write code in a much cleaner and efficient way; a few examples: gestures (for iPhone), blocks, GCD. Besides multitasking and background processing allows features that were impossible to get or required complicated hacks. And now that we must provide iOS4 and iOS5 mixed compatibility, we cannot absolutely maintain any compatibility with iOS3.

<comment><USER5> It is quite impressive that in just over a year developers are able to start requiring iOS 4.

I hope that iOS 5's OTA updates we could get to the point where iOS versions older than a few months are considered obsolete.

Apple has done a great job at fostering this culture of upgrading as soon as possible. Microsoft and Google still have problems were the average consumers see OS updates as something that can cause problems, not bring new features.

<comment><USER3> >I hope that iOS 5's OTA updates we could get to the point where iOS versions older than a few months are considered obsolete.

While a very nice idea, I'm not convinced it much will change due to old hardware being incompatible with new versions of iOS. It's rarely the x.y versions which are the barriers to progress, but the x.0 versions.

<comment><USER5> That is true but Apple does seem to have a higher adoption rate with their physical products. iOS 4 killed support for the original iPhone and now iOS 5 is killing support for the iPhone 3G.

When the iPhone 5 comes out this fall I think by June of next year there will be enough penetration of iOS 5 that some apps will be able to put that requirement on it.

Heck if we're lucky iOS 6 will finally kill support for non-Retina displays.

</comment></comment></comment></comment><comment><USER7> Interesting stuff. Keeping the OS so up to date has got to help both users and developers. As a nitpick, the "OS/CPU is at least this" plots are screaming for a CDF graph.

[http://en.wikipedia.org/wiki/Cumulative_distribution_functio...](http://en.wikipedia.org/wiki/Cumulative_distribution_function)

</comment><comment><USER8> And when iOS 5 is released Instapaper will become completely unnecessary.

<comment><AUTHOR> Maybe for some users, but by no means everybody.

1) Reading List is Safari only. 2) Many popular apps (such as Twitter for iOS) actually support Instapaper's Read Later, whereas I'm not sure that there is a Read Later API (someone correct me if I'm wrong). 3) Instapaper has social sharing built in.

<comment><USER9> I've been using the iOS 5 betas and I can tell you I use Reading List and Instapaper completely differently. Instapaper has always been long form reading, stored for later (and potentially offline). Reading List, I use to quickly transfer a site I'm currently reading from my desktop to my iPad or iPhone, incidentally replacing an app I wrote to do exactly that. I guess it's time to take Panic's Audion advice and retire that app ("When you double click the competition in the morning, that's a pretty good sign that it's time to hang up your hat!", <http://panic.com/extras/audionstory/>)</comment></comment></comment>


Why hasn't renting home as office space have not taken off in U.S? - <AUTHOR> U.S has Breather, Sharedesk, LiquidSpace, Pivotdesk all which serve in renting unused office spaces, however I assume there are more apartments in San francisco that are empty most of the day than office spaces(especially true for young professionals).Europe has multiple startups i.e Vrumi, SpaceHop & officeRiders that target private home spaces for hourly rentals. What is it about the American target market that is different that has stopped these startups to enter this market. Is it regulations? Americans perception of hourly rentals? <comment><USER2> Because most homes are not zoned for office space. Working at home is one thing, renting your house as an office is another. You'd quickly piss off your neighbors and draw the attention of the city.</comment>


Record labels to pay $45M for piracy - <AUTHOR> http://www.newswire.ca/en/releases/archive/January2011/10/c9214.html

<comment><USER2> It's pretty hilarious that the big record labels also dabble in "piracy", releasing stuff without permission from the artists.</comment>


Eve Online goes free-to-play - <AUTHOR> https://community.eveonline.com/news/dev-blogs/introducing-clone-states-and-the-future-of-access-to-eve-online/ <comment><USER2> I used to play EVE Online for many years (unsubscribed 3 times, about 4+ total years of playing). It's a fantastically complex and rewarding game once you understand the mechanics. That initial first step though has to hurt them when trying to attract new players. They've made a ton of progress in making the game better for new players (especially getting rid of learning skills which essentially took about a month+ just to speed up learning other skills and if you didn't train those first you would fall way behind everyone else).

I'm not convinced this move is going to help them gain more players. New players will come into the game at a disadvantage now with a slower training rate. Training in real time is an interesting gimmick but one of the biggest barriers to the game (you can be the best pilot in the entire game with more money than everyone combined and you _still_ can't fly any ships fancier than the tier 1 ships for usually several months let alone YEARS for some of the bigger ships like carriers).

Not going to like though this temps me to start-up my old account even if it is just so I can resume training skills that never finished.

</comment><comment><USER3> Don't know a whole lot about Eve Online, but isn't the local currency (isk) linked to real currency due to the pay-to-play model? Will his affect the Eve economy?

<comment><USER4> There is, in that you can buy game time with ISK from a player who sells their game time for ISK. But all game time is still paid for in real money by someone, so there's never ISK entering or leaving the economy through this model.

As with other subscription games with a F2P option tacked on later, the F2P option is very, very restricted. A handful of available ship types and skills, and the skill limits heavily restrict how efficient you can be economically.

So I don't think there will be a lot of competition created by free accounts. But more players playing EVE will increase the overall ISK generation rate in the universe a little bit, so you might see some mild inflation.</comment></comment>


A big step towards Firefox generational and compacting GC - <AUTHOR> https://blog.mozilla.org/nnethercote/2014/01/20/a-big-step-towards-generational-and-compacting-gc/ <comment><USER2> From Terrence Cole:

>Exact rooting is required for us to use GC algorithms that relocate objects in memory. It will allow us to implement compacting GC to save memory and generational GC to push our performance to the next level.

For a comprehensive overview of a good open source GC, check out Mono's description of theirs:

[http://www.mono-project.com/Generational_GC](http://www.mono- project.com/Generational_GC)

Browser GC is really tricky. The browser provides all sorts of complicated native services, like a flexible rendering engine (you know, HTML), recording audio, LocalStorage—really complex stuff implemented efficiently in C++ and with cross-platform support. All of these native objects can be accessed/instantiated from Javascript. Hence the GC is especially well tuned, on top of the security requirements around dealing with untrusted code running trusted code in general. It's a big undertaking for sure.

</comment><comment><USER3> Please excuse my naivety, but I have only recently gotten interested in compilers, memory management, etc. [1]

Can someone please explain to me why GC isn't implemented as a library that can be used by any runtime/VM? We recently had a generational GC land in Ruby 2.1 Few languages out there specially target JVM because of its GC story. Wouldn't everyone benefit from a common code-base with rock-solid GC algorithms & implementations? Analogous to crypto libraries.

[1] After getting sick of the fact that all the "new age" languages use shit- loads of resources for, essentially, achieving trivialities. We were able to do the same things using 386 PCs with a few megs or RAM for which, today, we need 2 GHz multi-core CPUs and 8 GB of RAM.

PS: Not trying to downplay the work done in bringing better memory management to Firefox. I would really appreciate Firefox not using up 1.3GB of memory -- that was one of the reasons I had to fork out INR 5,000 for an extra 8GB of RAM recently.

<comment><USER4> The hard part is not the high level algorithm - most of the common ones can be prototyped for toy systems in trivial numbers of lines.

The hard part is system interactions. E.g. the GC needs a way to identify all the "roots" (references from outside the heap, such as registers, the stack, or pointers that may have been retained by external libraries etc.).

It also needs a way to identify which parts of an object are pointers and this varies with language. "Generic" GC's like Boehm's solve this by assuming you've done nothing to obscure the pointer, and then assumes everything that _could_ be a pointer into the heap is, but this fails miserably for any language implementation that uses bits for type tagging, for example, and retains too much memory in many other situations because it isn't precisely determining which fields are pointers.

Then you have issues like threading models (threading and GC are intimately linked, as if you don't block all threads during marking or moving/collection, you have all kinds of additional exciting issues to deal with to ensure you don't break things)

<comment><USER3> Thank you for the replies. A follow-up question, how does any GC/runtime/VM know which parts of the memory are actual data vis-a-vis pointers to other parts of the memory? Some sort of global pointer table, perhaps? If so, why cant the hypothetical GC lib define an API to share said pointer-table?

</comment></comment></comment><comment><USER5> Wow, that must have been a lot of freaking work. Testing this must be nightmare, if you have on native pointer left the browser could essentially randomly crash.

Pretty cool stuff. I really want to see the performance changes the GC can get.

<comment><USER6> Isn't that problem right in the domain of automated testing and static code analysis?

<comment><USER7> We do both, but it's still very tideous. After a while the dynamic analysis only caught false postives (something on the stack looked like a pointer). The static analysis had to be updated when new potential hazardous cases became obvious. [https://wiki.mozilla.org/Javascript:SpiderMonkey:ExactStackR...](https://wiki.mozilla.org/Javascript:SpiderMonkey:ExactStackRooting)

<comment><USER8> You've got a typo in your URL there - missing 'n' in 'rooting'

</comment></comment></comment></comment><comment><USER9> Is this the equivalent work of Oilpan project for Chromium-Blink? [https://groups.google.com/a/chromium.org/d/msg/blink- dev/59f...](https://groups.google.com/a/chromium.org/d/msg/blink- dev/59fb1FIirx0/u1EV00Ca5sgJ)

Doc: [https://docs.google.com/document/d/1y7_0ni0E_kxvrah- QtnreMlz...](https://docs.google.com/document/d/1y7_0ni0E_kxvrah- QtnreMlzCDKN3QP4BN1Aw7eSLfY/edit)

<comment><USER10> No, Oilpan is different; it's a garbage collector for C++ objects, while exact rooting is for JS objects. Oilpan has more in common with the XPCOM cycle collector in purpose (although the approach is different), which Firefox has had for several years now but which WebKit has had no equivalent to.

<comment><USER11> Right, and on the flip side, V8 has had a generational, incremental JS collector for quite a while :)

<comment><USER12> For what its worth, it looks like v8 has had incremental GC since 2011 ( [http://blog.chromium.org/2011/11/game-changer-for- interactiv...](http://blog.chromium.org/2011/11/game-changer-for- interactive.html) and generational GC for longer) while Firefox has had IGC since 2012 ( [https://blog.mozilla.org/javascript/2012/08/28/incremental-g...](https://blog.mozilla.org/javascript/2012/08/28/incremental- gc-in-firefox-16/) ).

</comment></comment></comment></comment><comment><USER13> Can anyone comment on what this will mean for Firefox in rough terms? Less bloat in long-running processes? Less memory usage in general?

<comment><USER14> The eventual introduction of compacting and generational collection will:

Dramatically reduce the cost of GC for short-lived objects ( _dramatically_ , to the point of producing something like 5-10x wins on some of the stupidly tuned microbenchmarks typically used to compare JS runtimes)

Reduce typical heap fragmentation (essential for long-running processes - imagine a facebook/gmail tab left open for days)

Potentially improve computational performance (compacting your GC heap will improve memory locality in some scenarios, which means the CPU cache can be used more efficiently, which will make JS code manipulating small objects much faster)

Reduce average GC pause duration and reduce the frequency of GC pauses

In summary, generational collection is a big win for the things users tend to care about, if you look at what the advantages mean for applications. Compacting is less important, but tends to be nice too.

</comment></comment><comment><USER15> Still waiting for e10sM2. I hope after this is finish and done they can move on to it.

Firefox really needs some help in its snappiness area.

<comment><USER16> To be honest I haven't noticed it being sluggish, except when loading a 10 tabs when waking from hibernate. These days Chrome chokes with same amount of tabs that FF deals with easily.

Chrome does sometimes win with the JS demos (mainly that 3D period table demo).

<comment><USER17> Chrome wins on psychology, it's uber fast on start and with few tabs, then it gets a bit slower than firefox, which is relatively constant in its non- snappiness (it's not slow but you notice tiny lags in the UI regularly)

<comment><USER16> To be honest I haven't noticed that it's non-snappy (I am on Nightly but use Regular at home). I'm bit biased towards Mozilla, but I don't think it is lacks much polish. Chrome dev tools are better, but the gap is closing in that area.

<comment><USER15> Fan boys will try to tell you otherwise. But lets just admit Firefox is slower then Chrome. Its a fact. Even though i have been an Firefox users for longer then a decade.

Try Opening "Tab from Other devices". Firefox will stall. Try using Feedly and open link in a new tab, Feedly will suddenly response very slowly. There are also other page loading performance which Blink/Webkit leads. Not to mention Google's way of implementing advance preloading technique which seems to win as well, even though Firefox has something similar.

Yes I understand the geeks and tech cares about DRM. Yes I understand about implementation of Web Standard and Freedom. But most users dont. When ever i see users complaining about why not switch to Chrome on their computer. I just say no. I FORCED the usage of Firefox on 100s of computer in the office. If not, I bet users would choose a Chrome anyday.

So the point is, Mozilla needs to seriously think about its execution model. It needs to be efficient and not spread itself thin.

<comment><USER16> I admit I am a bit of a Fan boy.

However, I recall trying FF on my laptop and being slow, then switching to Chrome and it being super fast. When I updated to Nightly, the speed was about the as Chrome.

DRM and other things be damned, I can't notice a difference between Firefox and Chrome in performance. And I bought my computer 3 years ago.

I can't remember when Chrome subjectively outperformed Firefox. And the objective measures are usually about the same.

<comment><USER18> Maybe you used a new, fresh and bloat-free profile when running the Nightly?

Could perhaps explain the speed difference.

<comment><USER16> No, both were fresh installs without plugins. Nightly ran at significantly faster speed than Regular on that laptop.

On my regular comp the difference was non-noticable. Even with all the plugins.</comment></comment></comment></comment></comment></comment></comment></comment>


Ask HN: Optimising ML PhD for Startup? - <AUTHOR> For researchers who've founded a company before -
How would you approach your PhD if you want to start a company during/after your PhD? How would this influence the choice of advisor you choose, schools you pick, etc?
For background: I'm applying for a PhD in ML and am actively thinking about this question. <comment><USER2> I would assume 95% of startups that use ml do it for stupid marketing and fundraising reasons.

I also think once you are done with your PhD the field will have changed in a way you simplycant forecast.

I suggest it's more important to find your interest and passion. That will enhance your. Chance of a great thesis and lead to better outcomes.

</comment><comment><USER3> Many universities have a tech transfer program, ask about those. Keep in mind anything you develop with their time and money, they have rights to, which are usually arranged as a license royalty.

So what I did was get involved with those programs, learned a lot, started something different after graduation</comment>


Iran Bans English in Primary Schools - <AUTHOR> https://www.nytimes.com/2018/01/07/world/middleeast/iran-english-schools.html?mtrref=www.google.com <comment><AUTHOR> All Iran's Mullahs accomplished with this stupid ruling is to make learning English much cooler among the youth because now it's forbidden.

<comment><USER2> True, the Streisand effect in action. But even if they can accomplish their goal of keeping people from English language information there's plenty of people that know English already and will spread what they learn. "Information wants to be free," is a truism.

</comment></comment><comment><USER3> The thing I found most insightful in this piece is that Iranian primary schools were teaching English.

As someone from a country that has English as its first language, I often lament the fact that I don't know any foreign languages and feel a sense of choice paralysis with so many languages to learn. It strikes me that for many learning English as a second language isn't a choice.

The only foreign languages I was introduced to were French and German, and these were in secondary school. I couldn't speak either then, but I found my understanding of spoken French improved when I spent time around Geneva. Can anyone outline the norms for English teaching in the rest of the region and the rest of the world? I often wonder if I'd been born in a particular country, by what age could I expect to be reasonably proficient?

<comment> LV-426 > Can anyone outline the norms for English teaching in the rest of the region > and the rest of the world?

I'd be interested in this too (or other languages, where it would be appropriate, such as the extent of French teaching in Canada, or Spanish in the USA). I suspect what Iran is apparently not doing any more is very uncommon around the world anyway.

<comment><USER4> English is tought as a second language (or third language in bilingual countries) in most of the world.

You would be hard pressed to find a country without ESL classes for it primary and secondary schools.

<comment> LV-426 > English is tought as a second language (or third language in bilingual > countries) in most of the world.

In primary schools, commonly?

<comment><USER5> In Russia, for example, it's one of the common subjects you start studying in middle school and continue up to the last year in high school. Also almost each college/university course also has English as one of the subjects with inclination towards the course major, e.g. more chemistry-related topics if your major is chemistry, etc.

<comment> LV-426 Thanks. You may not be old enough to know from experience, but how does this differ (if at all) from the Soviet period?

AIUI Soviet citizens didn't generally learn English in (high/middle) school, which I always thought a bit surprising (assuming that's correct), and for some reason I have the idea German may have been taught in the USSR. (An idea which may simply derive from Russian being taught in East German schools.)

<comment><USER5> Well, I was born in 1978 and did experience the last years of the USSR, but I also know from my parents` experiences and from the old text-books, that there was a foreign language taught in Soviet middle/high schools and colleges for decades. Upon some research I've found that a foreign language was introduced as a common subject in to the schooling programmes in 1927 in the USSR. Initially that was German. Even in my school years I know that German, French, Italian and Spanish were still taught in schools, but English was more popular.

It would be surprising if they didn't study foreign languages in schools in the USSR considering that the country was surrounded by "enemies".

<comment> LV-426 Thanks. And yeah, that's one reason I always thought it was surprising if they didn't teach English, since it was the (primary) language of 'the enemy'. Plus whatever faults the USSR may have had, education seemed to be pretty good.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> I never learned my English proficienfy in school, let's face it learning a language requires more than a few hours a week in a classroom. Watching TV, playing games and reading books will get you there after a few years. Hell I have immense difficulty now reading stuff in my native language (English is wonderfully efficient).

Besides Iran can grumble but even the French have to use English at universities now because that is the language of science.

<comment><USER7> But it was a start to English proficiency, without the (little) you learned in school I doubt you would've been able to learn as much from TV and reading books, because you need to start somewhere.

</comment></comment><comment><USER8> It's bullshit, of course.

[http://www.moonofalabama.org/2018/01/how-mainstream-media- lo...](http://www.moonofalabama.org/2018/01/how-mainstream-media-lose-their- reputation-fakenews-on-iran-and-egypt.html)

Fascinating how the same credulous repetition runs though the major press as through the "social media" they deride.

<comment><USER9> The article you posted agrees with TFA. Not sure what you think is bullshit.

From TFA:

"The teaching of English usually starts in middle school in Iran, around the ages of 12 to 14, but some primary schools below that age also have English classes.

"Some children also attend private language institutes after their school day. And many children from more privileged families who attend nongovernment schools receive English tuition from day care through high school."

<comment><USER8> According to the article I linked to, there was no 'ban', only some government official saying something about existing curricula. No doubt they're paranoid about foreign meddling, but then who isn't?

</comment></comment></comment><comment><USER10> That's a great way to shoot yourself in the foot.</comment>


Commits are programs - <AUTHOR> https://blog.antipa.io/commits-are-programs/ <comment><USER2> 1- blogs without feedback/comments are useless, stop using them.

2- there's no point in considering commits as programs if it's not easy to modify them. It is not easy with git. Nobody can remember the commands (we have to google for each git action beyond git checkout git commit git push), and the procedures are overly complex. Notably compared to writing programs, if you want to consider a git commit history as programs.

So happy new year!</comment>


VMWare Acquires SpringSource  - <AUTHOR> http://www.techcrunchit.com/2009/08/10/vmware-acquires-springsource/ <comment><USER2> This seems like a strange acquisition. VMWare makes money from selling virtualization and VM management software; spring is just a set of popular java frameworks. maybe they're trying to enter a completely different market?

<comment> brown9-2 SpringSource makes money from selling support for Spring Framework and related tools, lately they've been promoting their own app server (built on top of Tomcat with extra monitoring stuff built in) and IDE; so they are more than just a popular framework.

But this is a very interesting acquisition. I don't think many people would have ever dreamt of this team-up.

<comment><USER3> Consider that SpringSource just purchased Hyperic, the open source app/infrastructure monitoring company. That fits with VMWare's model a bit better.

</comment></comment></comment><comment><USER4> What troubles me is why VMWare would pay such a high valuation for a company whose software is highly dependent on Java infrastructure from one of their competitors, Oracle.

I do see VMWare wanting to put together a more robust cloud offering with an AppEngine type infrastructure, but I think they would be more credible just hosting VMWare machines. That would be a great cloud to have- more like an easier EC2 with local storage than a constrained environment like AppEngine.</comment>


Tesla gets top marks in Consumer Reports satisfaction survey - <AUTHOR> http://www.4-traders.com/TESLA-MOTORS-INC-6344549/news/Tesla-Motors-Inc--Tesla-gets-top-marks-in-Consumer-Reports-satisfaction-survey-17483950/

<comment><USER2> Surveys where you have very enthusiastic first adopters tend to report well. Car purchases driven by emotion rate very different than do those based on need. Hence buyers of V8 Chargers feel much better about their cars than those who buy Versas. When you have financial freedom to buy what you want you tend to overlook issues.

Top that off with the general positive response of hybrid and TDI owners and honesty I was surprised the S didn't get 100.

Not saying that it doesn't deserve its high score, but lets be honest, unless it was just Fisker dreadful how could overly enthusiastic early adopters rate it anything short of perfect?

<comment><USER3> Just look at the other top cars:

>After the Model S, the Porsche Boxster sports car came in second place with a score of 95. The Porsche 911 sports car and Chevrolet Volt, made by General Motors Co, both got a 91.

</comment></comment><comment><USER4> The market is really killing them for their current earnings report, and for the statistically insignificant fires. The market doesn't appear to be correct. Tesla has a long way to go, but they seem to be doing it very right.

<comment><USER5> I suppose one could point out that terrorism is also statistically insignificant, but fear of it very much is significant.

So, I can well imagine that the fear of being in side a burning new fangled electric car, which has the batteries making up the entire area of the floor and are the scary chemical burny things, probably makes people think twice. Especially when for what ever reason they is a safer alternative.

Now, given that marketing is usually about manipulating emotional response in a positive way for a product, we can see that emotional response is a real and serious issue. Simply quoting statistics simply fails because statistics have little to do with emotional response. There for it is missing the point hugely to bang on about such events being statically insignificant. Such events are negative PR and marketing and have a huge negative emotional response.

Or, to ram the point home in a hard, emotional way... Imagine trying to tell a parent whose child burned to death in a burning Tesla that its all very sad, but comfort yourselves in the sure knowledge that their child's cindered corpse is statistically insignificant. I'll park out side for you, and keep the engine running, and hope the Mum is a poor shot.....

<comment><USER6> You seem to have a bone to pick with Tesla - this is not the first emotionally charged, negative comment I've read from you in a Tesla discussion. Is there a reason?

The part that makes me wonder is your example of having to tell a parent their child burned to death in a Tesla. Who is this example aimed at? It's one thing to argue that safety perceptions can harm sales, it's another to argue... I'm not sure what that example is actually arguing, other than FUD.

</comment></comment></comment><comment><USER3> Not surprising. The knocks against Tesla are generally reasons why people don't want to buy them (price, range). A survey of people who already bought them avoids those issues.

<comment><USER7> On the subject of range, I was surprised to see recent ads for the Vauxhall/Opel Insignia with a range of just under 1200 miles - which is pretty impressive.

</comment></comment><comment><USER8> Anyone interested in a meetup in Berlin? [http://www.meetup.com/Tesla-Motors- Berlin/](http://www.meetup.com/Tesla-Motors-Berlin/)

</comment><comment><USER9> I wish I could afford one!

</comment><comment><USER10> I'm glad Tesla's doing so well, but a cautionary word about Consumer Reports: they're often wrong. Some of their recommendations in fact turn out to be total disasters.

<comment><USER11> They have also increasingly had more of a Green agenda, which (although I am sympathetic with) is troubling because it jeopardizes their credibility. Specifically, I have seen them rate worse quality products higher than others merely for being green.

<comment><USER12> If "green" is a significant part of their score, then they're actually rating the better product higher.

</comment></comment></comment><comment><USER13> > The survey will be published in its January issue, which comes out next week

These people sound utterly confused.

Also, the article seems to present the fires as a bad thing, ignoring the fact that the model S has less fires, and much less deaths than other cars.

<comment><USER14> That sounds about right, magazines are always published way early.

<comment><USER13> I can fully understand publishing the January issue in late December, or even half December (though that's already pushing it).

But right now it's still November. Next week it'll still be November. At what point does the month associated with the issue stop meaning anything? Will we get the Winter issue in the summer?

<comment><USER15> I've been saying the same thing for a long time.

I love how US car manufacturers bring out the "next year" model half way through the current year.

The best example I've ever seen is in Q1 2014 Jeep will be bringing out the 2015 Grand Cherokee.

I'm looking forward to mid 2018 when I can buy the 2020 edition :)

<comment><USER16> There may be a tax-savings angle to that. Some states, like Nevada and Massachusetts, charge vehicle property tax based on the year of the car and buying a car "one year ahead" can result in a reduced rate for that year compared to same-year tax rate. That might short-term make leasing cheaper. I only noticed it in passing when I leased a vehicle there.</comment></comment></comment></comment></comment>


Quad-rotors: How the 1% will control the 99% in dystopia  - <AUTHOR> http://qz.com/185945/drones-are-about-to-upheave-society-in-a-way-we-havent-seen-in-700-years/ The author posits (melodramatically) one very  compelling economic question, which is: How will the 99% provide economic value when the 1% do not need them and do not fear them. <comment><USER2> Parts of this, especially the democratizing nature of guns as the primary weapon, read similarly to [this essay]([http://www.george- orwell.org/You_and_the_Atomic_Bomb/0.html](http://www.george- orwell.org/You_and_the_Atomic_Bomb/0.html)) by George Orwell, "You and the Atomic Bomb". It's an interesting read, and somewhat prescient.

While no country that possesses atomic bombs has attempted to use them as weapons of repression, drones are surely far more tempting to tyrants with much less collateral damage.

</comment><comment><USER3> A very scary premise, but it's also possible that the future will be more egalitarian, with technology liberating us into an age of abundance.

I also wonder if the future of armed conflict is really going to look like robot warfare. In the near future, it probably will be the case, but if I was one of the fortified 1%, I'm not sure I'd feel all that secure. I suspect there's a coming age of biological engineering that will completely transform warfare away from robots and into things like targeted viruses.

</comment><comment><USER4> There's one counter-argument that I thought of right away, that kinda dispels this whole scenario:

What if there's one hacker in the 99% who is smart enough to re-program the killer robots to kill the controlling part of the 1%? There's a good chance at least one will be found...

</comment><comment><USER5> Maybe it's because I'm a grumpy old man, but I really do think that our species is doomed to unhappiness and poverty.</comment>


Where should I start learning Assembly? - <AUTHOR> So, yeah, where to start? I know C, Obj.-C, Java and Python. I am self-taught. Now I want to get in Reverse Engineering and I don't know where to get started. Feedback and help is highly appreciated! <comment><USER2> Reverse engineering is quite a different skill set from assembly. Unless you are reverse engineering malware, whatever you are analyzing is unlikely to have been written in assembly or to be heavily obfuscated. Then it's more about knowing how certain high-level programming constructs (think virtual function calls in C++) will be translated into assembly by a compiler, what residual information there might be left in the binary or what all that noise is you are seeing (think C++ templates, destructors called for stack-allocated variables..).

For many reverse engineering projects, assembly might be a wholly uselss skill, since whatever you are looking at is actually MSIL or running on Python with its own embedded interpreter. Here assembly only serves you to quickly tell you would be wasting your time :)

<comment><USER3> You have to know assembly to be able to understand what you are looking at. Yes, you need to know more than just assembly, but you absolutely need to know assembly.

</comment></comment><comment><USER4> If you already know C, you can start out by looking at the machine code generated by your compiler with "objdump -d" on Linux and "otool -tV" on Mac. Start experimenting by writing out C constructs like functions, loops, switch statements, etc., and just looking at what the generated code looks like.

Of course, to do that, you need to find the manual for your machine architecture. The x86 manuals are, for example, available here:

[http://www.intel.com/content/www/us/en/processors/architectu...](http://www.intel.com/content/www/us/en/processors/architectures- software-developer-manuals.html)

You also then start to notice things like the operating system specific application binary interfaces (ABI):

[http://www.x86-64.org/documentation/abi.pdf](http://www.x86-64.org/documentation/abi.pdf)

and object file formats such as ELF that's used in Linux:

[http://www.skyfree.org/linux/references/ELF_Format.pdf](http://www.skyfree.org/linux/references/ELF_Format.pdf)

or Mach-O used in Mac OS X:

[https://developer.apple.com/library/mac/documentation/develo...](https://developer.apple.com/library/mac/documentation/developertools/conceptual/machoruntime/reference/reference.html)

You can also do the same thing with the JVM and look at its JIT-generated machine code with the '-XX:+PrintCompilation' option:

[http://stackoverflow.com/questions/13086690/understanding- th...](http://stackoverflow.com/questions/13086690/understanding-the-output- of-xxprintcompilation)

</comment><comment><USER5> [http://nongnu.askapache.com/pgubook/ProgrammingGroundUp-1-0-...](http://nongnu.askapache.com/pgubook/ProgrammingGroundUp-1-0-booksize.pdf)

<comment><USER6> This is probably the best guide (and I've read a lot of them) to actually writing assembly on your average PC one can get. I definitely recommend reading it.

</comment></comment><comment><USER7> I started with the following book:

[http://www.z80.info/zip/zaks_book.pdf](http://www.z80.info/zip/zaks_book.pdf)

Wonderful book from which a lot of knowledge is applicable to other architectures straight away. It teaches you about planning, control structure implementation and the maths behind it all as well.

<comment><USER8> The glorious, good old Z80. Highly recommended.

Also, if you get one of those Z80-powered Texas Instruments calculator, you could do pretty neat things.

<comment><USER9> That's how I got my start. After TI-BASIC, Z80 assembly was the second programming language I learned, at age 12. It turned out to be a great foundation. For one thing, it was fairly easy to understand, from a syntactic perspective. Secondly, it gave me a much better foundation for understanding the lower-level aspects of C, letting me concentrate more on understanding the more complicated abstractions, and what they actually represent.

</comment></comment></comment><comment><USER10> Code by Charles Petzold [1] is a fantastic introduction. It isn't so much the nitty gritty "this opcode performs this operation, and these are all the tricks to making it do things, edge cases and things you should worry about" and more along the lines of "what opcodes should a CPU have, and how do those translate into electricity flowing through physical wires?" I feel like really thinking through that book made MIPS and x86 assembly much easier for me.

1 - [http://www.charlespetzold.com/code/](http://www.charlespetzold.com/code/)

<comment><USER11> In addition, if you like "Code", I'd recommend The Pattern on the Stone by Danny Hillis (creator of Thinking Machines' Connection Machine supercomputer).

It's much shorter than "Code" but covers basically the same ground much more quickly, but Code might be better first because it really explains it thoroughly.

</comment></comment><comment><USER12> Although I cannot claim to know a lot, [http://microcorruption.com](http://microcorruption.com) was a very nice "fun" way to at least start with a small, easy to grasp instruction set.

<comment><USER13> It's a great way to get into reversing and assembly of you like the "series of puzzles" format of a ctf.

</comment></comment><comment><USER14> 1\. i suggest diving a little into a processor architecture first. Z-80 and 8085 are almost the same, conceptually. Once you grasp the fundamentals, you can move onto x86. It too builds upon the architectures mentioned previously. Added concepts are- pipelining, segmentation etc. One of the best sources for me has been- [http://www.amazon.com/Microprocessors-Principles- Application...](http://www.amazon.com/Microprocessors-Principles-Applications- Charles-Gilmore/dp/0028018370)

2\. Knowing how the microprocessor works comes really handy while coding assembly as you can't 'catch exceptions' out there. It is like treading a land-mined area and nothing can replace the knowledge of the fundamental terrain- the architecture.

3\. Since you know C, you can start with some serious gdb usage, as mentioned by @penberg.

4\. Then find your sweet spot between these two ends. You could start with embedded robotics, another viable hobby could be IoT application. Two added advantages of these over 'theoretical' assembly language learning are that-

a) You are doing something with a real-scenario implementation, so you're surely hooked.

b) You can eventually mold a business model around it if you end up with something really innovative.

</comment><comment><USER15> Start with a computer architecture introduction. The McGraw Hill Computer Science series book "Computer Architecture" did a good job of creating a fictional processor and then designing the machine code for it. "Assembly" is just a way to represent machine code in text files.

That way you will learn what it is the computer is trying to do, and how constraints on how it is built change that.

Then I'd suggest some cheap 8 bit Microprocessors like the AVR series and the PIC series from Atmel and Microchip respectively, (the AVR has solid C support so its probably a better single choice, but the PIC has weirdness associated with architecture constraints which is good to understand as well).

Once you are a pro writing AVR assembly code, then grab a copy of x86 assembly and a description of the Pentium architecture. To do it proper justice start with an 8086 assembly book, then a 286 assembly book, then a 386 one, and finally a Pentium one. That will let you see how the architecture evolved to deal with the availability of transistors.

</comment><comment><USER16> Get IDA pro and start reversing things with some clear objective. I learned a lot having friends that knew and competing with them to remove limits on commercial software when I was a teenager.

Making trial version complete and so on. Some times it was really easy(just finding a jmp and changing it), other times we had to compare with the complete program, finding code blocks,patching the trial and making all checksums and stuff to work.

None of the software that we cracked was released to the public, it was just for fun.

At the time there was little exercises called "crackme" for exercising your abilities.

It takes at least over a year of work to start being really good at this, and is not like Obj.C, Java or Python, or even c, but way more tedious. Without having friends on this and clear objectives I would had found it boring.

It would be probably a better idea to buy a micro processor and code simple things in assembly, like blinking LEDs.

</comment><comment><USER17> Linux Assembly Tutorial: [http://docs.cs.up.ac.za/programming/asm/derick_tut/](http://docs.cs.up.ac.za/programming/asm/derick_tut/)

Introductory Book: [http://www.amazon.com/x/dp/0763772232/](http://www.amazon.com/x/dp/0763772232/)

Reference: [http://www.intel.com/content/www/us/en/processors/architectu...](http://www.intel.com/content/www/us/en/processors/architectures- software-developer-manuals.html)

</comment><comment><USER18> First, find _Core Wars_ and play it until you can beat the "tutorial" programs. Hell, I should reimplement Core Wars as a JavaScript app doing CodeCombat style instruction for assembly.

<comment><USER19> Yeah, an MMO Core wars could be fun :)

</comment></comment><comment><USER20> As an option to jumping into real world assembly language there is Knuth's MMIX [and MIX]. It provides access to the underlying concepts alongside structured exercises. One might say it's an "onramp to the foundations of computer science." I prefer "gateway drug to TAoCP" however.

[http://www-cs-faculty.stanford.edu/~knuth/mmix.html](http://www-cs- faculty.stanford.edu/~knuth/mmix.html)

The first fascicle is a free download and the place to start.

</comment><comment><USER21> I would recommend picking a project that you can do only in Assembly. For me, this was creating a special waveform on a microchip controller. I had to create a custom 800kHz signal using a 16MHz clock, so there was no way other than to respect each and every clock cycle, and make the most of it.

The key is to choose a project that you are excited about. If you pick another blah assembly tutorial, without the excitement of a project pushing you, your enthusiasm will evaporate sooner or later.

</comment><comment><USER22> Check out the bomb lab from CMUs systems course. Its an assignment specifically designed to teach you assembly and gdb via reverse engineering a binary "bomb". There are 6 levels, and you need to figure out the right password for each level by reading the assembly/inspecting the program via gdb.

[http://csapp.cs.cmu.edu/public/labs.html](http://csapp.cs.cmu.edu/public/labs.html)

</comment><comment><USER23> A good way to learn asm is through books but there are not many for current architectures (especially x64, except the official Intel manuals which are quite good but also hard to read). Nevertheless, there are some on ARM which I can recommend, namely: ARM System Developer's Guide by Sloss, Symes and Wright. ARM Assembly Language by Hohl. ARM SoC Architecture by Furber.

IDA Pro is the industry standard for reverse engineering but it also is expensive (like USD $2k). There is a free version but it doesn't offer 64bit, so not really an option for modern ObjC or Intel computers. As you've mentioned ObjC chances are you work on OS X. IDA pro is not working well on OS X (the recommended way is to use the Windows version via virtualbox and not the OS X version). Still, Hopper.app is a great alternative on OS X. Not as good as IDA, but it has a Python interface, GDB support, and decompile support for ARM, Intel (and some knowledge regarding Objc). And it's only ~USD$100. [There is also a Windows version of hopper.app but it seems not yet ready to use, as I've only heard bad things about it there so far.]

</comment><comment><USER24> For MIPS (recommended for starting out), check out my post. It walks you through creating the initial program in C all the way through finding its vulnerability and exploiting it. The buffer overflow building is done in Python through Bowcaster. [http://csmatt.com/notes/?p=96](http://csmatt.com/notes/?p=96) (also check out the links at the end). Good luck!

</comment><comment><USER25> I'm writing a tutorial in x86-64 assembly on OS X that you might enjoy: [https://plus.google.com/+MagnusHoff/posts/9gxSUZMJUF2](https://plus.google.com/+MagnusHoff/posts/9gxSUZMJUF2)

Its focus is actually writing assembly on an acutal computer, with the goal of implementing a snake game.

</comment><comment><USER26> If you're on a mac, XCode has a really nice feature: using the Assistant Editor (press the "bowtie icon"), you can get (dis-)assembly parallell to your source code and step through it with the debugger. A really convenient way of learning what's going on, and also understanding potential inefficiencies!

</comment><comment><USER27> Well, that depends how comfortable you are thinking in terms of machine code. It takes a completely different mindset because you're now literally dealing with blocks of memory -- even more so than C.

It also depends how steep of a learning curve you want to encounter. I, personally, have not yet played with x86 assembly because the documentation for them is so unfriendly for beginners. To that end, when I want to play around in Assembly and learn techniques for that level of programming, I usually play with the DCPU ([http://dcpu.com/dcpu-16/](http://dcpu.com/dcpu-16/)). It's fake and was designed for a (sadly) not-to-be-made game. But it is an absolute joy to program in.

Play around with that until you're comfortable and THEN tackle x86.

</comment><comment><USER28> As an intermediate step, you could also study LLVM bitcode. It should give you a good idea of what assembly languages "feel" like without tying you to a particular architecture. It is easy enough to write smallish programs in the ASCII format and assemble them with llvm-as.

</comment><comment><USER29> I'd second what others have said and go with a micro like an avr or a pic. Tons of open source support and a small system you can totally "own" will help you understand not just the code but how computers execute code at the lowest human-legible level.

</comment><comment><USER30> Id start with ARM first. Its a lot easier to pick up and is a lot easier than x86. Also take a look at the C++ itanium abi. It can be found on the GCC website. It explains the rules of going from C++ to assembly.

</comment><comment><USER31> I like Randall Hyde's style:

[http://www.amazon.com/Art-Assembly-Language-Randall- Hyde/dp/...](http://www.amazon.com/Art-Assembly-Language-Randall- Hyde/dp/1593272073/)

<comment><USER7> I disagree. It diverges into HLA (high level assembly) which is pretty much a macro monoculture that is tied to this book and nothing else. I was rather disappointed with the book.

</comment></comment><comment><USER32> I found this on HN a while back... This is a fun way to get your feet wet:

[https://microcorruption.com/](https://microcorruption.com/)

I would also grab a copy of Art of Assembly Language.

</comment><comment><USER33> I can suggest this free book called "PC Assembly Language" by Dr Paul Carter.

[http://www.drpaulcarter.com/pcasm/](http://www.drpaulcarter.com/pcasm/)

 _The tutorial has extensive coverage of interfacing assembly and C code and so might be of interest to C programmers who want to learn about how C works under the hood. All the examples use the free NASM (Netwide) assembler. The tutorial only covers programming under 32-bit protected mode and requires a 32-bit protected mode compiler._

</comment><comment><USER34> Try having some fun with Core War. ([https://en.wikipedia.org/wiki/Core_War](https://en.wikipedia.org/wiki/Core_War))

</comment><comment><USER35> As always learning by doing is the best, look at this old school website: [http://www.japheth.de/index.html](http://www.japheth.de/index.html) Aside of it's manual, he also recommends the (partially free) book [http://www.phatcode.net/res/223/files/html/toc.html](http://www.phatcode.net/res/223/files/html/toc.html)

</comment><comment><USER36> [http://flatassembler.net/](http://flatassembler.net/) is very good assembler (linux, win, dos) [http://flatassembler.net/docs.php](http://flatassembler.net/docs.php) is good place to start and [http://board.flatassembler.net/](http://board.flatassembler.net/) is very good place to explore

</comment><comment><USER37> I enjoyed Jeff Duntemann's "Assembly Language Step-by-Step". I see there is a 3rd edition. Nice writing style and overall fun read.

<comment><USER38> Yes! I came in here to recommend that one as well. He does an excellent job of not only talking about the mechanics of the language, but also the system components to which the mechanics directly relate: and he does so in a way that is both easy to understand and thorough. Such a good book.

</comment></comment><comment><USER39> I found it very useful to read the Intel software developer's manual to get an understanding of the instruction set. If doing this for the x86 architecture seems too daunting at first, a fun alternative is to read the manual for the AVR microcontroller which powers the Arduino and then program an Arduino in assembly.

</comment><comment><USER40> A good place to start programming assembly are on micro controllers (Arduino etc.). They have a more limited set of instructions, registers etc, and an easy to grasp memory layout. The development environments also often come with a pretty good debugger/simulator so you can step through your code and we how it works.

Good luck!

</comment><comment><USER41> This isn't the most aesthetic site, but the content really is top-notch. If you really want to learn assembly (MIPS, in particular), I can't recommend this enough:

[http://chortle.ccsu.edu/AssemblyTutorial/index.html](http://chortle.ccsu.edu/AssemblyTutorial/index.html)

</comment><comment><USER42> It's in french, but... [http://lemoidului.wordpress.com/2013/10/03/lecon-au- plus-pre...](http://lemoidului.wordpress.com/2013/10/03/lecon-au-plus-pres-du- bit-streamer-audio-sur-attiny-15l/#more-1422)

</comment><comment><USER43> I highly recommend Computer Systems: A Programmer's Perspective

[http://www.amazon.com/Computer-Systems-Programmers- Perspecti...](http://www.amazon.com/Computer-Systems-Programmers-Perspective- Edition/dp/0136108040)

</comment><comment><USER44> Because Transport Tycoon is written in Assembly by Chris Sawyer. (I know, pretty amazing right?)

</comment><comment><USER45> 1988?

</comment><comment><USER46> Which assembly? x86, PowerPC, ARM, MIPS?

Personally my favourites are 6502 ([http://skilldrick.github.io/easy6502/](http://skilldrick.github.io/easy6502/)) and 68k ([http://www.easy68k.com/](http://www.easy68k.com/)) tho' neither of these are realistically of any commercial use.

<comment><USER47> 6502 is great for getting into assembly. It counts as tiny and I've done a great deal of things on the c64 including fixed point arithmetics, cellular automata and the like. Also a good place to start your "descent" into low- level code that article that was recently on here, [http://www.chiark.greenend.org.uk/~sgtatham/cdescent/](http://www.chiark.greenend.org.uk/~sgtatham/cdescent/)

</comment></comment><comment><USER48> x86 ? This should get you started: [http://www.asmcommunity.net/](http://www.asmcommunity.net/)</comment>


Winter is coming - <AUTHOR> http://cyberomin.github.io/life/2016/03/23/saving-the-pennies <comment><USER2> Wow! This is so badly written (spelling, grammar, logic)...</comment>