HNHacker News
TopNewBestAskShowJobs

compay

1,997 karma · joined July 18, 2008

I program, mostly for the web and mostly with Ruby and Lua.

Me: http://njclarke.com

My code: http://github.com/norman

My blatherings: http://twitter.com/compay

[ my public key: https://keybase.io/compay; my proof: https://keybase.io/compay/sigs/5ghM6xDeYY3U9odHk-2BOd7DxA9AIP5-QcWBkrTOgSQ ]

submissionscomments
compay··on More information on Google's new web language, Dash
Agree 100%. The fact that Javascript is the only language you can realistically use to script the browser is a terrible limitation and legacy of bad technical decisions at Netscape more than a decade ago. I'm always surprised at the lack of concern about this.

While I do actually like Javascript a lot, I think we need to have more choices. When people point out Node as a benefit because "you can use the same language on the client and the server" I agree - but it misses the bigger problem in that, if you want to use the same language on the client and the server, you only have one real choice.

compay··on Lock Down Your .XXX Domain Before The Land Rush Begins
I would assume that's because using a .ly domain for pornography is a violation of the terms and conditions, and Libyan law.
compay··on Lock Down Your .XXX Domain Before The Land Rush Begins
I believe the larger adult businesses will in fact use it, if just for the branding, and to make a case for their legitimacy by having their site on an easily filtered TLD.
compay··on Linux is now hosted on GitHub
Kudos to Github. Hard to think of a better endorsement than that.
compay··on Want to Write a Compiler? Just Read These Two Papers.
Want to know Modern Philosophy? Just read Kant's "Critique of Pure Reason." After all, how hard could one book be?
compay··on Should UTF-16 be considered harmful?
I gave a presentation on this topic at Rubyconf Brazil last year, and would be hard pressed to describe Ruby as "good" at dealing with Unicode, unless by "good" you mean "avoids making almost any decisions at all" (which might actually be a good thing but it's debatable).

Ruby 1.9 doesn't even offer Unicode case folding, so from a practical standpoint working with Unicode text is a PITA with Ruby unless you use third party libraries.

Ruby source can include constants, variables, etc. with Unicode (or other character set) symbols, which is very cool but for Unicode text processing I've found Ruby to be frustratingly lacking.

compay··on Edit like an Ace
Ha, can't believe I completely missed that.
compay··on Edit like an Ace
I'm really happy to see this feature. Sometimes I see a small problem in somebody else's code or documentation and out of sheer laziness I don't go though the trouble of forking, cloning, editing, pushing and sending a pull request. I think this will be wonderful for exactly those situations and should help encourage more people to participate in open source.
compay··on Ruby Programming Language (alternative Ruby home page)
I think root of the problem is, do we want a site that reflects in-the-trenches Ruby developers' reality, or a site that reflects the Ruby core team's vision?

It seems that there's room in the world for both, they are different needs and perhaps trying to satisfy them with one website is a mistake.

compay··on Lua/APR - proper standard library for Lua
That's a very useful library, and also great example of how easy it is to hook into C code from Lua.

Another one which I prefer personally because it's more comprehensive, is Steve Donovan's Penlight. If you have a background in Python you might enjoy using it:

https://github.com/stevedonovan/Penlight

compay··on ORM is an anti-pattern
The term entered widespread use after the AntiPatterns book was published. The authors were referring to "patterns of failure" commonly seen in software projects.
compay··on GitHub: Block the Bullies
I've been trolled by people in lots of different "communities." PHP, Postgres, Java, Perl and Lua just to name a few. IMHO if a software community doesn't have jerks and trolls, it's because nobody is using the software. Ruby has its share but I don't find it any worse than the others.
compay··on GitHub: Block the Bullies
Sometimes you have to look at what somebody says, and not how they say it. I personally wouldn't have approached the trolls the way Zed did, but he was right that this was broken and needed to be fixed. Github did a great job - as far as I can tell they handled things professionally and cranked out a fix in just a few days. Everybody wins (except the trolls).
compay··on Why staying logged in to your FB/Twitter is dangerous
Ironically, the article's header has Facebook "Recommend" and Twitter "Tweet" buttons. The Facebook one has 4,000 "likes" and the Twitter one has 235 Tweets.
compay··on CEO of Svpply: I have no idea what I'm doing
True. Good point.
compay··on CEO of Svpply: I have no idea what I'm doing
It's a shame so many of the comments here are criticizing this guy for not lying more.
compay··on Fructose: compile Ruby into PHP
Tip of the cap for the fun hack factor. People asking if this is practical are missing the point, I think.
compay··on Why PHP Was a Ghetto
> why do you insist PHP is my "favorite language?"

Sorry, I guess I just assumed that because of the amount of time you've dedicated to writing about PHP on your blog, and the fact that all but one of your projects on Github are implemented in PHP. But sure, maybe your favorite programming language is one you never publish code in, and never write about on your blog. Forgive me for assuming too much. BTW, I never said there's anything wrong with PHP being your favorite language, if it is.

> You're drawing an invalid assertion based on the fact that I've been disagreeing with you.

Bravo, you've scored a point in the argument. However, you've also managed to reduce our conversation from a potentially friendly, intelligent discussion of the benefits and drawbacks of PHP to a competition to cherry pick single sentences and find the tiniest flaw in them, rather than look at the ONLY point I've been trying to make the whole time, which is that PHP's average performance on cross-platform benchmarks is not very good, and so it's not such a good idea to claim it's "maybe the fastest and most scalable scripting language" unless you have good evidence to show why the benchmarks are irrelevant.

In the course of this discussion you've lost sight of the fact that I posted a friendly, supportive comment on your post and merely pointed out one thing that I thought was inaccurate, and you've come at me with guns blazing, telling me to look into APC, which I was already using when you were probably still in elementary school. That's why I called you a cocksure noob.

> When building a webapp although, those benchmarks suddenly because unclear to me

Yep, like I said in my very first comment, I think PHP is often just fine for web apps, because its raw performance in a web context is often not the bottleneck. However, sometimes it is a problem, which is why people have invested the time into creating PHP to native binary compilers, for example. If APC solved all performance problems, do you think anybody would have bothered?

> because they mask the fact that byte/machine code caching is used for some

Stop equating Java bytecode and PHP bytecode. It's not the case that if you simply enable APC, you'll get in insane performance boost in, for example, array traversal. You'll get a significant performance boost in page request time because the interpreter doesn't need to generate the bytecode over and over again. That's it, unless you throw in an optimizer as well.

compay··on Why PHP Was a Ghetto
So do you stand by your claim that PHP's "Speed & Scalability" is "maybe the best among script-based languages"? Because in the benchmark I cited it gets spanked by pretty much everything, including other interpreted languages like Ruby, which is what I pointed out above (not Java).

And if you still can't understand why opcode caching is irrelevant to the benchmark I cited, then you are being a fanboy.

If you have a hard time believing that your favorite language may have some performance deficiencies that could be improved then you are acting like a fanboy. Simply saying "I'm not a fanboy" doesn't disprove it because actions speak far louder than words.

compay··on Why PHP Was a Ghetto
Obviously benchmarks have their deficiencies. I'm referencing one of the most standard, frequently cited set of benchmarks for programming languages but make no claim that they're perfect.

You can read all about them here: http://shootout.alioth.debian.org/

There's a very obvious reason why a language may be relatively fast today and relatively slow tomorrow - namely, other languages continue to be developed as well.

And now, here's what the point of my comment is. I assume you work with PHP and are unhappy hearing that it's slow. Well, I work primarily with Ruby, which in general is even slower, so don't take offense. :)

Let's take a look at the context of this conversation. You haven't seen any evidence of its relative speed for "several years," and haven't even given the issue enough thought to discover the most obvious reason why its status may have changed, and yet in the face of somebody offering evidence (I did on the OP) are reluctant to accept the possibility that PHP is slow. I've programmed in PHP for around 10 years, starting when 3.0 was in beta up until the first few releases of 5.x, and in that time I've seen many, many PHP developers with this attitude.

This is a general problem of the PHP community: Zend has done a fantastic job marketing PHP, and PHP has been used on so many high profile projects, that developers just assume PHP is "blazing fast," when that's simply not the case.

Now, before I get attacked as a PHP hater again, let me point out that even though I prefer to work with other languages now I am by no means a PHP hater. I just recommended a PHP solution over a Ruby one to a potential client, because in their business context I thought it made more sense and couldn't in good faith sell them a technical solution that wouldn't meet their needs as well just because it used my current favorite language.

I'll also explain where PHP is quite fast. A lot of the functionality in PHP is just a very, very thin wrapper on top C library calls, and has very little overhead. This is why things like math operations are generally quite fast. Facebook's Hip-hop compiler, which precompiles PHP to C++ and then compiles it to native binary, produces code which on some benchmarks performs worse then the original PHP code because of this fact.

But the parts of PHP which aren't just delegated to C code are in general very slow. Consider, for example, a benchmark that's heavy on array traversal. Take a look at PHP compared to other languages and see how incredibly badly it performs compared to everything else:

http://shootout.alioth.debian.org/u32/benchmark.php?test=bin...

TL;DR: 16 minutes for PHP and 268.15 seconds for Ruby 1.9.

If you want to bitch about the fact that that benchmark includes the time it takes PHP to compile the code, well, then subtract roughly 0.1 seconds from PHP's time, but also do it for Ruby since Ruby's benchmark also includes compile time. Opcode caching isn't going to save you here.

Think about this for a second: what do you use more in a web development context: math operations, or array traversal? Just think how much time your web apps spend looping over database result sets. See what I mean? PHP may certainly be "good enough" but please just stop saying it's the fastest thing out there unless you can show me some proof.

If the PHP community had more of a backbone and stopped believing untruths like "our docs are the best in the business" and "PHP is the fastest scripting language" then Zend would be forced to do something about it. The fact that the language, the interpreter, and all the soft infrastructure around it are such a mess is not because Rasmus or Zeev or Andy are incompetent, it's because for years they've had such an incredibly unskeptical community of "true believers" that never holds their feet to the fire on anything. Stop being a true believer. Insist on something better. Bitch and complain if you have to. That's how to improve the programming language you love to use.

compay··on Why PHP Was a Ghetto
I posted some generally supportive comments on his post, but dared to point out that PHP's interpreter is in fact rather slow compared to pretty much everything else, so he shouldn't claim that PHP has "maybe the best speed and scalability among script-based languages." I ended up getting attacked as some kind of PHP hater.

If PHP has a reputation as a ghetto, it's in part because of cocksure noobs like this who think they know everything and are impossible to have a rational conversation with.

compay··on Chomsky was wrong: evolutionary analysis shows languages obey few rules
Yeah, I tried to be careful to criticize only the Ars article, since I imagine there's a strong possibility the original may have been misquoted or misinterpreted.
compay··on Chomsky was wrong: evolutionary analysis shows languages obey few rules
Well, I was admitted to a PhD program in linguistics which required more than passing familiarity with the basic concepts of Chomsky's research, of which Universal Grammar is the basic concept.

In my comment UG = Universal Grammar.

compay··on Chomsky was wrong: evolutionary analysis shows languages obey few rules
I studied linguistics in the 90's, including a class and a few seminars with Chomsky, but left grad school after a year. At this point I'm neither a linguist nor an expert but maintain a slightly more than passive interest in the field.

These kinds of crackpot articles surface every couple of years in the mainstream press, always from people who demonstrate no knowledge of Chomsky's work beyond having read the back cover of his 1965 "Aspects of the Theory of Syntax."

I didn't read the original article, but as described in the Ars article, the thesis makes absolutely no sense whatsoever. The fact that we may have a hard time reconciling how languages can be diverse in their handling of subject/object/verb order doesn't disprove the concept of Universal Grammar. In fact, it's an argument for Universal Grammar that we can even have a coherent conversation about the way all languages handle subject/object/verb order - Universal Grammar is not about providing a set of rules describe all languages, it's about explaining what a possible rule is, and you have to approach that with logic rather than statistics.

The Ars article talks about "languages that have been evolving for a minimum of 4,000 years," as if those languages simply sprung into existence a little more than 4 millennia ago with no relation to anything else. This is the linguistic equivalent of creationism.

[Edit: expanded acronym "UG" to "Universal Grammar" for clarity]

compay··on Ask HN: Help, my $150,000 student debt is ruining my life, and my future
> Extradition is unlikely

An understatement, to say the least.

> but getting back into the US could be sticky to say the least

Really? They're not going to allow you back into the USA, or arrest you at the border for defaulting on a loan? That doesn't sound very credible at all. Any evidence to back that up?

compay··on English as a second language: Test results on the most fluent countries
I believe it. I know quite a few developers from there and aside from being quite talented at what they do, their English is excellent. But having spent little more than a weekend in the country I didn't want to assume they were a representative sample. :)
compay··on English as a second language: Test results on the most fluent countries
Argentina was #16 overall and #1 in Latin America. As an American living in Argentina I think that sounds about right. Knowledge of English is definitely more widespread here than in other countries in Latin America that I'm familiar with, particularly in Buenos Aires.
compay··on 7.1 magnitude earthquake hits Japan
It depends on many factors. I was in a 6.8 earthquake in Seattle in 2001 that did some fairly significant damage to a few buildings in Pioneer Square, but otherwise was just a scare and an inconvenience. At the time I read that we got off "easy" because of the depth of the epicenter. An earthquake of similar magnitude had hit Turkey a few years before that and did a lot more damage.
compay··on Plain Text Offenders - Did you just email me back my own password?
Codeweavers, the creators of Crossover for Linux and OS X, do this. I emailed them about it around a year ago and they never bothered to reply back, even though I've bought several licenses from them over the years.

https://www.codeweavers.com/login/

compay··on Raphters, a web framework for C
I'm thinking of small devices like wireless routers, phones and maybe even wristwatches. I like the idea of having a full stack framework for web apps, served locally on a tiny device. You could reuse a lot of code that way and at least for phones, potentially avoid some of the cost of having a native app with totally different code from your web app.

But yeah, LuaJIT recently added support PPC and soon will add ARM, so point well taken - to do what I'm thinking of, it may not really be necessary to have anything in C.

← PreviousPage 4 of 16Next →