HNHacker News
TopNewBestAskShowJobs

60654

1,890 karma · joined October 25, 2016

submissionscomments
60654··on Ask HN: Best Lisp for software development?
If you want to use Common Lisp, the best implementation by far is Allegro Common Lisp from Franz (https://franz.com/). This is the Lisp that gets used by research labs whose bread and butter is Lisp and AI work, and their tooling (runtime, libraries, debugger, IDE, etc) is the best bar none. I've used it for a while some years ago, and came away very impressed. However, it is a commercial product, and not free (but not as expensive as some other commercial development tools).

For a free CL, SBCL is very good. However it's a very "classic" kind of a language, with just text mode tools and a unix bias.

For a non-CL Lisp-like, Racket is fun, but their debugging story is not my favorite. But pragmatically speaking, Clojure is probably the better choice. It is based in the Java Runtime, so things don't work exactly like they would in a normal Lisp, but in exchange you get great interop with a ton of Java libraries and tools, which I think is a net positive.

That said, Franz ACL would still be my tool of choice, if non-free is not a deal-breaker. :)

60654··on Despite High Hopes, Self-Driving Cars Are ‘Way in the Future’
Well said. Autonomous navigation is still a huge open research problem, in the sense that we don't even know how it _could_ work, there is no AI work capable of integrating all of the necessary pieces. Heck, we don't even know how simple bird or lizard intelligence works, much less be able to replicate human cognition that goes into operating heavy machinery in a busy multi-agent social context.

So promising that it will be not just solved, but productized into a polished consumer gadget, in 5 or so years, was an astonishing, unbelievably foolish promise.

And worst of all, yes, it came from people who should have known better.

And as a quick aside: there's much talk about "ethical AI", but here's a more common AI ethics failure: taking money from funders, shareholders, and customers, with promises of imminent deliverables, while knowing full well that the AI advances required for that haven't happened yet, and there's no evidence for when they will, if at all.

60654··on Facebook was called a 'chaos factory' and maker of 'data voodoo dolls'
While the article mentioned McNamee and "Zucked", on the topic of behavioral manipulation strategy by big tech, there's a much better, more thorough recent book: The Age of Surveillance Capitalism by Shoshana Zuboff, a professor emerita of economics at Harvard. It's an excellent analysis of what big tech is doing, and where it's heading.

Just one quote from an interview in this review:

https://www.theguardian.com/technology/2019/jan/20/shoshana-...

> "It is no longer enough to automate information flows about us; the goal now is to automate us. These processes are meticulously designed to produce ignorance by circumventing individual awareness and thus eliminate any possibility of self-determination. As one data scientist explained to me, “We can engineer the context around a particular behaviour and force change that way… We are learning how to write the music, and then we let the music make them dance.” This power to shape behaviour for others’ profit or power is entirely self-authorising. It has no foundation in democratic or moral legitimacy, as it usurps decision rights and erodes the processes of individual autonomy that are essential to the function of a democratic society."

60654··on Should array length be stored into a local variable in C#?
Nice benchmarking on Microsoft .Net CLR. Looks like the JIT compiler is smart enough to recognize that array.Length is an invariant and hoist it out of the loop, which is awesome for the common use cases!

One nitpick about the title: C# runs on more runtimes than Microsoft .Net CLR, and those may behave very differently. For example: Mono CLR, or Unity's IL2CPP which is an ahead-of-time compiler.

Specifically, I'd expect IL2CPP would not hoist length out, because it would not recognize it as an invariant. (Some great examples of IL2CPP cross compilation are here: https://jacksondunstan.com/articles/4749 )

TLDR: the Microsoft JIT compiler makes the local variable unnecessary, but this is a property of the JIT, not of C#. Developers on non-MS platforms shouldn't assume this.

60654··on The multi-armed bandit problem (2012)
That's a nice paper, thanks for posting this!
60654··on The multi-armed bandit problem (2012)
Multi-armed bandits are also well known in game AI. They got popular with the introduction of Monte Carlo Tree Search, where MAB are used there to select which subtrees to search for largest expected payoff, e.g.:

https://www.aaai.org/ocs/index.php/AIIDE/AIIDE13/paper/view/... https://courses.cs.washington.edu/courses/cse599i/18wi/resou... etc.

