PostgreSQL Migration Tool - <AUTHOR> https://github.com/aphel-bilisim-hizmetleri/pg-migrator <comment><USER2> I have quite a lot of experience using migrations in Rails, and over time I've become just incredibly suspicious of "down migrations."

I have never once been in a situation where I needed to use one, and even if I did, I'd have some reason to hesitate. Let's say everyone on my team wrote one, and they even tested the "down then up" process to ensure it applied (on their machine), unlike the normal "up" migration, that migration code was probably only executed in a single environment with test data.

And even given those two ifs (1 - a down migration exists and 2 - it was tested anywhere), the darn things are still annoying and time consuming to write.

I would much rather write another "up" migration in the event that I needed to roll back a change. I guess that would be "rolling forward" a change.

All that said, my sphere of influence is pretty small. Has a down migration ever saved your skin? What am I not considering?

<comment><USER3> The only time I've had use for rolling back migrations is when I'm working on a feature/develop branch that have modified existing columns and need to switch back to the master branch to start work on a bug fix.

That could potentially be solved in other ways, though - such as keeping separate databases for different git branches, or making database snapshots. Both of those are manual work, though - apart from the upfront effort it takes to write the "down" migration, rolling back migrations seems like the path with least friction.

Unless you don't need any of the data in your database, or it's easily reproducible (database "seeders"), in which case you can just delete the entire database and start from scratch every time.

</comment></comment><comment><USER4> We have a similar migration tool we built a long time ago, and this project has a bug that we had to address.

When you have to branches that each have a migration, you end up with 2 copies of N_N+1.sql, or worse yet, things that subtly merge w/o error, meaning you have committed migrations that might not run. Or the conflict-resolution process cascades painfully as you "re-sequence" your migrations.

We ended up moving to a solution based on a manifest file; there is a single migrations.json that enumerates the exact order in which migrations must be applied. It causes merge conflicts whenever you have migrations that need their "application order" resolved, and it's fixable just by re-arraning the manifest; no file renaming required. It's been pretty robust so far.

<comment><USER5> I've had similar problems with FluentMigrator, even though it orders things nicely using an attribute on the migration class that has a long value representing the order things should run in.

I just use timestamps for when the migration was created, like 201509010034, and for the most part, things are great. Until we got a high priority ticket, and a migration with a later timestamp got pushed ahead of an earlier one, so it never gave us the option to migrate the earlier one.

Easy fix was just to update the timestamp of the earlier migration when it finally got through QA, since they weren't dependent on each other, but things could've gotten really messy, so I'm not 100% happy with the way migrations currently work.

<comment><USER4> And that's exactly the point of the migrations.json manifest; you'll get a merge conflict whenever this happens, and all you need to do is resolve the order of named migrations in a JSON array. It works really well!

</comment></comment></comment><comment><USER6> This looks comparable to Sequel and seems straightfoward enough. Still, when I need a full-featured tool, I prefer sqitch[1] - does what this does without requiring numbered migrations, treats database changes as commits (very similar to git), and includes the option of running tests to verify schema changes.

That said, this looks good for cases where you have a node project and want to keep your tooling on the same platform.

