Tiny C Compiler - <AUTHOR> https://bellard.org/tcc/ <comment><USER2> It's not just a tiny C compiler - it's a compiler you can use as a static library that can compile your C code directly to memory. And then you can call into it, if you dare.

I used it as a scripting backend for a long time, but eventually you will realize that you are not the only one that could write scripts, but you also really need to have a trust boundary (or just a different address space), so that errors in the script don't drag the whole thing down.

That's where Lua and LuaJIT shines: It's simple, and it's sandboxed. However, there is still one thing missing. These days, several programming languages have several targets that they can compile to, and so imagine if you could emulate some platform at high performance with low overhead, in a sandbox. You would then be able to script in whatever language you so desire, provided it has that target.

Unfortunately, those languages tend to be system languages and not the absolute best for scripting. With one big exception: Compile-time programming support.

<comment><USER3> LuaJIT is not sandboxed.

Mike Pall told me this in no uncertain terms: [http://lua- users.org/lists/lua-l/2011-02/msg01582.html](http://lua- users.org/lists/lua-l/2011-02/msg01582.html)

> The only reasonably safe way to run untrusted/malicious Lua scripts is to > sandbox it at the process level. Everything else has far too many loopholes.

<comment><USER4> The issue isn't that Lua can't nominally provide a sandboxed environment--it can, better than almost any other language. The central issue is whether LuaJIT, PUC Lua, or any other particular piece of software can be made sufficiently free of bugs that you can trust such a sandbox to run potentially malicious code.

The answer in the case of LuaJIT is definitely no, because the JIT engine is sufficiently complex that exploits are inevitable. Note that this is _also_ the case with JavaScript. Many browser exploits start with some codegen bug in V8 or SpiderMonkey. And there are many more eyeballs looking to fix bugs in V8 and SpiderMonkey than LuaJIT, so in the case of LuaJIT the prudent answer is that you should never trust it to run potentially malicious code.

The case for PUC Lua is more nuanced. Lua used to have a bytecode verifier, but it was removed for 5.2 because too many bugs were found in the verifier, and because the VM relied heavily on the verifier to filter bad opcode patterns, that led to sandbox breakouts. This made the PUC developers believe that the verifier made Lua worse off as compared to a more wholistic emphasis on correctness and robustness, so they dropped the verifier. They also dropped any pretense that you could safely sandbox bytecode (i.e. precompiled scripts); if you want a sandbox in Lua you should only load untrusted code as plain Lua scripts into the sandboxed environment. To that end Lua 5.2 added a parameter to all APIs for loading code that specified whether to accept text scripts or binary bytecode. In other words, the bytecode verifier was considered a third wheel, so they removed it and redirected attention to the compiler and the rest of the VM.

So for PUC Lua the issue really comes down to how prudent it is to draw a trust boundary around a pure Lua sandbox; or rather, what your adversarial model is, precisely. PUC Lua is committed to Lua's sandboxing features, but many developers are fairly of the opinion that the only way to run untrusted code, if you're to run untrusted code at all, is using either a hardware VM or a very strict seccomp jail. If you're of the latter opinion, the language is irrelevant--you shouldn't trust Lua, JavaScript, Java, or any other language environment, period. In practice, however, even people of the latter opinion generally apply the principle of defense in depth. That's why browser JavaScript APIs and capabilities are still relatively limited, even though browsers execute JavaScript in OS-based sandboxes. In most practical contexts Lua's sandboxing features still provide great value; it just needs to be understood that they're a complement to rather than substitute for process sandboxing.

The same analysis applies to WebAssembly, FWIW, especially JIT'ing WASM environments. Anybody who thinks WASM is a magic cureall for running untrusted code is mistaken.

<comment><USER5> These types of comments are why I still read HN.

</comment></comment></comment></comment><comment><USER6> The author is a genius: a while ago he implemented an x86 virtual machine in javascript: [https://bellard.org/jslinux/vm.html?url=buildroot-x86.cfg](https://bellard.org/jslinux/vm.html?url=buildroot-x86.cfg)

<comment><USER7> >The author is a genius

Understatement of the century! :-) The breadth of his work, all non-trivial, is truly humbling. All done without fanfare or self-aggrandizement. I can't even find a good interview of him to understand his mind and thought-process.

<comment><USER8> Is there a good magazine, news outlet or blog we could tip off, and try to get them to make an interview?

<comment><USER7> The usual suspects: Reddit, Slashdot, ArsTechnica and of course HN.

And the interview should be purely on the technical side i.e his educational background, how he approaches design and programming, how he learns new technical domains, his thoughts on languages, advice to young programmers etc. Given his off the charts productivity, i suspect he has a highly efficient way of learning and doing things which i would like to copy :-)

</comment></comment></comment></comment><comment><USER9> Want to "skip" the compile step?

      //usr/bin/tcc -run $0; exit
      main() { printf("Hello\n"); return 0; }

Just `chmod +x` and run it...

<comment><USER10> How does this work? Is there an alternate form for #! (aka shebang)?

EDIT: hah, I should have realized that "//" is the C comment and "//usr/bin/tcc" is equivalent to "/usr/bin/tcc". Clever!

<comment><USER11> "C comment," you mean.

So it's running the file as a shell script, where the first line runs tcc on the current file and quits.

<comment><USER10> Fixed typo, thanks. Yeah for some reason it didn't click when I saw it.

</comment></comment></comment></comment><comment><USER12> I used to learn the source code of TCC 4 years ago and the experience is...pretty awful. Until then, I never know that compilers aren't reentrant and is supposed to follow the Unix philosophy -- use global state but do your thing as minimalistic as you can then let people spawn your program as a process to turn a blind eye to lack of reentrancy. This means you can't embed TCC to your program without TLS or global lock to each compilation however, and I think I already lost my reentrancy patch cause the maintainers said they won't accept it :(

Now I carry on and would like to make a TCC rival. I also wondered if I can make a TCCPP until Iearnt not only C++ syntax is ambiguous (and so we need some form of context sensitivity, and GLR is one good technique to handle C++ type of thing) C++ templates are Turing-complete effectively meaning it will be hellish hard. I abandoned this idea thereafter.

<comment><USER13> "I also wondered if I can make a TCCPP until Iearnt not only C++ syntax is ambiguous (and so we need some form of context sensitivity)"

I believe a C parser would also need some form of context sensitivity. "T * x;" can be a declaration or a statement. However, C++'s syntax is larger than C's and I believe that there may be more cases where context sensitivity is needed to resolve ambiguities.