For what it's worth the MAB algo in the original post looks like Epsilon Greedy. It's probably better to look into Upper Confidence Bound variants like UCB1 that dynamically adjust how much to explore vs exploit, e.g.:

https://towardsdatascience.com/comparing-multi-armed-bandit-...

60654··on Google and Binomial Open-Source Basis Universal Texture Format
From this [1] it sounds like the texture is a modified variant of ETC1, which gets loaded up from disk into memory as such, and transcoded on the CPU into target GPU format (DXT, PVRTC, etc), and then uploaded to VRAM.

If so that sounds similar to their previous Crunch library [2], in that it does transcoding on the CPU before moving the texture to the GPU - but most likely much faster than Crunch because it starts with ETC as shared basis. (And artifacts are a common with transcoding between compressed formats, especially when transparency is present, but I have high hopes for this one considering the authors! :) )

Authors suggest that a version that transcodes on the GPU would be possible - that would be really interesting, I would imagine that would be even faster, although at the cost of higher texture memory usage.

[1] https://github.com/binomialLLC/basis_universal#quick-basis-f... [2] https://github.com/BinomialLLC/crunch

60654··on Chicago successfully taxes streaming services
For what it's worth - the title is a bit misleading.

The tax began its life as an extension/adaptation of an existing 9% "amusement tax" on patrons of amusements (movie theaters, bowling alleys, etc) in the city. But until 2015 it only included physical businesses, not any of the new online replacements. The definition is now expanded to include online games, streaming movies, movie tickets sold online, etc.

Also, this has been in effect for a while now (e.g. my Netflix bill went up by $0.99 a year ago) and all the various online businesses have already implemented it. Not sure why the article is bubbling up now, just as the new mayor is about to take office. :)

For more history see https://www.forbes.com/sites/kellyphillipserb/2018/05/29/chi...

60654··on Opposition to Sidewalk Labs in Toronto
The opposition to this is not just from the privacy perspective, there's also the issue of data ownership, and giving all this data away to Google for free. And once it's owned, both cities and citizens lose all control and oversight - you can't get yourself removed from the dataset, impose restrictions on how this personal data will be used, etc.

There are some good quotes in this older Reuters story (https://www.reuters.com/article/us-canada-cities-privacy-fea...):

> The proposal amounts to “permanent surveillance” and “massive data scraping” under the guise of fighting climate change, he said. “They are conducting an experiment in real time, in the real world: the privatization of our cities on a large scale. They will have intellectual property rights over all of this (data).”

> “We live in a system that values property rights,” Orasch told the Thomson Reuters Foundation. “In that system, data is a valuable asset for an individual to have.”

And the developer asking for investment money and a cut of property taxes, on top of gathering all this private data and owning it forever without oversight, is just icing on the cake. :)

60654··on Get Your Book, Make It Free
What a great reminder to authors that it's possible. Especially in tech, since the various technologies get replaced so quickly - quite a few books barely sell out the first printing before they're already obsolete. Why not put them up online for free after that.

Plus, the freebie can serve double duty as free marketing for the next edition.

60654··on 3D Game Shaders for Beginners
Oh sure, and especially for custom materials with specific lighting or masking properties, or for tweaking instanced meshes, etc. The standard materials only get you so far.

But post fx like bloom or vignette? I'm okay using a stock shader for that, it's not worth spending the time on building one from scratch. :)

60654··on 3D Game Shaders for Beginners
That's a very cool intro to a variety of shader techniques, especially post-processing effects.

What's even more wild, is that modern engines include all of this stuff out of the box, you just have to tick a few check boxes to enable them in your game. :) For example, check out these postprocessing filters built into Unity and Unreal - a ton of person-hours went into these:

https://docs.unity3d.com/Manual/PostProcessingOverview.html

https://docs.unrealengine.com/en-us/Engine/Rendering/PostPro...

60654··on Tokyo's Underground Discharge Channel
These enormous underground projects are so interesting.

I've been following the Chicago Deep Tunnel project, which is nearing completion after half a century of work.[1] Because Chicago was built on swampland and next to the lake, rainwater used to be a huge problem because it didn't have anywhere to go when it rains, except into sewers - which used to be well under capacity for burst rainfall, which led to basement flooding etc.

