14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions
comment 8y ago · link · parent
Higher level abstractions are a good idea, but the problem is, are you able to exploit the capabilities that the chip exposes? For simple things like computing a scalar function elementwise over a vector, no problem, but a lot of the more interesting problems don't fit such simple templates.
comment 8y ago · link · parent
Once you get a _good_ solution to embedding untrusted code, you might find it turns out to be pretty useful.
comment 8y ago · link · parent
comment 8y ago · link · parent
So definitely yes, if you want to implement a historic Lisp. Otherwise, not so much.
comment 8y ago · link · parent
If you're programming in Rust, you can use the cpal crate, which wraps all these. I'm not sure cpal has astonishingly good performance in all cases, but I plan to work with the authors. It doesn't have an Android back-end yet, but such a thing should be possible.
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
https://groups.google.com/forum/#!topic/comp.sys.apple2/qXZy...
comment 8y ago · link · parent
It's not just Facebook, either. I got tired of getting a sick feeling every time I woke up to see my employer in another controversy, which is a large part of the reason I'm an indie game developer now.
comment 8y ago · link · parent
https://android.googlesource.com/platform/frameworks/minikin...
comment 8y ago · link · parent
comment 8y ago · link · parent
There's a learning curve, but with much experience, I find myself naturally thinking and writing in Rust code. I can get in the flow, and it feels just as high level and productive as languages prized for those qualities. I'm happy to see other very talented programmers have similar experiences.
comment 8y ago · link · parent
comment 8y ago · link · parent
I found a lot of common ground:
* Trying to write object-oriented code in Rust doesn't work well. Writing data-oriented code does.
* "Fighting the borrow checker" is a sign you might be doing it wrong. Try data-oriented approaches instead.
* Use a structure-of-arrays rather than an array-of-structures.
* Use what I call "state splitting" to borrow mutable references to just the state you need; this works well with the structure-of-arrays approach and is a powerful motivator to use it.
* To build graph-like structures, reach for a Vec of components, and indexes into the Vec for relationships, as your first choice. Self-references, arena allocators, and Rc are viable alternatives, but you should have a good reason to use them instead of Vec.
* Some form of dynamic typing is useful to keep your system loosely coupled (though we ended up with very different forms of dynamic typing, see below).
* Data-oriented approaches have taken root in the C++ gaming community, mostly motivated by performance, but adapt well to Rust, and some of the ideas may be useful in domains beyond gaming.
There were some other points that went beyond what I talked about, but could fit in well:
* A "generational index" is a good way to avoid use-after-free style errors that result from the use of a stale index. The slotmap crate can help.
And now for the things that are different.
* The exact nature of dynamic typing is different. An ECS usually uses a registry of the different component types (anymap is a useful crate) and is quite open-ended in adding new types of components. My xi-win-ui, by contrast, has two main component types, Widget and listener, and does dynamic dispatch on a Widget trait.
This naturally raises the question, which is better? From my perspective, both are valid. The pure ECS approach definitely makes sense when the components are interacting with each other in diverse ways (collisions, damage, etc). In a GUI, the components are mostly interacting with the framework, and have diverse behaviors within standardized interfaces (input, layout, paint).
Thus, one point of my talk is that you don't have to reject all vestiges of object oriented programming, it's perfectly reasonable to hybridize, using data-oriented approaches for state splitting and graph structure, and dynamic dispatch for the behavior variation.
My talk also went deeper into the ideas of "data flow rather than control flow" and the use of an event or command data structure rather than method calls. I'm not sure how deeply these ideas apply to games, but wouldn't be surprised if they do.
[1] video: https://www.youtube.com/watch?v=4YTfxresvS8 , slides: https://docs.google.com/presentation/d/1aDTRl5R-icAF38Di-qJ4...
comment 8y ago · link · parent
But I do need to say that third-party fonts are not the problem here, or shouldn't be. Neither Google Fonts[1] nor Typekit[2] sets cookies. I don't know off the top of my hand if any of the other services do, but if so I would agree it's a good reason not to use them.
Disclosure: I helped launch Google Fonts and was involved in the decisions to make it privacy-friendly.
[1] https://developers.google.com/fonts/faq#what_does_using_the_...
comment 8y ago · link · parent
I've had some discussions with the lobste.rs folks about another attempt to do a sophisticated trust metric, but nothing ever rose to the level of "we should do this."
comment 8y ago · link · parent
But if you're being careful, you can do type-punning. The "modern" way is generally with memcpy, but union can be valid if done carefully. The clearest statement I was able to find of this is [1]. I find it frustrating that it's so hard to get a clear read on this. For example, if as Regehr says union-based punning is reliable, then what was the concern that the linked Linux kernel patch trying to address? I haven't dug into it in super detail.