Hacker Newsnew | past | comments | ask | show | jobs | submit | deckarep's commentslogin

Is it just me…or does article seem a bit contrived? I was expecting to read this to learn about a really powerful hijacking technique when in reality it’s just a program that manipulates your input program.

This is something that could easily occur with scripting languages, backend systems, open source, closed source, etc.

Basically any black-box system that takes in some input could pre-manipulate the input yielding an unknown/unexpected output.


> This is something that could easily occur with scripting languages, backend systems, open source, closed source, etc. Basically any black-box system that takes in some input could pre-manipulate the input yielding an unknown/unexpected output.

IMO thats why it's a scary attack. It's a really simple idea and there are so many ways to apply it


The key point is that if your system has an evil compiler, building your own compiler from known-good source code will just give you another evil compiler, no matter how many times you do it. It creates a bootstrapping problem for the victim that doesn't have easy solutions.


Perhaps another way to say it-using an evil compiler could bootstrap any kind of malicious code in the compiled artifact whether it’s a compiler or not.


No, because if that's all it did, just rebuilding your compiler twice would free you from it.


Curious what makes Raylib good for emulators? I’m genuinely interested in this.


Brilliant project and execution. I love the idea of bringing the tactile experience together with a digital gaming experience.


As a long-time PC user, I remember going to CompUSA and seeing the Mac section of games which was laughable.

Back then you bought Apple if you were a sound engineer or into graphic/media design.

I used to tell people I’m a die-hard PC user simply: Mac sucks!

Fast forward to around 2009 and I’ve been a happy Apple user since then for all my software engineering needs.

Is the platform perfect? Nope! And nothing is.

Is it expensive? Yes, but the quality is fantastic and if one really wants to can get 5 years easy out of any Mac computer…I’ve got 11 years out of my family’s Mac mini that I was able to upgrade a few times.

Which brings me to my only real gripe: the lack of upgrade ability and the obsession with “thin” design.

Please address that because everything else I can mostly get over.


One more thing: Apples’s turnaround was one of the most unexpected things in modern computing.

Also, never have I ate my own words harder with the “Mac sucks” thing.

At the end of the day I’ll use what works.


I used to be the same, but I'm contemplating a return to Linux more and more and already use a Linux machine for day-to-day work.

macOS' recent updates have been a massive downgrade in terms of usability, try to force garbage on me that I don't want (no, I don't need Apple TV+ nor News on a work machine) and reliability on the M1 Air is bad - just yesterday the thing half-locked-up for 30 seconds (caps lock still responded, but everything else froze) with no explanation, not to mention the occasional kernel panics and constant nags for permission for every goddamn thing (you've implemented the notifications permission system to prevent apps from spamming me, but your solution is to spam me with one for every app that I run even for apps that never actually send notifications?).

I just need a machine that works and gets out of my way. It used to be as everyone else was trying to get in your way, Apple was mostly content with just charging a huge premium. That seems to have changed in the last couple years.


You might be a good candidate for the new Studio


I know this doesn’t satisfy compilation issues but for playing Flash content using a modern engine try out: https://ruffle.rs/

It’s written in Rust (don’t shoot the messenger) and was able to play some flash content I had produced around 1999…

Ok I’m going to go crawl back under my rock.


Ruffle is an awesome project, but there's a huge amount of work that has to be done to support the entire catalog of Flash content.

> AVM2 is ActionScript 3, which was introduced with Flash Player 9 (June 2006). After the release of Flash Professional CC (2013), authors are required to use ActionScript 3 - making any movie made after that date very likely to fall under this category.

> Ruffle is still working on the foundational support for AVM 2, and does not yet support any content that requires it. A warning will be placed in the log when you attempt to play AVM 2 content, for this reason. We do plan on supporting this soon!


I tried my old startup from here:

http://dudefactory.com/

And it boots to the title screen, but I guess there is some sort of check inside the SWF to make sure it is running inside the right domain, because then it tries to redirect the browser back to the main URL and won't load the main avatar creation screen. Bummer. (I downloaded Adobe's Flash Projector and the behavior is the same)

EDIT: I installed the Chrome browser extension instead and it booted up fine. Some rendering issues to do with stroke widths that make it reasonably unusable, but it worked and when you click to download you get the actual proper file since it is rendered using .NET on the back end.


I had a similar problem. My flash content was several modules where the main module swapped in and loaded in sub-modules.

The main screen would loaded but when clicked wouldn’t resolve the sub-modules correctly but I was able to just play the sub-modules and individually and see the old content in all its cheesy glory.


It’s written in Rust (don’t shoot the messenger)