So the city is building (and almost finished with) a set of huge tunnels across the entire city that regular sewers will drain into during flash floods, and then pump the water out to reservoirs repurposed from abandoned quarries on the edge of town. The target capacity is 17 billion gallons, which is apparently the volume of twelve football stadiums stacked together? [2]

I'd love to tour that construction. Not sure they offer public tours though. :)

[1] https://interestingengineering.com/chicagos-deep-tunnel-proj... [2] https://www.mwrd.org/irj/portal/anonymous?NavigationTarget=n...

60654··on Immediate Mode GUI
Oh, they're switching to RMGUI in the editor as well, though more slowly. More info here:

https://blogs.unity3d.com/2019/04/23/whats-new-with-uielemen...

60654··on Immediate Mode GUI
Oh no, not again! (Just kidding :) )

Immediate mode UIs come up every now and then, especially in games, and for relatively simple things they're a neat idea (imagine not retaining any extra view state!) But - and there's a big "but" coming up - it does not scale to complex and stateful UIs.

The problem is that, for games that have complex needs - think simulation and strategy games, not racing or arcade - complex UIs are needed to express complex relationships between underlying data and the relevant UX flows. But how do you do that in IMGUI? This information about UI state, layout, etc. is not in the UI anymore, but it has to live somewhere - so you end up having to build your own layout and UI management stuff, and basically duplicate what a RMGUI library would offer, but now with less generality and potentially more bugs.

For the probably best known example, Unity used to have an IMGUI [1] but they've actively moved away from it. It's still there in vestigial form, the API is not removed, but game developers don't really use it.

[1] https://docs.unity3d.com/Manual/GUIScriptingGuide.html

PS. And there's also the lack of visual layout tools, which is directly related to IMGUI's reliance on code to produce layout.

60654··on Fluent 1.0: a localization system for natural-sounding translations
Yeah this is where these things fall apart. I haven't used Mozilla's Fluent but I used a very similar closed source system at another company some years back. Some failure modes:

- Gender agreement is not trivial. In French, in "Mary bought it" the verb needs to match the gender and number of the object not the subject: "Marie l'a acheté" vs "Marie l'a achetée" vs "Marie les a achetés" depending on the gender/number of the "it" object. But in most other cases the verb needs to match the subject in gender and number, in Polish "Maria kupila" vs "Stas kupil" vs "Oni kupili".

- In many languages nouns need to agree in case, gender, and number with the phrase they're in, even in English we see this with pronouns: "this is he" vs "this is his".

- And not to mention number agreement between pronoun and either subject or object, depending on context: "this is the button" vs "these are the buttons" - but also "this hovers over the button" vs "these hover over the button" etc. Pronouns in general are a world of hurt, as are copulae (is/are/etc)

- So once we want more complex sentences, simple word tagging like $gender becomes insufficient, because now there's multi-party agreement to worry about, we have to worry about $gender_subject and $object_gender_number_case, etc.

This becomes completely untenable for all but the most technical translators. Maybe those are easy to find for a world famous project like Firefox. Unfortunately, not so for a run of the mill commercial project.

60654··on The case for rejecting the memristor as a fundamental circuit element (2018)
I'm not sure the logic gate metaphor works here, because the domain is so different, the questions relate to the charge-voltage relationship and its first and second derivatives.

Maybe a different metaphor would be better: a bank statement involves stored money (like a capacitor), and a profit/loss sheet involves effects of money moving over time (like a resistor), and you can see how they're related through integration/differentiation, but they're fundamental because you can't create a bank account by nailing a bunch of P&Ls together.

Ok, so maybe that's not a great metaphor either? ;)

The paper does discuss equivalence categories (along the lines of nth derivatives of charge and voltage) so it's probably best to refer directly to that!

60654··on The case for rejecting the memristor as a fundamental circuit element (2018)
Oh what a thoroughly impressive academic hatchet job, and I mean that in the kindest possible sense. It's intended to kill the idea of memristors as fundamental passive circuit elements, and it's very good at doing just that.

