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

It is very easy to switch. Today I got things done with ChatGPT. If I didn’t have any LLM available only then it would be disaster.

It is discouraged to override internal internal functions, hence, one often only needs to monitor the public API changes of packages as in every other programming language. Updates for packages in my experience rarely had broke stuff like that. Updates in Base somrimes can cause issues like that, but those are thoroughly tested on most popular registered packages before a new Julia version is released.

Interfaces could be good as intermediaries and it is always great to hear JuliaCon talks every year on the best ways to implement them.

> Imagine you try to move a definition from one file to another. Sounds like a trivial piece of organization, right?

In my experience it’s most trivial. I guess your pain points may have come by making each file as a module and then adding methods for your own types in different module and then moving things around is error prone. The remedy here sometimes is to not make internal modules. However the best solution here is to write integration tests which is a good software development practice anyway.


So

In Julia, the (+) function is commonly overloaded

The [] is as well. For things that have no shared interface. (E.g.: Int64[1][1] contains two calls to the [] generic function, which have no interface in common.)

Plenty of definitions of (+) are not commutative. E.g.: for strings.

There is some package which uses the (+) generic function internally, meant to be used on numbers. You call it instead with some kind of symbolic expression type. And it just works. Yay! This is the kind of stuff Julia afficcionados preach.

Then suddenly the package gets updated so that it uses (+) in a way which assumes commutativity.

Your code breaks.

In your world, how would you be notified of a change that some internal use of the (+) function now assumes commutativity?

Or when Julia afficionados preach the amazingness of being able to just throw a differential operator or matrix or symbolic whatever in a place, are they just overselling something and should stop?


> I admit that I was initially surprised by how often I ran into the attitude from students in these programs that they don't actually need to be well-versed in anything besides the exact information they need to know to conduct research in their field.

The PhD students tend to get this attitude from the competitive publish an perish environment where they are in. Sometimes suprrvisours are contributing by dismissing students gaining context and the big picture on why their research is important when the research topic is preassigned as it is unproductive. When the productivity is measured in papers not curios PhD graduates who contribute to the society that’s true.


>when the research topic is preassigned

Well, when you have grant money for a project on X most supervisors will not let you do Y. Most students wouldn’t do research on Y if they weren’t going to be funded. I work in a lab where everyone else has to play ball by their grant proposals and you can sense a general lack of genuine curiosity. Which makes sense, they are not really different than a contract employee with a very specific deliverable that was designed before they even showed up. I can’t speak for other fields but especially in biomedical/compsci where your peers are making six figures working for graduate pay for 2 years (MSc) and then another 4-6 (PhD) doesn’t motivate you to engage outside of your exact degree requirements and your project. Add on that “curious” research doesn’t have a guaranteed path to publishing or to success and it suddenly becomes less appealing to gamble your future on such a thing. I would label my own research as “curious” in that I have support from professors at a few universities but on the whole we are facing challenges from academia at large. The only reason I can comfortably pursue something that has a genuine non-zero chance of failing into obscurity is that I am funded by an in-house university scholarship and I have a full time job.


All is true, and I agree with you, yet it is deeply unsatisfying for one with original ideas.

The entire university system has shifted from general education to specialized job preparedness over the last 100 years.

Because of the variety of roof designs and associated mounting systems, it is generally known how to mount the panels you are paying for. Installing panels on a high-pitched roof is also not an easy feat.

For ground mounting, site preparation is required. Probably one wouldn't want to see their panel system get some slope year after year.


Equating freedom with choice is strange. Often choices comes hand in hand with commitments which removes initial options from the table while other options appear. Whether the lost options produces regret is a matter of one’s evolving values that perceives the available options at the given time. Hence absence of regret seems the real freedom, but we don’t have a Time Machine or a Crystal Ball. The next best option is approaching regret with humility of the past and agency to align current values with future options. If the values don’t need to be forced on oneself to align with available options then we get freedom.


> if you wanted to store an integer in a collection, you had to manually convert to and from the primitive int type and the Integer “boxed” class

I have never worked with Java. What is this? Why would one want to have a class for an Integer?


