Earlier quoted context omitted.
Don't most (all?) browsers consider file:// and localhost to be secure for the sake of enabling those features? https://developer.mozilla.org/en-US/docs/Web/Security/Defens...
Unfortunately, no. CORS will block this on Chrome and Firefox. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/COR... The security risk : https://www.mozilla.org/en-US/security/advisories/mfsa2019-2... You need a local webserver. Or bundle everything in one html file.
This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
41–50 of 93 posts
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#42Semi-related: Windows EXE files are runnable in DOS (at least when DOS was a thing, so for Windows 3.1x or 9x), but most of the time the DOS part just prints "This program requires Microsoft Windows." and exits. An exception is regedit.exe, that one can use to import registry values even in DOS. (Huh, although, how does it do that without using Windows API?)
without knowing anything, i am going to guess that they could either directly import the same code that the windows api uses (either via knowing where the implementation code resides and load that), or even statically link the library! After all, regedit doesn't need to obey cleanliness rules that other non-first-party programs would need to - presumably, because if those registry editing api/format changes, regedit would get updated along with it!
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#43I love the idea of applications which exist in one file which you can run anywhere. I've been working towards this with my serverless platform; you can build complex data-driven apps with just one .html file and mostly declarative HTML markup (thanks to web-components which are loaded from a remote server). With modern browser features, you don't need a bundling system. Once you do away with it; a whole universe is o…
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#44On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#45On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...
My favorite slight of hand was that all the dungeons and caves were part of a single rectangular map. Designers carved out a few specific designs, then other levels were clearly what worked with the remaining map screens available so it all fit in the space they had, with caves thrown in to take up single screen gaps. https://ian-albert.com/games/legend_of_zelda_maps/
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#46Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#47Forma instance, a static compiled and linked "hello world" in C on Linux is around ~785KB
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#48On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#49On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...
Zelda 1 was 128 kB, for those wondering, and that's without any compression. Double that for the sequel.
Perhaps not compression as we see it today. But one could argue that tile based graphics and code based music is a form of compression. Old games used a myriad of cool tricks to get around their limitations.
Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
#50The binary relies on the runtime, so yes it is nice. Forma instance, a static compiled and linked "hello world" in C on Linux is around ~785KB
Huh?
$ musl-gcc -xc -static -Wl,-z,norelro -Wl,-z,nosectionheader -Wl,-z,noseparate-code -s -
int
main(void) {
static const char s[] = "Hello, World!\n";
fwrite(s, (sizeof s)-1, 1, stdout);
}
eof
$ ./a.out
Hello, World!
$ ls -l a.out
-rwxr-xr-x 1 oguz oguz 4976 Jan 12 09:38 a.out
And if that's not enough $ musl-gcc -xc -static -nostdlib -fcf-protection=none -fno-asynchronous-unwind-tables -fomit-frame-pointer -Wl,-z,norelro -Wl,-z,nosectionheader -Wl,-z,noseparate-code -s - -lc
void
_start(void) {
static const char s[] = "Hello, World!\n";
write(1, s, (sizeof s)-1);
_exit(0);
}
eof
$ ./a.out
Hello, World!
$ ls -l a.out
-rwxr-xr-x 1 oguz oguz 487 Jan 12 09:58 a.out