[https://eli.thegreenplace.net/2007/11/24/the-context- sensiti...](https://eli.thegreenplace.net/2007/11/24/the-context-sensitivity- of-cs-grammar)

<comment><USER14> Another great piece by Eli on how Clang solves this problem and the nested functions inside C++ classes is [https://eli.thegreenplace.net/2012/07/05/how- clang-handles-t...](https://eli.thegreenplace.net/2012/07/05/how-clang- handles-the-type-variable-name-ambiguity-of-cc).

Clang basicaly moves the semantic processing to another pass, and tokenizes both types and variables as 'identifiers'.

I'd agree that C/C++ have some sort context sensitivity. However I think this is not an ambiguity. You can deduce a single logical solution when you see T *x; . If the T in scope is a variable you do multiplication, if the T in scope is a type definition you make a variable declaration.

Real ambiguity happens when there are two logical solutions to the same statement and the language specification has to prefer one to remove ambiguity and undefined behaviour.

For example a C# code example from spec that is ambigious and therefore doesn't compile:

" static void F(bool a, bool b) { Console.Writeline($"{a} and {b}"); }

static void Main(string[] args) { int G = 2; int A = 1; int B = 2; F(True, False); F(G<A, B>(7)); "

The compiler prefers to interpret the last line as a function call with one argument, which is a call to a generic method G (that doesn't exist in the code above) with two type arguments a one regular argument. Instead of one function call with two boolean arguments.

<comment><USER15> It can be complicated even when it's not ambiguous. Consider:

       template<size_t N = sizeof(void*)> struct a;

       template<> struct a<4> {
           enum { b };
       };

       template<> struct a<8> {
           template<int> struct b {};
       };

       enum { c, d };

       int main() {
           a<>::b<c>d;
       }

This is not ambiguous, but the meaning of the line inside main() depends on the compiler and the target - it can be either a declaration:

       a<>::b<c> d;

or an expression:

       a<>::b < c > d;

depending on which b gets selected. This in turn affects future references to d etc.

<comment><USER16> Note that this is only an issue in non-generic context. For dependent names you have to disambiguate with "typename" and "template".

But yeah, it looks like a C++ compiler has to instantiate templates in lock- step with parsing to make this work, but possibly there are some tricks that are applicable here. In any case, this looks like a hard problem.

</comment></comment></comment></comment></comment><comment><USER10> It's worth reading through all the other bellard projects. He is an amazingly productive developer.

[https://news.ycombinator.com/from?site=bellard.org](https://news.ycombinator.com/from?site=bellard.org)

<comment><USER17> Perhaps most famously, the original creator of both ffmpeg and qemu.

</comment></comment><comment><USER18> See also

2016 [https://news.ycombinator.com/item?id=13249851](https://news.ycombinator.com/item?id=13249851)

2017 [https://news.ycombinator.com/item?id=15272894](https://news.ycombinator.com/item?id=15272894)

2018 - obfuscated! [https://news.ycombinator.com/item?id=17335856](https://news.ycombinator.com/item?id=17335856)

</comment><comment><USER19> The author is incredible:

> On 31 December 2009 he claimed the world record for calculations of pi, > having calculated it to nearly 2.7 trillion places in 90 days. Slashdot > wrote: "While the improvement may seem small, it is an outstanding > achievement because only a single desktop PC, costing less than US$3,000, > was used—instead of a multi-million dollar supercomputer as in the previous > records."[10][11] On 2 August 2010 this record was eclipsed by Shigeru Kondo > who computed 5 trillion digits, although this was done using a server-class > machine running dual Intel Xeon processors, equipped with 96 GB of RAM.

</comment><comment><USER20> I still wonder about the feasibility of Rob Landley's idea of QCC - TCC with TCG backend - the code generator used by qemu which comes originally from TCC itself. That would make it fast to compile and with quite an extensive repertoire of architectures covered.

[https://landley.net/qcc/](https://landley.net/qcc/)

</comment><comment><USER21> On a somewhat related note, I always thought dietlibc was a pretty cool project (basically trying to get libc to be very tiny). It's been a pretty long time since I browsed the code but I remember it being quite elegant.

[https://www.fefe.de/dietlibc/](https://www.fefe.de/dietlibc/)

<comment><USER22> From my experience musl libc[1] is a more popular project in this space

[1] [https://musl.libc.org/](https://musl.libc.org/)

<comment><USER23> The creator of Zig language wrote a praise to musl:

[https://andrewkelley.me/post/why-donating-to-musl-libc- proje...](https://andrewkelley.me/post/why-donating-to-musl-libc-project.html)

</comment></comment></comment><comment><USER22> Heads up: Though amazing, the compiler makes use of the deprecated POSIX setcontext API[1], which means you may have trouble running it on some modern distributions.

[1] [https://en.wikipedia.org/wiki/Setcontext](https://en.wikipedia.org/wiki/Setcontext)

<comment><USER24> Do modern distros really not have setcontext? If they don't it shouldn't be too hard to implement in assembly.

<comment><USER2> It's a very tiny API, and requires little assembly, so I agree.

</comment></comment></comment><comment><USER25> Anyone being impressed by the compile time of the modern languages such as Switft, Rust or Go should try TCC at least once in their lifetime.

Both compilation and link are generally finished before your fingers have relased the enter key...

<comment><USER26> You should not mention "Rust" and "fast compile time" in the same sentence, unfortunately.

[https://prev.rust-lang.org/en-US/faq.html#why-is-rustc- slow](https://prev.rust-lang.org/en-US/faq.html#why-is-rustc-slow)

<comment><USER25> That was sarcasm on my side ^^

</comment></comment></comment><comment><USER27> My main experience with tcc was that it was the only C compiler available for Damn Small Linux (a <50 MB Linux distro with X and Firefox).

<comment><USER28> I loved DSL! I can't remember the specs, but I had an ancient machine lying around in about 2004, that would have been otherwise worthless, and put DSL on it just to check it out. I remember being so impressed with how productive I could be and how zippy that old machine could be with such a lightweight OS. Fond memories :)

<comment><USER29> How does DSL compare with Alpine?

<comment><USER27> I wouldn't use DSL these days, it's very old :)

DSL's goal was to provide most of the tools you might need in a tiny footprint. The platform target was the old "thin-client" style machines which might pack a 500 MHz AMD Geode or a VIA C3 processo and have either no internal storage or maybe a few hundred megabytes for preboot environments.

They were able to fit X (Xfree86, iirc) w/ Fluxbox, Firefox, Ted (a word processor), and a few other things into a 50 MB "bizcard" image (PCMCIA cards & compact flash).

Another thing it was designed to do was allow you to install most of the common things to a small internal storage device, while running the rest off of optical media.

It dates to the time before common support for USB booting. Also kinda crazy to realize you could fit Firefox, a windowing environment, and a kernel into 50 MiB while today the standard vim install is 33 MiB...

<comment><USER27> *it used Xvesa, not Xfree86.

</comment></comment></comment></comment></comment><comment><USER30> Its not dead, i use from git for years.

[https://repo.or.cz/w/tinycc.git](https://repo.or.cz/w/tinycc.git)

<comment><USER31> wtf are those tags?

<comment><USER32> Looks like anyone can add them right next to the tag cloud...

<comment><USER33> Classic mistake to allow anyone to add content to a public site anonymously

<comment><USER34> Yeah, I raised this on the mailing list almost a year ago. The people maintaining TinyCC know about it but don't care enough to take action.

</comment></comment></comment></comment></comment><comment><USER35> How funny, I use tcc /all the time/ and I was just tinkering with one 'script' [0] the other day. Basically more often than not for me it's easier/quicker to write stuff in C than fighting with another script language that will break next time I want to use that 'script'. C works.

 _of course_ I could compile it, but really, it doesn't have to, and to develop/try that sort of small C tools, tcc is just unbeatable.

[0]: [https://gist.github.com/buserror/227a7e64c92acece821ec8ee587...](https://gist.github.com/buserror/227a7e64c92acece821ec8ee58776276)

</comment><comment><USER36> For someone who wanted to read more about Fabrice Bellard.

[https://web.archive.org/web/20110726063943/http://www.freear...](https://web.archive.org/web/20110726063943/http://www.freearchive.org/o/55dfc9935a719fc36ab1d16567972732c2db1fd7d7e3826fd73ee07e4c3c7d0b)

</comment><comment><USER37> More info about Fabrice: [https://smartbear.com/blog/test-and-monitor/fabrice- bellard-...](https://smartbear.com/blog/test-and-monitor/fabrice-bellard- portrait-of-a-super-productive-pro/)

</comment><comment><USER38> > Measures were done on a 2.4 GHz Pentium 4. Real time is measured. > Compilation time includes compilation, assembly and linking.

How old is this project?

<comment><USER39> > (Nov 18, 2001) TCC version 0.9 is out. First public version.

</comment></comment><comment><USER40> been already discussed numerous times. But I never miss a chance to sing praises to Bellard. One of the very few real programming geniuses.

</comment><comment><USER41> It offers bounds checking! The documentation links to

[http://www.doc.ic.ac.uk/~phjk/BoundsChecking.html](http://www.doc.ic.ac.uk/~phjk/BoundsChecking.html)

Someone needs to add this to llvm.

<comment><USER42> Whilst TCC's bounds check was rare for quite some time, the bigger compilers do now actually offer it.

Clang supports bounds checking as part of -fsanitize=address, (though with a few more flags you can _just_ have bounds checking instead of the other sanitisation options). (Since around 2015?)

GCC supports bounds checking and others, depending on which frontend you're using the options can change. (Like -fbounds-checking for C, and -fcheck=all for gfortran). (Since around 2013? GCC 4.71)

Even Intel has -check=bounds. (Though not under macOS). (Since around 2015?)

<comment><USER41> Wow did not know that.

Is there a distribution that offers bounds checking for all linux software ? I wonder how slow a typical LAMP stack will be. My guess is no more than 5x. I think thats an acceptable tradeoff. I'm guessing there's a way to add global compiler flags in source distributions like Arch linux / BSD.

<comment><USER42> Gentoo has a few ways to set up global C flags [0], because the default is to compile all your software yourself.

(Arch isn't actually a source distro, it's binary, though rolling release. Gentoo is, however).

[0] [https://wiki.gentoo.org/wiki/USE_flag](https://wiki.gentoo.org/wiki/USE_flag)

</comment></comment></comment></comment><comment><USER43> I tried to use that for toy C programs on Windows 10, but for some reasons I cannot run these programs in the invite CMD afterwards. It works only if i use tcc run or something like that.

</comment><comment><USER44> I wanted to comb through the code without cloning, but can't tell if that's possible with the git web UI they're using. Anybody know if it is?

<comment><USER45> They're using gitweb. You can read the code for any commit, just click the 'tree' link associated with it. Alternatively, just click the 'tree' link at the top for the tree of the latest commit in their default 'mob' branch.

</comment></comment><comment><USER46> As a side note, I'm surprised how big Links is!

</comment><comment><USER47> tcc is part of the guix bootstrap project [https://guix.gnu.org/blog/2019/guix-reduces-bootstrap- seed-b...](https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/) which aims to be able to rebuild everything from source code plus the smallest possible binary seed

<comment><USER48> So that's currently scheme-blob -> cc-in-scheme -> tcc -> ancient-gcc -> proper-gcc? Wow, that's something that really deserves the term _bootstrapping_.

</comment></comment><comment><USER49> It looks like there is a real effort now to get TCC working on macOS which would be amazing.

</comment><comment><USER50> Can't use it in iOS but I guess may be the mac arm ...

</comment><comment><USER51> For some time it has a risc64 backend.

</comment><comment><USER52> What is the author upto now?

<comment><USER53> [https://bellard.org/quickjs/](https://bellard.org/quickjs/), for one

</comment></comment><comment><USER54> someone to revive tccboot ?</comment>


Volkswagen Claims Ownership of an Entire Group of Insects - <AUTHOR> https://www.eff.org/takedowns/volkswagen-claims-ownership-entire-group-insects <comment><USER2> I'm getting a feeling that the "mindless and unwarranted takedown filter" is going to become a stereotype, like the "cruel and greedy kulak" of the 21st century. We're getting flooded with stories like this from Amazon and Youtube already of small businesspeople getting screwed over, and it never, ever looks good on the company.

</comment><comment><USER3> Well.. This is what we get for the DMCA as it has absolutely zero consequences for misuse.

</comment><comment><USER4> Perhaps the only way to demonstrate the utter silliness that is DMCA takedowns is to flood the system with takedowns aimed at people who usually issue them frivously themselves and have the resources to fight them.

</comment><comment><USER5> There needs to be some negative feedback for companies that do this.

<comment><USER6> Well you're in the right place.

</comment></comment><comment><USER7> Americans have always called those cars "bugs"...imagine if they took this nonsense that far.</comment>


Arista is just a few months from an exclusion of their products entering the USA - <AUTHOR> http://blogs.cisco.com/news/protecting-innovation-cisco-seeks-only-fair-competition <comment><USER2> > _They have directly lifted more than 500 multi-word command line expression_

That constitutes an API or instruction set.

If vendors have to invent different command syntax to do the same thing, that is not really an invention, and it is bad for customers, and their choice. Complex configurations have to be transliterated from one language to another in order to migrate among equipment units.

This is like Lotus 1-2-3 versus Borland all over again: [https://en.wikipedia.org/wiki/Lotus_Development_Corp._v._Bor...](https://en.wikipedia.org/wiki/Lotus_Development_Corp._v._Borland_International,_Inc%2E)

 _" This case established that copyright does not extend to the user interface of a computer program, such as the text and layout of menus."_

 _" Borland released a spreadsheet product, Quattro Pro, that had a compatibility mode in which its menu imitated that of Lotus 1-2-3, a competing product. None of the source code or machine code that generated the menus was copied, but the names of the commands and the organization of those commands into a hierarchy were virtually identical._"

"Names of commands and organization of commands into a hierarchy:" same thing as the multi-word syntax in some Cisco box.

<comment><USER3> OTOH, didn't Oracle just show that APIs are copyrightable?

In other news, Arista is now pushing CloudVision and NetDB after being satisfied with the CLI for years.

</comment></comment><comment><USER4> The headline is a little misleading.

According to Cisco (specifically, their General Counsel):

"If infringement is found, Arista, despite their efforts to delay the ITC process, may be just a few months from an exclusion order banning a majority (or all) of their products entering the United States."

That's a (debatable) claim, not a fact, and -- for someone who works with gear from both of these vendors -- had me going "Huh!? What!?" and hurriedly clicking the link to get to the article to find out what was going on.

Regardless, I think this will be an important case. I don't know if _Lotus v. Borland_ (as mentioned by kazinator) counts as precedent (though, I hope it does) but the decision will definitely affect future products and services.</comment>


A Salary Survey on Ukrainian Developers - <AUTHOR> http://www.developers.org.ua/lenta/work/salary-survey-report-oct-2010/

<comment><USER2> I enjoyed the challenge of finding out what the graphs mean, just by reading numbers and city names. I think the salaries are in the blue bar graphs, separated per years of experience and per city?</comment>


Ask HN: Why don't people talk about programming by example? - <AUTHOR> I've been searching for the future of programming for a while, and just recently discovered "programming by example". Basically, you specify your program by giving examples of inputs and outputs, and the reasoning engine does the rest. It's already implemented in Excel as a feature called "Flash Fill".<p>Why are people still debating syntax when programming by example is clearly the future? Why don't more people talk about this? <comment><USER2> > Why are people still debating syntax when programming by example is clearly > the future?

In your opinion, why is it clearly the future?

From the abstract of a paper about this topic [0]: " _Programming by Examples (PBE) has the potential to revolutionize enduser programming by enabling end users, most of whom are non-programmers, to create scripts for automating repetitive tasks._ "

Most of the professional programming I've done has been solving (relatively) unique problems, not automating repetitive tasks. While automating repetitive tasks is a great use-case for programming, I don't think that's enough to call it the future of all programming.

[0]: [https://www.microsoft.com/en-us/research/wp- content/uploads/...](https://www.microsoft.com/en-us/research/wp- content/uploads/2016/12/pbe16.pdf)

</comment><comment><USER3> I hadn't heard of it before so forgive me if I get something wrong. Two main thoughts:

1\. It sounds like, to implement a robust program (and not just a pattern in Excel), you'd need to provide every different combination of input/output. This is just not feasible for any remotely large project. For example, if you need the program to handle an obscure error in a specific way, then you'd have to provide the series of inputs that causes the error.

2\. If programming by example is characterized by giving inputs and outputs, then isn't it basically just supervised machine learning? In which case, we're still many years away from not needing to write the actual ML code ourselves in a standard programming language.

</comment><comment><USER4> I think it would be rather hard to have such a system implement something like a sequence alignment algorithm, much less an NP hard problem like subgraph isomorphism, much less a humanly complex problem like tax filing software.

</comment><comment><USER5> You're basically describing function or program approximation. This is the central problem that machine learning is trying to solve. A lot of people are talking about this.

</comment><comment><USER6> another huge thing is it will be really hard to get optimized algorithms</comment>


Our Development Workflow - <AUTHOR> http://engineering.zenpayroll.com/this-is-how-we-zenpayroll-our-development-workflow/ <comment><USER2> I feel it's slightly concerning that the same text contains:

"There's no room for error."

and

"Someone on the product team will usually play with the feature on our staging environment trying their best to break things."

The first sentence seems to imply that they try to maintain the highest quality possible. Yet the second sentence does not really fit that idea. The article pretty much only lists the tools they use.

But on a scale from Random PHP site to NASA space shuttle software, where is zenpayroll located?

<comment><USER3> One presumably talks about the production environment, the other about staging environment.

<comment><USER4> If you truly have "no room for error" (i.e. you are shipping code to a hundred-billion-dollar space vehicle), you might have:

\- Very strict coding guidelines

\- Rigorous code review

\- An extremely thorough test suite

\- Multi-stage approval through a QA process involving many pairs of eyes and thorough, formally defined and scientifically rigorous test procedures

\- Static analysis and possibly even algorithms proved correct in Coq

Simply playing with it in staging for a while and determining that everything looks good is NOT the kind of testing that you do when there's "no room for error."

<comment><USER3> No room for error probably means one thing to people working on a $10^11 space vehicle and something else to webdevs. Does that surprise you?

<comment><USER5> As a statement, it is absolute.

<comment><USER6> As a statement, it is meaningless.

</comment></comment></comment></comment></comment></comment><comment><USER7> Testing _after_ merging with develop is a very, very bad practise. And there're plenty of tools to help you don't do that, just kick a build to run all your tests, which will add a tick or a comment to the branch's PR. And never merge anything without that tick or comment.

<comment><USER8> Totally agree. Testing should be done BEFORE merging, like this article explains: [http://www.yegor256.com/2014/07/21/read-only-master- branch.h...](http://www.yegor256.com/2014/07/21/read-only-master-branch.html)

</comment></comment><comment><USER9> Point 2 (Branch off development) confuses me.

At my workplace we have branches for dev, staging, and production. We're working on feature branches. Now if my coworker merges feature A into dev, and I merge feature B into dev, and feature A is done and ready for release, but feature B needs more work, and my coworker checks out a new feature branch C from dev, he'll be unable to merge into production without merging in my unfinished feature B.

We branch off of production so this won't happen. Are we doing it wrong?

<comment><USER10> Couldn't you merge the features that are done to your staging branch and from there merge to production? Your staging branch would be the 'release branch' in this model: [http://nvie.com/posts/a-successful-git-branching- model/](http://nvie.com/posts/a-successful-git-branching-model/)

<comment><USER9> Thanks for the link.

We merge feature into dev when we want to show a feature to a fellow developer.

We merge feature into staging when a feature is ready to be tested by non- developers and to be included in documentation.

We merge feature into production when it's ready for all users.

Has been working out well so far.

<comment><USER11> We have a similar process it allows for more releases. imo there are things that require more testing then others, and they shouldn't hold up the process of releasing code.

</comment></comment></comment></comment><comment><USER12> This looks like a very sensible workflow in general. The one thing that worries me is long lived feature branches. This workflow is fine as long as features never take more than a few weeks. If it takes longer you end up with bugs that have been fixed on the development branch still appearing on various feature branches. Also if you do a lot of refactoring on a feature branch while development goes on in parallel there will be difficult merges. It is especially problematic when work on a feature stops for some reason and an old branch sits around for months.

In general code should be merged to the development branch as soon as it is working, tested and reviewed, even if not all the functionality of the feature is done.

<comment><USER13> Did you miss the part about rebasing?

<comment><USER12> It looks like rebasing is only done after the feature is complete. Maybe that was just a simplification.

<comment><USER13> Why does it matter? All the fixes will already be there after rebase anyway.

<comment><USER14> The point is that if you're not continually merging development down into your feature branch, then rebasing becomes overly difficult. Merging can introduce bugs if not done correctly.

At my company, we eschewed feature branches about a year ago. We have two branches - development and main, with a branch ("tag" in git speak, we use TFS) created for each release of our product (we're a software company, not a service company). Development happens in the development branch, and is merged up into the main branch after code freeze.

This does not preclude us from releasing often. With judicious use of feature toggles, it's simple to release with a feature that's not done.

Feature branches would just create a mess for us as there's necessarily many communicating parts between teams, and the number of feature branches required to keep them all in sync would be exponential.

</comment></comment></comment></comment></comment><comment><USER15> 1\. "Don't optimize for the short-term" vs "Keep it simple and straightforward".

Often the simplest thing may not work in the long run. But its better to err on the side of keeping things simple.

2\. Code reviews + off mainline development is a potential disaster in waiting unless the review process is fast. The fastest review process I have seen is automated testing and pairing when someone is working on something that cannot be caught easily by automated tests like synchronization.

<comment><USER16> >> 1\. "Don't optimize for the short-term" vs "Keep it simple and straightforward".

>> Often the simplest thing may not work in the long run. But its better to err on the side of keeping things simple.

IMO, the best reason for simplicity is that simple things can be torn out and replaced more easily than complex things. So the simplest thing isn't necessarily right, but you haven't wasted much resources by choosing it, so you've left your options open. You always want to have options.

<comment><USER15> Ah, that's what I meant by "erring on the side of keeping things simple". It is okay if you make decisions that are not optimal in the long run, but are simple since they can be torn apart.

</comment></comment></comment><comment><USER17> Nothing special. It is just normal workflow when you use common sense, no? Except the development branch because master is new development branch.

</comment><comment><USER18> Reading things like this make me long for the simplistic development environment of a web startup. Almost none of this would fly in an "Enterprise IT" environment, except in the very rare case where the team is legitimately building (and owning) a product rather than creating business process optimization crutches.

</comment><comment><USER11> Dedicated QA team? Person? Feels like they are missing a crucial piece of non- devs testing and accepting features. Only my opinion but in my experience developers have a different definition of done then non developers so having both QA and even some user acceptance testing goes a long way.

<comment><USER11> Also this article is a year old. Can we get a title change? and maybe someone from ZenPayroll can chime in how their process has changed, if it has?

</comment></comment><comment><USER19> And THIS is how you write a job posting. Explaining the setup and perhaps some of the culture lets potential candidates know right away if that's an environment matching their style. (And it doubles as an interesting article too.)

Disclaimer: satisfied ZenPayroll user here.

</comment><comment><USER20> This is the first time I've ever seen a write up of a development/deployment process that makes any sense. Good on ZenPayroll for having their fundamentals straight.

</comment><comment><USER21> This was an infomercial in the form of a blog... dissapointing

</comment><comment><USER22> > The name of this test server is Leeroy, who does all this with the help of > Jenkins.

</comment><comment><USER23> No usability testing?

<comment><USER24> Presumably this happens at the spec stage. At least it's implied.

</comment></comment><comment><USER25> Error 1008 for me.</comment>


Blog of current ISS astronaut - <AUTHOR> http://wiki.nasa.gov/cm/newui/blog/viewpostlist.jsp?blogname=letters

<comment><USER2> "The impact of humanity on Earth is humbling from orbit. Our greatest cities appear to the bare eye as minor gray smudges on the edges of continents—they could be the fingerprints of Atlas, from the last time he handled the globe. They are hardly distinguishable from volcanic ash flow or other geologic features. If you didn't know it was a city, it would be difficult to conclude it was the result of human design. Under the scrutiny of the telephoto lens, things appear different. Like ants moving crumbs of dirt, we are slowly changing our world. You realize that Earth will do just fine, with or without us. We are wedded to this planet, for better or for worse, until mass extinction do us part."

This is profound to me. Human design is powerful, especially when amplified with our ability to create and use tools. We use our tools to make games and another photo sharing app. How can we use these same CPUs and resources to design a better world that we are wedded to?

<comment><USER3> Not a call to be irresponsible, but guy does have a point: <http://www.youtube.com/watch?v=eScDfYzMEEw>

</comment></comment><comment><USER4> The photo associated with the "The World Through a Looking Glass" post contradicts the theme of the "The impact of humanity on Earth is humbling from orbit." paragraph. Also it's a bit of a downer to read something like "We are wedded to this planet, for better or for worse, until mass extinction do us part." from an astronaut. I would have hoped for a more Extropian outlook. Does he honestly not think that there's any hope of humanity expanding beyond the Earth and surviving? If so, that's a shame.

</comment><comment><USER5> What a great read.

I've been fascinated with ISS since learning about TWISST. If you follow @twisst on on Twitter and your location is in your profile, you'll be sent a tweet with where ISS will show up next in your area. It's been fun to take the family outside and look at the space station as it goes by.

I am a little jealous, though. I want to go for a ride.

</comment><comment><USER6> Incredibly interesting read. Great writing style. Perfectly captures the essence of our world and our place in it. I could read this all day long. Thanks for sharing!

</comment><comment><USER7> incredible blog. guy really can write well. are there any similar blogs from astronauts or is this the only one?

<comment><USER8> André Kuipers is also blogging from the ISS: <http://blogs.esa.int/andre- kuipers/?lang=en>

His Flickr stream also has some great pics: <http://www.flickr.com/photos/astro_andre/>

</comment></comment><comment><USER9> OT: RSS feed link hidden behind javascript and no autodisco? Uff.

</comment><comment><USER10> Fantastic!</comment>


Archiving C64 Tapes Correctly - <AUTHOR> https://www.pagetable.com/?p=1002 <comment><USER2> In the early 1980s, I had a [https://en.wikipedia.org/wiki/TRS-80_Color_Computer](https://en.wikipedia.org/wiki/TRS-80_Color_Computer) For storage, unlike the C64, the CoCo used normal, consumer level cassette machines, with their associated cassettes.

I was quite busy with that system, and ended up building a library of several dozen tapes, containing off the shelf software, but mostly software and data that I'd created and saved.

The problem I had was tape reliability. At the time, I estimated that each tape had about a 2-3% chance of becoming corrupt _per day_. Having more time than sense, I ended up going forward with an intensive, structured tape backup/duplication scheme, not unlike tape backup rotations I'd end up administering professionally some years later.

With the gear that I had, a tape duplication took 30-40 minutes, so this was a time consuming process, but it worked.

Why did my tapes go bad so frequently? In retrospect, there were two factors:

1\. There was a high voltage step down transformer on a power pole about 20 feet from my room. I remember as a child that this transformer had problems at least a couple of times. In one case, it spectacularly sprayed sparks down on our back yard, and the electric company came out and messed with it multiple times besides.

2\. In the other direction, our neighbor had a very tall CB antenna. Probably 30 feet or more, and the base of this thing was only 60 or so feet from my room. We know that he transmitted on illegal frequencies. (We sometimes heard _his voice_ on our TV, I'm totally not kidding.) It would not surprise me if he was using illegal power levels too.

Good times.

<comment><USER3> _unlike the C64, the CoCo used normal, consumer level cassette machines_

 _The problem I had was tape reliability_

And now you know why the C=64 didn't use consumer tape recorders.

Ordinary tape recorder speed and volume of recording can vary from machine to machine. The 64's datasette was more strictly engineered, for compatibility between systems.

It's why on CP/M machines, you _could_ hook up a generic tape recorder to record your programs, or you could spend extra money for a "data" cassette recorder, which helped improve reliability.

(The C=64 part is according to what I've read. I never had a datasette for it. I was one of the fortunate who started out right with a 1541.)

<comment><USER4> Also longer tapes could be affected more by stretching.

For computers they sold cassettes in short lengths such as 15-minutes.

The Datasette had a digital interface to the computer. This and the known calibration went a long way to help it.

</comment></comment></comment><comment><USER5> Can anyone recommend decent method of decoding such signal? Here is description[1], it uses variant of frequency-shift keying (continuous phase FSK?).

According to Wikipedia[2], which cites service manual[3], actual hardware just clips this signal, and (probably) software on C64 just detects zero crossing, using CPU clock for sampling. Are there better approaches, more tolerant to noise and inconsistent tape speed? Maybe using matched filters? Almost everything that I found was about radio which does not have problem of "changing speed of time": you have to correct drifting phase, but not frequency. I know only basics of DSP.

I'm interested primarily in ZX Spectrum, not Commodore 64, but it has almost the same modulation/encoding. It uses regular tape recorder, input port with two levels (above zero and below zero), no dedicated clock for sampling, and software decoding. Routine in ROM finds zero crossings and measures time of pulses. I think it's possible to do better with modern computers, and achieve better noise and tape speed tolerance.

[1] [http://wav-prg.sourceforge.net/tape.html](http://wav- prg.sourceforge.net/tape.html)

[2] [https://en.wikipedia.org/wiki/Commodore_Datasette#Physical_c...](https://en.wikipedia.org/wiki/Commodore_Datasette#Physical_coding)

[3] ftp://www.zimmers.net/pub/cbm/schematics/datassette/C2N-1530-1531_Service_Manual_Preliminary_314002-002_(1984_Oct).pdf

<comment><USER6> For Spectrum, at least as far as ROM loader is concerned, decoding the signal is basically the matter of deciding whether a pulse is length t0 or t1. Technically it's FSK, but since each symbol is only one period long, it's more convenient to talk about pulse lengths. I don't think traditional matched filters are any help here.

With a modern computer you could record lengths for all impulses present in the signal and then find a threshold that best divides the two groups. You could then do probabilistic decoding. E.g. if checksum doesn't match, try flipping the bits that are closest to the threshold and are most likely to have been decoded incorrectly.

<comment><USER5> But maybe such "binarization" throws out information which might be useful? ZX Spectrum generates rectangular signal, after writing to tape and reading back, it becomes heavily low-pass filtered. So, I thought, if we take typical tape frequency response, pass ~1KHz and ~2KHz rectangle pulses through it, we get typical "0" and "1" signals as passed through tape, and if we cross-correlate them with tape signal, maybe we can achieve better results than by zero crossing detection?

Also, what I felt unattractive in binarization/zero-crossing is that you should do band pass filtering anyways to fix DC offset and ripples that can affect zero crossings: [https://imgur.com/ys78f1M](https://imgur.com/ys78f1M). So, maybe if single filter is used for both frequencies of "marks" and "spaces", then we are doing it wrong and filters matched to marks and spaces could do it better? As alternative to filtering we can use adaptive binarization threshold and then morphology on binarized signal (AFAIK, this approach is popular in detecting various barcodes on photos).

</comment></comment></comment><comment><USER7> A key method I've learned through various sources for ensuring good conversion from WAV to TAP is to invert the whole waveform in Audacity through Effects -> Invert before the actual conversion process.

I can also recommend the command line tool UberCassette for easy conversion: [http://www.retroreview.com/iang/UberCassette/](http://www.retroreview.com/iang/UberCassette/)

<comment><USER8> Huh, that's weird! How does inverting a waveform affect the process?

<comment><USER7> According to post #5 in this Lemon 64 thread[1], sound cards or TV amplifiers may invert signals from tape. I have actually just tried it when running recorded tapes in emulators but it has proved useful in cases when non- inverted tapes have failed to load.

[1] [https://www.lemon64.com/forum/viewtopic.php?t=45206](https://www.lemon64.com/forum/viewtopic.php?t=45206)

</comment></comment></comment><comment><USER9> If one was able to collect, say, a couple dozen tapes of the same game or magazine supplement, and the tapes all had different bits lost, would it be possible to recreate the tape with the WAV representations?

May be a way to find a bunch of different tapes on ebay, and recreate old classics.

EDIT: this is actually performed later in the article, whoops, I should have read the whole thing before commenting.

<comment><USER10> That's what I was thinking as well; I wonder if it would be as simple as recording all of them, aligning them in Audacity and playing back the resultant mix? Any dropouts on one tape would be largely overruled by the (strong) signal from all the good tapes?

<comment><USER11> Aligning them is non-trivial because of "wow and flutter" caused by variation of the tape speed. Even if your tape player has perfectly stable tape speed the original recorder wouldn't have had it. Maybe you could calculate some inverse-wow-and-flutter distortion that minimizes the difference between the tracks.

</comment></comment></comment><comment><USER12> I wonder if they ever tried duplicating a bad tape on a higher end audio double cassete deck, to a brand new tape.

It sounds like most of the devices used in the article would have low end quality motors, heads, etc. Such that a (still glitchy) copy on a new tape might read better.

I suppose it's possible the important bits of a high end cassete player aren't any better. Audiophile equipment is sometimes funny that way.

Edit: Found the full service manual for the Commodore 1530/1531 Datasette: ftp://www.zimmers.net/pub/cbm/schematics/datassette/C2N-1530-1531_Service_Manual_Preliminary_314002-002_(1984_Oct).pdf (hrm, guess HN doesn't linkify ftp:// urls?)

<comment><USER13> I suspect that the magnetic bits of the tape delaminated.

</comment></comment><comment><USER14> As a kid I sometimes played our PET tapes through a tape recorder to listen to the data.

At the time I wondered if data could be written to the tape to play a particular song. Anyone else wonder this and actually try it?

<comment><USER15> There was a "Waz" hack back in the day that did the opposite - it read the audio off the cassette and somehow replayed it from the SID ...

Otherwise the closest thing I can think of is Aphex Twin's windowlicker where a particular sound in the song displays Richard D James face in a spectrum analyser ...

<comment><USER16> The super-simple approach to this is to set up the sid and then flick the volume from min to max and back for every 1 read from the tape input in a tight loop. You can probably do many much better variations of this, but that's enough to get recognisable music out.

</comment></comment></comment><comment><USER17> I don't have tapes but more than 100 old floppies. I still have the original 1541 II the disks were written with. I'm willing to throw some money at the task but can't spend more than a day or two for this. Any tips for a realistic plan to save my floppies?

<comment><USER16> c64.com and other archive sites often take donations of floppies and will try to make images of them and return copies of the data in return for being able to keep any non-personal/private data.

But if you have the original drive you might want to try to copy it off first rather than risk mailing it off anywhere. There are multiple options for that including the 1541 Ultimate II (1) if you have a C64 to do the actual copying (as far as I understand anyway), and USB adapters for the 1541 called XU1541(2) and XUM1541/ZoomFloppy (3). The USB adapters might be your easiest option; the ZoomFloppy is listed at $35 (note: I have _not_ dealt with this company, so can not guarantee they're reliable).

If you do image it, I'd strongly recommend you submit any non-private content to one or more of the archives - there's still plenty of stuff floating around that's not archived anywhere.

(1) [https://en.wikipedia.org/wiki/1541_Ultimate](https://en.wikipedia.org/wiki/1541_Ultimate)

(2) [https://spiro.trikaliotis.net/xu1541](https://spiro.trikaliotis.net/xu1541)

(3) [http://www.go4retro.com/products/zoomfloppy/](http://www.go4retro.com/products/zoomfloppy/) and [http://www.root.org/~nate/c64/xum1541/](http://www.root.org/~nate/c64/xum1541/)

<comment><USER18> I can confirm that the 1541 Ultimate II works very well. I got my floppies copied directly to a USB stick, with no problems.

[http://1541ultimate.net](http://1541ultimate.net) [https://ultimate64.com](https://ultimate64.com)

</comment></comment></comment><comment><USER19> Don't throw away the old unreadable tapes, I'm sure they can be read other ways. Long ago I built an interface to the 1531 to allow tape duplication via my external Aiwa tape deck. I tapped the signal somewhere near the output of the device, sent it through some TTL gates to make its shape more squarish, then it went through a voltage divider into the deck input. Results were astonishing: I didn't have any tool at hand to condition the signal, but merely making it more loud and clean did wonders; no more hours spent adjusting the head azimuth. To be clear, a cassette which required adjustment could turn into a perfectly readable copy if recorded _without_ adjusting the azimuth. In other words the problem wasn't the azimuth but low signal level (which is _also_ a product of bad head alignment).

Now back to those old cassettes. If saving them from one device to another or sampling and filtering them doesn't work, it may just be the poor 1531 that cannot cope with a signal too much dirty because it lacks the brains to recognize it, but our eyes could indeed spot the problem. No kidding, In the old days I spent hours for every single music track cleaning them from vinyl scratches by zooming the waveform in Cool Edit Pro until I could see every single sample. Scratches became clearly visible for having a very different shape, often a few samples at a level not compatible with normal music. With time I learnt to spot them even more easily, and after finding them and verifying that they were actual scratches, I spent even hours for a single track cleaning them by reshaping the waveform, by hand, one sample at a time. The reason behind this was Cool Edit's vinyl cleaning algorithm which at the time sounded like garbage.

Cleaning digital data should be much easier: one can load the waveform into an editor then zoom it until the signal becomes visible. It doesn't have to be readable by a 35 years old 1531, but merely recognizable by a human. Then either correct it manually (slow!), or write some macros to put x 1 or 0 samples where the mouse is according to a keypress. Then one can scroll the wave to a point where it starts an unknown bit; we know both data speed and carriers speed, therefore we know how many samples a bit is made of, this way when an unknown bit is met we know what to search for and based on this interpretation press a key which turns that series of unreadable samples into a nice 0 or 1 of the right duration and frequency. Still slow, but doable.

Analyzing the waveform at single sample level would also make possible to correct wow and flutter: again, we know the carriers frequencies and tape speed, so we know for sure how much long a bit must be and apply corrections where necessary.

Also, it might be interesting to sample all tracks at the same time into a multitrack file just like the cassette was a single side media. The reason being if the tape got damaged at a point, we can analyze the other track as well (yes, it's reversed but we're aware) to see if recovering one of them can help to save the other one too just by comparing a probably very similar damage done to two signals, one of which hopefully is easier to recover.</comment>


Sans Forgetica: a font designed help you to better remember your study notes - <AUTHOR> http://sansforgetica.rmit/ <comment><USER2> Anyone know what the licence is?</comment>


Ask HN: Finding Unique Internships for Young College Engineers - <AUTHOR>

I am a longtime reader/browser of HN but never had "real" content worth contributing until now. Please bear with me if this seems somewhat scatter-brained and vague.
About me:
I am going into my second year for Electrical/Computer Engineering at an Ivy League school (for better or worse). I am a varsity athlete at the school and am constantly attempting to balance academics with athletics.
I have dabbled with Objective-C, C, RoR, and a couple other languages/frameworks. I understand my way around them beyond the basics, but am far from being competent enough to feel confident promoting them as current skills.
The dilemma:
Having attended school for only one year, I am yet to learn the "meat" of engineering concepts. My first year was filled with traditional introductory courses and requirements. That being said, I thoroughly enjoyed my CS course and introduction to engineering lessons. At my school, I am an average student. I pay my dues and study hard. I do enjoy learning here and would not be willing to give up my current situation.
Basically, I want to gain experience in "real-life". This summer, after months of searching, I am working for a small-ish health start-up in Boston. While my official title is iPhone Development Intern, I mainly serve as a translation layer between the product manager/s and contracted development agencies. I've had plenty of time to play with my own code but probably will not have a product to call my own at the end of the internship when I go back to school in late August.
Next summer:
Basically, I am looking for a unique internship next summer ANYWHERE in the US where I can truly learn awesome skills and be able to contribute to something. I would love to relocate for next summer.
I am looking for any suggestions, tips, tricks, or anything else to get me on this path. Where can I look beyond the obvious resources? Career fairs at my school are nightmares. I can wait in line with dozens upon dozens of older classmates possessing 4.0+ GPAs just to have my 3-5 minutes to talk with a recruiter who can't wait to get on her lunch break.
I know I do not have a lot of experience. I am willing to learn new skills in pursuit of experience. I am understand I cannot be the only one in this situation. Where should I begin? Thank you for reading this!
GIST: Young engineering student looking for suggestions or tips on finding a really cool internship next summer to gain "real-life" knowledge.
EDIT: My email is firstname.lastname@example.com -- kind of defeats the purpose of my attempted school anonymity (although I am not hard to track down based on my username). <comment><USER2> You should leave a way to contact you in your HN profile. Some HNers might be interested in hiring you.

<comment><AUTHOR> Thanks, I added my email.</comment></comment>


Scripting C with Python - <AUTHOR> http://www.suttoncourtenay.org.uk/duncan/accu/ScriptingC.html

<comment><USER2> If you're trying to script a C application, Lua is also worth a look. It's similar to Python (with more Scheme influence: coroutines, _real_ lambdas, fully lexical scoping, no GIL), but its design favors being small and easy to embed over "batteries included" (since if you're scripting a C project, you probably already have the libraries you need).

<comment><USER3> Indeed. Lua also offers a tremendously flexible method of setting up sandboxes or restricted/unusual function environments.

</comment></comment><comment><USER4> It's really easy to use CTypes, with DLLs exporting regular C functions (as described in the article). That's a very straightforward way to get some quick Python-to-C when you need it.

</comment><comment><USER5> dated.

also, now there's cython, which is a more advanced variation of pyrex.

edit: okay, that link was useless. sorry for that.

cython and pyrex are trying to be mostly source-compatible, but cython often includes features faster.</comment>


Tumblr down, and the Web goes mad - <AUTHOR> http://tech.blorge.com/Structure:%20/2010/12/06/tumblr-down-and-the-web-goes-mad/ <comment><USER2> It appears to be back up. <http://www.tumblr.com/></comment>


Facebook's internal rulebook on sex, terrorism and violence - <AUTHOR> https://www.theguardian.com/news/2017/may/21/revealed-facebook-internal-rulebook-sex-terrorism-violence <comment><USER2> I hope the take-away that comes out of the leaked documents is this: community moderation is _very, very hard_. It's not just a simple cut-and-dry "free speech vs censorship" issue. There's an enormous amount of nuance involved to sustain a community that won't just devolve into a toxic waste dump that's poison for 99% of the people there.

In my experience working with startups, many of them don't treat their content moderation team well, or it tends to be an afterthought. In reality, this can be the hardest and most important job at a company. PTSD is a real problem with these teams, and pay is often sub-par. And when they make mistakes (or when they don't but people still get mad), they tend to get the bulk of the criticism from it. And then at the end, they usually aren't allowed to talk publicly about any of the work they do.

Please take your content moderation department seriously. If you have one, read through the crap Facebook's team has to deal with on a daily basis, and then go over and hug them.

<comment><USER3> > _There 's an enormous amount of nuance involved to sustain a community that > won't just devolve into a toxic waste dump that's poison for 99% of the > people there._

Is it? I always admired the much-scoffed YouTube as the free-est place to talk on the internet. Where a vegan gay liberal from NY can discuss on the same video with a neo-con Mongolian and a 15-year old hipster from Sweden, an Israeli Jew, an Arab, and a black South African truck driver, and even agree and share experiences, and at worse you just get a few insults thrown and that's it.

<comment><USER4> I find Reddit a lot better for that kind of conversation (excepting certain subs like /r/the_donald, /r/resist, /r/worldnews, /r/politics and certain others).

/r/AskReddit is one of the best places to have such free and open conversations and the best thing is that you get to set the topic for the conversation instead of some arbitrary video remotely related to what you want to talk about.

<comment><USER3> > _and the best thing is that you get to set the topic for the conversation > instead of some arbitrary video remotely related to what you want to talk > about._

That's a good point (allowing for deeper discussion), but in YouTube I also like how the image/video transcends borders and politics etc in a way that targeted discussion doesn't.

(You can be anything, black, KKK, hipster barrista, 40yo soccer mon, Jew, Arab, donald-fan, etc, but still like/dislike the same cat clip, or old bluegrass song, or belly dancing or whatever).

</comment></comment></comment></comment><comment><USER5> My first thought on reading this makes me deeply empathize with the people that have to deal with these questions. It must be extremely draining and emotionally difficult work, probably traumatic. Just having to write a policy about what constitutes acceptable nudity in the context of the Holocaust by itself is pretty terrible. And yet it's important for people to see those images. Just like the controversy over the image of the naked Vietnamese girl running down a road with napalm burns. That too is an important image. But to allow that image, someone has to look at these kinds of images and decide what's ok and what's not. I can't even imagine all the disturbing shit one has to look at to come up with those rules (which will be imperfect).

I can't imagine that there are many other single entities that have to deal with the ugliness of humanity at the scale of FB.

The sheer volume of content is unlike anything else humans have ever seen before. By comparison news outlets like the Guardian have the luxury to struggle with these kinds of questions on a 1-off basis.

Given all that I have to wonder how government regulations would make this better?

<comment><USER6> > Given all that I have to wonder how government regulations would make this > better?

No no, that would impact free speech.

You want all large user content-handling companies to be able to tell users wanting to talk about X to go somewhere else, and it then has to be legal for those users to make that somewhere else themselves. There's enough idiots screaming about free speech on private platforms already, we don't want more of them.

</comment></comment><comment><USER7> > Anyone with more than 100,000 followers on a social media platform is > designated as a public figure – which denies them the full protections given > to private individuals.

100k followers is a curiously high threshold to be labeled as a public figure. I'd wager many people who are notable enough to have Wikipedia pages would not be able to hit that threshold even on Twitter.

<comment><USER8> What is the downside of having a high threshold for _removing_ protections?

<comment><USER9> Well, that is because by adding protections to a person, you are removing free speech rights from someone else.

<comment><USER10> The right to free speech does not imply a right to be heard (read, viewed, etc), by groups or individuals. If you spout things onto Social Netowrk, Inc's platform from which Social Network, Inc has decided to protect me, a private individual, they have not infringed your right to freely spout those things.

Notwithstanding the fact that it's Social Network, Inc's platform (and thus property) and you have no free speech rights on someone else's platform. Your right to free speech means the government cannot unduly curtail your speech.

</comment></comment></comment></comment><comment><USER11> Why is there so much emphasis on the credibility of the threat? Why not just blanket remove all explicit threats? Establishing credibility is impossibly hard.

<comment><USER12> Most (≈99.99%?) death threats aren't at all serious.

<comment><USER11> Every death threat is serious. Not many result in death, but that's not how we define serious is it?

More importantly, I can't come up with a reasonable argument that it's ever constructive to the conversation to be allowed to threaten someone.

<comment><USER13> Where I live "I'll kill you" is a common way to express dissatisfaction with someone's actions and while explicit, it's neither serious nor credible. I'm sure facebook is full of such posts.

</comment></comment></comment></comment><comment><USER14> This is the type of thing that can really benefit from public disclosure and discourse. What's "acceptable" varies so much by person and over time that having the censoring done in a black box will never be the answer.

The guidelines in the article seem overall reasonable given the range of possibilities versus the number of people working on it. I hope this stays out of the reach of government as long as possible.

</comment><comment><USER15> There was a recent documentary I saw shared by a couple blogs about the moderators from Facebook,YouTube, etc and how they have to deal with depression now because of the job.

Full documentary is free to watch by the creators themselves [https://vimeo.com/213152344](https://vimeo.com/213152344)

</comment><comment> chroem- It's interesting that they have specific provisions for Zionism.

<comment><USER16> [https://www.theguardian.com/news/2017/may/21/revealed- facebo...](https://www.theguardian.com/news/2017/may/21/revealed-facebook- internal-rulebook-sex-terrorism-violence#img-2)

What does it even mean? What are the red and green marks?

What's even weirder to me is that they don't touch upon more examples. It's just so incredibly arbitrary that it can be used to easily cover up anything with zero consequences.

<comment><USER17> From the article:

 _A tick means something can stay on the site; a cross means it should be deleted._

</comment></comment></comment><comment><USER18> Are the original files out there for people to go through themselves? Or do we only have what the Guardian will show us?

<comment><USER19> I doubt documents like that would ever be published willingly.

If those documents were public, that (in my opinion) would just enable bullies etc., as they would know exactly what they could get away with. That would then trigger tightening the rules, which would then trigger much complaining about Facebook suppressing free speech etc..

There are also the motivations of whomever wants this out there. Some people may only want the debate, but some want it out there so as to enable the bullies. And others just want the fame and fortune of being the one who published it.

Honestly, this all sucks.

</comment></comment><comment><USER20> Parts of this read like a mundane description of minority report.

</comment><comment><USER21> As I have said many times, violence is considered more tolerable than sex. Guess what you're gonna get more of. And yet there is no mechanism to decide who has input into FB's community standards.

</comment><comment><USER22> Do you have any legal citations about the right to be heard?

<comment><USER23> Are you asking for proof that a speaker has a right to force other people to listen to their argument?

<comment><USER10> I read it as requesting exactly the opposite.

</comment></comment></comment><comment><USER24> I'm more surprised that they haven't moved to Machine Learning yet.

<comment><USER25> The cult around ML here is pretty amusing. As another poster said, AI is currently staggeringly bad at this task, and I'm not sure it's going to be good enough in the near future either.

<comment><USER2> I think ML could be used to flag certain content as potentially problematic (I'm hoping to experiment with this in the future), but yeah, it's definitely not going to be doing the final verdicts anytime soon.</comment></comment></comment>


Samsung could have bought Android - <AUTHOR> http://hacksandstuff.com/android/samsung-could-have-bought-android-but-didnt_1234223.html

<comment><USER2> I think not buying Android was a really good decision for Samsung. I don't think they would have been as good for Android as Google was, and a bad Android would not have been much use to Samsung.</comment>


Am I doing open source right? - <AUTHOR> I'm a member of an open source project. I tend to issues, answer questions, do house keeping, review some PRs, such and such. But I feel out of place because although I tend to the matters of the repo, I don't really know how the internals work, therefore I could not contribute the most essential part of it all: code.
Other developers in the project are having these cool discussions about implementation in the issue tracker, but I have no idea what they are talking about. They talk about all these buzzwordy things like virtual DOM, view models, and all those things.
Every time I try going on a safari, the parser piece is enough to scare me away. I also tried to implement a minimal version of the framework just to get the basics. But whenever I look back at the project for reference, it feels like I'm rewriting years of debugging and work.
I know how to use the framework, I use it regularly. I can explain to others how to use it, why use it. I just can't wrap my head around the implementation. I feel like I'm not at the same level as the other members of the project.
Am I doing open source right? <comment><USER3> Few people highlight this, but people doing stuff like documentation and support are hugely valuable... and often, completely missing... from open source projects. Open source projects have a high tendency to be seen as difficult to get involved with or difficult to use, because support may be limited or non-existent.

If you're helping people on issues or giving feedback on PRs, I'd absolutely argue you're a valuable member of that project's community, and perhaps key to the continued success and growth of that project.

</comment><comment><USER4> Non-code contributions are super valuable. They're not "doing open source wrong".

But rebuilding it from the ground up is rarely the best way to try to understand a codebase. You're both biting off more than you can chew and at the same time requiring yourself to build code for concepts you don't yet fully understand.

If you want to get deeper into the code, ask your fellow maintainers to help you do it slowly.

Ask them to assign you a few easy changes - just as you'd do when learning a new codebase for a new job. You can start with something as simple as tweaking copy in a hard-coded string, and move up from there.

With specific tasks you also have a defined learning curve for picking up bits and pieces of how it works, and an excuse for asking for explanations.

Another thing to try might be to start reading the commit history of the codebase from commit zero. However, that's a LOT of code to read, its usefulness (and tractability) depends on the original developers' commit habits, and you still won't have the conceptual guidance around why things were done a specific way.

</comment><comment><USER5> What you do is also very important, and it's normal that a project has people with different levels of skill and knowledge about the details in it. So no, you are not doing it wrong!

If you _want_ to get more into the details:

If you already do useful work for the project, you should be able to ask one of the devs more familiar with the internals for help/review. Try finding some "easy" issues in less scary parts of the code and work on those, then work your way up. Just because you don't understand all aspects enough doesn't mean you can't start working on some of them.

If you as someone quite familiar with the project has trouble getting started, that should be a sign that onboarding (e.g. high-level documentation of what happens internally) could be improved, and hopefully is something other devs support. Maybe you could write docs about what you learn and have it reviewed by them -> learning effect for you, better docs for the project.

<comment><USER6> > What you do is also very important, and it's normal that a project has > people with different levels of skill and knowledge about the details in it. > So no, you are not doing it wrong!

Companies need product owners, project managers, testers, support staff, technical authors and many other non-coding roles (roles not mapped 1-1 with people: a coder can where these hats too). So I suggest open source projects need this too and the OP's role is quite valuable. It can be useful also to have someone say ELI5 to make sure the coders can justify those funky changes!

</comment></comment><comment><USER7> Yes. You seem to be bringing very valuable contributions that few developers are able to dedicate time to.

On the other hand, you also seem to be wanting to explore more depths in software development.

A parser should not scare any programmer, parser theory is well developed and well known. There are a lot of books, and online-lectures to learn about parsing, so you may learn about it and become able to modify or debug the parser or the parsed language.

Just use a search engine to find lectures about scanning (lexical analysers), parsing (syntactic analysers), and compilation in general, since it's usually in the context of compilers that parsing algorithms are studied.

Now the point here may be that for each component of your software, you may have to learn one more technique or one more theory to understand it and be able to contribute to it in a meaningful way. That's how it is: programmers keep learning all the time, we're not finished when we get our diploma, it's only the start.

</comment><comment><USER8> I'll reiterate like almost everyone - I think you're doing extremely important work.

The bigger question is - is it what you _want_ to do? You might be really good at what you do right now, but you may actually want to code - for various reasons that are yours.

If that's what you want, I'd first suggest - don't try to take it all at once. It's a hard task even for experienced developers. From the top of my head - <USER2> good way to get in might be writing tests. Maybe you could partner with a current developer to write tests for him and that way get a glimpse into a specific module.

If you're not into actually writing code, I'd try to understand why you feel you're not at the same level. If it's because of other people's attitudes, well, that's not good!

</comment><comment><USER9> Sounds like you are doing a good and important job. Personally I would like to get myself into projects, both to help open source and learn more.

What project is this and how does one start helping?

</comment><comment><USER10> Yes, many projects would kill to have someone like you on their team.

</comment><comment><USER11> Like the others, you're definitely doing it right. The work you describe is critical to a well-functioning project, and not everyone has to provide code or understand it to provide to a project.

====

If you want to understand the code, something I've taken to recently is to perform a dissection of a project. Obviously, large projects make this _very_ difficult, but if it can be broken down into component parts then it becomes more manageable.

Let's say I want to understand a C project. I'll take the code, verbatim, and put it into a literate code system (I use org mode in emacs, there are others that will do this like the Leo editor but I have less experience with them):

      * foo.c
      #+BEGIN_SRC c :tangle foo.c
        /* Often the license and other basic comments
        */
        #include<stdio.h>
        void function1(void);
        void function2(void);
        int var1;
        int var2;
        void function1(void) {
          ...
        }
        void function2(void) {
          ...
        }
      #+END_SRC

I then tear it apart:

      * foo.c
      #+BEGIN_SRC c :tangle foo.c :noweb yes
        <<comments>>
        <<includes>>
        <<function-declarations>>
        <<variable-declarations>>
        <<function-definitions>>
      #+END_SRC
      ** Comments
      #+NAME: comments
      #+BEGIN_SRC c
        /* comments from earlier */
      #+END_SRC
      ** Includes
      ** Function Declarations
      ** Variable Declarations
      ** Function Definitions
      #+NAME: function-definitions
      #+BEGIN_SRC c :noweb yes
        <<function1>>
        <<function2>>
      #+END_SRC
      *** function1: void->void
      Notes on what I've learned about this function, what it does and why.
      #+NAME: function1
      #+BEGIN_SRC c
        void function1 (void) {
          ...
        }
      #+END_SRC

I keep tearing things apart like this, and test that the whole system still builds (and passes what tests may be runnable on my system) when I tangle the code (C-c C-v t in emacs), which generates a file called foo.c. Another option is to do a diff between the generated file and the original, tell it to ignore whitespace with `diff -w` because you've probably messed up tabs/spaces or empty lines, but those shouldn't stop the program from compiling/executing correctly (be careful with languages like python, but even there it still works just pay more attention).

I keep going until I get to an absurd level of detail sometimes, but I understand what the code is. And by deliberately tearing it apart I learn a lot right there. Often the notes are unneeded for my personal understanding and only written to maintain the habit for those sections that I don't understand. And, being emacs and org-mode, I can insert links to specific lines of code, footnotes, external documentation, internal links, etc.

====

Writing about something (really, communicating with others about it, writing is just one exercise of this) is a great way to understand it.

      Project does X.

      Project does X by Y.

      Y depends on A, B, C. Specifically, A.f, A.g, all of B, and C.f.

      To use Project you do This.

      To test Project you do That.

As you add pieces to this document, you'll realize what's missing. Use a good editor that lets you mark sections as complete, incomplete, in-progress, need- work, etc. This will help you quickly discover what parts to add to and so on. You don't have to complete this, but it may be useful to your community if you can create a series of guides in this vein or get them started and get others to begin contributing to complete them. A developer's guide to the code (the dissection example). A contributor's guide to compilation/testing. And so on. The act of producing these will provide benefit to the project and improve your understanding, and comes from your current experience with contributing to the project.</comment>


Musk: Hyperloop Tunnel Is Now a Normal Tunnel – 'This Is Simple and Just Works' - <AUTHOR> https://jalopnik.com/elon-musk-says-hyperloop-tunnel-is-now-just-a-normal-1835024474 <comment><USER2> It seems to me that there were two technical details of TBC. One was "We can build a tunnel cheaply". That seems as far as I can see to have been entirely down to digging smaller tunnels- which doesn't seem like innovation to me, especially since some of the cost saved is by not building the escape tunnels that traditionally are built for safety not capacity. The second detail was "These tunnels will be fitted in a way that allows super-efficient transportation". That seems to have entirely disappeared.

I would really hope to see some evidence of their efficiency of digging tunnels being legitimately better than traditional methods now. Otherwise you've got to fear that this all ends in a dozen people dying in a tunnel because the safety precautions weren't sufficient.

<comment><USER3> The first benefit was directly as a result of the second. It was the hyperloop concept that afforded the option of a smaller diameter tunnel; switching to a more traditional transportation method would mean concessions all around if you want to still stick to the smaller diameter.

</comment></comment><comment><USER4> This will be a blessing to all, until someone runs out of gas in the tunnel. Then we will discover a new Musk-created hell.

</comment><comment><USER5> > To recap: Musk's company spent two years developing a very narrow car > tunnel. To anyone who ever believed Elon Musk's bullshit: you've been had.

TSLA investors take note.

<comment><USER6> Clearly different tunnel implementations are appropriate for different situations. If you're going from LA to Las Vegas you'll do it differently than if you need to go a dozen city blocks.

The practicality of the hyperloop has by now been demonstrated in various places. What's being demonstrated here is the entrance and exit technologies that go with the hyperloop.

SpaceX investors take note.

<comment><USER7> TBC is not building hyperloop. There is no vaccuum tunnel with maglev/air- cushion propulsion.

This is just a tunnel. Not even the planned sled from before. A tunnel for just Teslas.

</comment></comment></comment><comment><USER8> There is at least one real, operational tunnel with few side exits and electric car sleds: the Chunnel!

<comment><USER9> The channel tunnel actually are three tunnels: two train tunnels with a service tunnel in-between. The train tunnels are connected to the service tunnel at every 375m ([https://en.wikipedia.org/wiki/Channel_Tunnel#Tunnelling](https://en.wikipedia.org/wiki/Channel_Tunnel#Tunnelling))

So, there are no exits to the surface, but there are ways to get out of each of the tunnels.

I would guess this kind of construct would make Musk's design at least 50% more expensive per kilometer (in Musk's design, a service tunnel can't be less wide than the real ones. You could make a setup where tunnels can serve as service tunnels when needed, but even than, you need to build all those connections between the tunnels)

</comment></comment><comment><USER10> What? An entrepreneur shot for the moon but didn't make it on the first try?

Burn him at the stake for trying.

<comment><USER11> The ass on my armchair deserves everything it was promised(for nothing).

</comment></comment><comment><USER12> > This is simple and just works

Who is that guy and what has he done to Elon Musk?

</comment><comment><USER13> what would be the benefit to put a tesla on what's basically also a tesla? and the autopilot should be able to navigate the known narrow tunnel, no?

<comment><USER14> Having the car on a sled means no wear on the tyres. Furthermore the sled is specifically designed for the rails and acts as a guide for the car, which is more reliable than having the autopilot cruise through the tunnel with the danger of the user being able to disable the AP and blick the tunnel. The sled therefore makes the Tesla some sort of a bumper car without making any damage.

<comment><USER15> If it's a consumer's vehicle then the tunnel operator doesn't care about the tire wear and tear.</comment></comment></comment>


Proper use of English could get a virus past security  - <AUTHOR> http://www.newscientist.com/article/dn18211-proper-use-of-english-could-get-a-virus-past-security.html

<comment><USER2> I don't see how this is the huge problem they make it out to be. Since when do people execute strings of random English text. It also isn't clear that they did anything besides search texts for runs of valid machine code characters so where is the complex engineering here?

</comment><comment><USER3> The problem I have with this is it still seems to require a decoder to actually function properly. So, it becomes simple to just look for the decoder, you don't even care about the "payload"</comment>


Over 1,100 New Arcade Machines Added to the Internet Arcade - <AUTHOR> http://blog.archive.org/2018/09/21/over-1100-new-arcade-machines-added-to-the-internet-arcade/ <comment><USER2> Am I the only goofball that can't figure out how to play any of the games in the list? Went straight to Alcon to relive my youth and couldn't figure out what the keyboard controls were.

<comment><USER3> From the article: "In general, pressing the 5 key will insert coins, 1 and 2 will start 1 or 2 player games, and the arrow and spacebar keys will control the games themselves."

</comment></comment><comment><USER4> I love that Internet Archive is doing this, but I have no idea how this isn't running a foul of copyright laws.

<comment><USER5> The IA was officially designated as a library by the state of California in 2007.

[https://en.wikipedia.org/wiki/Internet_Archive](https://en.wikipedia.org/wiki/Internet_Archive)

I guess libraries might be excempt from certain parts of US copyright laws.

</comment></comment><comment><USER6> Is there a way to simplify gameplay by adding a Bluetooth gaming controller? Just asking if anyone try this or personally know?

Nelson</comment>


Modern JavaScript Explained for Dinosaurs - <AUTHOR> https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70 <comment><USER2> > The bad thing was that it was annoying to find and download new versions of > libraries every time they would update.

This goes back to one of the key complaints about front-end culture, though. Exactly how often should this be a problem? Seems to me that actual library code should be stable and updates would be on an infrequent basis.

One general response is "well, this is what happens when you don't have a solid/broad standard library," and that's one of the complaints about JS that kindof sticks for me, but if that were what this was all about, I might expect to see a handful of standard libraries pop up over time and stabilize instead of a fine-grained and deep transience-ridden dependency tree that requires a package manager...

<comment><USER3> > I might expect to see a handful of standard libraries pop up over time and > stabilize

What makes you think this hasn't happened? jQuery and underscore/lodash are some examples of libraries that have a lot of traction. Why is JS having package management seen as a downside? It's an upside in every other language community, but for some reason we should try to avoid using one in JavaScript?

<comment><USER2> underscore is a good counterpoint. jQuery is a great library, but I think it's arguably not what people mean when they talk about standard libraries, which has more to do with the question of why in the world there's a leftpad package.

> Why is JS having package management seen as a downside? It's an upside in > every other language community

FWIW I'd say that thinking of package management as an _unqualified_ upside in any language or environment is a mistake, though getting deep into that argument is not on my to-do list for the day, as convincing anybody who isn't naturally amenable to it would probably require going over the groundwork involved in groking JWZ's famous quote about regular expressions ("Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems.") and some philosophy about automation and the attention economy.

But package management is convenient for sure, and there's any number of situations in which I use it and am happy about it, particularly when I'm installing things where I'm primarily a user rather than a developer. The specific complaint about JS is based on the observation that the dependency tree seems to be fine-grained and transient in what seems like an unusual way to me. In that situation, I suspect the problems that come with any other pm system are likely magnified, including developer dependency on it, which moves from convenience towards necessity.

</comment></comment></comment><comment><USER4> I've been a huge fan of JavaScript since 2005. My roots are in Fortran, Pascal, C/C++, ASM, later Perl and Python and Java. JS is by far is the most convenient language I've ever worked with and thanks to BabelJS it is even better.

Yes JS is not perfect and it has a fair dose of inconsistencies but 99% of the time it just feels right and it works well. Also thanks to NPM the community is alive and healthy, surpassing the success of Perl's CPAN and Ruby's Gems and Java's Maven and what not.

If you haven't tried JS yet, you should!

EDIT:

P.S. I talked to HD Moore back in the days during the Metasploit rewrite why Ruby was chosen for the next iteration of Metasploit. The reason was that Ruby was so much closer to Perl then JS and I don't think Node was around. I wish I tried harder to make my case as it would have been a huge asset now.

<comment><USER5> My roots are the same as yours (except Java). I am not a professional developer, but rather code to simplify my work, so some projects or write as a hobby.

I like JS but one of the things which are horrendous is debugging. Pycharm allows me to debug Python code in a simple, intuitive way.

I still need to find a setup in JS where I can debug the same way (there is always something which does not work, between the IDE and Chrome and DevTools). This is really the ONE thing which is pushing me away from that otherwise nice language.

<comment><USER6> It seems a bit unfair to blame the language for the added complexity that is introduced when debugging a browser script. Pycharm (or any of the JetBrains IDEs with JS support) offer a very comparable debugging experience for server side Javascript.

<comment><USER5> Not being a professional, I tend to see a language through holistic glasses : the ease and versatility, the libraries, IDE support, debugging, etc.

I was mostly referring to front end JS, where I sometimes managé to debug in my IDE and sometimes not (and I then need to have DevTools open).

</comment></comment></comment></comment><comment><USER7> _The goal of this article is to provide a historical context of how JavaScript tools have evolved to what they are today in 2017._

...

 _We went from plain HTML and JS to using a package manager to automatically download 3rd party packages, a module bundler to create a single script file, a transpiler to use future JavaScript features, and a task runner to automate different parts of the build process._

 _Definitely a lot of moving pieces here, especially for beginners._

 _Modern JavaScript can definitely be frustrating to work with as it continues to change and evolve at a rapid pace._

 _But even though it may seem at times like re-inventing the wheel,..._

</comment><comment><USER8> All this build and packaging machinery makes sense if you're building something like a CAD system or a virtual world viewer that runs in the browser. But for the typical web site? It just runs up load times.

<comment><USER9> While I think that many websites don't need much JS in the first place, you pretty easily hit a degree of complexity where a package manager is very useful. And the whole build thing is in part precisely to keep load times down.

(That said, I'm a front-end dev who is leaning more and more towards good old back-end rendering and something like TurboLinks perhaps, for many situations where previously I'd automatically go for React or Vue.)

</comment></comment><comment><USER10> Preface: I am a dinosaur. I know I'm a dinosaur, with a tiny dinosaur brain.

But I couldn't help but wonder as I read this whether much of the complexity of the JS ecosystem isn't a consequence of the fact that whatever Node.js uses isn't _really_ javascript. It's apparently a fork of javascript that has includes and is intended to run natively.

Now, modern javascript packages _for the web_ also use includes because it's part of NPM and the Node ecosystem. And as a result, there _has_ to be a transpiling/build step to convert "Node" javascript to "frontend" javascript, or some other language to frontend javascript.

But, to me, includes shouldn't be part of the "code", because they aren't really part of the language - that should be separated to the packaging directives and handled entirely by the package manager. Javascript package management meant for the web would just pull in javascript, maybe minify it, and dump it into a file. No need for transpiling, building or webpacking.

Although I suppose you _could_ if you wanted to, but that should be the exception, not the norm. But, no. We have to have a million packages written in pseudo-js or typescript or coffeescript with a single function each and a separate test suite and build step for each.

I appreciate that the modern JS ecosystem works, and works well for many people, but... I still feel like it doesn't _need_ to be as complicated as it is. It could be much, much simpler and still be better than just pasting in script tags. Not that there's anything wrong with that. In the end, that's what happens anyway.

Sometimes the ways of the warmbloods confuse and infuriate me.

<comment><USER11> I'm the same kinda dinosaur, but I have to disagree with the following:

> Now, modern javascript packages for the web also use includes because it's > part of NPM and the Node ecosystem. And as a result, there has to be a > transpiling/build step to convert "Node" javascript to "frontend" > javascript, or some other language to frontend javascript.

At first, I would agree, but with ES2015+ the import system isn't too different or at least shares a lot with CommonJS.

Since that's the future of JS modularization, I think it's important to embrace it. However, there is one area where the TC39 committee, along with browser vendors/Node, really messed up is the releasing of the module system with so much undefined or all over the place.

For example, the lack of a bundling strategy. Every person I've talked to about this has just said "oh, http2 will take care of it". Really? Even if http2 supports multiple connections, there will either need to be multiple round-trips to the server for further dependencies (which, physics puts a limit on the speed that can happen at), or you need to calculate on the server and send over what's needed.

So I think these module bundlers are essentially doing that at build time (which sucks for runtime dynamic inclusion of resources).

Then there's the whole .mjs fiasco with Node.

Since committees are so often slow to update (for valid reasons, many times), and miss many valid use cases, I think the new world of frontend development will include some sort of tooling like this.

It should, God willing, start to simplify (maybe kind of like how npm scripts are becoming more preferred to gulp and the like).

</comment></comment><comment><USER12> This is a well written explanation of the different layers one will encounter when writing JS. It's a bit frustrating at first but once you get past the hill, it's very satisfying.

</comment><comment><USER13> The fact that you have to know a dozen major technologies just to make basic UI that breaks half of the time should make you feel awful as an engineer.

<comment><USER14> I see this quip a lot but never any honest side-by-side comparisons illuminating how much easier/simpler some other fullstack +crossplatform ecosystem is.

</comment></comment><comment><USER15> Very good synthesis ! Whatever everyone'd wanna say or think about JS, it's hard to be in web development and not ear the bells. Better know what you ear and what's'all about :)

I still have a tickle, you conclude with 3 so-called "modern features" from JS ... Both the 3 thing you quote come from Clojure and amazing work from google nerdz, and was ported to JS later :p

</comment><comment><USER16> my workflow is

npm to get the packages in VS2017 called from package-mgr console

gulp to move the package from node to wwwroot

system.js.config declares the packages

system.js to load the package

npm get the @types files (so typescript knows how to compile and I get autocomplete)

and then I do a typescript import

\--- real pain in the neck to setup but now its really not bad at all

<comment><USER17> VS Code will automatically pull type definitions from npmjs.org, so you get code highlighting and inline errors for free (not sure how much such automation is included in VS2017).

Many npm modules come with their own typings. Those which don't usually have them in the definitelytyped repo. For those 'npm install <foo> @types/<foo>' should be enough so that typescript can find both the code and corresponding type definitions.

The rest of your setup seems to be related how you build and bundle the files. I use webpack and a typescript loader, and there is literally nothing more that I have to do after installing the packages, I can just import (or require) them in my code.

</comment></comment><comment><USER18> This is actually really well written. I learned a few things about the history that I've always been wondering (CommonJS, etc)

</comment><comment><USER19> npm is so 2016 (being sarcastic).

<comment><USER18> What do you propose using instead?

<comment><USER19> yarn.

<comment><AUTHOR> Honest question: what advantages does it have over npm? As far as I see, the only cool feature is the license check.

</comment></comment></comment></comment><comment><USER20> JavaScript programming and more importantly JavaScript way of thinking is quickly becoming equivalent of company in need of hiring few good programmers and solving it by hiring more HR 'professionals' first.

Let's solve this pile by throwing more useless stuff on top of it.

Yes, I do have badge that says I can say stuff like that. You know I am right even if you can't agree in public. /rant

<comment><AUTHOR> What badge?

<comment><USER20> "Gentleman wearing this badge can speak freely and name things as they are", you know, usual.

<comment><AUTHOR> what

</comment></comment></comment></comment><comment><USER21> Most developer bros still think modern JS is Jquery but unnecessary. I've had "Senior" engineers ask why we need Webpack because it's too complicated and unnecessary and wanted to take it out. Others who think Angular is the same as Bootstrap which is a UI framework. And those who doesn't even know what ES6 is.</comment>