Primitive variables in Java, such as `int`, `boolean`, and `double`, store their actual values directly in memory. When they are local variables inside a method, this memory is typically allocated on the thread's stack. These primitives do not have the structure or overhead of an object, including the object header used by the Garbage Collector (GC) to manage heap-allocated objects.

If a primitive value must be treated as an object (e.g., when stored in a Java Collection like ArrayList or when passed to a method that requires an object), Java uses a process called `boxing` to wrap the primitive value into an instance of its corresponding Wrapper class (e.g., Integer, Boolean, Double). These Wrapper objects are allocated on the heap and do possess the necessary object header, making them subject to the GC's management.


Aside from this, having such a class provides a convenient place to hold all the int utility functions, and the same for the other primitive types.


Can you have a collection of primitives?


No, but yes. There is nothing in the standard library, that implements the Collection-interface and works with primitives. However you can write your own and there are several implementations of collections for primitives. The problem is that you have to implement them seperately for each type of primitive (e.g. an IntList, DoubleList, BooleanList...).


Can't you use templates for that, or do these also only work with objects?


Templates do not exist in Java.


My bad, I think they are called Generics in Java. I always thought of these as the same thing, just with different names in different languages, is that wrong?


Templates and generics are very different. Afaik Templates generate specialised code for each invocation of that template with a different type.

Java uses Type Erasure for Generics, which means that generic type variables are checked at compile time, but that type information is not available at runtime. At compile time you may have List<Foo> and List <Bar> but at runtime its all just List<Object> (Object being the base type everything inherits from). Basically List stores a bunch of pointers to objects and since pointers can point to anything a List can basically "store" anything.

Then you have a divide between primitives and Objects in Java, where primitives are double, int, boolean etc.. Primitives are types in the C-sense, e.g. int is nothing more than a 32-bit number, not a class in the Java-sense. But since ints are not classes and as such do not inherit from Object, they cannot be placed inside of List<Object>. Therefore there cannot be a List<int>. But there is Integer, which is an Object-wrapper around an int, meaning you can have a List<Integer>. This is called boxing and like all indirection carries a performance penalty.

Java hopes to heal this rift between primitives and Objects through something called Project Valhalla which has been 10 years in the making and is expected to land in the next two years or so.

Hope this ramble is comprehensible.


Thanks it is. So the compiler would bark on List<int> ?

Yes, exactly.

It's because the collection types (and generics) don't support primitives, only objects. So you been to stuff the primitives into objects to use them with a lot of the standard library.


One of the more amusing bugs I had to figure out resulted from the fact that some of the autoboxed values get cached, resulting in peculiar behaviour when someone managed to reflectively change the boxed primitive value...

i.e. something like:

  Integer x = 42
  highlyQuestionableCode(x);
  println(x); // "24" WAT?
I'm a fan of JEP-500...

https://openjdk.org/jeps/500


That doesn't sound very pleasant.


Well, it was annoying until autoboxing came in.

  // Before autoboxing
  list.add(new Integer(42));

  // After autoboxing
  list.add(42);
Mostly it's a non-issue now. If you're desperately cycle/memory constrained you're likely not using Java anyway.


You can get pretty good performance out of Java these days, so long as you know to avoid stuff like boxed primitives and the streams api, as they generally have god-awful memory locality, and generally don't vectorize well.


Yeah, I know there are even oddballs using it for HFT and the like - I like Java a lot, but even I find that a bit peculiar.

Edit: actually, if someone here is using it for something like that I'd love to hear the rationale...?


I've worked adjacent to that space (high performance fin-tech java), enough that I feel qualified to answer.

It's mostly a trade-off. Java's tooling, reliability and ecosystem is some of the best around. Even though building high performance software in Java is a bit of a pain, looking at the bigger picture, it's often still worth it.


Not „oddballs“ for sure. Java established itself as the primary enterprise language for fintech in 2000s and since then there was and there is no reason to switch. It offers everything business needs including vast supply of workforce.


If you're desperately cycle/memory constrained you're likely not using Java anyway.

Java Cards would like to have a word with you. But yeah I know what you mean.


