HNHacker News
TopNewBestAskShowJobs

curveship

1,097 karma · joined December 16, 2010

submissionscomments
curveship··on Riot – A React-like, 2.5K user interface library
Confirmed. Just take the demo app and insert the line 'this is some text.' anywhere in it. It looks like it's particularly bad if you put it into a nested element: the compiler treats everything after the line (including html markup) as javascript.
curveship··on Riot – A React-like, 2.5K user interface library
Question: do I read your compiler right, that any line starting with 'var', 'function' or 'this' is assumed to be javascript? So for instance:

   <p>
      How will riot.js compile
      this line?
   </p>
would fail?

[Don't mean to sound negative: I've been playing around with my own minimalist framework, so this is right up my alley. I'm reading the code to get a feel for how we've solved problems the same or differently, including the compile phase. Neat stuff and I'll write more when I have time to go over it in more depth.]

curveship··on F# 4.0 Preview
I've used it for parts of two commercial projects (not counting side projects). One was a small parser -- C#'s parser options were uninspiring while FParsec (based on Haskell's Parsec) was great. The other was to simulate a client-server algorithm we were developing under different network situations. F#'s ability to express algorithms concisely was a real win there.

Side projects have mostly been stats/data based: using type providers to mash together different data sources, with visualization via FSharp.Charting.

curveship··on Microsoft takes .NET open source and cross-platform
What makes you think I haven't :) I spent several years as a Debian package maintainer, plus the usual mix of patches and bug reports to several projects.
curveship··on Microsoft takes .NET open source and cross-platform
I started as an open source programmer. Then I got a job as a .NET programmer. Now I'm an open source programmer again.

Feels good :)

curveship··on Foobar
My suspicion is that the HN traffic has overloaded their backend.
curveship··on Post Mortem: A single whitespace character
One reason to still use an Arduino is realtime. The arduino's minimalist OS is realtime by default, but the BBB runs non-realtime Debian. They might need RT timings for the printer interface? You can add realtime linux extensions to BBB, but it's not a beginner task -- basically rolling your own Linux installation and writing your app as a kernel module. You can also use the PRU on the BBB to get insane RT performance, but you'll have to code it in assembly. I love the BBB, but Arduino is still an easier package for simple realtime.
curveship··on Poll: A browser without tabs?
I love tabs and use them heavily, but I wish they behaved on the desktop like they do in Chrome on Android, where hitting the back button when there's no prior history closes the tab. Sometimes I open a link in the same tab (plain old forward navigation), sometimes in a new tab. I then need to remember that the first one requires a back button when I'm done, while the second requires a Ctrl-W. If I forget and use Ctrl-W when I should have used the back button, then I lose my history (and have to go to the "Recently Closed Tabs" menu to restore it).
curveship··on Hack Back – A DIY guide to those without the patience to wait for whistleblowers
The server-side upload code let him put it somewhere where PHP was enabled. So he "started" it by just going to its URL.
curveship··on BeagleBone Black GPIOs
Another great feature of the BBB GPIO pins is that you can map some of them to a register on the PRU. Since the PRU runs at 200Mhz, this gives you some really impressive real-time capability. The sysfs technique the article outlines is definitely convenient, but latency can be high, as much as 1ms. Mmaping the GPIO controller and using some real-time extensions to the kernel can get that down to a few us, but using the PRU can take it down to a handful of ns.

The PRU is the unrecognized gem of the BBB. As long as you're not scared of assembly :).

curveship··on ETA: Building the World's Fastest Bike
It depends very heavily on duration. According to the power charts they published from their earlier human-powered helicopter, their rider put out about a horsepower for the 1 minute flight duration.
curveship··on The ROI on being an entrepreneur vs. an employee
The IRS requires that you pay yourself a defensible fair market salary. If you're paying yourself only $15k, you will quite likely get audited, and unless you can defend the idea that your work is truly minimum-wage level work, you will owe quite a lot in fines. If this is advice from your accountant, I think you need a second opinion.

Edit to add citation. Also, I'm assuming you're talking about an S-Corp, since it would make not sense for a C-Corp. From http://www.irs.gov/Businesses/Small-Businesses-&-Self-Employ... :

"If most of the gross receipts and profits are associated with the shareholder's personal services [i.e. not from other employees or capital], then most of the profit distribution should be allocated as compensation."

If you're only paying yourself $15k of the %80k your company brings in, and that $80k comes from payment by clients for work that you personally did, then you are definitely on the wrong side of the tax code.

curveship··on Swift impressions
In C#, the compiler issues a warning unless you declare the shadowing method with a 'new' keyword.
curveship··on Eating Lions, Wolves, and Goats Faster
Nice! I managed to get a javascript solution down to 0.388s (https://gist.github.com/curveship/f1f7155ef5243af18bc2), but this is considerably faster.
curveship··on HippyVM
The original project at Facebook was called High-Performance PHP and given the acronym HPHP. Some clever soul then decided that HPHP should be pronounced HipHop. I guess HippyVM is just following in that trend.
curveship··on Performance comparison of Functional C++ 11, Java 8, JavaScript and Wolfram
If anyone is still reading this thread, I optimized the javascript solution and algorithm, speeding it up by almost 20,000x and beating the C++11 one by almost 1,000x. Post is here: https://news.ycombinator.com/item?id=7858485 .
curveship··on Speeding up JavaScript Goats, Wolves and Lions by 18,800 times
This is inspired by last night's post to HN of the Goats, Wolves and Lions problem: https://news.ycombinator.com/item?id=7855455 .

I and others noticed that the javascript solution posted was far from optimal. So for fun, I tried optimizing both it and the algorithm used. The end result runs almost 20,000 times faster and handily beats all implementations in the original post, including the carefully optimized C++11 one by almost 1000x.

As I say in the gist: it's still about the algorithm, not the language.

curveship··on Performance comparison of Functional C++ 11, Java 8, JavaScript and Wolfram
Let s = startups, b = bigcorps, z = zombies

1) In any of the transformations [(-,-,+),(-,+,-),(+,-,-)], the delta b/w numbers (s-b, s-z, b-z) changes by 0 or 2. What this tells us is that if the delta is odd to start, it will always be odd, if even always even.

2) Since the final state will involve only one type left standing (or else the stronger could eat the weaker), we know that the final counts will be two at 0, one at something >0. Since our losers end with an even delta (0), they must always have had an even delta. In the scenario you proposed, that's s and z (2055 - 2017 = 38). So b, bigcorps, is going to be our winner.