[1] [http://sqitch.org/](http://sqitch.org/)

<comment><USER3> There was a HN thread on sqitch just yesterday [1], and a lot of people seemed super frustrated with it. Not that this is necessarily any better, I don't have experience with either.

[1] [https://news.ycombinator.com/item?id=10145933](https://news.ycombinator.com/item?id=10145933)

</comment></comment><comment><AUTHOR> I've found sqitch to be a little heavy. It's basically recreating parts of git as tables. Would love to see a lightweight postgres tool that can keep track of a dag of migrations.

[1] [https://news.ycombinator.com/item?id=10145933](https://news.ycombinator.com/item?id=10145933)

<comment><USER6> It can be a bit cumbersome, though you also don't have to use all of its features to make decent use of it.

</comment></comment><comment><USER7> interesting, we've been using [http://flywaydb.org/](http://flywaydb.org/) for some time, how is it different to this?

</comment><comment><USER8> knex already has this. How different is this from knex?</comment>


Comic Strip Tour of the Wild World of Pandemic Modeling - <AUTHOR> https://fivethirtyeight.com/features/a-comic-strip-tour-of-the-wild-world-of-pandemic-modeling/ <comment><USER2> This is so unsatisfying, they are basically concluding that it's unknowable. Not even estimatable. That means there is no expertise. Then what's the point, of you existing? Give us our money back and go work at Walmart, experts. It boils my blood to see so much tax payer money spent on so little. We spent billions to be told its unknowable, and that we don't have enough masks. I wish my job had such little accontability and oversight. And zero consequence for naked unpreparedness. I understand that laypeople couldn't see this coming, but we paid a ton of money for experts, so surely the experts could see it coming. If not then we deserve a refund.

<comment><USER3> I suspect your sentiment is why so many people accept confident predictions from blowhards who don't actually know/care how complicated the real world is. Maybe it's more comforting to listen to people who pretend to have the answers, but it doesn't help for making good decisions.

Personally, I think the accountability and oversight should be applied to the asshats who say exaggerated things with certainty. Yet for some reason, those people get a pass because "they were using the best information at the time" etc... It's doubly frustrating when they say, "Yeah, it wasn't so bad because you listened to me".

<comment><USER4> You're both correct

</comment></comment></comment><comment><USER5> ". . . like a hoard of suburbanites descending on a grocery store's toilet paper aisle." Should be "horde" but somehow "hoard" works better here . . .</comment>


Ask HN: Thoughts on the Bay Area versus other locations? - <AUTHOR>

I know this has been discussed a lot in the past, and I'm not trying to beat a dead horse... but I'd like to get the input of people who have lived both in SF and other locations (assuming that you were involved with startups while in both locations). What are the advantages and disadvantages of both? I'm very seriously considering moving to SF from LA for better opportunities within the startup world.
Also, if you know of any good posts that discuss this topic, please share!
Many thanks! <comment><USER2> San Francisco & the Bay Area exist at the center of the Startup universe. It's just the way it is.

I have lived in San Francisco and now live in Chicago and run my own startup- but NorCal is definitely the best place on Earth to be. There are other great places- but IMO the best is still Northern California

<comment><AUTHOR> Why did you leave then? I'm always curious as to why some people move away from SF if they want to run a startup.

<comment><USER2> Oh for a variety of reasons- cost of living being one. Chicago is expensive- San Francisco is REALLY expensive. haha. Although East bay is affordable

<comment><USER2> Saying, "If SF is a better environment for startups the cost of living should be a small trade off" doesn't work.

Everything depends on your personal situation. If you are launching a startup, LAUNCH IT. You don't need to be in SF.

If you want to live where the center of the startup universe is, if you want to not be able to swing a dead cat around your head without hitting another entrepreneur, if you like it 60-65 degrees almost every day of the year, SF is the place for you.

You don't NEED to be in SF to launch a startup unless your service/product is narrowly defined as SF residents using it. Plenty of startups move to the Bay Area when they need funding- but...you can always visit and check it out yourself.

I'd say, launch your startup now. That is key- forward momentum.

<comment><AUTHOR> Completely agree about starting now... and I have. I'm on my second startup. No one should delay starting because of location alone.

<comment><USER2> right on- and good luck!

</comment></comment></comment></comment></comment></comment><comment><USER3> One big advantage is if you fall on your face you can get a job at Google or Twitter or some other smaller startup. I've found in other places if all goes wrong you're stuck trying to get a job as an IT administrator.

I really liked the weather in the Bay Area but most people I know from LA do not. I enjoyed going to Marin and Santa Cruz, and biking and skateboarding in San Francisco.

That said, I left. It's hard to explain exactly why I left. Although I loved SF, I always had a feeling of impending doom. The social dynamics were also weird to me.

<comment><AUTHOR> Good point about working for other companies. Just curious, where did you relocate to, and are you still involved with startups?

<comment><USER3> I worked in NYC for a couple years and now I just travel around and make iPhone apps for fun.

</comment></comment></comment><comment><USER2> When you say you are considering moving, "for better opportunities in the startup world," what opportunities? Are you looking for a job? Starting your own company?

<comment><AUTHOR> I'm speaking in terms of founding and growing a startup.

<comment><USER2> You can do that anywhere- do you need capital? Then yes, SF has more (and easier) sources to find for capital. But really if I were you I'd build the thing first- you can always move later if you have to.

The biggest thing about building a startup is GET STARTED :)</comment></comment></comment>


New inline assembly syntax available in Rust nightly - <AUTHOR> https://blog.rust-lang.org/inside-rust/2020/06/08/new-inline-asm.html <comment><USER2> I recommend reading the RFC. It explains pretty well how it works and it's readable even for people with only very minimal asm experience:

[https://github.com/Amanieu/rfcs/blob/inline- asm/text/0000-in...](https://github.com/Amanieu/rfcs/blob/inline- asm/text/0000-inline-asm.md)

</comment><comment><USER3> To be honest, I still like the explicit cobber syntax of rusty_asm.

Last year I had some fun getting a rust program to run on some old 386 DOS SBC I had hanging around. Was terrible in terms of code density (basically a bunch of 32 bit instructions prefixed with the "execute 32 bit op in real mode" prefix).

This was a wrapper around the DOS string print function (where s is a &str).

            rusty_asm! {
                let ptr: in("{dx}") = s.as_ptr();
                let len: in("{cx}") = s.len();
                clobber("ah");
                clobber("al");
                clobber("bx");
                asm("volatile", "intel") {
                    "mov ah, 0x40
                    xor bx, bx
                    int 21h"
                }
            }

<comment><USER4> In the new syntax, a direct translation of that would look something like this:

        asm!("
            mov ah, 0x40
            xor bx, bx
            int 21h
            ",
            in("dx") s.as_ptr(),
            in("cx") s.len(),
            out("ax") _,
            out("bx") _,
        )

However, I'd personally write that like this instead:

        asm!(
            "int 21h",
            inout("ax") 0x4000 => _,
            inout("bx") 0 => _,
            inout("cx") s.len() => _,
            inout("dx") s.as_ptr() => _,
        )

That lets the compiler handle filling in ax and bx, and also avoids trusting that the interrupt routine leaves ax/bx/cx/dx untouched. (I might also write clobbers for every other general-purpose register, too. Take a look at Linux arch/x86/boot/bioscall.S and the "Glove box" for BIOS calls, due to misbehaving BIOSes that clobber registers they shouldn't.)

<comment><USER5> I agree that passing `ax` and `bx` as inputs is better than setting them in the inline asm, but I don't like the idea of setting registers that shouldn't get changed as outputs "just in case".

<comment><USER4> It's not a theoretical consideration. It's quite common for BIOS and firmware code to clobber registers that it isn't supposed to; see the code I mentioned in the Linux kernel, which arose through real-world bugs that were incredibly hard to debug.

<comment><USER5> But where do you draw the line? What if it clobbers the stack pointer?

<comment><USER4> Then it won't be able to return at all, and people will notice more quickly.

</comment></comment></comment></comment></comment></comment><comment><USER6> Rust folks, thank you so much for making this far, far better than GCC's asm syntax for C. Also, thank you for using Intel x86 syntax instead of AT&T.

It would be delightful if GCC were to adopt something similar after this stabilizes in Rust.

<comment><USER4> > Also, thank you for using Intel x86 syntax instead of AT&T.

Thank you for helping to validate that decision; this is the kind of feedback we needed.

(And note that you can still choose to use AT&T syntax, it just isn't the default.)

<comment><USER7> Yes, thank you for the Intel syntax. It is by far the most frequent syntax you'll find anywhere somewhat recent (1990+) and it is by far the most straightforward to learn by being clean. I did learn both in the 90s, but I've always struggled with AT&T symbols and different offerings which to me was hard to switch to when learning from different material sources.

<comment><USER8> FWIW I mostly see AT&T when compiling against C codebases to a) avoid requiring a secondary assembler & wanting to support legacy binutils and b) because inline C is AT&T in practice, at least outside of windows (no clue what the c ecosystem is like there). However, most resources exploring "assembly" do so in a context where it makes sense to use intel syntax & work with a "dedicated" assembler.

That said, this is a good decision because C compilers seem to be the major holdouts at this point—binutils has had .intel_syntax for a long time now, it's just not supported inline.

<comment><USER9> > at least outside of windows (no clue what the c ecosystem is like there).

Microsoft's assembler uses Intel syntax, and their inline assembly also uses Intel syntax.

Their inline assembly is much less explicit about inputs, outputs, and clobbers, and "just" has you mix C symbols and labels with assembly instructions, which I imagine is a pain to get right.

However Microsoft has de-emphasized inline assembly and doesn't allow it on amd64 or ARM. For things that need specific instructions you need to either use intrinsics or put assembly in a different object file.

<comment><USER10> > However Microsoft has de-emphasized inline assembly and doesn't allow it on > amd64 or ARM.

That's just sad :(

<comment><USER9> I suspect if they had a situation like GCC where the programmer had to annotate the side effects of every assembly snippet, it would have been easier for them to add it elsewhere.

But the way they had it, they presented a seamless blend of assembly instructions and any C identifier, in or out, and I guess the compiler would need to parse out any side effects and cope with them. My guess is they looked at porting all that to ia64 [which they supported until Server 2008 R2], amd64 and ARM and balked.

No idea if they ever had it on some of the old architectures they supported in NT4 days or on CE (alpha, mips, ppc).

<comment><USER11> I've used it with SH4 on Windows CE.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> The inline assembler syntax used in D is designed to match the syntax used in the Intel assembler reference manuals. It's not that the Intel syntax is that great (it isn't) but the mental gymnastic of having to swap the operands makes blood run out of my ears, and causes me to make huge numbers of mistakes.

</comment><comment><USER13> Anybody that knows about the RFC and other implementations in C compilers, why are always "string literal parameters" (quoted strings) used?

Wouldn't be nice to have a way to embed other languages without the need for those quotes everywhere?

I guess it is meant to avoid complicating the syntax/grammar reusing the existing macro one?

<comment><USER14> For maximum generality and compatibility, likely. Also note that this is "just" a macro, not first-class language syntax, so any non-quoted arguments would have to be valid Rust token trees.

<comment><USER15> > any non-quoted arguments would have to be valid Rust token trees.

Token trees allow a very wide set of syntaxes. rust-c for example allows you to embed inline C code as token tree via a macro: [https://github.com/lemonrock/rust-c](https://github.com/lemonrock/rust-c)

</comment></comment></comment><comment><USER16> I may be the only one but I feel like this (and the old) asm syntax is too complex and not very user friendly. It looks heavily inspired GCC. I'm sorry for the upcoming German (you can ignore it and just read the examples), I feel like a smarter compiler could have a friendlier asm syntax, similar to the one used by FreeBASIC[1].

I hope you can see why I prefer that. Even though the FB compiler is not very smart and just pushes and pops all important regs to and from the stack its asm syntax is a joy to write. I don't have to specify clobber registers, in, out and variables and functions are in scope by default. Also the asm code is not a string and doesn't need to be quoted, it's doesn't look like something foreign at all.

I know that something like that is currently not possible in Rust but I'd love to see it some day.

[1] [https://www.freebasic-portal.de/befehlsreferenz/inline- assem...](https://www.freebasic-portal.de/befehlsreferenz/inline- assembler-434.html)

<comment><USER17> > I don't have to specify clobber registers,

So how does the compiler know that these are clobbered then ?

<comment><USER18> I expect the entire assembly is encoded into the language.

<comment><USER19> That doesn't really help - the compiler doesn't know what could be clobbered by any given (sys)call.

</comment></comment></comment></comment><comment><USER20> I am super new to Rust and maybe not the best place to ask, but why would you want to use inline assembly in Rust at all? Does that not invalidate a lot of the safety features built into the language?

<comment><USER21> Rust has lots of unsafe features; they all require explicit `unsafe {}` blocks.

As the post mentions, inline assembly comes in handy in a number of low level contexts (e.g. dealing with memory-mapped devices, working on microcontrollers, using processor features that aren't exposed by the kernel or standard library).

<comment><USER22> > using processor features that aren't exposed by the kernel or standard > library).

As someone who doesn't do any low-level work, could you give an example of these kinds of features? I'd like to read into some of them :)

<comment><USER23> Some processors implement "Instruction Level Parallelism" where you can do arithmetic on many values simultaneously with special assembly instructions.

The most widespread cases of this (SSE, AVX2) came from Intel trying to get lock-in in the high-performance computing market. So it took a while for AMD to sell chips that implemented these instructions and even Intel's catalog doesn't uniformly offer them.

It's also tough to get the compiler to emit these instructions where you want even if it knows they're available (unsurprisingly, since you're asking it to auto parallelize a computation), so in the high-performance space a lot of people just have to resort to inline assembly.

<comment><USER24> Just a minor terminology point. Instruction Level Parallelism (ILP) means something else.

What you are describing, with special instructions, is called Single Instruction Multiple Data (SIMD), or simply vector instructions.

ILP means the execution of multiple separate instructions in parallel per clock cycle, though techniques like superscalar, out-of-order and speculative execution. ILP is sometimes used as a measure: How many instructions per cycle can be issued. It does not require special instructions, it's just the hardware being clever about running existing instructions faster.

<comment><USER23> Ah, we used that wrong in my old group then.

We talked about Instruction Level Parallelism vs. Thread Level Parallelism vs. Node Level Parallelism since generally if you are working on a problem with some data dependency you will really have to think about each separately to get the best performance.

</comment></comment></comment></comment></comment></comment><comment> open-paren I'm new to Rust, so there may be precedent that I don't know, and I'm kinda spoiled because I'm a front-end dev mainly, where the rule is "don't break the web", but doesn't changing the syntax of a macro like that break backwards compatibility?

<comment><USER25> asm! has been an unstable feature for years, which means a) it's available only in nightly builds, and b) there is no guarantee that it will remain backwards-compatible.

Actually, with regards to asm!, it's been known for a long time that it was unlikely to be stabilized as-is (being originally a very thin wrapper around LLVM's inline asm functionality). Probably nearly everyone who's been relying on inline asm to make their code work has already been following the effort to replace asm! with a better version.

<comment><USER26> > Probably nearly everyone who's been relying on inline asm to make their code > work has already been following the effort to replace asm! with a better > version

Except for my colleague who basically says "nah, they'll never be able to move off the LLVM syntax, the code i'm writing now will be supported forever".

Fortunately, we only have a small amount of assembly, so if we ever do want to upgrade to a version of the compiler which has dropped support, it won't be a lot of work.

<comment><USER2> Support will likely not be dropped anytime soon, maybe never. You just need to rename it to `llvm_asm!`. Through with `asm!` likely going to be stabilized while `llvm_asm` never going to be stabilized it might be worthwhile to switch to the new asm to get of nightly in the future ;=)

</comment></comment></comment></comment><comment><USER27> I don't know much about the topic, but I am curious: does this open Rust up to being less "safe" (in the Rust sense of safety)?

C is of course higher level than assembly and I understand that C is very much not "safe", so it makes me wonder whether this gives library developers incentives to add code that has a higher likelihood of creating security bugs while optimizing their code.

Is there any reason to believe this could be the case, or am I just misunderstanding how all of this fits together?

<comment><USER28> This does not make Rust less safe. The capability to use assembly is already there: either by using the existing assembly syntax, by linking to C code, or by linking to assembly routines directly. In order to use this, you need to use the _unsafe_ keyword in order to indicate to Rust, "I am aware that the guarantees that Rust provides to me are not applicable when using this feature." This is true of all the existing ways of interfacing with non-Rust or assembly code, and it does not change with this new syntax.

</comment></comment><comment><USER29> If I wanted to learn assembly language in 2020, what's the best book or resource people would recommend?

<comment><USER30> [https://famicom.party](https://famicom.party) features the best, most accessible 6502 assembly crash course I've yet to come across.

It does strike me as weird that there aren't any popular resources that sit between something as high-level as the linked e-book and something as low- level as "buy some hardware and figure it out".

<comment><USER31> I suspect this has to do with Intel architecture not being very beginner friendly. When I tried learning x86 assembly, I found it to be incredibly overwhelming.

There are simulators for teaching assembly, but I don't think those are nearly as fulfilling as hacking on real hardware. And since it's difficult to hack on your computer's hardware, you're left pickup up something more simple.

<comment><USER4> In my opinion, it's less that x86 is any more or less user-friendly, and more about having an environment that gives you the "raw" bare-metal feeling that you could once have from DOS. You can write a few instructions, write to video memory, and the result is _right there_.

You can still get that feeling on x86. For instance, try writing some code directly in the MBR of a disk that writes some bytes to the serial port on 0x3f8 with outb, and load it up in KVM.

</comment></comment></comment></comment><comment><USER32> Is there anything like [https://github.com/herumi/xbyak](https://github.com/herumi/xbyak) on the Rust side? I like this approach a lot for non-tivial high performance work since it lets you tweak your assembly for particular hardware at runtime.

</comment><comment><USER33> I don't understand (I do actually but it's not that much work) why so few languages do what D does and actually have inline assembly as a fully supported (no quotes) syntactic construct within the language

<comment><USER34> > I do actually but it's not that much work

It apparently is, given that D only supports x86 assembly, doesn't support all instructions and has idiosyncrasies like requiring prefixes to be written as separate instructions.

<comment><USER33> D only has about <20 people working on it at a given time. Some languages probably have at least a hundred times that number.

<comment><USER10> The number of people working on the asm! for Rust on the more obscure architectures is likely less than one.

</comment></comment></comment></comment><comment><USER35> Always tricky. I avoid inline assembler, except in cases where the compiler cannot generate some special instruction. This can occur in drivers and kernel code, where there's no other language feature to manipulate processor architecture (special registers or machine state manipulation).

It can be fun to try and hand-optimize code in regular applications. I can't help but feel, there's more juice in teaching the compiler to recognize the case and generate better code instead. But few know how to go down that road.

<comment><USER10> Teaching compilers works in most cases, but not all of them. Sometimes the language just does not have ways of expressing things to the compiler that you would like it to know. (For example, how would you explain to the compiler that reading within the same page will not trigger a fault? Such a guarantee is often used in vectorized strlen functions, for example.)

</comment></comment><comment><USER36> Hopefully this will help us get better numerical libraries for scientific computing.

<comment><USER37> I hope so too but I'm skeptical. In my opinion, Rust still needs ergonomic multi-dimensional index expressions and standardized multi-dimension array traits. I'd love to see (or join) a scientific working group to help with this.

<comment><USER38> You can use a[(i, j, k)], and also a[i][j][k] for some data layouts.

As for multidimensional array traits, you can use Index<(usize, usize, usize), Output = f32>.

<comment><USER39> you can use the syntax `a[[i, j, k]]` too, just for another example.

</comment></comment></comment></comment><comment><USER40> Is Rust ever going to go for standardization? Seems like the language has been in a state of flux with heavy changes all the time. When's it going to settle down a bit?

<comment><USER41> As long as it's backwards compatible, why should that be a problem?

<comment><USER42> Use of Rust on domains that require compilers for ISO and ECMA certified languages.

</comment></comment></comment><comment><USER43> Bro. First, unsafe and now assembly. How is Rust a safe language?

<comment><USER44> There are two languages, "rust" and "unsafe rust". All code in unsafe blocks is not safe.

<comment><USER45> > All code in unsafe blocks is not safe.

That's a sadly common misconception. The unsafe blocks only enable a few extra language features, like dereferencing raw pointers and calling unsafe functions; if none of these extra language features are used, the code is completely safe. That is, if you have a block of code ({ X }) and just add the unsafe keyword (unsafe { X }), it works exactly the same and is still safe. This also shows that there are not "two languages"; what you called "rust" is a subset of what you called "unsafe rust", not a different language.

<comment><USER44> The first paragraph of the chapter on unsafe rust in TRPL reads:

> However, Rust has a second language hidden inside it that doesn't enforce > these memory safety guarantees: it's called unsafe Rust and works just like > regular Rust, but gives us extra superpowers.

I disagree that "{ X }" and "unsafe { X }" are the same. The former is provably safe if a bug free rust compiler accepts it. The latter leaves the burden of proof on the programmer.

</comment></comment></comment></comment><comment><USER46> This looks a lot better than GCC's asm. However, I can't think of a good reason why one should use asm in their code instead of letting the compiler write the far superior asm for you.

<comment><USER47> It's not always superior!

For example, I've been working on a big integer library. Addition is a bit annoying, because you need to add 3 numbers (the prior carry bit, and the two digits you're adding) and get out a new carry bit and a resulting digit. This is a bit cumbersome:

            let (res, carry1) = target_digit.overflowing_add(carry as u64);
            let (res, carry2) = res.overflowing_add(other_digit);
            *target_digit = res;
            carry = carry1 || carry2;

The resulting assembly is a fairly literal translation. We perform the addition using an add instruction, and extract the carry flag into a register using setb.

            addq    (%rdi,%rsi,8), %rcx
            setb    %r10b
            addq    (%rdx,%rsi,8), %rcx
            setb    %al
            movq    %rcx, (%rdi,%rsi,8)
            orb     %r10b, %al
            movzbl  %al, %eax

But there's a dedicated instruction for this, adc. adc adds two operands and the carry flag, while itself setting a carry flag. Manually unrolling the loop a bit, I wrote this assembly:

                    shlb $8, {carry}
                    adcq 0x00({y0}), {x0}
                    adcq 0x08({y0}), {x1}
                    adcq 0x10({y0}), {x2}
                    adcq 0x18({y0}), {x3}
                    adcq 0x20({y0}), {x4}
                    adcq 0x28({y0}), {x5}
                    setb {carry}

And got a 3x speedup.

<comment><USER48> The article here:

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

specifically recommends against the carry variants of addition, because the instructions are still dependent on each other and don't pipeline well. In other words, it's using the same algorithm, just buried in a single instruction, and that doesn't necessarily make it faster.

Have you considered using a strategy similar to what the article suggests? I think the HN comments also had some additional suggestions.

<comment><USER49> > _that doesn 't necessarily make it faster_

Did you miss the "And got a 3x speedup" part of the post you were replying to? Actual benchmarks of real code always trump theoretical deliberations.

<comment><USER48> Yikes. I was just trying to link to a relevant technique that the author might find helpful.

A big integer library may have many use cases; a benchmark only shows one data point. It's possible that by deferring carry work across more operations he'd see an even bigger improvement.

</comment></comment></comment></comment></comment><comment><USER42> Sadly it is yet another language that follows the UNIX tradition of not having a proper Assembly parser instead forcing us to play with strings.

I guess it leaves PC based languages to have actual inline Assembly parsers or intrisics.

<comment><USER50> If you want the outer language to be cross platform (e.g. x64, ARM64, etc), then you'd either need a parser for every potential platform (even ones you aren't currently using!) OR you just settle for strings.

Don't get me wrong: Parsed assembly is superior because you can have certain parser guarantees/checks. But it will definitely limit the scope of your language or at least slow its adoption to new platforms.

<comment><USER42> Productivity of language users vs compiler developers.

<comment><USER51> There are infinitely more language users. I'd rather throw a bone to the compiler developers.

<comment><USER52> Then that means there is infinitely more productivity to be gained catering to the language users.</comment></comment></comment></comment></comment>


Used MP3 site prepares to launch Second Hand digital music marketplace - <AUTHOR> http://news.bbc.co.uk/newsbeat/hi/technology/newsid_7777000/7777008.stm <comment><USER2> I'm amazed they were able to get this far in the process, and get covered by the bbc. Is a used song going to sell for 10cents? and if so, are you going to risk the RIAA coming after you for buying stolen goods rather than either pay the 99cents to buy the track legally, or go whole hog and just download it free?

Who came up with this business model? I hope they didn't spend a bunch of money getting this going.

</comment><comment><USER3> This reminds me of that spider jpeg someone tried to pay a bill with a while back. How do you know that the mp3 has actually been deleted from the user's computer? Other than heavy-handed DRM, I don't see how that would be possible. For some reason, I don't the the problem with the online music market today is lack of DRM.</comment>


Ask HN: Monorepo (with git) best practices - <AUTHOR> Hi,
Just getting started with a relatively small group who has decided to merge several small repos into one.
In this case, the code varies in purpose (some code in the current repos is reusable, some combine to make a single project and others are just stand alone stuff) and implementation (C++, Python, Java, SQL etc.) ++
I have worked with both monorepos and lots of little repos before.  I personally prefer the monorepo approach but recognize both the many repo and monorepos methods are valid.
However,  when I have worked successfully with a monorepos it was with a large teams and there was lots of tooling around SVC system to support it.
In this case we are small group using GIT and don't have the resources to create a lot of tooling to support monorepos approach.
So my question is: what light weight approaches to monorepos management are recommended, what's to be avoided. etc.
Thanks in advance! <comment><USER2> You already said it: monorepos happen in organizations with lots of tooling.

Outside those organizations, all the tooling assumes one application per repo.

As a result, monorepos don't work well outside those large organizations.

<comment><AUTHOR> Thanks, but I have reading that they work for smaller orgs as well. e.g.

[http://www.thedotpost.com/2016/05/fabien-potencier- monolithi...](http://www.thedotpost.com/2016/05/fabien-potencier-monolithic- repositories-vs-many-repositories) [https://speakerdeck.com/fabpot/a-monorepo- vs-manyrepos](https://speakerdeck.com/fabpot/a-monorepo-vs-manyrepos)

[https://github.com/splitsh/lite](https://github.com/splitsh/lite) [https://gist.github.com/morewry/d3419a38d74590493042544d4afa...](https://gist.github.com/morewry/d3419a38d74590493042544d4afa49a7) [https://github.com/korfuri/awesome- monorepo](https://github.com/korfuri/awesome-monorepo)

I was just hoping to connect some one who has some first hand (recent) experience here.

Thanks.</comment></comment>


Richard Stallman Interview: Lunduke Hour - <AUTHOR> https://ia801509.us.archive.org/28/items/LundukeHourApril14RMS/LundukeHour-April14-RMS.mp4 <comment><USER2> This is the YouTube link for it: [https://www.youtube.com/watch?v=S0y0oXU8YNk](https://www.youtube.com/watch?v=S0y0oXU8YNk)

I haven't watched this yet, but I'm surprised there was another interview after the previous interview Lunduke had with RMS on the Linux Action Show did not go over well: [http://www.youtube.com/watch?v=radmjL5OIaA](http://www.youtube.com/watch?v=radmjL5OIaA)

Essentially, Lunduke was still mostly an Apple developer at the time and got in an argument after RMS said he should just go work in a factory or in the woods and Lunduke said that he needed to feed his family.

</comment><comment><USER3> I see the following:

> Item not available

> The item is not available due to issues with the item's content.</comment>


Ask HN: Idea map tool that you recommend? - <AUTHOR> <comment><USER2> You might be surprised how a simple two D grid of slides like reveal.js can work here. Like the Sony control bar, flow between groups which are sorted or rank is a very good model to show structured nested thinking.

I watched Larry lessig talk twice with something which looked like omnigraffle very like this. What it showed is that he probably did a metric tonne of thinking even with pen and paper to create the rational grid and then conducted a path through it.

I hate to be a nay sayer but it's possible an organisation using simpler tools (paper, pencils, whiteboard, lists, side by side lists, post-it notes) is how you think it, and then sort it, and then map it on to a sequence of sequences.</comment>


The Weird World of Expensive Wine (2016) - <AUTHOR> http://fivethirtyeight.com/features/the-weird-world-of-expensive-wine/ <comment><USER2> If you're interested in this, watch the Netflix documentary "Sour Grapes" about wine counterfeiting - millions and millions of dollars per year and most victims just "don't want to know". Sometimes the counterfeiters produce and sell wines for 10s of thousands of dollars - and the buyey later finds the vineyard never even made that kind of wine. William Koch is profiled in the film, he alone spent millions on counterfeit wine and hired a team of former CIA operatives to try and track some of it down. Fascinating stuff.

<comment><USER3> From end-to-end, I think the whole pipeline is a waste of human talent. I'm not ashamed to say, I'd be happy to hear about more people getting fleeced over bullshit like this.

Of all the things they expend time and effort worrying about: nuanced preferences for getting drunk.

Let it all burn, I say.

<comment><USER4> Moreso than adtech?

<comment><USER5> More so than anti-virus?

<comment><USER4> Why answer a question with a question?

</comment></comment></comment></comment></comment><comment><USER6> Collecting wine can be come quite an addiction. My wife and I both love wine and living in NorCal we have easy access to tons of great producers. We would taste a wine, like it and say, well lets get a few bottles. That turned into a case, then a few cases. Right now we have around ~3000 bottles and are in the process of building a cellar for them. The cellar will hold 4106 bottles. It is nothing fancy, just a room above the garage that has been well insulated (spray foam) and as a dedicated AC unit. The unit is pretty cool as it has a probe you put in a wine bottle full of water and it uses that to set the temperature.

We have in the last few years had the opportunity to taste and acquire some older wines from France from the 1960s. It is a completely different taste profile then anything from CA. Then need to open and sit for awhile (a few took 6 hours to really open up).

As far as cost go I think the most expense bottle I buy is around $200 (750ML). I just have never been able to justify the cost vs taste difference. Heck, one of my favorite bottles was $6 from Trader Joe's (a Chilean that they do not sell anymore).

If you live in the Bay Area I and want to try some very interesting wines that are not stupidly priced there are some great producers in the Santa Cruz Mountains area. Try one call Storrs or Silver Mountain.

For Napa - Corison or William Cole on the high end. Both can be aged for years. We had an opportunity to taste 25 years worth of Corison at a dinner and it was amazing to see how the years changed the wine.

I tried Screaming Eagle at a friends. Amazing wine, but not that that price point. But to each their own.

At the end the best wine is the one you like to drink, preferability with friends and family over a good meal.

<comment><USER7> [1] But don't you know by now that everything you are saying is BS? No one can tell the difference, there is no "opening up" it is all in your head, your 1960s bottle or your $6, its not just "personal taste" there is no taste difference, it is proven over and over again.

[1] [https://www.theguardian.com/lifeandstyle/2013/jun/23/wine- ta...](https://www.theguardian.com/lifeandstyle/2013/jun/23/wine-tasting-junk- science-analysis)

<comment><USER6> So you are telling me that the taste of wine does not change over time as it is exposed to oxygen? Hum, I guess I should call all my chemistry professors and tell them what shame all that chemistry is.

You can find studies that say anything. I would agree that a large number of people including experts can get it wrong, on the other hand a spectrum anazlizer will prove that the make up of a wine changes as it is exposed to air and those changes is something your taste and nose can dectect.

Also I have sat a completley blind tastings and watch as some where able to ID the grape (or mix) and the region it was from.

I suggest you try it for yourself. Go buy Pinot Noir from let's say Burgundy France, CA Santa Cruz and Washington State. 2 different bottles from each area. Then take one set and taste taking care to note how they are different. Then have someone open the 2nd set from the same region and pour a taste of each. You should easily be able to pick which wine was from which region based on what you learned from the first tasting. This is no different then anything else that picks up the characteristics of the input. Grass fed beef vs corn fed for example.

I promise you if you open a 62 1st growth and let us sit for an hour and then open the same bottle and pour a glass from each I will be able to tell you which is which. Heck the color of the wine even changes a bit as it is oxidized.

</comment></comment></comment><comment><USER8> I just watched Red Obsession. The documentary gives you some perspective about the recent price hike of the wines of Bordeaux, the Chinese and the expensive wine markets.

[http://www.imdb.com/title/tt2419284/](http://www.imdb.com/title/tt2419284/)

<comment><USER6> I was at a business dinner in China once. This guy ordered a very old and $$$ wine and then mixed it with Coke in his glass. I wanted to cry.

<comment><USER9> The last of my pre-scarcity pappy van winkle was drank with diet coke by my ex. It was a sad day.

<comment><USER6> I can understand why she is the ex! That is sad.

</comment></comment></comment></comment><comment><USER10> A level of eccentricity and quirkiness that inhabit almost every high end collecting industry, I would think.

I see similar traits in the top end of guitar and amp collectors that I sometimes associate with. People spending as much as their house is worth on gear that can give them a similar tone to a scratchy 60's recording...

Somewhere at the very peak of the dollar graph of diminishing returns, a level of mysticism, voodoo and ethereal subjective qualification tends to creep in.

</comment><comment><USER11> It's interesting that the conclusion serves the opposite purpose of what one expects from a conclusion. Usually the conclusion serves to put the preceding argument or analysis in context, but in this case the conclusion does the opposite by invalidating the subject of the analysis.

</comment><comment><USER12> Oh cool, finally an article related to what I've spent the last ten years working on as a side project.

The way wine and spirits are regulated in the United States can make it very hard to find any specific bottle that one might be interested in.

So I've created a search engine for wine and spirits. It's called 1000 Corks, [https://1000corks.com](https://1000corks.com)

It's useful if you read about a bottle of wine that you want to try, or try a wine in a restaurant and then want to order a few bottles to drink at home.

The backend is Python, Postgres, and Redis.

</comment><comment><USER13> For anyone interested in the intricacies of fine wine trading I would suggest the documentary "Red Obsession". It interviews a lot of Bordeaux producers and shows how the economic explosion of China led prices to skyrocket.

[http://www.imdb.com/title/tt2419284/](http://www.imdb.com/title/tt2419284/)

BTW, one thing that always troubles me. What if you start collecting wines but you lack the infrastructure for storing them? Can you rent storage at a cellar? If someone could build a subscription service for that I'd certainly pay for it.

<comment><USER14> Yes this is a thing. E.g., [http://vintagewinewarehouse.com/](http://vintagewinewarehouse.com/)

</comment></comment><comment><USER15> These guys make wine molecule by molecule.

Could shift everything.... utilizes 100 times less water.

[http://avawinery.com](http://avawinery.com)

<comment><USER16> Hmm, I wonder if they're doing anything to limit or prevent the use of molecules with an inorganic chirality bias (judging by New Scientist's comments on the smell, I imagine not enough).

</comment></comment><comment><USER17> I was really looking forward to a true 538 treatment of wine pricing data, but this is cursory and superficial at best. It would be fun to see how the first growths compare regarding appreciation and risk, or how they compare to the top grand crus from Burgundy (DRC, Leflaive, etc.), or whether Pommard is inflated relative to other premier cru in anticipation of promotion to grand cru.

</comment><comment><USER18> Sadly doesn't seem to be at [https://github.com/fivethirtyeight/data](https://github.com/fivethirtyeight/data)

</comment><comment><USER4> Mumble something liquid assets exchange values.

How much of this stuff sits in duty-free vault storage?

</comment><comment><USER19> Ethanol and... juice.

<comment><USER20> Are there any good, cheap laboratory wines that can pass blind taste tests?

<comment><USER21> You can even dye white wine red and even professional tasters will be fooled[1].

1: [https://www.theguardian.com/lifeandstyle/2013/jun/23/wine- ta...](https://www.theguardian.com/lifeandstyle/2013/jun/23/wine-tasting-junk- science-analysis)

<comment><USER22> Students, not professional tasters. "The wine comparison test was carried out by 54 undergraduates from the Faculty of Oenology of the University of Bordeaux."

[http://www.daysyn.com/Morrot.pdf](http://www.daysyn.com/Morrot.pdf)

<comment><USER23> Wine students. I'd expect them to know a lot more about wine than most people.

The wine's colour is part of the experience of drinking wine and affects the perceived flavour. They probably wouldn't have been fooled so easily if they were blindfolded.

Knowing a wine's price also affect its perceived flavour: [https://www.gsb.stanford.edu/insights/baba-shiv-how-wines- pr...](https://www.gsb.stanford.edu/insights/baba-shiv-how-wines-price-tag- affect-its-taste)</comment></comment></comment></comment></comment>


PhoneGap 1.6 Released - <AUTHOR> http://phonegap.com/2012/04/11/phonegap-1-6-released/

<comment><USER3> I just started developing mobile apps with Appcelerator. Any reason I should have gone with PhoneGap? I want to begin building basic data-driven apps for my clients and I like Appcelerator from what I've seen so far.

No experience with Java or Obj-C (I'm a n00b programmer and decent web developer) and wanted to start banging out apps ASAP.

</comment><comment> dc-tech-fan I'm giving Phonegap a try to make the mobile version of <http://doodleordie.com>. Thoughts/recommendations/inspirational success stories with Phonegap?

Of course Native is better but the Doodle or Die fans want a mobile app _now_ and Phonegap seems like a quick win because I know JS well and I don't know Java or Objective C.

<comment><USER4> I'm writing an application in it at the moment, experimenting with Parse and it's been a great experience. You can use a mixture of both native controls and HTML5, see the NativeControls plugin. I'm using a native UITabBar and the UIWebView for the HTML5 / jQuery (native developers seem be building this way now anyway (FB etc)).

<comment><USER5> I just learned about NativeControls today. From what I saw, it only provides Toolbar and TabBar but doesn't do Navigation, for example, am I right?

<comment><USER4> UIActionSheet, UIStatusBar, UIToolBar and UITabBar I think. What are you looking for?

<comment><USER5> I'd love to be able to have a web view for the "content" of my app, but native navigation at the top, and native everything else basically.

<comment><USER4> I may have misunderstood, but can't you use the UIWebView (PhoneGap uses this by default for rendering) for HTML5/Cordova assets with the native UIToolBar at the top? (that's what I'm doing, but with UITabBar) Everything else can be done using native UIActionSheets.

</comment></comment></comment></comment></comment></comment><comment><USER6> I wish they'd have better changelogs - look at the first item for iOS: "Updates for Media API". This is kind of important to me. What exactly has been updated? Is it backwards compatible?

</comment><comment><USER4> If 1.6 broke your build and you wish to rollback to 1.5 (temporarily), this worked for me:

      git clone https://github.com/phonegap/phonegap.git
      git checkout -b de1960d5a3 de1960d5a3

</comment><comment><USER5> There was a story about iOS local storage being broken in iOS 5.1 yesterday. PhoneGap 1.6 seems to fix this!

"The PhoneGap/Apache Cordova Community has worked hard to fix many bugs (including the nasty local storage bug caused by the iOS 5.1 update) and added some new features."

"Fixed CB-330 – localStorage / SQLDatabase no longer persistent after iOS 5.01 update Fixed CB-347 – iOS 5.1 localStorage / SQLDatabase error after upgrading an app"

</comment><comment><USER7> I'm confused what the downsides are to using phonegap - Is it a speed thing? Are there features that a native client could use that phonegap can't access? Development is harder? Coming from a web background this seems like a huge boon. Why should I invest the time into learning objective-c/java compared to using phonegap?

<comment><USER8> In short, the downsides:

\- You're limited to the number of "native" hooks you have access to, and cross-platform feature parity is iffy.

\- Can't verify this personally, but I've heard Android and Windows Phone apps can be very slow due to their webview wrappers kind of sucking. iOS is great though.

\- PhoneGap doesn't offer any sort of native UI elements, so if you want your app to look like a "real" iPhone app you have to build the UI from either CSS, which gets hardware-intensive when you start throwing in tons of gradients and shadows, and is difficult to make look _exactly_ like the native elements - <USER2> images, which will look like crap when Apple releases a new higher-resolution device. (Not a huge issue, but there are still a lot of apps with non-Retina graphics.)

\- Interactive elements (page transitions, glow/shadow/gradient effects, animations) can be very, very slow. There are ways around most of the speed issues - using hardware-accelerated CSS, detecting touch events instead of click events - but it can be hairy.

\- Fixing bugs is rough. PhoneGap doesn't dump Javascript errors to log like a web browser does, so you'll have to deal with your app randomly not responding for no apparent reason and spending an hour hunting until you find that one typo or missing semicolon.

But, the upsides:

\- Getting from point A to a working prototype takes significantly less time.

\- Porting to other platforms, while tricky if your app relies heavily on native hooks, is significantly easier than completely rewriting.

\- Personal opinion, but HTML + CSS + Javascript is just a nicer environment to develop with.

\- Every new iOS release comes with new features that make developing web apps a lot easier. iOS 5 brought native-style inertial scrolling to overflow: scroll, true fixed elements with position: fixed (though fixed elements still have some quirks), for example.

I'd highly recommend giving it a shot. You can be up and running with a working HTML/CSS/JS app in the iPhone Simulator in like 10 minutes. Hard to argue with that.

<comment><USER9> Although PhoneGap does not offer any UI elements, there are plenty of mobile optimized UI libraries such as JQuery Mobile and others that replicate a more "native feel". Using a mobile optimized UI library will also dramatically improve the interactive element's and transition's performance. Performance is still a big consideration though as it has more of a good enough versus "native" feel.

Regarding the limitation of "native" hooks, PhoneGap has a very solid plugin system which allows your JavaScript code to call native code. There really is no limitation to this.

As far as fixing bugs, since you are using web technologies to build your app you can usually debug in the the browser. If you have something that relies on a specific device implementation, then there is WEINRE. Granted its not as powerful as debugging in XCode or Visual Studio but it definitely gets the job done without to many headaches.

<comment><USER8> In my personal experience, jQuery Mobile has been incredibly slow (by incredibly, I mean hundreds of milliseconds of delay between touch events and response, which is unacceptable to me) and is kind of ugly. It feels cheap to me. I wouldn't recommend it, but again, personal opinion.

You're right about the plugin system, but that also requires that you know Objective-C if you want to build anything on the other side of that plugin, and if you know Objective-C why are you bothering to build an app with PhoneGap?

Debugging in the browser is a possible solution, but even Mobile Safari's developer tools are very limited. The console displays more JS errors, but often won't include line numbers or other critical details. Plus, no support for any native hooks. Weinre is _okay_ but you're right that it's still not as in-depth as a real browser, and I haven't been able to get it working on an actual device yet, only in the Simulator.

Basically, the whole environment still has that duct-taped-together feel to it. The benefits are still worth it to me, but there's definitely a lot of room for improvement.

<comment><USER10> Default settings aren't optimal, yes, but try looking around for answers on jQuery forum and Phonegap Google groups, and you'll find useful tips how to make interface more robust.

E.g., for my links I use following code. It binds a tap event (instead of a standard jQuery Mobile click event) to a button/link, resulting in almost no delay.

        $('#footer-menu a').on('tap vmousedown', function () {
            window.location.href = $(this).attr('href');
        });

</comment></comment></comment></comment></comment><comment><USER11> I'm finding it hard to figure this one out: does PhoneGap include any built-in Websocket support yet? I've Googled around and found a plugin and a few links indicating that it's going to included with PhoneGap in the future but nothing concrete.

</comment><comment><USER12> Hopefully not too dumb of a question .. can I use phonegap to make an augmented reality app?

If not, do you guys have any advice to get started?

<comment><USER8> Unfortunately, no. You'll need to go a lot deeper to access live camera info, overlay some sort of HUD, and run background processes to process and load necessary data.

</comment></comment><comment><USER13> wait, is it phonegap or cordova?

<comment><USER4> Cordova, but they're getting there :) The documentation has now been updated, however, you'll still find yourself having to update a lot of the plugins' import statements and if you're looking for resources on SO, or elsewhere, you're better off using "phonegap" as the search term.

<comment><USER13> Thanks, I thought they had switched the name, but this announcement made me thing the project was called cordova but the product called phonegap still, renaming stuff is hard

<comment><USER4> It's complicated, this helps explain (a little) [http://phonegap.com/2012/03/19/phonegap-cordova-and- what%E2%...](http://phonegap.com/2012/03/19/phonegap-cordova-and- what%E2%80%99s-in-a-name/)</comment></comment></comment></comment>


Show HN: Strelka – A new simple, flexible and composable web-router for Haskell - nikita-volkov https://github.com/nikita-volkov/strelka <comment><AUTHOR> Having a composable base is good, but as a high level interface I still prefer the ,,primitive'' syntax.

</comment><comment><USER2> If it meets the guidelines, this might make a good 'Show HN'. Show HN guidelines: [https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)

<comment> nikita-volkov Thanks for the suggestion, but I don't seem to be able to change the title or to repost this. Do you know what to do in such cases?

<comment><USER3> Named after the Russian word for "arrow", right?

<comment><USER4> Exactly

<comment><USER2> When the boy was little I read him _Pupniks: the story of two space dogs_ many times. Belka and Strelka, That's about the extent of my Russian.

[https://www.amazon.com/Pupniks-Story-Two-Space- Dogs/dp/07614...](https://www.amazon.com/Pupniks-Story-Two-Space- Dogs/dp/0761451374)</comment></comment></comment></comment></comment>


TI Mixes ARM cores with DSPs and programmable logic - <AUTHOR> http://www.eetimes.com/document.asp?doc_id=1326403&

<comment><USER2> That's nice.

In the article, a TI rep is quoted saying, "We believe customers will be able to develop their devices three times faster than when using FPGAs — in days rather than weeks"

I'm kind of wondering about that. Maybe if you were already up and running with syslink/codecengine/xdctools, etc. IMHO, working with TI's c6X DSPs was just awful, and their software suite was one of the only dev environments that has made me pine for Xilinx's stuff.

Syslink? Perhaps the worst-behaved linux kernel module I've ever encountered. Xdctools? Did anyone ever really want yet another build system? And in javascript? When we were working with the toolchain, even TI considered it inscrutable - their own image loader was a hacked example buried deep in the xdctools examples dir. And support? Every time we sent an email to TI, all we got was, "have you asked this question in the TI forums?" It was such a ridiculously poor standard of support that eventually it became a joke on our team.

But I know that in embedded, the quality of the software tools is rarely considered. Oh well.

</comment><comment><USER3> This is additional information that what I suspected was happening, is, which is that the combination of some hard "cores" \+ FPGA fabric is becoming useful. The original Xilinx run at this used Power PC cores but the current stuff (Zync) using ARM cores has had much better traction.

Looking at the TI site they want $328 each[1] in singles, not a great price point but not horrible given their performance but I don't think it crosses into the 'revolutionary' category.

That said, one of these and a couple of those 4 GSPS 12-bit ADC's and you'd have a pretty sweet front end for an oscilloscope. My new 200Mhz scope only has 2.5GSPS front ends on it and it cost $6K.

[1] This compares to $60 for singles of the Zync chip.

<comment><USER4> Tiny correction: Xilinx' combination ARM+FPGA SoC is called the Zynq ([http://www.xilinx.com/products/silicon- devices/soc/zynq-7000...](http://www.xilinx.com/products/silicon- devices/soc/zynq-7000.html)). This latest device from TI seems to be way higher-end than the Zynq (not surprising, since it's also newer).

<comment><USER3> Thanks, I am not a fan of phonetically obscured names :-). Xilinx's first foray into this space was the upper end Virtex series (the Virtex 4 and Virtex 5), I went back and looked at the pitch they gave me in 2005 around this. So here we are 10 years later and it seems like this stuff is finally getting closer to mainstream.

</comment></comment></comment><comment><USER5> Yeah, the headline on eetimes is a bit...sensationalistic. It may be useful for cellular signal processing, but there are quite a few other things that fpgas are used for. Now, were this chip to have a proper PCIe x16 bus dangling off it, and elements useful for video encoding/decoding, it may be more intriguing. Right now, it's just an interesting toy for telcos.

<comment><AUTHOR> So... we got a new plataform who is better to a specific range and eetimes says "TI Obsoletes FPGA"? That's what i think when i post it.

</comment></comment><comment><USER6> I hardly even understand FPGA's but I don't think TI's newest tech will obsolete it. Intel just purchased Altera for $16.7B and I've already seen them release updates to their line including fabrication on 14nm or less.

<comment><AUTHOR> But with intel buying altera and they starting to use FinFET technology , i'm quite curious how XILINX,TI and other will react.

<comment><USER7> Xilinx invested heavily in TSMC's TSV interposer and likely their IN-FO fan- out packaging. These allow them to integrate more silicon area in the same package space. It can potentially offset the technology node gap, and maybe for lower cost. Yes, TSV is expensive, but a process node is even more expensive.

<comment><USER8> Multi-die FPGA packages are a giant PITA to deal with, compared to monolithic. It's a lot harder to resolve timing problems.

There's a small customer base that's already used to partitioning their designs across multiple FPGAs, and taking the huge performance hit from it (e.g., ASIC emulation). But for most, yeah... giant PITA.

</comment></comment></comment></comment><comment><USER9> Do there exist free (as in freedom) compilers for the DSPs of TI?

<comment><USER10> There was some press material around that, as well as some preliminary support in the Sourcery toolchain back around the 2010-2012 timeframe. But I haven't heard anything about that effort lately, and I think that it has stalled.</comment></comment>


Refactoring Legacy Code (2014) - <AUTHOR> https://tiffnix.com/blog/2014/10/19/refactoring-legacy.html <comment> munk-a I have a lot of sympathy having also cut my teeth trying to improve the maintainability of a DikuMUD based variant. There were some pretty crazy anti- patterns in that code base - most of which originated with developer-lites, people who ran the MUD and just hacked at the code until it did what was needed.

I'm not certain if it also applies to FotR but the MUD I worked on also had an incredibly failable persistence strategy involving a lot of flat files that were written to in sequence - weirdly it also had a rather impressive code hot-swap system that allowed the binary to be swapped out during execution so thankfully the system wasn't brought down that often.

</comment><comment><USER2> interesting read. Here's how I understand the outline

* transition version control to Git

* Removed commented out blocks

* Add clang-format to the codebase

* remove support for old operating systems

* fix clang warnings and memory bugs

* reorganize sections of code changing behavior minimally

* add unit tests

* update compiler to clang++

* refactor and add new functionality

<comment><USER3> I agree

</comment></comment><comment><USER4> Yeah that's all really bad, but the worst I ever saw was some c with the comment at the top

/* converted with f2c dec 2001 */

I had to to fix some buffer overflow and int overflow issues flagged by an automated scanner. 2000 line function with about 50 labels and gotos in there.

Working on it was actually kind of zen, it was just one file though, any more would've been unbearable.

</comment><comment><USER5> Concerning the latency problem over ssh: switching to mosh would probably help a lot (and any downside to using mosh goes away when one is using tmux anyway).

</comment><comment><USER6> > I also found a back-door in the MUD that was inserted by a previous > maintainer.

YIKES. This strikes me as the kind of thing that happens when you don't use version control.</comment>


Show HN: POC to show the flaw in project collaborator notifications on GitHub - <AUTHOR> https://github.com/719Ben/attention-whore <comment><USER2> Interesting POC, I found out about it precisely in my github feed. Now, you really could have given it a different name. If you change it people will not have a problem sharing it. It's unnecessarily offensive!

<comment><AUTHOR> I am the project creator and after some feedback I agree. The project's name has been changed.

<comment><USER3> You showed up in my feed as well (multiple times). I thought this was an issue that had been fixed in the past?

<comment><AUTHOR> I think the fix is simple. Make people confirm that they want to be a collaborators before notifying all their followers.

<comment><USER3> Yeah... I just vaguely remember something like this popping up in the past. I guess it was a slightly different issue. Your suggestion would work, or at least only showing up in feeds until the collaboration has been accepted.

What's your /graphs/traffic page look like? Have a lot of people checked the page out?

[https://github.com/719Ben/notice- me/graphs/traffic](https://github.com/719Ben/notice-me/graphs/traffic)

<comment><USER4> > Yeah... I just vaguely remember something like this popping up in the past. > I guess it was a slightly different issue. Your suggestion would work, or at > least only showing up in feeds until the collaboration has been accepted.

Zed was a recipient of drive-by-collaboration back in 2011: [https://web.archive.org/web/20110603111859/http://sheddingbi...](https://web.archive.org/web/20110603111859/http://sheddingbikes.com/posts/1306816425.html)

The intent was a bit different, followers were not the target, the user being added was, but the core problem was the same: you don't get to confirm if you _want_ to become a project's collaborator (and can't squelch such requests), you just get added.

> The question then comes up: How is it that someone can just add you to a > project on github without your permission? Well, github will just let you > unilaterally add someone else. You can just pick a random person and give > them commit rights to it. It's under the assumption that you wouldn't do > something as stupid as adding someone who hates you to your own project. In > this case, it's a project the person doesn't care about, so adding them is > just intended as an insult.

> […]

> It took Nick Martini two days to fix his repo. Despite what Martin says on > his blog it actually was very little effort from me and most likely > considerable more for Nick. You would think that would be the end of it. > Nick would leave me alone.

> Then today, he added me to the dongml project again.

> Since there's no way for me to remove myself, and since github won't create > a way for me to block him, or report his project for abuse, I'm mostly left > with leaving it there.

> Of course, I have another option, which is to continually destroy his > project until github bans me from their servers. But now I have my code on > there...or do I?

</comment></comment></comment></comment></comment></comment><comment><USER5> Just today there was 2 annoying GitHub users doing this, probably using your script. I always report this kind of activity to GitHub. Hopefully they'll need to do something now that you made this accessible.

<comment><USER6> Yes same here. One project was also repeated which suggests that everytime you add/remove someone their followers get a new notification. Edit: oops nevermind.

</comment></comment><comment><USER7> I noticed this in my feed yesterday (via a user that seems to have been banned now[0].

[0]: [https://github.com/tushar-rishav](https://github.com/tushar-rishav)

</comment><comment><USER8> I posted a fix here: [https://ponyfoo.com/articles/github-for-human- beings](https://ponyfoo.com/articles/github-for-human-beings)

</comment><comment><USER9> This has been driving me nuts. I used to report all instances but GitHub doesn't care so I resorted to only blocking offending users.

</comment><comment><USER10> Urgh. You got me, 719Ben. I saw it on my feed, too. Three people: defunkt, mojombo and paulirish.

</comment><comment><USER11> Gotta love the hustle! ;) Gotta push that new track to get big!</comment>


Significant Drops in Small Businesses in 2009 (US down 24%) - <AUTHOR> http://www.economist.com/blogs/freeexchange/2010/01/small_business_takes_hit

<comment><USER2> I wonder if this takes into account the new micro tech startups? I doubt it.

What this is really indicative of is just how bad the credit situation was in early 2009. I know that restaurants and other capital intensive 'start-ups' really suffered.

<comment><USER3> I don't think so, as I deal with such startups every day and they are going very strong right now.

Startups can be viewed from what I call an "MBA perspective" or from an "independent founder" perspective, and these views are fundamentally different. The Economist sees the world from the MBA perspective and is not at all focused on what might be called the street level where independent launch and grow their ventures.

This is now actually a very promising time for early-stage ventures that do not have immediate capital-intensive needs.

</comment></comment><comment><USER4> This is bad. Over 66% of job creation comes from small business, up to 50% GPD and 33% of exports. Small business never gets the support it needs in America today. There just isn't enough money to pay for the lobbyists.

Healthcare is also a huge contributing factor to people not starting businesses today.

</comment><comment><USER5> Reduced personal wealth, no easy access to credit, reduced consumer demand... but that isn't the whole story.

IMHO the health care problem has a huge impact on this. I'm a Canadian expat in the US right now, and I unfortunately had to pay a visit to an American ER last night. I'm insured, so my out of pocket costs are manageable, but imagine a startup founder struggling to get to ramen profitability doing the same.

Oh, unrelated note: the whole "private health care works better" thing is total hogwash. ER wait times here are as bad as they are in Canada, main difference is that in one place you're not paying through the nose for it.

<comment><USER6> Ummm, was their any change in the provision of health care in the US in 2009? If not, how is health care relevant to a change specific to 2009?

<comment><USER5> I wasn't thinking about the 2009 dip per se, but rather how large the US's entrepreneurial drop was in comparison to other countries in the same time frame. I imagine places where health care is a significant unknown, and potentially catastrophic financially, would experience a larger loss of interest in economically turbulent times.

<comment><USER6> I suppose so, but one point here (that I'm sure many delude themselves above) is that there is no safety. Working for a startup and e.g. paying for minimal catastrophic coverage is not necessarily more dangerous than working for the established companies who have laid off millions (???) of workers in the US this recession (many many if not "millions"; heck, 600K+ workers dropped out of the US job market in December 2009 alone).

And ... hmmm, if you're in a country with nationalized health care and resultant higher price levels, aren't your expenses and therefore ramen profitability just that much higher? I.e. you pay one way or another ... and if you're young, you're subsidizing the older (and in the US, the elderly in Medicare as well).

<comment><USER5> Actually, because tax time is coming up, and I'm a citizen of Canada who has to file taxes in both the US and Canada, I've been doing the math on this, the "nationalized health care is more expensive" thing is really quite the myth (that I believed myself).

Firstly, there's the commonly known factoid that the US spends more per capita for health care than any other industrialized nation - in fact you guys pay more than 2x what Canada pays for each of its citizens. So health care, on an aggregate basis anyhow, is actually _much_ more expensive in the USA than Canada.

Secondly is the burden on the individual - I did the taxes for what I would have to pay in taxes in Canada (if I had earned the income there), and the total comes out to about $2K more than my tax burden in the USA. Considering my insurance (employer-subsidized) is still some $100 a month, the difference becomes even less pronounced. Not to mention there's no such thing as a co-pay in Canada (my US insurance plan has mediocre co-pays). Put it all together and suddenly you wonder why America just can't take the money it's _already paying_ and just create a public system where everyone gets care.

<comment><USER6> As cwan points out, access to a waiting list is not access to health care.

When you ignore easily gamed statistics like life expectancy and look at things like cancer survival rates, you see that we seem to be getting something for the extra money we're spending. And we're a rich nation, it would hardly be odd for us to choose to spend a lot there.

And for now, there are choices. At times I've had minimal health insurance, e.g. catastrophic illness or injury was covered but not my occasional sinus infection.

<comment><USER5> I don't really see the point in continuing this: you've already made up your mind about the validity of public vs. private health care. If any claims are made without numbers, you will demand numbers; when numbers are provided, you will claim they are gamed, skewed, or otherwise misinterpreted.

The relevant information is there - and from my experiences and wait time in the ER yesterday I cannot say I'm terribly impressed by the availability of your medical system. It wasn't a particularly busy night, but wait times were about equal to what I'd expect in Canada.

I've met many other expats from nationalized-healthcare countries who have lived in the US (some for well over a decade), and I've yet to meet a single one that doesn't regard America's health care system as some kind of barbarism.

<comment><USER7> I lived in the UK for 27 years, and then moved to California and have lived here for 7 years.

I agree. The American health care system is barbaric, and is just about the only reason my wife and I occasionally think about moving back to Europe.</comment></comment></comment></comment></comment></comment></comment></comment>


Jason Goldman of Twitter and Obvious Corp talks about the future - <AUTHOR> http://namesake.com/conversation/brian/todays-namesake-conversation-is-w-jasongoldman-coo--co-founder-of-the-obvious-corporation--former-vp-product-for-twitter-well-be-getting-deep-into-product-development-the-evolution-of-twitter--experience-design-product-people-take-note/?utm_source=sm&utm_medium=email&utm_term=goldman&utm_campaign=live

<comment><USER2> He's being very honest about his path developing Twitter. Very cool and refreshing to see someone like this converse candidly.</comment>


Ask HN: CLI – Java or Python or Go? - <AUTHOR> We want to write a command line interface tool that will be distributed to our customers. It is intended to be used on Linux. This CLI tool primarily will do few remote REST API calls, copy large number of big files from local file system to remote server (like AWS S3) and is expected to take few hours to complete.  We have lot of in-house Java expertise. Should we pick Go, Python, Java or some other language? I am biased towards Java but would like to hear additional opinions. <comment><USER2> A lot of people here are suggesting Go for its single binary with no dependencies, but if you're starting a small green field project in Java you should have no issue making sure it's jlinkable and even compiling it to a single statically linked binary with Graal.

This way you can re-use your Java expertise and still get a statically linked single binary with quick startup.

</comment><comment><USER3> JDK 11 comes with a new HttpClient. Might be useful and fun to learn.

[https://docs.oracle.com/en/java/javase/11/docs/api/java.net....](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html)

</comment><comment><USER4> Go, use cobra. It's awesome and really easy to get started and complete the project.

<comment><USER5> Cobra is great, add in Viper for config.

Goreleaser for creating binaries, home brew, os packages, GitHub releases.

</comment></comment><comment><USER6> I think you'll have the fewest distribution issues with a go binary. But if you have lots of experience building and distributing java programs to your customers then go with what you know!

<comment><USER7> Being able to build Go into a binary without any dependency makes distribution really easy. As a user I prefer a single file that I can download and run and as a developer it has really simplified builds and deploys.

<comment><USER8> agreed. for a user to get a python cli to work they will need to install python and any open source libraries your cli depends on (unless you use some tool to bundle all the dependencies with your app, in ye olden days this was py2exe or similar for bundling for windows).

similarly, for java you place the burden on your users to install a jre

with go the standard build toolchain lets you easily cross-compile a bunch of statically linked binaries, so each user just downloads 1 file for their target platform and runs it.

personally i am much more productive writing code in python than in go (this is largely a consequence of spending 20x as much time writing python than go) but go is dramatically more ergonomic from a deployment perspective and has a great cross-platform library and cross-compiler support out of the box

</comment></comment></comment><comment><USER9> I have written several similar programs using Python's cmd.Cmd class. Command completion, help messages, etc are all taken care of. All I need to do is to write the nitty gritty for each command and copious log the actions taken their return status to catch any networking, REST, etc issues. It is even possible to nest command interpreters within command interpreters to create sub-commands if applicable.

I should mention that I am more productive in Python than either Java or Go - so this may taint my view of alternatives.

</comment><comment><USER10> I really like using Go for this. The single binary with zero dependencies makes it really easy to deploy. You do not need the jvm or python environment setup. If you change something like upgrading your jvm or python or a library, aside from the path, the binary keeps working.

Maintaining things is just much simpler with a single binary.

</comment><comment><USER11> It depends on your customers. Will they have the right version of python? Will they install the Java runtime environment and the correct one (I assume that is a thing, but I'm not Java person)?

Or you can skip all of that and just use Go that runs as a single, stand alone binary and very likely uses less memory than Java.

<comment><USER12> Alternatively, you could always use pyinstaller to create a single static binary for a Python app, so no need for python to be installed at all. Not quite as performant as go, but should be good enough for this use case.

</comment></comment><comment><USER13> If you want to integrate with AWS/Azure, Python is the language of choice for CLI.

It's because the actual AWS CLI/Azure CLI is written in Python and they have the most supported interface so far known.

I personally like Go because it's easier to ship a static binary but in this case I would recommend otherwise.

</comment><comment><USER14> Java because you have devs and you can just make a shell/batch script to launch a JAR.

</comment><comment><USER15> You ask if you should use Java, Python or Go and the first three replies recommend you Java, Python and Go in that order, I love it.

</comment><comment><USER16> > We have a lot of in-house Java expertise. Should we pick Go

Give go an honest try. I am sure it will not disappoint you.

<comment><USER17> You quote "in-house Java expertise" then recommend Go? Man that is not what you should quote, and he should use Java.

</comment></comment><comment><USER18> Go is excellent at building CLI commands of this type. It maybe the thing that it's best at.

</comment><comment><USER19> Why not rust? Rust has excellent CLI support, is fast, can do REST calls</comment>


Docker user? Haven't patched Dirty COW yet? Got bad news for you - <AUTHOR> http://www.theregister.co.uk/2016/11/01/docker_user_havent_patched_dirty_cow_yet_bad_news/ <comment><USER2> As I've discused before, seccomp can block ptrace and thus this VDSO-based attack (and currently does by default in some distros). Shameless self-link to that post:

[https://medium.com/@gtrevorjay/consider-containers-a-case- st...](https://medium.com/@gtrevorjay/consider-containers-a-case-study-of- cve-2016-5195-2752efe4183b)

Containers are not a security panacea. However, it is equally erroneous to say they don't add layers to defense-in-depth.</comment>


The growth of the state: Leviathan stirs again - <AUTHOR> http://www.economist.com/world/international/displaystory.cfm?story_id=15328727 <comment><USER2> Interesting facts:

1/3 of the stimulus bill was tax cuts, and the TARP money has mostly been repaid.

Take a look at the graph of govt spending as a % of GDP -- it shrank a ton under Clinton, skyrocketed under Bush, and if you assume that we won't pass another TARP or Stimulus bill next year, it's set to go down again after one year in office for Obama.

But who needs numbers? We've got a democrat in office - government must be growing! And it must have shrunk under Bush!

<comment><USER3> Not to mention the fact the Bush Administration laid the groundwork for Obama to initiate the government bailout of GM. Bush knew it needed to be done but also recognized 1) He wasnt' going to have the time 2) it wouldn't be popular with Republicans.</comment></comment>


Using the Zune Web API on Windows Phone 7 - <AUTHOR> https://channel9.msdn.com/coding4fun/articles/Using-the-Zune-Web-API-on-Windows-Phone-7

<comment><USER2> I think the point was to learn an API, but it was much more effective as a tutorial on why XML can be an incredibly awful choice for certain things. The noise-to-usefulness ratio in the samples is maddening, isn't it?

<comment><AUTHOR> Really depends on what you're going to use it for. I tried to cover the basics, but people can go way beyond that.</comment></comment>


What Makes ColdFusion Markup Language Better Than Other Languages - <AUTHOR> https://www.epicenterconsulting.com/blog/what-makes-coldfusion-better-stronger-than-other-languages/ <comment><USER2> >No, we're not using an antiquated form of slang from the '90s.

like, whatever dude. hella gnarly.</comment>


Show HN: Is Covid-19 just like the flu? - <AUTHOR> https://iscoronavirusjustliketheflu.com/ <comment><USER2> you should mention the difference in effects. Just saying "No." isn't useful or educational.</comment>