There are libraries, like fastutil, that provide collections for primitive types.


Either the same of this feature or always hiding the boxing (e.g. a Python int is actually a wrapper object as well, with some optimizations for some cases like interning) is the case in almost all languages.


I personally use Julia, which does not have such boxing issues. Rust, C, C++, and Fortran also avoid boxing like this. Perhaps Go is also free from such boxing? Python does it, that's true.


I think your intuition is correct: you probably don’t.

That’s also very likely changing. Lookup “project Valhalla”. It’s still a work in progress but the high level goal is to have immutable values that “code like a class, work like an int”.

PS When I say “changing”: it’s being added. Java tries hard to maintain backward compatibility for most things (which is great).


Such petiotions also fail to communicate legitimacy in a sense that authentic members have signed the petitition. Hence it can also be used adversely to steer the public opinion (although unlikely for the given situation).


> trained on stolen data without permission

My sympathies to academic publishers ;)


What issues have you seen recently in the wild where Linux just does not work on a laptop? I have pretty good experiences just putting Ubuntu on old laptops for people who asks me to fix their computer.


For old laptops it's significantly less bad, but definitely old. 5+ years old is usually a good start, though these days it may be better if it's even older.

The most significant issues:

- Peripherals simply don't work at all, as in, no touchpad or keyboard, or at least no touchscreen. This is definitely an issue with a variety of laptops including some Microsoft Surface and Dell laptops.

- Power management. Frequently, machines fail to sleep or resume reliably.

- Audio is low quality and quiet. This problem was publicized pretty well by the Asahi Linux project, but it is far from unique to MacBooks: a lot of laptops now require OS-level audio processing to have good audio quality. Even my Framework 16 partly has this issue, though it can be alleviated partly with a BIOS option. I believe this also impacts some System76 laptops.

- WiFi/Bluetooth instability. This issue is probably worst with some Realtek radios, but I've also seen it from time to time with Mediatek.

- Sometimes, issues booting at all. Yep. Sometimes it just won't boot, as sometimes the kernel will just break support, and maybe unbreak it later. That's the nature of just running random shit, though.

I think that illustrates enough so I'll stop there, but also don't forget the hurdles to even get started. Often times the very first thing you want to do is disable secure boot which differs a bit per system. This isn't always truly necessary, but even if you're using a Linux distribution that works with Secure Boot it's often a good idea, as there are a variety of things that you can't do easily with Secure Boot on Linux.

Older laptops are less of an issue since Linux tends to get a lot more mature with older hardware as time goes on, but it's still a little hit or miss, especially with vaguely recent laptop hardware that has weird stuff like Intel IPTS. But that having been said: Linux doesn't support old hardware literally forever, either. Old hardware sometimes stops working and gets pulled from the kernel, or moves out of mainline Mesa, and so forth. So even that isn't a 100% panacea.


Not trying to contradict anything you’re saying, which I agree is true for Microsoft and Dell machines, but to provide an anecdotal counter-example, the Asus Zephyrus, Flow and ProArt lines run pretty well on Linux provided you replace the Realtek WiFi.

One place to check is the nixos-hardware repo for machines with reasonable support.


Yes, I use nixos-hardware. Definitely useful.

> to provide an anecdotal counter-example, the Asus Zephyrus, Flow and ProArt lines run pretty well on Linux provided you replace the Realtek WiFi.

I should be very clear here: what I'm trying to caution people not to do is set people up for the expectation that random Windows laptops will run Linux well. Specific Windows laptops absolutely do run Linux well sometimes, just by virtue of using parts that are very well-supported and somehow having firmware that isn't full of 100,000 bugs. (I love Framework but there are some occasional issues i have with my Framework 16 that really seem like they can only be issues with the firmware rather than Linux.)

