• 7 Posts
  • 529 Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle

  • Ephera@lemmy.mltoProgrammer Humor@programming.devTariffs
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

    Oh yeah, I was merely complaining about the syntax. Coming from other languages, I interpreted that import statement to mean essentially this:

    import { double, exponent /*...*/ } as operations from "Math";
    

    …and as such, it took me a few seconds to understand what’s being aliased by as operations.

    As for importing all symbols of a module, I do think it’s more harm than good in non-compiled languages. But when it comes to compiled languages, I’d say it depends on the language.

    In Rust, for example, I can easily throw down an inline module with one-way isolation, so that it can transparently access everything in its parent module via use super::*;, while the parent module can’t access what’s in the module (unless it’s been marked pub). That can reduce mental complexity of the code (and is actually used a lot, because unit tests are typically put into such an inline module).
    It’s also useful in Rust, because you can re-export symbols in different modules, so you can break up a file without breaking the imports by throwing a pub use my_sub_module::*; into the original module.

    But yeah, on the flipside, I really wouldn’t miss it, if it didn’t exist in Java. It was rather even annoying, because the popular IDEs have a rule to replace explicit imports with an asterisk as soon as it reached 5 symbols imported from the same module.
    It’s not as bad as one might think, because you can’t declare top-level functions or variables in Java (everything has to be in a class), but it still sometimes led to those asterisk imports bringing in the wrong class names, so I’d have to manually add the import I wanted underneath them…


  • Ephera@lemmy.mltoProgrammer Humor@programming.devTariffs
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 days ago

    import * as operations from "Math";

    Wow, I knew import syntax with a separate from statement could be awkward, but that’s a new one for me.

    Apparently, the * cannot be used to import all symbols underneath a module (you always have to specify the as moduleName), so I guess, that makes it somewhat less weird for referring to the module itself.

    From what I can tell, there’s also no obvious other keyword they could’ve used:

    • package is only a keyword in strict mode.
    • self is not a keyword.
    • this is kind of awkward.
    • Leaving out the keyword is kind of awkward (import as operations from "Math";).
    • Changing up the whole syntax for this one case is awkward, too (import from "Math" as operations;).

    So, I guess, I’ll allow it, but I’m still not happy about it…


  • We use Leptos at $DAYJOB for a web-UI of medium complexity. Debugging is mainly a matter of println-debugging, to be honest. Well, with log statements. We use tracing-web for logging to the browser console (if you’re using log rather than tracing, you can do the same with console_log). And then console_error_panic_hook to make panics visible in the browser console.

    None of this is particularly great. Sometimes you get a stacktrace and no chance to try to debug it, because it happens in compiled WebAssembly. Sometimes you run into reactivity issues, which you just have to try to reproduce and narrow down why it happens.

    You do gain experience over time and can spot issues more quickly or code it correctly upfront. And well, I’ve never seen a frontend framework, which was immediately intuitive in its reactivity or similar. Humans are just a messy interface.

    Yeah, not sure what else to add. The upgrade to Leptos 0.7 was definitely a challenge, but we managed to push through, although I would not have wanted to do that without some of the experiences I’ve made with personal projects.
    Feel free to ask questions, if you want to know anything more concrete.


  • Yeah, leaving moral reservations aside, it’s especially annoying to me, because it’s being pushed with complete disregard whether it actually helps me.

    I’ve been working in a programming language for the past two years, in which I’m well-trained. Better than the statistical average that LLMs blurt out, at the very least. So, I’ll often end up correcting whatever it generates, rather than just typing out the same directly. In particular, I also find it much easier to think while typing, rather than while reviewing code, so I need pauses to think anyways. And I also just find it disrupts my concentration when the autocompletion-style LLMs keep flickering their suggestions at me.

    Similarly, flavor images. So much of management is fucking excited about generative AI, because they can type shit like “wombat hanging off of a line of code” and then it slops out an image, which they can slap into their presentation and pretend it has meaning.
    I don’t like those images. The AI-generated ones look terrible to me, but I did not either like them before they were AI-generated. It’s just pointless imagery, why are you showing me this?
    Obviously, management can disagree with my stance, many people do, but if they want me to present shit, they need to respect that my presentation style just does not include flavor images, no matter what flavor image generator we pay for.



  • Well, as the other person said, it was not a failing of LiMux. It was political. Munich had been ruled by one coalition throughout the lifetime of LiMux and after it went to a different coalition, they announced the switch back.
    The manager of Munich’s IT department also publicly stated that they were surprised by the decision, because there are no larger technical problems and compatibility is resolved by providing virtualized MS Office, where necessary.
    Coincidentally, Microsoft also moved its German headquarters from just outside of Munich’s tax region into Munich around the same time.



  • Ephera@lemmy.mltoMemes@lemmy.mlBig F'N TV
    link
    fedilink
    English
    arrow-up
    10
    ·
    11 days ago

    I mean, yes, but I was rather wondering, if that extra space was maybe why it couldn’t find it. Maybe you had to manually enter the SSID and accidentally put in that extra space? Then again, I don’t even know, if you took that photo…








  • Well, part of the problem is that web apps themselves are kind of alien on the web. The web is generally document-based. Web apps take the document format and try to turn it into something it’s not.
    There’s a way to not do the JavaScript, but it doesn’t fix things being document-based and it can be argued that it makes other things worse in some respects.

    I’m talking about WebAssembly. Basically, you can write your web app in HTML+CSS+Rust and then the Rust part is compiled to WebAssembly, which then takes the role that JavaScript would normally take. It does not have to be Rust, lots of languages can be compiled to WebAssembly, but Rust has the most mature ecosystem for that, as far as I’m aware.

    In principle, it is also possible to use WebAssembly to render directly to a pixel buffer, but that’s really rather heavyweight and not terribly responsive, so not generally done, unless you implement a game¹ or similar.
    Alright, so back to the document mangling approach. There’s various frameworks available for Rust. I’ve used Leptos so far. There’s also Dioxus and Yew and probably others.

    Advantages:

    • Don’t have to write JS.
    • Can write Rust. Rust has some concepts that mesh really well with frontend dev, like the Result and Option types for error handling, which you can pass directly to your rendering stack and it can show either the data or the error (or nothing).
    • Can use the same language in backend and frontend and therefore also get compile-time checks that the two work together.

    Disadvantages:

    • The ecosystem is young. You will find barely a fraction of the component libraries as you can find for JS.
    • Rust also has concepts which don’t mesh well with frontend dev, like the whole memory management concept. Those frameworks bypass that or make use of it in clever ways, but things can be a bit peculiar or overly complex at times.
    • WebAssembly is sent to the browser in one big blob, because it’s a compiled program. This means you get somewhat of a loading time when first loading the web app. There’s ways to mitigate that with “hydration” strategies, but yeah, still a thing.
    • While JS is often minimized/uglified and therefore not readable anyways, WebAssembly makes that even more of a reality, because it is essentially assembly code that’s sent to the browser. It does still call the same APIs under the hood as JS does, so content blocking shouldn’t be affected, but yeah, can’t try to understand the code itself. This can also make debugging during development somewhat more painful.
    • Well, and it’s also yet another web standard that browsers have to support. It doesn’t make browsers simpler in the sense that suckless would like.

    I’ve listed a lot of disadvantages, so just to point out that, yes, to me, the advantages are absolutely worth it. But I can totally understand, if others see that differently.

    ¹) See, for example, Bevy and this UI example in particular.


  • Yeah, I’m honestly a bit confused. I have basically the same paper bin and it’s not heavy at all. I’d expect a cat to be able to knock that over no problem. Like, maybe it doesn’t try to while you’re around, because it might fall over with the bin or hit itself with it, but I wouldn’t expect a real troublemaker to worry about that either…




  • Yeah, Wikipedia tells me the longest word that was actually in use is Grundstücks­verkehrs­genehmigungs­zuständigkeitsübertragungs­verordnung. It was a decree from 2003 until 2007.

    Basically:

    • “Grundstück” is a plot of land.
    • “Verkehr” is traffic “trade” in this context.
    • “Genehmigung” is approval.
    • “Zuständigkeit” is responsibility.
    • “Übertragung” is transfer.
    • “Verordnung” is decree.

    So, it decreed that the responsibility of approving traffic on trade of private plots of land should be transferred (to a different government body).