LOL, I think the anti-rust stuff is more a backlash to those overzealous rustaceans who demand mature C or C++ projects be re-written in rust so they can be 'safe'.

I think new software in rust that does useful stuff is cool as :)


Awesome blog post Ben! Question: how did you come up with your list of opcodes?

I ask because while some opcodes are obviously needed others as not so obvious and coming up with a balanced instruction set is somewhat difficult design problem.


Good question. A bit of experience, some guesswork, and a lot of testing and benchmarking along the way. I separated out global and local opcodes originally because I wanted individual variable accesses to be fast (why do at runtime what you can do at compile time). As I mention in the article, originally I had all the builtin functions as separate opcodes, but that was slower due to the sheer number of opcodes and Go's current binary tree approach to "switch". I also used Go's profiling tools a bunch to see where the hotspots where. I'm sure there's significant room for improvement, but it's hard, because sometimes when you improve one benchmark, something else suffers.


What tools did you use for timing and benchmarking beyond the tools included in the go distribution?


Just the Go benchmarking tools built into "go test", as well as a couple of scripts of my own just using "time ./goawk 'BEGIN { ... test script ... }'" and that kind of thing. Nothing fancy!


Question on VM snapshotting: what’s the purpose/point in even having such an ability? What does it allow you to do?

I only know of snapshotting perhaps being necessary to support coroutine based context switching.

Thanks and very cool project!


A snapshot is a the entire state of a program at a single moment in time. Continuations are basically exposed snapshots, i.e. taking a snapshot, storing it in a variable, doing some work, and then 'calling' the snapshot to return to an earlier point. Continuations allow you to implement a naive version of single-shot delimited continuations - coroutines! This can be very useful for modeling concurrency.

Aside from coroutines and continuations, snapshots are neat for distributed computing: spin up a vm, take a snapshot, and replicate it over the network. You could also send snapshots of different tasks to other computers to execute. In the context of edge computing, you could snapshot the program once it's 'warm' to cut back on VM startup time.

Snapshots allow you to peek into your program. Imagine a debugger that takes snapshots on breakpoints, lets you to inspect the stack and heap, and replay the program forward from a given point in a deterministic manner. You could also send a snapshot to a friend so they can run an application from a given point on their machine. If you do snapshots + live reloading there are tons of other things you can do (e.g. live patching and replaying of functions while debugging).


To do these kinds of things on Linux checkout https://www.criu.org/Main_Page

Checkpoint and Restart In Userland


One nifty thing you can do with snapshots in games is use it for save/restore/undo.

See for example the Z-machine used for interactive fiction, and its younger cousin Glulx: https://www.eblong.com/zarf/glulx/Glulx-Spec.html#saveformat

(Apart from that, I’d note that Glulx and the Z-machine are both terrific examples of detailed VM specifications. Glulx is impressive because it was built by one person, the Z-machine possibly even more impressive as it was reverse-engineered by insanely dedicated Infocom fans.)


Big shoutout to the ScummVM team for keeping these games alive and well on modern hardware.

But did you know they also often times will additionally fix existing bugs in these games. Bugs that are now decades old!

These classic titles are now even better to play than when they originally came out.


Also for anyone wanting to learn the history from the man himself Ken Williams recently wrote a book on Sierra’s rise and fall as one of the industry’s top gaming studios.

Obviously he wasn’t there for the tail end of things during the acquisitions and fraudulent period but what I found most interesting is how Sierra was bootstrapped in the first place.

Ken is a brilliant thinker and had the foresight to build a game engine that Roberta could plug and play her game content in because she admitted to not being a great coder.

Later Ken wanted his next generation games to be built as a virtual machine (The Sierra Creative Interpreter) which meant they only had to make the game once and build the VM for different architectures. Again a brilliant move.

Check his book out: https://kensbook.com/


It's worth noting that he's also working on a new game.

https://kensgame.com/


> Later Ken wanted his next generation games to be built as a virtual machine (The Sierra Creative Interpreter) which meant they only had to make the game once and build the VM for different architectures.

Like Infocom did from the beginning with their Z-Machine VM.


And Lucasarts with SCUMM.


I read Ken's (self-published) book and was a bit underwhelmed. Maybe interesting to diehard fans though.

The chapter on Sierra in Steven Levy's "Hackers" was much more engaging (in fact probably made me want to become a published game author).

Ken only mentions the Levy chapter in passing which is too bad — Levy did a fantastic job of painting a picture of the adolescent coding Mecca that Sierra was at that time. All night D&D, 2-liter's of Coke, coding, hot tubs and gaming....


Oh wow, thank you Beej for this work and content! Your resource has been a tremendous reference to many of us myself included and still stands as one of the best resources to network programming today!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: