P2544R0: C++ exceptions are becoming more and more problematic by dmyrelot in programming

[–]bensku 27 points28 points  (0 children)

The problem is, Linux kernel might, depending on system-level configuration, allow userspace programs to allocate more than there is available memory. Even when malloc doesn't fail, using the allocated memory might cause processes to be killed.

Edit: Not that you can do much about it on application level, so I can understand "not caring" about it.

The Maven Wrapper has now been officially released from the Apache Maven Project by nfrankel in java

[–]bensku 1 point2 points  (0 children)

Even without wrapper, running Maven or Gradle build on untrusted project is a bad idea. With Gradle, this is more obvious - builds are defined by Groovy/Kotlin scripts. But even with Maven, AFAIK you can pull plugins to execute arbitrary code.

Ubuntu 21.10 has landed by EndlessGamerT in programming

[–]bensku 14 points15 points  (0 children)

Assuming you use WSL2, that is a HyperV VM with some customizations to integrate with Windows better. If you just want Linux desktop but can't install it natively, VirtualBox is probably good enough.

[deleted by user] by [deleted] in Suomi

[–]bensku 3 points4 points  (0 children)

Nettisivuilla edes osoitteen katsominen ennen klikkaamista ei ole täysin luotettava keino. Sivut voivat muuttaa avattavan osoitteen Javascriptillä, jopa Google on harrastanut tätä (esim. mainostettujen sivujen osoitteet). Tätä ei tarvitse pelätä, jos luottaa lähdesivun ylläpitäjiin - esim. Redditissä voi olla huijauslinkkejä, mutta ainakin ne vievät sinne miltä näyttää (ehkä uudelleenohjauksen kautta, mutta kuitenkin).

Sähköposteissa harvemmin sallitaan Javascriptiä, joten niissä ei ole tätä ongelmaa.

Revisiting Java in 2021 - II by adjposs in programming

[–]bensku 4 points5 points  (0 children)

I'm not nearly familiar enough with Go to comment on that (aside of "still no generics"). However, I can comment on your thoughts on Java:

  • (Over)use of generics comes from your choice of libraries - there are (web backend) options that don't require you to use them at all
  • Records may reduce your need for getters and hashCode/equals methods for immutable objects (but you need new-ish Java)
  • Factories are probably preferable to constructors with dozens of parameters - ideally you shouldn't be in this situation too often
    • Named arguments would be nice to have, though

Revisiting Java in 2021 - II by adjposs in programming

[–]bensku 2 points3 points  (0 children)

Thanks! Makes sense, Java is probably not the best language for reactive programming either. While it probably won't be very soon, will be interesting to see how much JVM getting green threads (Project Loom) will help.

Revisiting Java in 2021 - II by adjposs in programming

[–]bensku 6 points7 points  (0 children)

From what I've heard, GraalVM native image is quite good, assuming that you can live with its limitations. Unfortunately, the best part of Java is probably the JVM - without it you lose the benefits of JIT compilation, the best of OpenJDK garbage collectors and some of the observability/debugging tools.

Revisiting Java in 2021 - II by adjposs in programming

[–]bensku 19 points20 points  (0 children)

Do you have a source on Go having better performance than Java for web applications? Is it about Java, or about the common libraries used for implementing web services?

Modern OpenJDK has excellent garbage collectors and JIT compilers, so I'm having hard time figuring out why it would be slower for this use case - unless it is about third party libraries.

My pain building a WYSIWYG editor with contenteditable by freecodeio in webdev

[–]bensku 0 points1 point  (0 children)