That said, I still think you should consider tempering what you tell people, especially people you don't know well. The vast majority of users are not the type of people to disassemble their laptop and replace the WiFi card. And while I don't doubt what you're saying is true, I also think it's important to note that laptops vary a lot from SKU to SKU and revision to revision; the vendors typically don't support or test Linux, so there's absolutely no reason they wouldn't break it in a minor revision of hardware or firmware, either. Telling people that ThinkPads generally work well on Linux isn't necessarily unfair (They usually do, even today) but it's not as much of a sure thing as everyone portrays it, there are exceptions. And also, when you say they run "pretty well", you may have more reasonable expectations for what "pretty well" means than the average person. For one thing, I've found that the average person simply lacks the creativity to imagine the ways in which operating system compatibility issues can manifest. For another, these minor usability problems can profoundly impact how one uses their computer. For example, if sleep/resume works 99% of the time, that's actually not great. What happens in the remaining 1% of the time, you lose all of your work unexpectedly? Does your laptop melt inside your bag? Maybe, if you are profoundly unlucky, it could even light your damn house on fire. Of course, Windows and Windows laptops have plenty of problems with sleep/resume these days too with no Linux involved, but I still believe strongly that users who have never experienced broken sleep/resume will have a really bad time here. And again, since these laptops only support Windows, any random kernel or BIOS update could kick things into a bad state. (Immutable OSes will at least save you from having to guess, but I use NixOS and sometimes my intermittent hardware issues are really hard to pinpoint, which is observable for anyone who looks at the history of kernel versions on some of my less Linux-friendly devices.)

I think people evangelizing open source and Linux are very well-meant and often times manage to really help people escape the abusive relationship they have with Microsoft, and I want it to continue. I just want people to be careful with how they message Linux on laptops. If you are really sure someone will be highly tolerant of working through problems, maybe you need to caution them less. But, for other people, I just think it's better to be very careful and fully not recommend laptop vendors that don't support Linux. These laptops don't work well with Windows by accident!


This illustrates why Linux users should buy Linux hardware, not just slap Linux on Windows hardware.


How would setting up a primary credential with an identity provider differ from the process of registering to vote for USA citizens? All the discrimination opportunities and accountability issues seem to apply equally there.


if you had to register to vote to use Reddit or whatever people would complain about that constantly. and voter id laws are in fact controversial yes.


The same people who argue this will also argue that voter ID rules are discriminatory.


Voter ID laws actually have a long history of being used for disenfranchisement of certain classes in the US (most notably former slaves and their descendants, but also women), so it's understandable there is scar tissue there. It gives the incumbent state another lever of power in our very close first-past-the-post winner-take-all elections. Americans don't need imagination to see how it could be abused, just a good history book.


The problem with voter ID laws have rarely been with the ID itself. Very few people would have issue with a voter ID law which also guarantees that 100% of the population can easily obtain said ID at zero cost.

The issue is that those laws are usually linked to very specific forms of ID, which just so happen to be easily available to certain demographic groups.

Imagine a voter ID law where the only acceptable form of ID would cost $50.000 to purchase. Would you consider that fair and nondiscriminatory? What if you could only get the ID on the third Tuesday of the month, between 14:00 and 14:30, at a single location in the entire state? What if the ID required you to pass a certain kind of test, judged arbitrarily by a government official?


Are the laws that require you to show ID to buy alcohol, tobacco, fire arms, or gamble in casinos also discriminatory? Or is it only discriminatory when you prevent people without IDs from watching porn?


The definition of Porn by the state can change to include things that some people consider protected by the first amendment - right now there are a lot of state politicians or members of the house on record supporting classifying discussion of LGBTQ lifestyles as pornography for example.

I think alcohol, tobacco and gambling here are mostly irrelevant, but the firearms is a better example because of the second amendment, where you have a clash between a very old right granted by the bill of rights clashing with modern societies beliefs.


> Are the laws that require you to show ID to buy alcohol, tobacco, fire arms, or gamble in casinos also discriminatory?

So long as it is done for a legitimate purpose and in good faith, generally no. As such, IDs are only expected where there is reasonable suspicion of possible violation. For example, there is no onus, with a few exceptions, to see an elderly person's ID to buy alcohol when there is no reason to think that they aren't below the minimum age.

The exceptions haven't really been tested. It very well could be found discriminatory, and you could make a pretty good case that it is. Which is ultimately the same case being made earlier. Asking a no-question-about-it 50 year old to provide his ID to watch porn isn't really in good faith, is it?


