6 ms·
Why doesn't this run in the browser? :( It's 2023 - and no offence intended - but I would rather not download a binary blob from a random Internet page to execu
by vesinisa 3y ago
Why doesn't this run in the browser? :( It's 2023 - and no offence intended - but I would rather not download a binary blob from a random Internet page to execute it outside the browser's sandbox. Especially since it looks this game could easily be programmed with WASM and/or vanilla JavaScript.
- Cthulhu_ 3y agoYour OS has its own sandbox, so it should be absolutely fine unless you run everything as administrator.
- chrismorgan 3y agoIt’s shipping for Windows and Linux. Neither of these uses that kind of sandbox by default (or makes it at all easy to achieve). It could trash the user’s home directory, for example.
- 5e92cb50239222b 3y agoI beg to differ. $ firejail ./bin Even the very limited default profile hides things like ~/.ssh and makes the rest read-only (with the exception of ~/.cache and such).
- chrismorgan 3y agoThat doesn’t invalidate what I said. It requires going well out of your way (as do other sandboxing arrangements—I never said they didn’t exist), and it’s not a very good sandbox without a fair bit of work. (So maybe you’re blocked from trashing the home directory, but stealing all your passwords and login cookies was always more lucrative than vandalism, so making the rest read-only is small comfort.)
- 5e92cb50239222b 3y agoI have no desire to engage in one of those 50 levels deep nested arguments, so this is my last message, but you literally said: > or makes it at all easy to achieve firejail makes this trivial. You won't be able to steal anything of interest. Making an easy to use sandbox for desktop applications is the main goal of the project. You could have tried it out before arguing against it in what feels like bad faith. $ firejail bash -- snip -- $ ls ~/.mozilla ls: cannot open directory '/home/foo/.mozilla': Permission denied $ ls ~/.ssh ls: cannot open directory '/home/foo/.ssh': Permission denied $ ls -lh passwords.kdbx -r-------- 1 nobody nobody 0 May 29 14:53 passwords.kdbx And so on. (The last one is my real password database and it definitely isn't 0 bytes in size.)
- chrismorgan 3y agoI haven’t ever used Firejail, but I know a little about it. I understand that Firejail depends on you configuring things for each app, with a mixture of whitelisting and blacklisting. That’s untenable unless the default profile is safe. You said its default profile just makes the home directory read-only; I took that at face value (since I have no interest in installing it to check). If what you said was correct, then I presume that either you must have changed the default profile, or Bash is using a different profile?
- throwme_123 3y agoAlso... 61MB download!
- bayindirh 3y agoSmaller than most popular webpages.
- melx 3y agoWell.. it's a game!
- shultays 3y agox1270 of original NES Tetris! (32kb of code & 16kb of graphics)
- junon 3y agoThe original wasn't built to have sand physics and to be portable on most major platforms, displaying at high resolutions... What's your point?
- shultays 3y agolet's include an entire nes emulator with it then. fceux seems to be about 8mb displaying at high resolutions irrelevant sand physics how much of binary that would add? What's your point? My point was to highlight how much overhead modern software adds.
- doomlaser 3y agoJust waiting for wine to get fast enough to run Windows binaries in the browser. Last I checked, it's not quite there yet.
- MuricaFYeah 3y ago[dead]
- bayindirh 3y agoBecause the developer didn't want to. Instead they coded it in Java and ran with it. Personally, I love it. It's probably 10x more efficient than a possible JS implementation, tho.
- crubier 3y agoJava 10x faster than JavaScript, in 2023? No.
- bayindirh 3y agoI didn’t say faster, I said more efficient. They are two wildly different things.
- hutzlibu 3y agoThis seems to be such a pedantic discussion all around. Well, what did you mean by more efficient if not more performant, the usual metric? More efficient to develope? Possible, depending on the devs skill set, but hardly relevant for the end user who want to play the game on possible low performant hardware? Oh and I think wasm can beat java in several cases.
- bayindirh 3y ago> This seems to be such a pedantic discussion all around. No, as a high performance software developer, my aim was not to devolve the discussion into a pedantic "stone throw". > Well, what did you mean by more efficient if not more performant, the usual metric? Watt per instruction. IOW, power consumption. As a person who lives in HPC world, inefficiency is bane of my existence. Two software can be equally performant while having different power profiles. I'm focusing on power. What does this brings, you may say. Throttling is the simple answer. If you waste more power, you'll hit the throttling wall faster, use more battery, and will lower the quality of the experience. From your phone to biggest supercomputers have thermal budgets, and none of them are unhittable. > but hardly relevant for the end user who want to play the game on possible low performant hardware? Not all of us have latest processors, tons of RAM, and JS microbenchmarks show that browser JS engines have wildly different performance characteristics for some loads. Using a native platform pushes these concerns out of the picture. > Oh and I think wasm can beat java in several cases. Have no experience with that, need to test and see.
- jerrre 3y agoSomeone made something fun in the tools they know and shared it with the public
- aaron695 3y ago[dead]
- hutzlibu 3y ago"Especially since it looks this game could easily be programmed with WASM and/or vanilla JavaScript." Looking forward for you doing and sharing it. Because then I could complain, why you did not use WebGPU, as it is so much more powerful ...
- izacus 3y agoBecause the author owes you nothing.
- marcodiego 3y agoTry saying that to people who trashed GNOME for more than a decade because of the file picker and when thumbnails were finally implemented they said things like "too little too late".
- kristopolous 3y agoIt's a common target. The question is more about curiosity of why the choice was made
- marginalia_nu 3y agoThis would sound extremely conspiratorial except this exact scenario has happened on mobile: It's a real slippery slope from everything always runs into the Google browser into everything is an app in the Google browser store. Envision a FAANG stomping on a human face forever...
- pcthrowaway 3y agoI think you're missing the point. Mobile was kind of the opposite, where instead of having source-available applications on an open platform, the mobile OS makers made it near-impossible to install anything but closed-source apps from their closed-source walled garden app stores. Being able to run in the browser doesn't mean you have to run it in Chrome. You can use Chromium (open source), or Firefox, or Brave. You can bundle it into an electron app. You could write your own browser that runs javascript with just the APIs needed to make the game work, and deliver it in that (the standards are all open and the spec is public) This is so much better than what we have with mobile, and much more secure than running random executables on your daily-driver OS directly
- StackOverlord 3y ago[flagged]
- okamiueru 3y agoI'm going to assume this isn't a rhetorical question. This is a program written in java using libGDX, and the compiled target depends on JRE. If you read the documentation on it, you will see that libGDX can build with web as a target, but the developer has chosen not to do this as of yet. Perhaps they might, if asked nicely. Or, since you claim for it to be easily programmed in WASM and/or vanilla JS, you could go ahead and do that. I'm sure you didn't mean any offense, and I also don't mean any offense when saying that your apparent bewilderment (if rhetorical) comes across as entitled, and you should perhaps consider your approach here.
- vesinisa 3y agoIt looks like a fun game. I did not mean to offend. I don't think there's nothing entitled about giving suggestions for improvement and reaching a wider audience - e.g. through giving the reason why I did not try out the game personally. The sand physics simulation does not look that complex/heavy to me - probably if the author implemented it once in Java they could do it again in JavaScript + Canvas, and it could even be a fun exercise to port the game to a new platform.
- okamiueru 3y agoYou did not offend me at least. Given the stated goal, you could ask with a curious tone instead and avoid confusing you for someone rude/annoying. That said, you are right that technically, this isn't complicated. Sand physics like this is only a few lines of code. However, someone did mix concepts leading to a novel approach to an otherwise exhaustively cloned game. Tetris was huuuge in its day, and there are hundreds if not thousand commercial clones and variations. The interesting part to me is that novel combination. And, they went so far as to polish it as a game, share it for free, and all you have to do is click a couple of buttons. So, if this inspires you to want to recreate it in canvas, have at it. It's probably a great exercise. The author can likely just build a target for the web and libGDX takes care of the rest. They might have to solve some build errors, figure out how to host it on itch, etc, and if they cannot be bothered, they don't owe anyone anything. Quite the opposite. In summary, seemingly disregarding the novelty. Pointing out that it is simple, and that you (paraphrasing) cannot be bothered, is why I said that it could come across as entitled. In any case, have at it :)
- phaedrus 3y agoI've been working on making a base or skeleton game engine for when I participate in Itch.io game jams that compiles from C++ to web assembly using Emscripten. It's exactly as you say no one wants to download and run an unknown binary blob; this severely limits how many people will try your game. I'm alternately impressed that I can port C++ in this way at all, and sad at the state of the tooling still after so long. When something goes wrong with the web assembly version of the project, I can't debug it from first principles. This could be because, as an embedded and C++ programmer, I'm unfamiliar with Javascript debugging tools, but it's still unfortunate I can't single step through at the C++ source code level when debugging the web assembly build. I just want gdb for web assembly. I've also run into silly/stupid bugs like keyboard input not working only in fullscreen, except if you leave it on overnight in which case 1 out of N tries the keyboard input comes back. I spent days trying to debug this, only to have someone on a forum answer it in about 2 seconds that it's because a Firefox change now causes keyboard input to be captured by the awesome bar during fullscreen (which of course you can't see). I could have tried this for a million years to figure out what was wrong and not had that insight. It doesn't bode well for my game engine project if things are this fragile; no other C++ compilation target is this janky.
- pengaru 3y agoI experienced similar frustration using Emscripten to ~port a simple C+SDL2+GLES2 game to wasm. While it mostly worked, it wasn't a very polished environment and how well it worked depended greatly on which browser was used. And even in the best case there were still annoyances surrounding things like fullscreen handling. It all echoed of 90s-era web development when we had to test every browser and kludge browser-specific exceptions due to incompatibilities. It's been over a decade since I cared about web stuff, so maybe this is just the way it still is in general and not just emscripten/wasm support. Whatever the reason, it didn't inspire much confidence to rely on this pipeline for delivering native+web games to the masses in a single implementation.
- BeetleB 3y agoWhile you're not wrong about the sandbox aspect, there are people like me who detest doing everything via a browser, and prefer standalone tools. I think it's tragic that I need a browser to do most things.
- mslivo 3y agoit's coming.
- GuB-42 3y ago1996: Hey we made this cool language called Java, you can make applets that run in the browser. Also, it runs in a VM, this protects your system. 2023: Why can't I run it in the browser? Why can't I run it in a sandboxed environment? Because it is Java...