TLDR: by re-deriving the periodic table of passive elements from first principles, it shows that memristors don't fit. The "missing fourth element" from Strukov's table is not really a missing type of a passive element. Rather, it shows that Strukov's table itself is wrong, that it's just a view of the standard C/R/I relationships that conflates two different ways of looking at resistance specifically (see especially https://www.nature.com/articles/s41598-018-29394-7/figures/3 )

FWIW this does not diminish memristors as potentially industry-changing inventions, like transistors. But it denies them the status of fundamental, irreducible passive circuit elements, specifically, partly by showing that while fundamental elements are all connected by charge-voltage relationships (specifically, changes over time, like position/velocity/acceleration are in classical physics), memristors don't have a unique spot there; and also because fundamental elements can't be composed from each other, while the memristors demonstrated so far are "nonlinear composition of resistors with active hysteresis".

60654··on Removing Array Duplicates
Gah, I see the confusion, in one sentence I was talking about single element access, and in the next about full copy, and I was just assuming the jump was clear to the reader but clearly it wasn't.

So just to be fully explicit:

Single element access in a hash table is only ~O(1) when it's amortized over many accesses of a table that assumes few collisions (due to size and a good hash function). But the real worst-case performance, in case of incessent collisions, is going to be the performance of whatever data structure hides behind each bucket: O(n) if it's a naive list, O(log_x n) if it's a simple tree, etc.

So copying a full list into a hash table is not O(n), it's O(n^2) if the buckets are backed by naive lists, O(n log_x n) if the buckets are backed by simple trees, or another superlinear bound for another backing data structure.

How about it?

And personally I would still prefer to de-dupe an array by dumping into a hashtable and back, but the OP is right, you have to be careful about implementation details of both the hashtable and the hashing function. The simple hashtable-and-back can produce much worse perf than sort-and-dedupe if stars don't align.

60654··on Removing Array Duplicates
Not sure why you're getting downvoted. It's plainly true that hash tables accesses are only O(1) amortized. The real worst case is ~O(n log n) (or whatever the bucket data structure is) in the case of collisions and/or filling up.

And we can always pre-allocate a huge array for the buckets, but the behavior of the hash function is always going to be a risk.

60654··on Everything Is Going Deep: ‘The Age of Surveillance Capitalism’
That doesn't mean the meaning has to be precise or truthful. Poetry, metaphors, marketing, implication, white lies - they all rely on meaning being multifaceted, and bringing things to mind without actually saying them explicitly.
60654··on Everything Is Going Deep: ‘The Age of Surveillance Capitalism’
> "That’s why the adjective that so many people are affixing to all of these new capabilities to convey their awesome power is “deep.”"

One of the best pieces of academic marketing was calling this set of techniques "deep" learning. The word is so rich with connotations, it immediately brings to mind all the synonyms: profound, complex, arcane, etc. It makes people ascribe far more complexity to the system than it actually has.

When in reality, it's just a "massively multi-layered and multi-stage" network. But that doesn't sound nearly as profound, and doesn't allow journalists to spin wild tales.

60654··on Itch.io – Marketplace for Indie Games
Itch is very cool. Their tools are dev friendly, even the download client got released as open source (https://github.com/itchio).

And on the publishing side, they allow anyone to publish on the site, for free, no hoops to jump through. And if it's a paid app, they charge much less than Steam / iTunes / etc. Too bad they're not as popular with players.

But I'm idly curious why Itch popped up now, since it's been around for years.

60654··on Game dev: Linux users were only 0.1% of sales but 20% of crashes and tickets
This is a pretty well-known effect in gamedev. The specific numbers change, but Linux sales are only a small percentage of total, while generating much more development and support work.

At least dev work can be drastically simplified with middleware like Unity, which is how small studios can even consider Linux. But support difficulties are real. Players have so many possible distros, configurations, and drivers - actually supporting all of them would require a level of Linux expertise that gamedevs simply don't have (being typically Windows or OSX based themselves). Limiting yourself to something like Ubuntu LTS helps a bit, but there are still plenty of gotchas.

So it becomes a simple matter of numbers: given relatively small amount of extra sales, is it worth the extra work, and spending the time to learn Linux development and administration in sufficient depth? Sadly usually it is not.

60654··on If San Francisco Is So Great, Why Is Everyone I Love Leaving?
Huh, I lived in both as well (in the city itself, not the burbs, in both cases), and had a very different reaction. I haven't felt "unsafe" in either city, but Chicago feels so much nicer and cleaner in comparison. In SF, however, the trashiness you mention is very much right there, front and center. And I haven't seen people be harassed in CHI like I've seen in SF - there's no equivalent of mid-market, with its luxury condos getting built right next to the TL.
60654··on If San Francisco Is So Great, Why Is Everyone I Love Leaving?
I liked that medium post, because I'm also one of those people who said goodbye to a number of friends who had moved away - until I decided I've had it with this town, too, and it's time to move away as well.

But the post throws a bunch of softballs. It mentions rising costs, hipster drinks, etc. And yes, the _relentless_ costs are a huge factor. But it's not just the costs that changed, it's the entire tenor of the place. The focus on money, valuations, investments... it's like working for Wall Street, with all the nonsense and none of the benefits of being in NYC. And a lot of people are looking at themselves and asking: is this what I want to do with my life? (Except for those who did...)

But on the plus side, moving away is not such a bad thing. Unlike what the post author suggests, the transplants will not "ruin" other cities. At least not the large ones: Pittsburgh, Chicago, Boston, NYC, there are great cities out there with a fun tech culture, much more housing (so it's cheaper), and they've been absorbing newcomers for a hundred years without any danger to their existing culture. (I'll leave Austin and Portland out of it - they might be too small to survive a mass migration of Californians. ;) )

60654··on Ask HN: Cheap places to live with a good intellectual atmosphere?
Yeah, if the pension plan had no assets, the state would be in deep trouble, as would most others. But in terms of pension cashflow as a fraction of total assets, IL is actually doing really well, better than the vast majority of states: https://www.pewtrusts.org/en/research-and-analysis/issue-bri...

Which is what allowed politicians to kick the can down the road for so long. So yes, there is a hole and it needs to be plugged. But this is a big state, plan assets are considerable, and there's a lot of new contributions coming in all the time as well. This won't trigger "ever increasing taxes" as some doomsaying politicians put it, there can be a correction once there is political will to do so.

60654··on Ask HN: Cheap places to live with a good intellectual atmosphere?
Agreed, I lived in both SF and Chicago and much prefer Chicago. As a city, it's much better, more livable.

Plus it's cheap. There's so much housing stock available, you can find a place at practically any price point you want, from super affordable to very expensive. I tell my SFBA friends how much I paid for a condo in the city and their eyes pop out. :)

Also the hiring situation is desirable. Northwestern and UChicago are top notch schools, and many of their graduates would prefer to stay in the area for work.

60654··on Ask HN: Cheap places to live with a good intellectual atmosphere?
I hear taxes brought up a lot, but they're actually on par with major metro areas. Let's compare Chicago to SF:

1. Effective property tax rate: SF ~1.2%, Chicago ~1.7% *

2. State income tax: SF 9.3%+, Chicago 4.95%

3. Combined state, county + city sales tax: SF 8.5%, Chicago 10.25%

(* But property taxes do get much higher in the suburban townships!)

Altogether, the lower state income tax more than offsets the slightly higher property tax.

But taxes is a favorite bugbear in local political campaigns, because they're an easy item for politicians to harp on (who doesn't want lower taxes after all?). The other day I saw a political ad where the actor proclaimed, "I'm moving out of Illinois because taxes are too high! Support XYZ for governor." But let's be honest, uprooting one's family just to optimize a few percentage points on the tax return is a terrible idea. And as long as there are good jobs available, taxes are just one living expense among many.

As for the other items, I can't agree with them either. Chicago Public Schools are totally fine - they're very much focused on educating working-class and/or immigrant kids, so they're not like rich suburban schools with all the bells and whistles, but they do their job very well. And the magnet schools are top notch. Public works are a patchwork, but for example CTA is very well funded and runs much better than either MTA or MUNI. As for corruption - ok, I'll give you that one. ;)

60654··on Low-Tech Game Systems (2003)
For anyone interested in game systems, Mike Sellers' book is the best recent introduction:

https://www.amazon.com/Advanced-Game-Design-Systems-Approach...

This blog post didn't really do much for me. The blog author's definition of system is not how contemporary game development community uses the word. We wouldn't call decks of cards "systems", they're just game pieces. Systems are things more like "economy" or "crafting" - networks of mechanics working together.

← PreviousPage 3 of 5Next →