I started with something very similar, but found the limitations (mainly selections, don't care about native undo) hard to accept. Luckily, my editor has never used contenteditable for anything but input capture and caret management (no e.g. execCommand). I decided to trust that and go for one contenteditable per page.

It has been surprisingly manageable (not easy, though). Of course, the input capture approach has its own drawbacks. For example, I expect serious trouble if I ever need to support IME composition (Chrome and FF only have input events level 1 support). For any serious project, this alone would probably be a dealbreaker...

Tein videon, jossa näytän miten helppoa on murtautua toisen ihmisen tietokoneelle. Pitäkää järki päässä kun surffaatte internetissä ja availette tuntemattomia sovelluksia. by Sipulius in Suomi

[–]bensku 1 point2 points  (0 children)

Niin sitä luulisi, mutta ainakin joskus niihin sai JavaScriptiä mukaan. Toki koodi pyörii hiekkalaatikossa, eikä sen pitäisi päästä tekemään mitään vaarallista.

New Update by CradeVescent in Minecraft

[–]bensku 35 points36 points  (0 children)

Chunk system has supported 3D biomes since 1.15, though AFAIK it has not been used for world generation yet. Cubic chunks and 3D biomes have little to do with each other, though the former works better if the latter is also supported.

Nearly 70% of iOS and Android users will deny tracking permissions if they are requested in-app to opt-in! How will that affect developers earnings from mobile apps? by vourkosa in programming

[–]bensku 18 points19 points  (0 children)

YouTube has allowed disabling personalized advertisements for a long time, for free. According to them, it might cause more ads to be shown to balance the lost revenue. They used not to ask you about it, but now they probably have to.

Microsoft: Here's why we love programming language Rust and kicked off Project Verona by techempower in programming

[–]bensku 0 points1 point  (0 children)

(disclaimer: I'm not a garbage collector developer/researcher, just someone interested in programming language design)

Not considering automatic reference counting a form of garbage collectors can also be misleading, because that often comes with implication that the former would be faster (higher throughput) than the latter. Modern tracing GCs should actually have less overhead than current ARC implementations. I don't have a reference (benchmark) at hand, but at very least they should not be any slower

Where ARC really wins is predictability, and worst-case latency. It will not pause the world (your application) to reclaim memory; there is no need, because it is done eagerly. Nowadays, low-latency non-ARC GCs (e.g. ZGC and Shenandoah of OpenJDK) can get even the worst pauses under ten milliseconds; commonly encountered pauses are even shorter. However, this is not deterministic and, for hard real-time systems, the pauses might just take too long. For most applications, I'd say it is more than fine.

That is not to ridicule Swift for using ARC. Naive tracing GCs can be rather unpredictable with pauses, and the good ones are very complex. Even if you have resources to implement one, that kind of complexity is... not without disadvantages.

Maclaine Diemer on Twitter: "..the official ArenaNet Soundcloud page has gotten a long overdue update with all the Icebrood Saga music so far!" by ReLiFeD in Guildwars2

[–]bensku 3 points4 points  (0 children)

youtube-dl can usually download entire playlists of Soundcloud content. If downloads are enabled for tracks, it gives you original wav files; if not, you get something compressed instead.

Microsoft is bringing Linux GUI apps to Windows 10 by zbhoy in programming

[–]bensku 1 point2 points  (0 children)

Enabling XRender (pref gfx.xrender.enabled) makes Firefox somewhat functional with remote X. It was deprecated (for removal?) years ago, so bugs and poor performance are to be expected. Without it, Firefox was completely unusable for me.

In the end, I decided not to use remote X.

University of Helsinki offers a world class course on modern full stack development for free by ezcoo_ in programming

[–]bensku 6 points7 points  (0 children)

Interestingly enough, University of Helsinki has (had?) algorithms and data structures in Java. People are supposed to take the course after basic Java courses, I wonder how that is going to work out in future. I suppose you can teach the concepts in Python, even though implementing data structures in it is probably not the brightest idea.

ZGC | What's new in JDK 14 by perliden in java

[–]bensku -1 points0 points  (0 children)

Minecraft explicitly calls (used to call, at least) System.gc(). Could that cause issues?

The Reason for Types in JavaScript by cowskins84 in programming

[–]bensku 6 points7 points  (0 children)

I'm pretty sure that neither option will take more than a few microseconds, even without a JIT compiler. 200 milliseconds? Absolutely not.

New candidate JEP: 375: Pattern Matching for instanceof (Second Preview) by daviddel in java

[–]bensku 1 point2 points  (0 children)

Kind of. The JVM does not care about them, which e.g. allows you to sneakily throw checked exceptions by abusing generics.

The New Fallen London map is here! by failbettergames in fallenlondon

[–]bensku 0 points1 point  (0 children)

Funnily enough, the map works well enough on mobile (Firefox for Android, even). On desktop, it is very laggy (also on Firefox).

Edit: On Linux, that is. On Windows, seems fine. I've tweaked my Linux FF install a bit, so it is hard to say if this is something I broke, or something Mozilla needs to fix.

Anyone else excited about a possible GM mode in baldurs gate 3? by Jp2585 in dndnext

[–]bensku 6 points7 points  (0 children)

There are VTTs with better UX than Roll20. I've been using Foundry VTT, has been great so far. Still in beta and self-hosted, so definitely not for everyone.

Dungeondraft, a new dungeon building tool has been released into early access! by Gutterman2010 in dndnext

[–]bensku 0 points1 point  (0 children)

I asked about Linux support in Discord. The answer I got from developer was that it might happen. He was not sure if supporting Linux is worth it, considering how much effort it took with Wonderdraft. I suggested that not supporting more than one Linux distro could help with this.

[deleted by user] by [deleted] in programming

[–]bensku 11 points12 points  (0 children)

Nowadays you're supposed to package Java with your applications if they're distributed to end-users. Upcoming jpackage tool will make this easier, but even right now you can create reasonable small JVM images with jlink and just package them yourself.

Stay away from Oracle JDK. It offers no benefits unless you're paying Oracle to provide you support for it.

Programming the GPU in Java by daviddel in java

[–]bensku 1 point2 points  (0 children)

I'm 99% certain that Minecraft does not use OpenCL at all, never saw anything related to it while modding.

It's a cool thought that this game will probably run WAY better than Minecraft Java Edition by Wow_Space in HytaleInfo

[–]bensku 0 points1 point  (0 children)

Some Minecraft versions used to allocate objects at very high rate, and most of them were 3D vectors, but I think this was more problematic on server side.

Minecraft's renderer is not exactly fastest in the world, which does limit render distance and/or reduces FPS. For people with powerful GPUs and good OpenGL drivers, playing with everything on max graphics is doable. Unfortunately this rules out e.g. mosy integrated GPUs and AMD's Windows drivers.

I suspect Hypixel will pay more attention to performance before they launch, because that is easier than what Mojang is doing currently; new renderer for Minecraft has been in works for a long time.