Uniqlo cutting water use 99% so jeans don't kill earth - <AUTHOR> https://cnalifestyle.channelnewsasia.com/style/how-are-vintage-jeans-made-uniqlo-11836724 <comment><AUTHOR> From the article:

For the record, each pair of Uniqlo jeans uses an average of 100 litres of water to wash.

A staff said that each wash cycle typically requires about 80kg of pumice stones. But after just one wash cycle, they'll be reduced to half their size. "The stones turn into waste," Matsubara explained. "They break down into tiny bits and when discharged, they pollute the water system."

In fact, the very same distressed design can be replicated with precision on other pairs of jeans many times over. A designer just has to create the pattern on the computer beforehand, and the laser system can churn out 60 pairs of jeans per hour, compared to the 10 per hour using manual labour.

"Instead of using pumice stones to wash the jeans, we've developed our own eco stones made of polymer," he said. "They don't break down and won't pollute the water system."

And the biggest issue of water usage? A staff said that no water is added at all in the wash with the eco stones. The jeans are placed into the machine wet and that is all the moisture used. "The nanobubble technology turns water into moisture particles to cut down water usage by 99 per cent,"

<comment><USER2> Possibly more significant than the 100L:

> For one, it takes at least 10,000 litres of water to produce just a kilo of > raw cotton – enough to make only one pair of jeans, according to the United > Nations. And that's not counting the water usage in the wash process the > denim goes through to create the soft texture of used jeans – and other > repercussions we'll get to later.

However, I don't know where most of this cotton is grown... if it's in water- rich regions, is it something that needs to be reduced?

Also worth noting:

> For the record, each pair of Uniqlo jeans uses an average of 100 litres of > water to wash. That's actually just 43 litres shy of what the average > Singaporean uses per day in 2017, according to the PUB.

So I guess this means your jean washes are worth < 2 days' worth of water?

One last question on my mind: is using laser actually greener? Not sure how much energy (and in what form) that uses.</comment></comment>


Implementation of Arc in C - <AUTHOR> https://github.com/kimtg/Arcadia

<comment><USER2> The big question is whether or not this is faster than the implementation of Arc on top of racket. Arcueid, which is an Arc interpreter written in C actually wound up to be "about an order of magnitude slower" than the racket version[0].

[0] [http://arcueid-arc.org/2013/05/22/three-implementation- model...](http://arcueid-arc.org/2013/05/22/three-implementation-models-for- scheme/)

<comment><USER3> [I think that this is interesting as a project, so don't take this a critic.]

I'd like to see some benchmarks too. But I think that this project is not a complete Arc implementation. Some parts are more trick to program and more tricky to get fast code.

For example, I couldn't find ccc in this project ( [http://arclanguage.github.io/ref/foundation- doc.html#ccc](http://arclanguage.github.io/ref/foundation-doc.html#ccc) ) (it's like call-with-current-continuation). A version without ccc can cut some corners and be faster than a complete version.

Racket has a lot of work and optimizations under the hood, it has a JIT compiler and some analysis to detect the parts of the code that don't use continuations and can be compiled ignoring the continuations problems.

Arc has more mutability than Racket, and in some parts Arc goes against the Racket philosophy, so perhaps a direct C implementation may be faster. I'd like to see some benchmarks.

</comment></comment><comment><USER3> You may also submit this to the Arc forum: [http://arclanguage.org/forum](http://arclanguage.org/forum)

</comment><comment><USER4> Could someone please explain why this is interesting, besides being yet another Lisp implementation in C? The readme is exceptionally unhelpful in this regard.

<comment><USER5> It is probably noteworthy here because Hacker News is itself written in Arc.

<comment><USER6> Honestly Arc should get another flagship/notable thing that it has been used to create...

</comment></comment></comment><comment><USER7> AtomType_Pair is an oxymoron! :)

"Atom" is not a good synonym for "value"; it is a kind of value.

<comment><USER8> As I understand the code, an "Atom" is like a tagged pointer. It gets passed around by value, sometimes it contains the value itself (numbers), and sometimes it contains a pointer to something malloc'd. So an AtomType_Pair is an atom in the sense that it gets passed around by value like an atom, but it is a pointer to a malloc'd pair.

What strikes me is that Atom's are being copied by value all over the place, even when a good chunk of them don't matter. I don't know whether the optimizer can help with that or not, but it seems like there could be a lot of unnecessary copying during procedure calls and returns.</comment></comment>


Linus Torvalds: "I'm happily hacking on a new save format using 'libgit2'" - <AUTHOR> https://plus.google.com/+LinusTorvalds/posts/X2XVf9Q7MfV <comment><USER3> On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua.

This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing problems is easier, and using a programmatic data structure on the backend means that you can pretty much keep things clean and forward compatible with ease.

(Oh, also being able to debug by altering the save file in any way you want is a godsend).

<comment><USER4> That's how people are going to cheat at your game.

<comment><USER5> The save format does not matter at all. It wouldn't matter even if it were an obscure, made-up format. All it would do is slow down 'cheaters' by half an hour.

The only argument against human-editable text files is parsing speed, not security.

<comment><USER6> Data size has a bit to do with it. Not trying to be pedantic, just adding that.

</comment></comment></comment></comment><comment><USER7> What's with all the XML hate? Of course, doing everything in XML is a stupid idea (e.g. XSLT and Ant) and thanks heaven that hype is over.

But if I want something that is able to express data structures customized by myself, usually with hierarchical data that can be verified for validity and syntax (XML Schemas or old-school DTD), what other options are there?

Doing hierarchical data in SQL is a bitch and if you want to transfer it, well good luck with a SQL dump. JSON and other lightweight markup languages fail the verification requirement.

<comment><USER8> The issue is probably that 99.999% of all XML use cases don't use (or need) the verification aspect. For all of those, XML is overkill. Besides, surely it would be possible to design a verification layer on top of JSON, for instance - the fact that one does not currently exist does not mean that XML (and abuse of XML!) should not be criticized.

<comment><USER9> One of the core aspects of XML that is really important is that no typing is inferred by the structure of the file unlike JSON. JSON is by nature tied to the JavaScript type system which is sparse and inaccurate. For example, if you look at the following:

       { "name": "bob", "salary": 1e999 }

Ah crap! Deserializer blew (in most cases silently converting the number to null)

       <person>
          <name>bob</name>
          <salary>1e999</salary>
       </person>

No problem. The consumer can throw that at their big decimal deserialiser.

And the following is _not_ acceptable as it breaks the semantics of JSON and requires a secondary deserialisation step as strings ain't numbers...

       { "name": "bob", "salary": "1e999" }

JSON is a popular format but it's awful.

<comment><USER10> JSON's semantics is that you represent numbers by their decimal representation.

In this particular case, you're giving a different representation, so of course you an pass it as a string.

<comment><USER11> His point was that this number is too large to store it in a Javascript Number variable (which is a IEEE 754 double).

<comment><USER12> OK, so the provided number format is not sufficient for the kind of numbers he is trying to deal with. So instead you would represent it as a string and handle the encoding/decoding of that number yourself. How is that different from the XML way where there is no provided number format to begin with, and everything is a string?

</comment></comment></comment></comment></comment></comment><comment><USER9> I think this title is wrong.

Firstly some clarification - this appears to just be about the persistence format for his dive log. It was XML, now it's git based with plain text.

As someone who had to manage a system which worked with plain text files structured in a filesystem for a number of years in the 1990s, this is done to death already.

You now end up with the following problems: locking, synchronising filesystem state with the program, inode usage, file handles to manage galore and concurrency. All sorts.

Basically this is a "look I've discovered maildir and stuffed it in a git repo".

Not saying there is a better solution but this isn't a magic bullet. It's just a different set of pain.

<comment><USER13> Maybe you want to wait till he release something. Cause you know, if he took months to get the big picture in mind, I doubt you grasp what he envision just by reading his comment.

<comment><USER14> Yes, because his design of git was so well-formed.

Git is so well-designed that _expert users_ manage to trash their repositories and propagate the damage.

Maybe that's not a problem of libgit. But tools are both the infrastructure _and_ the UI.

<comment><USER15> Not sure what you are referring to. What are some common ways "expert users" manage to "trash their repositories?"

<comment><USER14> Let's start here: [http://randyfay.com/content/avoiding-git-disasters-gory- stor...](http://randyfay.com/content/avoiding-git-disasters-gory-story)

So, the solution to the fact that the merging UI is a pile of garbage is _HAVE A SINGLE PERSON ALWAYS DO THE MERGE_. Excuse me? The whole point of a distributed revision control system is so I don't have to have a single choke point. That's the definition of _distributed_.

Then there was the KDE disaster: [http://jefferai.org/2013/03/29/distillation/](http://jefferai.org/2013/03/29/distillation/)

Yeah, the root fault wasn't Git. However, at no point did Git flag that something was going horribly wrong as the repository got corrupted and deleted. Other distributed SCM systems I have used tend to squawk very loudly if something comes off disk wrong.

Maybe the underlying git data structures are fine, but, man, the UI is a pile of crap.

And, I won't even get into rebase, because that seems to be a religious argument.

<comment><USER16> The issues in the randyfay.com post are due to a misunderstanding when using git as a "centralized" repo like SVN. Git, by design, does not enforce a central repo even if you designate one logically. These issues can be completely avoided if you merge the right way:

[http://tech.novapost.fr/merging-the-right-way- en.html](http://tech.novapost.fr/merging-the-right-way-en.html)

<comment><USER17> Well, that confirms that the "obvious" workflow of "git pull" is dangerous. At least it explains all the spurious merges. Why on earth did it ship with this broken design? Why doesn't git pull do the right thing by default?

<comment><USER18> Yup, and Windows is broken because ctrl-c copies text instead of killing a process.

Why doesn't Windows do the right thing by default?

Oh, its because a different system behaves differently.

DVCS is fundamentally more complex than VCS.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER19> Back in the bad old DOS days, instead of creating a file format for saving/loading the configuration of the text editor, I simply wrote out the image in memory of the executable to the executable file. (The configuration was written to static global variables.)

Running the new executable then loaded the new configuration. This worked like a champ, up until the Age of Antivirus Software, which always had much grief over writing to executable files.

It's a trick I learned from the original Fortran version of ADVENT.

<comment><USER20> Thank you for that anecdote, it made my day. Simply awesome.

<comment><USER19> I learned a heckuva lot from reading the ADVENT Fortran source code. I was floored when I figured out how it was saving its configuration - such a brilliant idea. And in DOS it could be implemented in about 5 lines of simple C code. (Code size was critical in the old 64Kb days.)

The other huge thing I learned from ADVENT was polymorphism. The comment in the source code "the troll is a modified dwarf" was an epiphany for me.

</comment></comment></comment><comment><USER21> From the comments (Tristan Colgate) :

"XML is what you do to a sysadmin if waterboarding him would get you fired."

Made my day :-)

<comment><USER22> That's just mean. Waterboarding isn't that bad...

<comment><USER21> But it gets you fired ... on the other end, nobody has ever been fired for using XML.

</comment></comment></comment><comment><USER23> What I like is the "I dont start prototyping till I have a good mental picture"

I am currently stuck on a project I want to start becasue I cannot get it to fit right in my (future) head. And I am glad I am not an idiot for not being able to knock out my next great project in between lattes.

(Ok, in direct comparison terms I am an idiot, but at least its not compounded)

<comment><USER24>
      "A change in perspective is worth 80 IQ points."

      -- Alan Kay

My biggest hurdle solving new problems is divining a unifying, simplifying metaphor. Once you have the right notion, that Eureka! moment, everything falls into place, like magic.

Like how Kepler was able to fully explain Bache's astronomical data once he realized the planets orbits the sun.

Personal example: I used to write print production software. Placing pages onto much larger sheets of paper that get folded and bound into a book. A task called image positioning aka imposition. It took me years to figure out how to model the problem. Key insight was simulating the work backwards, from binding back to the press. Then when I showed the new solution to my coworkers, the response was "Well, duh."

</comment></comment><comment><USER25> I just realized that Linus' posts are the only reason I ever go to Google Plus.

<comment><USER26> The question nobody is asking, but actually should is: I wonder what other good G+ content you are missing?

G+ is largely misunderstood. It is a lousy tool for interaction with people connected to you purely socially. It's a very good way to find and interact with people connected to you by interest.

<comment><USER27> The really sad thing is that I have tried several times to _search_ for content that I know exists on G+, but I can't find it, even when I knew the author. After the third time failing at this my usage of G+ dropped significantly. Of all of the things that you would think would work search would be at the top... :|

<comment><USER28> Right, if I could subscribe to a Circle with all of the kernel devs in it I would.

G+ is actually a great place to read long form messages and comments, but doesn't really have content discovery down.

</comment></comment></comment></comment><comment><USER29> I don't quite get Linus' problem with XML for document markup (for anything else - config files, build scripts - sure, XML is horrible). Does anyone know any more details about what his specific gripe is? For me, asciidoc (which looks very similar, conceptually, to markdown) suffers from one huge problem: it's incomplete. Substituting symbols for words results in a more limited vocabulary, if that vocabulary is to remain at all memorable.

Sure, XML _can_ be nasty, but thats very much a function of the care taken to a) format the file sensibly b) use appropriate structure (i.e. be as specific as necessary, and no more).