3) Now that we know who will win, we need to find the maximum possible number of bs remaining. Since each move reduces the total population by one, the maximum bs will be produced by the shortest sequence of moves that gets rid of all zs and ss.

4) As long as z>0 and s>0, our best move is to have z eat s, as it drops the population of z and s by 2. So our first sequence is to have all zs eat ss, leaving us with s = 38, b = 4023, z = 0.

5) When z = 0, our only possible move is b eats s, creating a z, which can then be eaten by an s to produce a b, thereby restoring b to its original count and lowering s by 2. After repeating this sequence 19 times to get rid of the 38 ss, we'll have s = 0, b = 4023, z = 0.

Ergo, maximal final state is 4023 bigcorps.

curveship··on Netflix replies to Verizon cease and desist letter
I've seen this argument about Netflix's oversized traffic slice, but it always seems to me like it should mean the opposite: if Netflix is 35% of the reason people sign up for broadband, isn't Netflix making broadband more valuable? People are willing to pay more for broadband because Netflix makes it worth more to them. So shouldn't the broadband providers be paying Netflix rather than the other way around? You never hear the cable TV providers complaining that a particular channel has gotten too popular. What's different here?
curveship··on Introducing Swift
Not sure the date. I first noticed the change back in April, when I was profiling some code. Ask vegorov: http://mrale.ph/blog/2012/09/23/grokking-v8-closures-for-fun... .
curveship··on Introducing Swift
Yep, this is as per spec: http://www.ecma-international.org/ecma-262/5.1/#sec-10.4.2 . "Indirect" calls to eval (i.e. assigning eval to another variable, like you did by passing it as a param) are evaluated in terms of the global environment. "Direct" calls, like in your second example, use the local environment.
curveship··on Introducing Swift
OK, thanks. I guess that makes sense. Now that the website is working, I see that they're aiming at fairly seamless interop between Swift and Objective-C, so I guess they need a similar memory strategy.
curveship··on Introducing Swift
So go ahead and run his test. Things have changed :). Memory builds up 1mb/second, then after a few seconds, you'll see it drop back to zero, as the GC runs.

V8 has seen a lot of really nice optimizations to closures over the last year. My favorite is that closures are no longer considered megamorphic.

curveship··on Introducing Swift
Yes, the V8 compiler bails out of several optimizations if your function uses eval. You can see this in the profiler: functions which V8 wasn't able to optimize will have an alert sign next to them, and if you click it, it'll tell you what the issue was.
curveship··on Introducing Swift
> In this example, the compiler could not possibly have known I was going to access x.

Right, but it knew you were going to use eval, and to support that, it had to allocate all local variables in the closure. That's why you saw this behavior. The same would happen if you used a 'with' construct.

curveship··on Introducing Swift
> It has the concept of explicitly capturing variables from the surrounding context inside closures, like PHP does, instead of keeping the entire context alive forever like Ruby or JS.

Just as a point of fact, javascript -- at least the v8 implementation I'm most knowledgeable of -- doesn't "keep the entire context alive forever." Only variables used in the closure are allocated into the closure (i.e. on the heap), the others are allocated on the stack and disappear as soon as the function returns.

I don't use iTunes so can't read their book, but I wanted to ask: you say that ARC is still their GC strategy, correct? So reference cycles are still an issue? I'm surprised at this. I can see reference counting being a strategy for moving a non-GC'd language to GC (like Objective-C), but to start a new language with that constraint is surprising.

curveship··on Introducing Swift
Informal protocols and implicit interfaces are not the same thing. In particular, implicit interfaces are type checked statically at compile time, while informal protocols are checked dynamically at runtime.
curveship··on The Swift Programming Language
Am I the only one who thinks the name "Swift" sounds a lot like "Dart"?
curveship··on Google's XSS game
https://curveship.org/alert.js
curveship··on Tech firms write to U.S. FCC to oppose 'net neutrality' plan
True, but it's also worth noting that there were rumors a month ago that Apple is trying to broker an anti-net-neutrality deal with Comcast whereby Apple traffic will get priority treatment: http://www.tuaw.com/2014/03/24/apple-comcast-and-net-neutral... .
← PreviousPage 3 of 7Next →