I agree "ensuring everyone has ID" is a separate problem that we should absolutely trying to tackle. We are already seeing people struggle with it absent any new ID schemes, eg in the case of trying to get access to banking. You can already get ID at a post office, maybe we should add other government facilities such as libraries.


That's absolutely true, and orthogonal to the problem that you shouldn't need to identify yourself to anyone in order to access arbitrary websites.


I don't think thats the proposal. The proposal is that you prove to websites that you are over 18 to see adult content.


"adult content" is the boogeyman, to try to make this harder to argue against. The actual net result is shutting down a wide variety of websites and making people identify themselves (to paid identity providers conveniently provided by those who lobbied for this legislation) in order to access others, including Reddit, Discord, etc.

You should not need to identify yourself to access arbitrary websites, either to the website or to some third party.


I agree, you shouldn't need to identify yourself. Protocols like mobile drivers license (and others) allow you to do selective disclosure of properties such as "over 18", without disclosing any other personal identifiers. That seems like reasonable compromise.


Feel free to do that if you wish. Don't force it on everyone else. No "compromise" is needed here.

Would be interested to hear whether you've evaluated the regulatory capture angle here, of paid services being pushed by the same people who forced the legislation down everyone's throats.


I touched on this in another comment. We are already doing age verification today, and poorly.

> There is a lot of this going on in this thread and frankly it is quite frustrating. Texas and France are two jurisdictions I know implemented privacy laws and now porn websites are collecting PII. I know this because when I traveled to Europe, my account on an adult website (gasp, yes I admit to having one) started asking me for ID. When I tried to proceed through verification with their chosen third party the flow requested a video of my face. Yuck. When I got back the US, it was still requesting face verification. I talked to support and, basically, once I used a French SIM card it "blew a verification fuse" and the only way to get my account back was to send that video of my face. I found this unacceptable, so I abandoned my account.

> If we refuse to find a workable solution that respects privacy and is based in open standards, we are going to cede this space to private third party companies.

When we deny the government a role, we cede this territory to private companies that are accountable to no one but their shareholders. I'd rather develop ID standards that protect privacy while providing access.


> I touched on this in another comment. We are already doing age verification today, and poorly.

Yes, and we should fight that vigorously and make it stop, not make it "better".

> I talked to support and, basically, once I used a French SIM card it "blew a verification fuse" and the only way to get my account back was to send that video of my face. I found this unacceptable, so I abandoned my account.

Helpful data, thank you. Note to self: don't browse the web at all in draconian countries without a VPN, not even once.

> When we deny the government a role, we cede this territory to private companies that are accountable to no one but their shareholders. I'd rather develop ID standards that protect privacy while providing access.

So if we're going to lose, we should try to make it hurt less? That's a strategy for when one has given up on winning.


I want harm reduction and pragmatism, yes. Can you tell me that in five years these laws won't be widespread regardless of whatever technology we implement? In five years fewer countries and states will have age verification laws?


I can tell you that choosing to lose will make it happen faster.

I would like to see https://bsky.app/profile/tupped.bsky.social/post/3lwgcmswmy2... on the top of every major news outlet:

> The U.K. Online Safety Act was (avowedly, as revealed in a recent High Court case) "not primarily aimed at protecting children" but at regulating "services that have a significant influence over public discourse."


The “not everyone has an ID!” argument is such an American perspective. The vast majority of world citizens live in countries that require you to have some form of government ID anyway:

https://en.wikipedia.org/wiki/List_of_national_identity_card...

It seems pretty reasonable to leverage this into online identification.

In fact, online ID is already used in the European Union for popular initiatives (see, e.g., https://www.stopkillinggames.com/ ) and nobody seems to think this is “bullshit” or infeasible or any of the concerns that are lobbed at the age verification requirements.


Only in part of EU as you can see, and we will hopefully be able to push back against this too.

And it isn't mandatory for these initiatives.


It's more accurately a very Anglo perspective. The US, UK, AU, NZ, CA all do not have national ID cards.


Sweden has them but very few people actually have one. They all use a card issued by the tax office that is not valid in the rest of EU.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: