HNHacker News
TopNewBestAskShowJobs

gngeal

987 karma · joined March 2, 2013

submissionscomments
gngeal··on What Lua scripting means for Wikimedia and open source
Not if your brain is used to doing modular arithmetics since childhood. :/ Python whitespace and Lisp parens seem trite in comparison to that. I just get 1-based indices more often wrong that I get 0-based indices wrong.

(When doing things like "given an interval of indices a-to-b, partition it into n subintervals so that every element of the original interval is in precisely one of the sub-intervals, and the lengths of the intervals are either the same or as close to each other as possible", I find the "count from one, bounds are inclusive" model horrible. How do you express an interval from a with the length of zero? It's just <a,a) with half-open intervals. What, <a, a-1>? So many special cases with the <a, b> model...)

gngeal··on What Lua scripting means for Wikimedia and open source
"Transforming wikitext into HTML is surprisingly IO-bound, since most Wikipedia pages transclude many other pages for templating and logic."

Sounds like a case for in memory caching. Or is it that any random Wikipedia page requires logic from a random subset of a large pool of other pages? Somehow I doubt that, with Zipf's law coming to my mind.

Also remember that an HTML5 front-end would be able to cache a substantial amount of this (a few megs at least) and Lua can be quite effectively compiled into JS.

gngeal··on What Lua scripting means for Wikimedia and open source
You don't even need to do that, you can run Lua in a multithreaded program, as long as no lua_State is accessed from multiple threads. You can spawn independent interpreter states, have them do their job and terminate. The whole Lua codebase as such is completely stateless (apart from the state that you keep for your code). The shorter the scripts actually run, the smaller overhead you get by this.
gngeal··on What Lua scripting means for Wikimedia and open source
Why not? Isn't that the whole purpose of coroutines in Lua?
gngeal··on What Lua scripting means for Wikimedia and open source
"But, because we’d never planned for wikitext to become a programming language, these templates were terribly inefficient and hacky — they didn’t even have recursion or loops — and were terrible for performance."

That sounds like the life story of PHP! And many other similar solutions.

gngeal··on Show HN: a lexer, parser, interpreter and web runtime (np, a 5-weekend project)
"To my surprise, making decisions about how scope should work was actually the hardest part."

Perhaps a thorough reading of SICP would enlighten you as to how scope should be handled if you don't want to run into problems with it.

gngeal··on Steve Jobs claimed the best coders are 100x better than avg. Still true today?
Why unfair? I have a friend who is an extremely competent programmer (and a very prolific writer) and he sends me - of his own initiative - snippets of code written by his cow-orkers (or at least he did, until he switched jobs and went into a company with much more respectable peers, so there's no fun to be had in that). You wouldn't believe what some people are capable of attempting to write. (Except, of course, you would, if you visit thedailywtf.com with any frequency.) Let's just say that, for example, an awful lot of people believe these days that they are competent enough to rewrite date-handling libraries in the Java ecosystem. Of course, the correctness of the result fails horribly.
gngeal··on Clue 0.6 - C to Lua, Javascript, Java and Perl compiler
You don't have to verify the code with gotos, you have to verify the translator. After all, if you were serious about this, you'd have to stop using most computers since they do actually run programs with JMPs in in.
gngeal··on Clue 0.6 - C to Lua, Javascript, Java and Perl compiler
Lua 5.1 doesn't have this, which means I have to fake goto using what boils down to a switch statement. This is much less efficient.

Or he could just use tail calls and be done with it. I mean, that's the reason why the tail calls are there in the first place.

gngeal··on Digital Comic Publisher Quits, Customers Lose All Their "Purchased" Titles
In that case, Wireshark and protocol analysis comes to the rescue. The trick is to find the images in the mess that is the downstream packets, but I've had success in the past with recording VoIP calls this way (the client didn't support recording).
gngeal··on Digital Comic Publisher Quits, Customers Lose All Their "Purchased" Titles
What about a caching proxy? You can't view it on your screen unless the browser downloads it anyway.
gngeal··on CSS3 Patterns Gallery
"The one with hearts is 944 bytes (css file), 232 bytes gzipped (with 7zip)"

Did you measure the compressed size on its own or as a delta inside a larger CSS file? The pattern is going to share at least a part of its dictionary with the rest of the CSS file if sent deflated.

gngeal··on A $4.99 utility that might just have saved Windows 8
"(Disclaimer: I work at MS. I do work on windows.)"

A minor nitpick: I thought that you call this "disclosure" in English, not "disclaimer"? (I'm not a native speaker, which is why I may be easily wrong, but something is nudging me to ask when I see things that seem wrong to me.)

gngeal··on How to Escape from {{ #PROGRAMMING_LANGUAGE }}
"And I've found that learning a lot of languages is a waste of time."

I'd say that your time would be much better spent learning language concepts and learning to implement them yourself in some sane environment, like OMeta, for example. This way, you could 1) do the incremental changes you want (instead of throwing away one language wholesale and learning another from scratch), 2) recycle the execution environment you have to use (e.g., at work, instead of being forced to switch), 3) broaden your horizons in a fundamental way (learn about type systems, implementation techniques etc.).

"But it's so much more efficient to just become better at the languages and frameworks you use at work and then use that experience to become good at new technologies for that area."

That's exactly in line in what I'm suggesting. Also, wait until Javascript gets tail calls (coming in EcmaScript 6), and you'll be able to implement a vastly increased range of additional language features yourself, in an elegant way (think CPS transforms).

gngeal··on Russian Satellite Hit by Debris from Chinese Anti-Satellite Test
"Gravity doesn't do anything on its own, in the absence of other forces, the orbit of a steel nut around the earth would be stable"

Actually, it wouldn't, because orbiting a celestial body radiates energy in form of gravitational waves, but in case of Earth's gravitational field and at the speed of orbiting satellites, this mode of losing energy is negligible.

gngeal··on Some dark corners of C
"The point of an anonymous function isn't to make it not have a name, but to be able to define it where it is needed instead of referring to some specific function name in your code."

Actually, its point is to make it a value that can be referenced from any number of bindings (associations between names and values) in any number of scopes. What you're saying is just a consequence of this.

"It also fits well with the way PHP handles "pointers", by storing the name of a variable in another variable."

Which only shows the deficiency, since any such indirect reference should never refer to a name, but to a binding instead.

gngeal··on Wikidata, the free knowledge base that anyone can edit
"The term "WikiData" seems to connote data of the tabular type"

There's a strong correspondence between "tabular data" (you probably mean relational) and triples (<predicate,X,Y>). Bot are based on the first-order predicate logic, so there's actually a natural mapping.

gngeal··on Microcode: the place where hardware and software meet
There are many more machines without microcode - 6502, machineForth chips like f21, c18 etc. I'd argue that they are much more appealing to a designer with taste.
gngeal··on On being a girl in computer science - a confession
"The culture of CS, "judgmental introversion" as you put it, is not anything intrinsic to CS. Indeed, software engineering is a profession that demands a high level of communication and cooperation."

Except that 1) CS has nothing to do with software engineering, 2) a cursory review of the current field of software reveals all too easily that the current breed of "software engineers" haven't learned their lesson from the 1970s and 1980s. Why do you ascribe the ability to communicate and cooperate to people who perpetually reinvent the same stuff all over again and aren't bothered by it in the least is beyond me.

gngeal··on Escaping a Python sandbox (NdH 2013 quals writeup)
Given a sane language and a sane exposed API, it's not difficult to limit what the remote code can do. It's just that bolting a software-based isolation layer ("sandbox") on top of something existing can be expected to yield a few holes in the process. If I were to use anything existing, it would be something like Lua. Just strip away the standard library API and replace it with something strictly under your control.
gngeal··on Google called the MPEG-LA's bluff, and won
It's like negotiating with a terrorist.
gngeal··on Extreme debugging - a tale of microcode and an oven
Why not? Much better than assembly. I believe that even today, a sound asynchronous stack design (much simpler, therefore with asynchronicity still being a viable option) would consume less joules per unit of computation than any current ARM/x86/RISC nonsense. (You don't actually have to program in the Forth machine code, it's just that it's still a good medium for many interesting high-level languages.)
gngeal··on Some dark corners of C
That's true (except for C), because I can't see how a create_function-defined function closes over its environment), but what I had in mind was the way in which the author of the documentation, obviously one of the PHP core developers, talks casually about "returning the name of an anonymous function". It shows just how much twisted the logic of these people is.

But I suppose that goes naturally hand in hand with the cargo cult approach to language design.

gngeal··on Learning from Big Data: 40 million entities in context
Are these phone numbers or DNA sequencing data sets? :-)
gngeal··on Some dark corners of C
Hah, a nice article. :-) My favourite sentence from the PHP documentation:

string create_function ( string $args , string $code )

"Creates an anonymous function from the parameters passed, and returns a unique name for it."

So there you are. Of course you can choose to be an anonymous value, but you'll get a name assigned by the state, for free. :-) Fascinating logic, captain.

gngeal··on Physicists Discover a Whopping 13 New Solutions to Three-Body Problem
Hah, my high school memories - a graphical gravity simulator project for my CS class, leaking energy due to the use of a very naive integrator (the Euler method for ODEs).

You might want to try Stormer-Cowell, it's sort of a gold standard in orbit simulation.

UPDATED: Hmm, now that I think of it, this would probably profit more from a variable step method. Some of the close approaches seem to be really close for a fixed-step integrator.

gngeal··on Decompiling C# (async/await)
"While async/await is a cool feature and is worth using, it is worth noting the up trend in complexity of generated code – and ansyc/await generates significantly more code in the simpler language without this feature than previous new features did."

This is the case with all high-level language features. Full lexical scoping with first class functions forces the PL implementation to either generate a <code;environment> tuple for all function values, or to perform aggressive closure conversion (up to Stalin levels) in addition. Virtual method dispatch gives rise to inline caches, often polymorphic ones. Lazy evaluation forces you to generate thunks. Pattern matching forces you to generate a decision tree or a similar structure. The list goes on. You already have such things in C#, even without async calls.

gngeal··on My granny is a programmer
"To be fair you might expect that, if you have a command economy you can say "how can we get more women in IT?" and answer with "Take women out of nursing and put them in IT"."

During WW2 in Russia, the Soviets had female snipers and female fighter aces. Why shouldn't they have females in a new, blurry position of a computer programmer - a position so new and so alien to most people that no stereotypes could have evolved by then?

gngeal··on Elements of Statistical Learning
"If the last math class you took was 20 years ago, ESL probably seems rather intimidating."

Actually, only ten years ago. :-) But I do need a refresher. Just started working on it recently. I feel actually smarter today than I felt back then, so I don't think will hurt that much.

"The good thing is that most of the book requires only calculus and linear algebra. By brushing up on those topics first, you could be in a position to understand most of the basics of machine learning."

Yeah, I've noticed. The scope of the whole book is vastly overblown for my needs, my application (NLP-related) won't probably need more then the basic stuff, but any good material at my disposal helps.

gngeal··on Elements of Statistical Learning
Looks like completely normal math to me. It's not like they're trying to shove category theory down your throat or anything.

A useful book! Look just like what I needed. If there's something heavier about it, it's the terse encyclopedic feeling of it, it's not a gentle introduction in this sense.

← PreviousPage 15 of 16Next →