<comment><USER30> For those who missed it, here's what Linus wrote in the comments:

"+Aaron Traas no, XML isn't even good for document markup.

Use 'asciidoc' for document markup. Really. It's actually readable by humans, and easier to parse and way more flexible than XML.

XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist.

As to JSON, it's certainly a better format than XML both for humans and computers, but it ends up sharing a lot of the same issues in the end: putting everything in one file is just not a good idea. There's a reason people end up using simple databases for a lot of things.

INI files are fine for simple config stuff. I still think that "git config" is a good implementation."

<comment><USER7> Linus' adversion to XML explains also why parsing git's output is so abysmal inconsistent.

Subversion has a really good XML output for its log command which is a joy to use (and that's something to say if you work with XML) whereas with git you always have ugly format options that are most of the time underdocumented.

<comment><USER31> I disagree. It's actually quite simple, and _fast_.

Git's output was designed in the Unix spirit; you can parse it very quickly without needing a parser toolchain.

It's also extensively documented: git help log, etc

</comment></comment></comment></comment><comment><USER32> [https://github.com/torvalds/subsurface](https://github.com/torvalds/subsurface)

I didn't really know what he was talking about but I think this is it.

The title does need changing though as it is definitely file formats under discussion not file systems.

</comment><comment><USER33> What is it with HN commenters and their demented ability to send topics completely of track? I would have thought someone might have examined the code or what Linus is trying to implement and comment about it.

But here we have threads about Lua, why people hate XML and love JSON and all kinds if irrelevant issues which have been well hashed elsewhere ad nauseam. Why not restrict to an analysis of whatever it is Linus developing?

HN is getting truly annoying and sucky, if it isn't so already.

</comment><comment><USER34> > "I actually want to have a good mental picture of what I'm doing before I > start prototyping. And while I had a high-level notion of what I wanted, I > didn't have enough of a idea of the details to really start coding."

This I like. The race away from the waterfall straw man has also stripped us of the advantages of BDUF.

While rigid phase-driven project management helps nobody, I think there's still room for speccing as much as we can upfront within iterative processes.

Or you could run to the IDE and start ramming design pattern boilerplate down its throat the second you're out of the first meeting ;)

<comment><USER35> You should be speccing what you want to achieve: the goals, the why, the impact, the external limitations, measures of success and so forth. This also allows you to describe and plan testing up front. The "how" is best handled in an iterative manner.

A lot of people use AGILE to avoid planning at all, which is a particular destructive anti-pattern, and the exact opposite of what you need.

<comment><USER36> >The "how" is best handled in an iterative manner.

I think that the first "how" should be planned as much as anything else. I understand how you refactor from v0.0.1 to v5.34.2 iteratively, but I think that getting from vNothing to v0.0.1 is qualitatively different.

If I don't have a complete idea of how my minimally functional thing will work that is small enough that I can completely hold it in my head, and instead just architect by agglutination and test writing, 1) my results are going to be hacky garbage, 2) my first 50 iterations are going to be devoted to replacing it all haphazardly to fix bugs, and 3) the code and interface will become increasingly more complex, harder to work with, and strewn with special cases.

When v0.0.1 is well planned, v2.5.2 may not look anything like the plan anymore, but in my experience it becomes shorter, cleaner, and more correct rather than a giant ball of band-aids propped up with tests.

<comment><USER35> Personally, once "the goals, the why, the impact, the external limitations" have been defined, we start to do mockups, a programmers "differential", to zero in on a solution that satisfies the demand.

With that on the board/paper/code, we can start to test our assumptions and iterate on the solution. I do not know if that classifies as planning, but it works very well.

</comment></comment></comment></comment><comment><USER37> he talks about a save file format, not a file system. or do we have different concepts of "file system"?

<comment><USER38> I agree it's confusing, I think the submitter just meant "system for files" or something.

<comment><USER39> That would be excusable if we were talking abuot somebody who writes higher- level programs that would be excusable, but not for a kernel developer.

<comment><USER40> The submitter isn't Linus.

</comment></comment></comment></comment><comment><USER41> I don't really understand what he's talking about here (my ignorance, not his fault.) Is it something like [https://camlistore.org/](https://camlistore.org/) that is a content addressable (the git part) datastore?

<comment><USER42> Yep, I thought it sounded like Camlistore, but as a library.

</comment></comment><comment><USER43> >>So I've been thinking about this for basically months, but the way I work, I actually want to have a good mental picture of what I'm doing before I start prototyping. And while I had a high-level notion of what I wanted, I didn't have enough of a idea of the details to really start coding.

This might be a tangential discussion. Earlier, I used to have a similar approach. Can't code until I have the complete picture. But, it's tough to do in a commercial world and you have deliverables. So, nowadays, I start with what I know and scramble my way until I get a better picture. There are times when that approach works. But, there have been days where I was like - "wish I had spent some more time thinking about this".

I am curious how folks on HN handle this "coding block".

<comment><USER44> I've got a few strategies that might help, depending on the circumstances.

A notebook: I'll write down some notes and just kind of free write whatever thoughts come to mind. If there's something that I think is important to come back to, I'll draw an empty box in the left margin (to be filled with a check mark later)

Readme: start writing the Readme for the project, even if you're not entirely sure of the details. Include code examples. If you don't like how the API is coming together, change it. It's way less work to modify the API now than it will be later.

Write a test: I don't always unit test, but when I do I test first :). This works well on projects that already have a decent test suite. It's kind of an executable version of the Readme.

Branch and Hack: branches are cheap. Make one and start playing. Don't like how it's turning out? Make a new branch and try again!

Ctrl-Z: maybe the answer won't come to you right away. Let it sit and run in the background for a while and come back to it. If I'm worried about forgetting details, I'll write it down in a notebook first.

</comment></comment><comment><USER45> This is what Linus does. He has strong opinions and he throws them around. You can't let that get to you. Both XML and JSON are just fine if used properly.

<comment><USER46> This is the first profanity-free Linus rant that I've read in a long time.

<comment><USER47> Almost all of Torvalds' "profanity rants" that get passed around are the result of frustration at an existing conversation, and you can find profanity- free comments by him simply by checking out a slightly earlier one.

</comment></comment></comment><comment><USER48> And the actual description is here: [http://lists.hohndel.org/pipermail/subsurface/2014-March/010...](http://lists.hohndel.org/pipermail/subsurface/2014-March/010592.html)

</comment><comment><USER49> Why reinvent on-disk data formats when you can just make a file of protocol buffers? [https://code.google.com/p/protobuf/](https://code.google.com/p/protobuf/)

<comment><USER50> Why reinvent binary serialization when you could use ASN.1, or any of the thousand binary serialization formats that pre-date protobufs?

<comment><USER51> For that specific example, you can find a good discussion here: [https://groups.google.com/forum/m/#!topic/protobuf/eNAZlnPKV...](https://groups.google.com/forum/m/#!topic/protobuf/eNAZlnPKVW4)

</comment></comment></comment><comment><USER52> Current title that I see "Linus Torvalds on implementation of human-readable file system" is off. It's about file formats, not file systems.

</comment><comment><USER53> why do you need to view filesystem and make it readable for humans, you would interact it via commands "ls" or some gui

git as the basis of filesystem is interesting, hope we don't need to manually make branches and commits to use it

<comment><USER29> Did you read the article? It's not really about the filesystem. 1 part your fault for seemingly not reading the article you're commenting about, 1 part the submitter's fault for choosing such a misleading title.

</comment></comment><comment><USER54> Worked on a project a few years ago where we needed distributed sync capability. Using git (or bazaar or mercurial) was one of the options - <USER2> everything in it versus a database. Interesting to see the same thought "coming back".

<comment><USER55> I've also used libgit as a means to a similar end - providing versioned data across a local filesystem. Its an idea whose time has come ..

</comment></comment><comment><USER56> Why not sqlite or sexpressions? Linus states that databases can't hold previous state but that's not really true...

I'm not sure why git is the best tool for the job in this case, even after reading the post & some of the contents.

<comment><USER28> They can, if you recreate the primary feature of Git on top of them.

</comment></comment><comment><USER57> erik-naggum's most excellent xml rant: [http://www.schnada.de/grapt/eriknaggum- xmlrant.html](http://www.schnada.de/grapt/eriknaggum-xmlrant.html)

</comment><comment><USER58> At work we have a git backed document store that just saves as json - versioning makes keeping track of audit points nice and easy.

</comment><comment><USER59> Title is entirely misleading. Tech support! TECH SUPPORT!!

<comment><USER60> Have you tried turning it off and on again?

</comment></comment><comment><USER61> xml haters!!! using other formats how can I define DTDs?

<comment><USER62> [https://news.ycombinator.com/item?id=7333354](https://news.ycombinator.com/item?id=7333354)</comment></comment>


Elastic Lists for Movies - Please review.. - <AUTHOR> http://www.goopendb.org/ <comment><AUTHOR> Hi HN, I coded this site up over the Christmas brake and I would like to know what you think of it.

I was greatly impressed with Moritz Stefaner's Nobel Prize winners list when I first saw it and since then I was inspired to build something similar. I finally got around to building a site that allows you to browse information on Movies and Actors in a manner similar to that of the original.

It certainly is not as refined as my original inspiration, but, it is a starting point for me. I hope you like it and find it useful when you need information on an Actor or Movie.

Also, if you are interested in adding/updating the Movie/Actor info, please let me know here. I will e-mail you the admin access details.

Thanks, K7.</comment>


Commodore Basic as a Scripting Language - <AUTHOR> https://github.com/mist64/cbmbasic <comment><USER2> While this is cool pet project (intentional pun), Microsoft Basic 6502 was, in my personal opinion, one of the worst BASIC implementations of that era. If we're going early 80s BASIC then I'd prefer to use BBC BASIC which supported functions amongst other things -- albeit still not as readable as modern structured programming.

There's still a few BASIC implementations floating about for modern systems too. FreeBASIC ([https://www.freebasic.net/](https://www.freebasic.net/)) is one worth checking out.

Personally I still have quite a few of those 80s micro computers and occasionally hook them up to teach my kids programming.

<comment><USER3> Came here to say this. Commodore BASIC (which was really by Microsoft, as you've pointed out) was by far my least favourite of the 8-bit BASICs I used.

It was even worse than Sinclair BASIC due to the lack of drawing commands (yes, I know you could get these as extensions on a cartridge - I didn't have that). The main issues with Sinclair BASIC were limited functions and the fact you had to use key combinations to enter most keywords.

I also remember it as being slow as all hell when compared to other BASICs, although that might just be the opposite of whatever rose-tinted nostalgia is.

I loved the Commodore 64 but its BASIC _sucked_. Commodore continued to royally eff up with Amiga BASIC which, if memory serves, was also basically[1] by Microsoft. I immediately switched over to AMOS by Francois Lionet, which was great, although with hindsight wish I'd given Blitz a go too.

 _[1] Pun also intended, even though dreadful._

<comment><USER4> To be fair to Microsoft, the C64 BASIC was notoriously outdated when the C64 shipped. Jack Tramiel managed to buy an unlimited-use license to Microsoft's BASIC in 1977, and was determined to get his money's worth. On the bright side, the C64 BASIC was great at motivating new programmers to learn assembly programming so they could avoid it, and in the process finding out how computers _really_ work. :)

<comment><USER5> This. I remember the C64 BASIC mostly as a glorified loader for the machine code. I even typed in a monitor published in some magazine just so I could push the machine nearer its limits.

<comment><USER6> Cut my teeth on Oric Atmos BASIC, and I can verify that my eyes still scan magazine listings intuitively looking for the DATA statements that indicate fast BLIT code ..

</comment></comment></comment></comment></comment><comment><USER7> [https://github.com/mist64/cbmbasic/blob/master/runtime.c](https://github.com/mist64/cbmbasic/blob/master/runtime.c):

        * CBMBASIC implements CHRGET/CHRGOT as self-modifying
        * code in the zero page.

I did quite a bit of programming on the C64 but I didn't know that. I always thought that, although there is no technical reason not to, zero page is only used for storing data and not code.

<comment><USER8> It's entirely for speed reasons. It's a very hot routine and exists in RAM to facilitate speedily loading and updating the BASIC text pointer, which is embedded within it, so having it in zero page optimizes it further. Modifying this code fragment to point to your own code and add additional commands to BASIC was called a "wedge" and for some systems was the only easy way to do so. It is a central component of all 6502 Microsoft BASIC variants. See [https://www.pagetable.com/?p=774](https://www.pagetable.com/?p=774) for the routine in its entirety.

<comment><USER9> Wow, I did my own BASIC extension back in the day and just now I learned from you where the name "wedge BASIC" came from. Thanks!

</comment></comment></comment><comment><USER10> Interesting.

However, there's really nothing special about Commodore BASIC 2.0. It was a very basic Microsoft BASIC; not as minimal as Apple Integer BASIC but not as good as something like GW-BASIC on the PC.

The Commodore BASIC 2.0 supported none of the hardware features of the C64 that weren't provided by the Commodore Kernal through PRINT statements. So you can clear the screen and change text color through embedding the appropriate control codes in strings or use ASC function, but accessing the VIC-II or SID had to be done through assembly or PEEKs and POKEs. So honestly making it a general scripting runtime can work easily.

If you want to use a real BASIC as a scripting language you want to check out FreeBASIC. It's an reimplementation of Microsoft's QBASIC with OOP and other extensions.

</comment><comment><USER11> The main interpreter (cbmbasic.c) seems to be generated code but it's not clear where or how it was generated (specifically, what it was generated from). The rest of the code looks for the most part looks handwritten.

<comment><USER12> I read about this project when it came out. If I understand correctly, it's actually the original C64 implementation, decompiled into C. It's a really neat implementation.

<comment><USER13> Yes. From reading cbmbasic.c, I can see a couple of things clearly:

1) This code was generated by the LLVM C-backend (llvm_cbe), which converts LLVM IR to C code

2) The code contains variables for the 6502 registers.

This suggests it was generated by translating 6502 machine code to LLVM IR, and then converting the LLVM IR to C.

<comment><USER14> The structure of a loop around a big switch statement (based on value at PC) to blocks of code that manipulate the register variables (A, X, Y, PC, etc) and RAM looks exactly like an emulator core.

The code also appears to include the Commodore BASIC ROM. (See initialization of llvm_cbe_ROM in cbmbasic.c).

So, it looks like an emulator that was written in some other language then converted to C using the LLVM C backend.

</comment></comment></comment></comment><comment><USER15> If you want BASIC as a scripting language, and VB isn't the answer, then you can get the remarkably capable BBC BASIC for many platforms for not much money at [http://www.bbcbasic.co.uk/bbcbasic.html](http://www.bbcbasic.co.uk/bbcbasic.html).

A couple of years ago I got an software exception request (regulated industry...don't ask) from a developer who wanted permission to use this. No one had any idea what to make of it, so it bubbled up to me. Turns out the developer was British, started out on BBC BASIC, and even though nothing in the app was BASIC, he'd written an amazingly comprehensive testing scaffold in it. I granted the request on the condition that they train at least 2 other devs to maintain it. It was impressive enough I bought my own copy and used it for various scripting tasks on Windows until PowerShell became what the cool kids used.

</comment><comment><USER16> I love this. I got my start programming in BASIC on my C64 at the ripe old age of 6. While something like this has little practical value, it certainly provides a lot of nostalgia for someone like me.

</comment><comment><USER17> Last updated in 2014... should it have 2014 in the headline?

This is kind of neat, OP what interested you about it to submit it?

<comment><AUTHOR> I originally submitted it a while ago and it failed to attract attention. I received a note from HN inviting me to resubmit so I did. I love it. I learned to program the VIC-20 before I could properly speak English. The experience is so embedded in my psyche that I couldn't NOT re/post this.

</comment></comment><comment><USER18> But can we POKE in it? :)

</comment><comment><USER19> Might very well be a better solution for writing software than bash, which seems to be the trend lately.</comment>


Why We Sleep – a tale of institutional failure - <AUTHOR> https://yngve.hoiseth.net/why-we-sleep-institutional-failure/ <comment><USER2> The "law of large numbers", "institutional inertia" and related phenomena tend to cause large organizations to behave worse than individuals.

E.g. at least some individuals will do the right thing, but institutions do the wrong thing consistently and punish those who do the right thing.</comment>


Ask HN: submitting other people's libraries to npm / bower / jam / etc? - <AUTHOR>

What do people think about submitting other people's libraries to package registries like npm, bower, jam or other package managers?
I'm against it. I've come across a few circumstances where a branch submitted to the registry and then not kept up to date, or where there are multiple submissions of the same library.
Isn't it much better to ask the maintainer to submit it themselves, and until they do (or if they won't) just install the library directly from their repo (which is supported by both npm and bower; not sure about jam.) <comment><USER2> I think it is polite to communicate with the original author first. They may appreciate having somebody else in charge of package management.

It's not uncommon for an app author to provide only source code and then some other person decides to build and maintain binaries for a few systems. That's been happening for years. The author doesn't want to deal with various systems and compilers, but some other person takes an interest. Putting a lib in a package manager system seems somewhat similar.

Basically I think just communicating with the author is the best policy. And if you submit it - plan to keep it updated.</comment>


Twitter Abuse Toward Women Is Rampant, Amnesty Report Says - <AUTHOR> https://www.wired.com/story/amnesty-report-twitter-abuse-women/ <comment><USER2> Link to the findings themselves: [https://decoders.amnesty.org/projects/troll- patrol/findings](https://decoders.amnesty.org/projects/troll-patrol/findings)

</comment><comment><USER3> > The study looked at 778 women journalists and politicians in the US and UK, > and found that 7.1 percent of tweets sent to them last year were abusive or > problematic.

What is the baseline for "abusive or problematic" tweets? What's the amount of abuse a man can expect? Looking at their methodology, I don't think this was taken in to account (it looked just at a cross-section of female Twitter users).

</comment><comment><USER4> Males receive more Twitter "abuse" than females: [https://demos.co.uk/press- release/demos-male-celebrities-rec...](https://demos.co.uk/press- release/demos-male-celebrities-receive-more-abuse-on-twitter-than-women-2/)

</comment><comment><USER5> So the online world mirrors the actual world: [https://www.youtube.com/watch?v=jDoVckC6NhA](https://www.youtube.com/watch?v=jDoVckC6NhA)

In short, men are animals and e-animals.</comment>


RS-232 for Commodore PET and Dialing a BBS Over WiFi - <AUTHOR> http://biosrhythm.com/?p=1359 <comment><USER2> This brings back memories. My first experience of a computer was using a PET 3016 at secondary school in the UK in 1979. Later I bought a Commodore 64 and built an RS232 interface for it - I still have the prototype on stripboard kicking around somewhere. I also wrote a VT100/220 terminal and file transfer program in assembler; it ran in graphics mode, using a custom bitmap font table to create an 80x25 display. Like this PET version, my C64 code had to bitbang the serial interface and because the 'serial port' shared an interrupt with the printer's, when you printed, serial comms was held up and so characters could be lost. I all-but cracked that problem with some clever buffering.

</comment><comment><USER3> I was just thinking of using the ESP8266 in the ESP-01 package as a modem for the Raspberry Pi Zero. Does anyone have any suggestions for how to accomplish this?

<comment><USER4> [https://github.com/jeelabs/esp-link](https://github.com/jeelabs/esp-link) replicates what's commonly known as a terminal server.

The default firmware already emulates a modem.

[http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module#AT_Co...](http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module#AT_Commands)</comment></comment>


Ask HN: Any good places to get feedbacks for app prototype? - <AUTHOR> Could anyone share good places to get feedbacks for mobile app prototypes? <comment><USER2> Talk to a potential customer/user. If you haven't identified any actual individuals that are clearly potential customers and users, that is likely more important than building a prototype when it comes to success...it may also be harder and less pleasent.

related, [https://blog.ycombinator.com/minimum-viable-product- process/](https://blog.ycombinator.com/minimum-viable-product-process/)

<comment><AUTHOR> Great advice. Thank you, Ben!</comment></comment>


Ask HN: Tumblr vs self-hosted blog? - <AUTHOR>

Want to start blogging but was wondering if you guys had any personal experiences with going tumblr vs something self hosted (aka wordpress). <comment><USER2> It depends on what is more important to you: do your blog have to be ultimately easy, instantly working and that's all. Or do you need ultimate control over it and to have your data where you decide to. In the first case go for Tumblr, Posterous, Wordpress.com, Blogger..., in the second case go for a self hosted blog like Wordpress.org, Jekyll, fugitive, DotClear...

And since you ask for personal experience: I've always prefered to host my own data so I'm in the second case, also I've almost always written my blogging engines myself (fugitive is the first I open source thought) since what I wanted didn't exists (a git managed blog, with nothing more than git).

</comment><comment><USER3> Wordpress is flexible, but you'll need to stay up-to-date on security updates, make sure your blog doesn't fall over if it's popular on HN, do something about spam, etc. If that's not your cup of tea, consider something hosted (tumblr, posterous, wordpress.com) or something simple (static site generators work fine, see p4bl0's comment.)

This may or may not matter: tumblr is free, conventional hosting (Dreamhost, cheap Linode) will run you ~10-30/month, and pay-as-you-use hosting like nearlyfreespeech.net can be extremely cheap (especially with static site generators). I'm using the latter option, for what it's worth.

</comment><comment><USER4> If all you want to do is write a blog then definitely go the tumblr route (for that matter posterous does pretty well too). I have been a long time user of wordpress (hosted sites on my own as well as wordpress.com) and recently started using tumblr and posterous and like the simplicity of these blogging tools/services.

</comment><comment><USER5> I personally wouldn't use tumblr for a less personal, more professional blog. Tumblr feels like blogging meets something like twitter or facebook, which is nice for personal blogs, but a lot of what tumblr offers (the dashboard, non- text posts, reblogging, liking and following) seems kind of wasted on a more professional blog. If you're mostly just posting text and looking for a place to host, I'd probably go with something like wordpress (self-hosted or wordpress.com).

Just my two cents. Tumblr arguably does have the benefit of allowing people to find your posts more easily through hash tags, I guess.</comment>


Canada's Tech Firms Capitalize On Immigration Anxiety - <AUTHOR> http://www.npr.org/2017/06/09/532220824/canadas-tech-firms-capitalize-on-immigration-anxiety-in-the-age-of-trump <comment><USER2> _" For years, Canada's tech industry has watched in frustration as Microsoft and Google hired the country's top computer science grads for high-paying jobs in Seattle and Silicon Valley. Now Canada believes it has found a new way to lure American and international tech workers."_

Is it... paying more so people don't have to choose between their country and financial security? Let's see.

 _" Canadian tech companies are eager to capitalize on anxiety among international visitors and would-be immigrants following President Trump's travel ban and other immigration policies."_

Nope. Just trying to capitalize on people's fear and anxiety to avoid matching their competitors' pay.

<comment><USER3> I'd love it so much if Canada had comparable salaries. I'd move back for sure, at least if it came 10% within Seattle and SV.

But, I'm not sure it's possible for companies to do so.

I mean, first of all, in the US, outside of a few cities like NY, SV, Seattle, Bellevue, you start to see lower pay which gets closer to Canadian pay.

Appart from that, Canada just doesn't have the same market. That's the biggest difference. Most startup capitalize on the US market, and that's just easier and more accessible to do if you're US based.

In a way, Canada pays decently. You'll be very comfortable as an engineer in Canada, even with a large family. But compared to certain US cities, it's abysmal.

It's kind of crazy that in the US, a bachelor degree in CS can give you pay close to what doctors make. And a 9 month dev boot camp can have you earn similar to many university level degrees.

I'm not sure this will last forever. My point being, it's unclear if Canada's pay for tech is too low, or if some US cities pay is too high.

<comment><USER4> > In a way, Canada pays decently. You'll be very comfortable as an engineer in > Canada, even with a large family. But compared to certain US cities, it's > abysmal.

Hmmm depends on where you live. In some places a large family would be quite unaffordable. The average cost of a detached house in February in Metro Vancouver was $1.76 million. Vancouver has become so unaffordable that even those with great (for Canada) six figure salaries would find it very hard to cobble together enough money to buy property.

<comment><USER5> Toronto is the same. In fact, worse because you need two cars per family

<comment><USER6> From the transportation perspective, Toronto is probably marginally better than Vancouver for families.

You're more likely to require two cars in Vancouver than in Toronto as the combination of the Greater Toronto Area public transportation options cover a wider area than Vancouver's.

<comment><USER5> That is simply not true. If you are in dt Vancouver you can get pretty much anywhere walking. Not the case for Toronto(even downtown) due to city size and climate

<comment><USER6> I'm not sure why you're suddenly restricting your "two cars per family" point to the city downtown cores alone.

But sure - if we change frames then both city downtown cores are either easily walkable or extremely accessible via public transportation, hence ceteris paribus neither family (living in the downtown core) in their respective cities would require more cars than the other.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> The reason engineer salaries in Canada are low, especially for startups, isn't that companies are cheap. It's that there is no funding or support network for growing companies -- nothing compared to the valley.

In my experience seed funding in Canada doesn't mean "this idea looks like it's on a promising growth trajectory, here's 100K for a bit of equity to see what we can make of it". Instead it means "show us $500K in revenue and we'll consider you for a loan next year".

So what you have left are the smaller companies that happily feed their owner and not much else, or enterprise shops delivering established solutions in an established market for established rates (Canadian ones).

And the companies that do well and grow: they just move to the valley, because they generally can, and they have every reason to.

Source: I've lived both worlds.

<comment><USER8> I don't disagree with your points, but I'd like to point out Shopify as an exception. Started in Ottawa, grew, got VC funding, grew some more, IPO'd on NYSE, and is still headquartered in Ottawa.

<comment><USER9> There's one or two of them, but they are hen's teeth.

My startup has a $10M run rate after three years and the best we can do is get debenture and loan offers, no actual investment.

Investors in Canada hate technology.

<comment><USER8> Get investors from the US then, that's what Shopify did.

</comment></comment></comment></comment><comment><USER10> Not sure how exactly they are planning on "luring American tech workers" when they are paying much less on average, taxes are higher and real estate prices in large cities where these jobs are typically at are pretty insane compared to most of the US.

<comment><USER11> Toronto and Vancouver are Canada's big insane housing markets. There are smaller tech communities in Ottawa, Waterloo, and Montreal, and those cities have _normal_ housing markets.

<comment><USER12> PyCon Canada is coming to Montreal this year, and Montreal has the second largest Python user group in the world (IIRC). So these communities aren't necessarily short on tech.

</comment></comment></comment><comment><USER13> While we could certainly pick up a few people, I can't see how it could possibly be more than a few unless Canada's tech firms start paying more.

Source: developer in Vancouver who could easily get 2x the salary a 4 hour train ride south. I stay in Canada because it's my home.

<comment><USER9> For me, I don't qualify for a TN visa because I don't have a college degree. I could probably walk in off the street to most places in SF with my 20+ years of experience and triple my salary, but my visa eligibility leaves me here.

There's lots of people in similar situations, so it's not impossible to find 10x devs up here, just more difficult than SF.

<comment><USER13> It's not every degree that grants TN eligibility, either. Software engineering degrees are eligible, CompSci are explicitly _not_ eligible.

So I'd be out, too.

Though I could likely find a Seattle-based company willing to let me work remote most of the time. I could hop on the train once a month and AirBnB a place for a week, and many employers would be satisfied with that. It's what I'm considering next time I'm on the job hunt.

</comment></comment></comment><comment><USER14> I just can't believe tech companies in Canada don't realize/aren't willing to just pay the price for top engineers. Like, how can they be such cheapskates? One day I'll start a company in Waterloo and address this problem.

<comment><USER15> Which Canadian tech company makes money hand-over-fist like Google, Facebook and Apple? The motivation to pay more for talent is to make more money... but Canadian tech companies 1) Do not make all that much money (with exception of Shopify) and 2) Don't believe that they will eventually make all that much money after hiring more.

<comment><USER14> >Don't believe that they will eventually make all that much money

That is a pattern I've noticed in Canada in contrast to the US in fact; We settle for "good enough" or "profitable" but not the "moonshots" or strive to be "the best".

Whether in tech, business, or even global influence, we are a "middle power" and we seem happy about it (my high school politics teacher explains that this is a result of constantly being the US's little brother). This makes me immensely unhappy, and I hope to make Canada more ambitious one day.

<comment><USER16> > We settle for "good enough"

The main problem is investment. You just don't have the investment capital in Canada that you can get in the U.S. I'm not just talking tech, but throughout the economy. Lots of successful Canadian SMEs get bought out by Americans because there's no one here who has the balls to invest in them. In many cases, their (head) offices are moved to the U.S., further reducing the economic impact they had here and making the U.S. economy stronger. Canada is a perpetual SME incubator feeding the U.S. economy.

<comment><USER17> There are numerous counterexamples throughout the Canadian economy: banking, oil & gas, mining, agriculture, etc.

Software investment is probably the only sector that is undercapitalized in Canada.

<comment><USER18> Well you've basically stated those industries that are specifically and geographically tied to Canada.

Of course commodities and the financial system to support them as well as local consumer banking have that funding. All nations do.

It is the 'soft' economy outside of that where the differences lie.

<comment><USER17> There are at least 50 nations that receive most of their financing from foreign sources.

</comment></comment></comment></comment></comment></comment></comment><comment><USER19> For those people who are talking about salaries in Canada versus salaries in the United States -- I don't have a dog to pick in the fight, but I think cost of living is a really important consideration when you're looking to evaluate compensation differences.

Some people have put together prices and it came out that Toronto is about 31% cheaper to live in than SF. ([https://www.expatistan.com/cost-of- living/comparison/san-fra...](https://www.expatistan.com/cost-of- living/comparison/san-francisco/toronto)). That adds up.

<comment><USER20> Salary are usually 1.5 to 3 time higher. You can save much more money.

<comment><USER21> Until you have to put kids through school or have a big medial emergency that isn't covered by your insurance.

<comment><USER22> There are _very good_ public colleges in the US. They don't need to go to Harvard. Plus, if your kid in Canada wants to do medical school or dental school, you'll still be shelling out tens of thousands of dollars per year.

As for medical care, most tech jobs have very good benefits. If you have a major medical problem, you might be out $5K before you hit your out of pocket max. The higher wages and lower taxes in the US mean you can easily handle it (but you do have to plan for it).

<comment><USER8> Exactly, living in California or Ontario, if you're kid wants to go to Stanford or Harvard, it'll cost.

And you can't count on your kid getting into Waterloo, the only university anyone in SV/SF have heard of, it's very competitive.

</comment></comment></comment></comment></comment><comment><USER23> Think Canadian salaries don't compete with US companies? Guess what happens when supply increases?

Most other professionals (doctors, lawyers, accountants, etc) throttle supply through things like certification, but for some reason developers can't / don't want to get their act together to do the same.

Even worse, they (we) welcome more supply! The mind boggles. And I say this as a Canadian employer who would certainly welcome more good developers at a lower price...

<comment><USER11> Because software isn't a zero sum game. Having "too many developers" in a community doesn't mean a glut of developers fighting for scraps, it means Silicon Valley. It means you get bigger companies doing bigger things with bigger success which means bigger quantities of cash whirling around up for grabs.

Being the only plumber in town means you can charge whatever you want. Being the only developer in town means you're telecommuting and competing with Satyam.

<comment><USER24> > Having "too many developers" in a community doesn't mean a glut of > developers fighting for scraps, it means Silicon Valley.

I think we might be talking about two different Silicon Valleys. The one here in the real world has a glut of developers fighting for scraps. Companies that have the luxury of being extremely picky and only hiring the best. Lots of interviewing and so-called "open positions" but not a lot of hiring.

<comment><USER17> I disagree; the nationwide median salary was $100,080; the bottom 10% earned less than $58,300. [1]

The unemployment rate for Computer and Mathematical Occupations was about 2.0%. [2]

Anecdotally, since a large part of someone's world view is by bad things that have happened to them, none of my friends from college are working outside of software. Some earn at the 10% spot in low cost-of-living areas, but they all are employed with enough money to get by.

1\. [https://www.bls.gov/ooh/computer-and-information- technology/...](https://www.bls.gov/ooh/computer-and-information- technology/software-developers.htm#tab-5)

2\. [https://www.bls.gov/web/empsit/cpseea30.htm](https://www.bls.gov/web/empsit/cpseea30.htm)

Edit: this only holds true for the U.S.; unemployment for coders is probably far different in other countries.

<comment><USER25> >since a large part of someone's world view is by bad things that have happened to them

I've never thought of it this way, but it seems so obvious in retrospect.

</comment></comment></comment></comment></comment><comment><USER26> Yeah, the media here have been deliberately exaggerating immigration uncertainty to draw attention.

In the land of facts, salaries are lower here, and taxes are higher. Liberties are eroding, and the cost of living is skyrocketing.

On the whole, you can work just as hard here for a whole number fraction of your salary, have less capital availability, and have less personal liberty. The best deal for the brilliant people at the U of T here is to leave, if we're talking about money and freedom. If we're talking about security, maybe a slight improvement for some kinds of people, but not all.

</comment><comment><USER27> One reason that is often over-looked is the green card backlog issue in the US that affects tech workers from India/China.

I'd easily make the choice to move to Canada where I can get a green card right away rather than wait 10 years for a green card in US. Salaries might be low, but one cannot put a $ amount on peace of mind.

<comment><USER28> Are you referring to Canadian permanent residency?

<comment><USER27> No, I meant US permanent residency which takes 10+ years in EB2. For Canada, one can easily get a PR via Express Entry. Which is why many people like me are strongly considering Canada irrespective of salary.

</comment></comment></comment><comment><USER29> "Starting Monday, Canada's government says it will streamline the visa process so that international tech workers can get a work permit in just two weeks — compared to a complicated process in the U.S. that can take months."

Excellent, we welcome world-class talent, you'll like it here.

</comment><comment><USER30> Canada's Tech Firms will have to increase compensation if they want to attract talent from the US.

</comment><comment><USER31> Poignant for me, I haven't been able to decide on where to move. US is still the big whale as far as tech opportunities go, but for Indians going there now, permanent residency is not possible within their lifetimes, with an 80+ year waiting time on the green card processing.

Canada is far easier to permanently settle in, but the opportunities are far fewer, and salaries are lower too.

I don't know what the answer is here.

<comment><USER2> The path I've seen many immigrants take (particularly young people who don't mind re-settling twice) is move to Canada, live here for 3 years, get citizenship then move to the US on a TN visa. I would say 50% of the international students I knew in engineering school did this. As you probably know Canada is by far the easiest G7 country to be naturalized as a citizen.

Others come to Canada with the intention of doing this and end up staying cause hey, life is pretty good in Canada and after 3 years you may have family ties here.

The mistake I've seen immigrants make is move to Canada, then move to the US on an H1B, L1 or other visa before attaining Canadian citizenship, lose their Canadian PR due to leaving the country permanently, then lose their US job & visa and end up having to return to their original country.

<comment><USER31> > The mistake I've seen immigrants make is move to Canada, then move to the US > on an H1B, L1 or other visa before attaining Canadian citizenship, lose > their Canadian PR due to leaving the country permanently, then lose their US > job & visa and end up having to return to their original country.

Ouch, that sounds terrible.

Yes, getting citizenship in Canada first seems like a good idea. Btw, it's not 3, it's 4 years.

It's a sad commentary on the broken immigration system of the US, when it would be faster for me to get Canadian citizenship, and then switch to US citizenship than go directly for US citizenship.

Though of course, I wonder if the US authorities would be able to find out I am switching citizenships like that, and cause issues. Do you know anyone who did this?

</comment></comment></comment><comment><USER32> To me the bottom line is I can't be "part of the US". My personal values are not represented at all and I believe their leaders are making all the wrong choices.

</comment><comment><USER33> My understanding from working with Canadian tech workers is the lure of Canada is that it is much easier to immigrate there than to the USA.

</comment><comment><USER34> I bet a number of countries in addition to Canada find the current scenario highly beneficial.

<comment><USER35> Canada has some advantages: English is an official language, it already has a legal and administrative system in place to receive qualified immigrants from almost everywhere, and a public that's favorable to it.

AFAIK the only other developed country that comes close is Australia.

</comment></comment><comment><USER36> Why startups condense in America? paulgraham.com/america.html and bloom.bg/1O04ymn

</comment><comment><USER37> I dont understand the hate on Canadian salaries. Its a safer, more liberal country that looks after its poorest.

If you want cut throat lifestyle that pays the most - with the guy who cooked you dinner keeping one eye out for an ICE van, your ex-slaves in prison and some homeless guy going through your dumpster - you'll love the US. If you want to live a fairer society (Canada, France, Germany, Australia etc) don't complain about earning less.

<comment><USER38> I don't think people would complain if it were only a little less for the benefits you describe, but the factor of three that is mentioned by other comments is not an exaggeration. It is one thing to take a pay cut of 20% to live in a "safer, more liberal country." It is quite another to take a pay cut of 70%. Right now, I am trying to move back to Canada. My goal is to get about 50% of the salary that I got at my last job in the U.S., and even that is looking very unlikely.

<comment><USER37> Sure but the second problem isn't the general level of salaries its that most countries dont have a city like the Bay Area or NYC. If you compare similar types of cities: Portland/Vancouver and Chicago/Toronto I dont think the salaries are 3x.

(Though I get the point that this isn't consistent with my first comment)

<comment><USER39> Entry level for a really good engineer in Toronto is... 90k if we're optimistic & it's changed since I last looked last year? Entry level for a really good engineer in America is 185k+. Total compensation, obviously.

That's before taking into account the volume of job opportunities, exchange rate, and access to goods and services.

<comment><USER37> > Entry level for a really good engineer in America is 185k+.

Maybe in the Bay area. Most of the USA you'd get half that with 10y experience.

</comment></comment></comment></comment></comment><comment><USER40> While I agree with this sentiment overall, what pay differential can compensate for a more general stability? It would be great if someone could get a high-paying job and not worry about being bankrupted by an unforeseen medical disaster, but that's not the case in the US.

And by the same token, almost no amount of pay (within the tech spectrum) could convince me to live in the cities in Texas where right-wing extremists are rallying outside mosques with assault rifles.

<comment><USER41> > It would be great if someone could get a high-paying job and not worry about > being bankrupted by an unforeseen medical disaster, but that's not the case > in the US.

I agree with this sentiment but if you have a high-paying tech job then you probably get insurance which won't bankrupt you in the case of a medical disaster. It's the ~90% of the rest of the population who has to worry.

<comment><USER40> I mean...maybe? I know of few American companies that aren't going to find away to get rid of you if you're out of work for an extended period of time because of a serious illness or accident. Labor rights are pretty poorly enforced in the US, and when they are, it's often dependent on you being able to mount and survive a costly legal challenge. People tell themselves they'll be ok, but it seems more like a gamble/survivorship bias to me.

<comment><USER41> True, if you lose your job and can't get on disability you're pretty screwed.

</comment></comment></comment></comment><comment><USER42> Come on Canada. You're making me and all Canadians look bad.

</comment><comment><USER43> Could someone explain how taxation works in Canada (including VAT, compulsory insurances, council tax...). Quick googling says income tax has doubled in 2017.

edit: Here is a source for doubled tax, looks like google parser is wrong [https://pasteboard.co/hMazP1hHs.png](https://pasteboard.co/hMazP1hHs.png)

<comment><USER11> > Quick googling says income tax has doubled in 2017. reply

This is not true, and was likely posted by a conservative hardliners.

Canada uses an after-price sales tax like the USA, but in higher quantities - it will vary between 5% and 13% depending on province. Also, all provinces are currently implementing a carbon pricing system, so some provinces will have an additional sales tax on carbon intensive goods like gasoline. Unlike VAT, they're _above_ the printed cost of the time, not included. These have been quite stable for a long time.

Also, Canada has income tax. Like the Americans, we run on a graduated income tax system, where you pay no tax at all on the first $11,000ish dollars you earn, and then in each tax bracket you pay increasing percentages on the money that falls within that bracket. There has been modest increases in the highest tax brackets to pay for a cut in the second-lowest bracket. Also some "boutique" exemptions have been closed or reduced recently.

In every case, there are taxes paid separately to both the federal government and provincial governments.

The biggest rising expense here on Ontario is not taxes, but "hydro" which is what Canadians call electricity (so much of it is generated by hydroelectric dams and power companies market themselves as hydro companies because of it). Ontario has had a history of mismanaging electrical bills, and that process has come to a head and so energy prices have skyrocketed recently.

While our taxes are normally somewhat higher than Americans, it hasn't been really a huge problem historically. Only now it's starting to come to a head with cost of living as the crazy housing market has driven mortgages through the roof _and_ the hydro crisis have come together to create a cost-of-living problem in the Toronto area.

Finally, we have municipal property taxes (comparable to British council taxes). These are priced based on the value of your real-estate property. These are generally stable, as councils are very price-sensitive and are hesitant to raise them outside of a crisis.

<comment><USER44> > In every case, there are taxes paid separately to both the federal > government and provincial governments.

I would like to just add that unlike the US, where some states do not have state income taxes, all provinces in Canada have provincial income taxes, and with the exception of Alberta, all of them have provincial sales taxes.

</comment></comment></comment><comment><USER45> _" Starting Monday, Canada's government says it will streamline the visa process so that international tech workers can get a work permit in just two weeks — compared to a complicated process in the U.S. that can take months."_

I'm increasingly troubled by the notion that the only way one can move from one place to another, is by some contrived rule of value-add that person may offer. Aside from this new rule, Canada otherwise is a difficult country to gain entry to. The exclusivity of such movement is worse than outright border lockdown, because it essentially provides a validated classist bias against others.

<comment><USER46> Why should a country not be permitted to prohibit you entry if you don't add value to said country? That's what sovereignty is all about.

If you are down on your luck, I will take you into my home. But there is a limit to how many people I can support without them contributing to the household. Scale this up to nation state scale, and you have visa quotas.

<comment><USER41> > Why should a country not be permitted to prohibit you entry if you don't add > value to said country? That's what sovereignty is all about.

The problem is that capital flows more or less freely but labor does not.

<comment><USER46> Fully agree there needs to be tighter capital controls. Capital should be a second class citizen to labor.</comment></comment></comment></comment>


NPL: A programming language for neural networks, 3d simulation and visualization - <AUTHOR> https://github.com/LiXizhi/NPLRuntime/wiki/WhatIsNPL <comment><USER2> I don't understand... This doesn't look like a programming language. It looks like a new VM for the Lua language, but with batteries included.

There's a difference between "language" and "language implementation". With this you have a new language implementation, but not a new language per se.

Furthermore, I think it could benefit from marketing as batteries for Lua, instead of a new thing Lua compatible. Your runtime would benefit from things like Lua's package manager (LuaRocks) and getting the existing Lua community to try this?

<comment><USER3> Indeed:

> NPL embeds the small Lua/luajit compiler, and adds tons of native C/C++ API > and new programming paradigms, making NPL a general purpose > language/runtime.

[https://github.com/LiXizhi/NPLRuntime/wiki/NPLVsLua](https://github.com/LiXizhi/NPLRuntime/wiki/NPLVsLua)

The page also thinks "C/C++" is a language and that "JAVA" (in contradistinction to Java, I suppose) exists.

</comment></comment><comment><USER4> For a visualization tool, I sure expected some pictures.

<comment><USER5> They have a couple of screenshots on their website [0].

[0]: [http://www.nplproject.com](http://www.nplproject.com)

</comment></comment><comment><USER6> The Paracraft '3D movie maker' and NPL in general are interesting. Paracraft is like Minecraft in a way. There are some screenshots of MS Visual Studio for debugging and editing, and it mentions that the NPL runtime can also run on top of Mono/C#. There's a screenshot of The Haqi Magic MMORPG which has over 5 million registered users in China online since November 2009 according to the site. There is substantial development history, apps, cross platform (PC, Android and iOS) per [http://www.paracraft.cn/](http://www.paracraft.cn/). I'll have to spend some time looking at this over the weekend for game dev.

</comment><comment><USER7> IMHO 3 dimensions are mostly not enough for NN visualisation. Even for education purposes. Right after you finish HelloWorld tutorial its just not going to get job done.

</comment><comment><USER8> So it's Lua?

<comment><USER9> [https://github.com/LiXizhi/NPLRuntime/wiki/NPLVsLua](https://github.com/LiXizhi/NPLRuntime/wiki/NPLVsLua)</comment></comment>


Learn Git Branching - <AUTHOR> https://learngitbranching.js.org/ <comment><USER2> I can't recommend this highly enough. Before, I had been working with IBM Clearcase and SVN, so I don't feel like I "got" git until I saw, visually, the following:

* interactive rebasing

* how remote branches are represented

* what HEAD is, and how it relates to branches

* in day-to-day usage, commits are never really thrown away or deleted. For example, git amend doesn't actually delete a commit.

This was a great starting point, it's highly interactive, and I'm considering learning javascript for the sole purpose of adapting this style interface to teach other subjects. Imagine learning docker through something like this. It's not that much of a reach!

<comment><USER3> I'm still going through the exercises but as an old SVN user I completely agree, the visual aids in the tutorial are excellent. It would be great to have this resource integrated into a git client.

</comment></comment><comment><USER4> For those of you about to click: it's a visual interactive guide, and it's excellent. This guide is way too easy to not just learn it right now.

<comment><USER5> Also, it doesn't seem to work on mobile, so, maybe saved you a click.

</comment></comment><comment><USER6> Several previous discussions:

[https://hn.algolia.com/?query=Learn%20Git%20Branching%20poin...](https://hn.algolia.com/?query=Learn%20Git%20Branching%20points%3E20&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0)

</comment><comment><USER7> Meta: I opened this on mobile in a background tab and was quite surprised that my browser (Chrome on iOS) forcibly switched tabs to focus on the new tab. It seems it was because the site uses an alert to say "can't receive input on mobile". I guess this is the browser's default behaviour but seems like something that could be completely abused by spammers/advertisers.

<comment><USER8> This is one of those browser specific things, but I believe should be considered a bug by whatever browser you're using.

<comment><USER9> Happens on Firefox for Android, too...

</comment></comment></comment><comment><USER10> I love this guide, it is seriously fantastic. Definitely one of the more fun ways to learn a useful skill.

</comment><comment><USER11> This is just an amazing resource. I just found it here and have gone through most of it. At some point I found myself ignoring the goal and just playing with git commands to see the visualization of them. And for the most parts, it's very great!

I need to give this to some people I work with.

</comment><comment><USER12> It's sad that the default spanish translation is so obviously localized (for Argentinians in particular). It's annoying for the rest of spanish speakers to read the texts, specially the imperatives ("Compartí" instead of "Comparte", etc).

<comment><USER13> What are developers doing reading a dev resource in a localized version in the first place?

<comment><USER12> The page spawns in the system locale, and it's pretty hard to change it using the icon in the toolbar below due to the overlay.

<comment><USER13> That's a valid reason I guess.

Normally I'll read and write any programming related documentation in english, since it's easier to share, refer to common terms and concept, lookup online, etc, and every dev is expected to be able to read it anyway (else they'll have much worse troubles with error messages, tooling, PL syntax, etc).

<comment><USER14> A contrasting view: [http://idlewords.com/2006/05/on_bilingual_ballots.htm](http://idlewords.com/2006/05/on_bilingual_ballots.htm)

<comment><USER13> I don't have an opinion on bilingual ballots or not.

Not even for bilingual texts for medicine or not. I guess French or Russian or whatever texts on medicine are fine.

My comment was strictly for developer documentation -- where everything in programming is in english, and even basic syntax and terminology needs tons of english to grok anyway.

So English + development is more like a case of being an Egyptologist and not speaking ancient Egyptian -- they go with the profession.

</comment></comment></comment></comment></comment></comment><comment><USER15> Second level doesn't work. Created a branch with git checkout -b bugFix level does not complete then, redoing it in two steps as suggested does not complete the level so the player is stuck

fyi

<comment><USER16> On Firefox at least, I can concur and say it does choke more or less randomly.

I got softblocked on the first level because head didn't move when I committed.

I reloaded the page and it worked.

</comment></comment><comment><USER17> Nicely done, but Courier is the ugliest font on Earth (I don't have Monaco). For the sake of humanity, never write "Courier" in a CSS file. ;-)

<comment><USER18> Yes, I really don't understand that design choice. On Linux you have Deja Vu Sans Mono (same origin as Menlo which replaced Monaco 10 years ago) and on Windows Consolas is a pretty good default. Or because the website is for developers, just keep 'monospace' as the default.

</comment></comment><comment><USER19> Pretty nice tutorial. Visualization is easy to understand. Took me two hours to finish but enjoyed every minute of it.

</comment><comment><USER20> The only way to properly learn git.</comment>