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

That may be dangerous. The more obscure the topic, the more likely it is that the AI will come up with a working but needlessly convoluted solution.


Compared to what though? I have ended up with needlessly convoluted solutions when learning something the old-fashioned way before. Then over time, as I learn more, I improve my approach.

Not everyone has access to an expert that will guide them to the most efficient way to do something.

With either form of learning though, critical thinking is required.


Exactly. After all, how can WE confidently claim that we’re more than stochastic parrots?


We once rented bikes in Copenhagen, they all looked like they were fresh from the junk yard. We had to try several to find ones where at least one of the brakes was still working. It was a horrible experience, and we tried several different places. That was after we found out that the public bikes that were supposed to be available all over the city had all been stolen.


You won’t just be viewing an ad, you will have to actively engage in a minute long sales talk with the LLM.


In my head, it'll be like the high pressure timeshare sales pitches or the dreaded car sales transactions, where they pull out all the tricks to convince you to buy something you don't actually want or need, regardless of whether you can afford it.


“That’s a great point about your finances. But did you know this company offers credit to someone in your position for only this low interest? I can apply on your behalf if you just sign this statement”


The code will come out just fine, so your atrophied brain will remain dependent on OliCorp's parasocial prosthesis for strenuous thinking, dissolving wariness in experiences of super productivity. Then elsewhere, when plausible, OliCorp will progressively nudge you in some direction sold as predefined weight bonus to third party customers. You won't even notice and really, isn't it a fair price for all that productivity? Of course, AI isn't always right yet, but I'd say in a very practical 95% of cases your goals and expectations are in alignment with OliCorp AI.

Don't forget, every website and service monetized automated access as a consequence of the AI scraping boom and made unauthorized web-indexing impossible, traditional search dried off. And when OliCorp finally turned off access to their legacy index monopoly in favor of AI interfacing, you really have no choice but to trust your friendly chat buddy. Who else are you gonna ask for the fix? Former friends, your family or neighbors? People you've grown to hate because sympathetic local clustering is discouraged through four color divisive information shaping. I mean, those guys really are at fault for your lack of self-efficacy, the hate is warranted. And you're too tired to bother anyway.


“We’ll finish up your feature soon. In the meantime, have you considered a timeshare in Vegas?”


True. I often think of Rust as a best-of compilation of Haskell and C++ (although I read somewhere that OCaml had a greater influence on it, but I don’t know that language well enough)

In real life, I find that Haskell suffers from trying too hard to use the most general concept that‘s applicable (no pun intended). Haskell programs happily use “Either Err Val” and “Left x” where other languages would use the more expressive but less general “Result Err Val” and “Error x”. Also, I don’t want to mentally parse nested liftM2s or learn the 5th effect system ;-)


>I read somewhere that OCaml had a greater influence on it

Whoever wrote that is wrong.


If we could wave a magic wand and remove Haskell's influence on Rust, Rust would still exist in some kind of partial form. If we waved the same wand and removed OCaml's influence, Rust would no longer exist at all.

You are the one who is wrong, I'm afraid.


Which OCaml features exist in Rust but not Haskell? The trait system looks very similar to Haskell typeclasses, but I'm not aware of any novel OCaml influence on the language.


> Which OCaml features exist in Rust but not Haskell?

Rust's most important feature! The bootstrapped implementation.


I'm not convinced the implementation language of the compiler counts as a feature of the Rust language. If the argument is that Rust wouldn't have been invented without the original author wanting a 'systems OCaml' then fine. But it's possible Rust would still look similar to how it does now in a counterfactual world where the original inspiration was Haskell rather than OCaml, but removing the Haskell influence from Rust as it is now would result in something quite different.


Rust isn't just a language, though.

Additionally, unlike some languages that are formally specified before turning to implementation, Rust has subscribed to design-by-implementation. The implementation is the language.


That just means the semantics of the language are defined by whatever the default implementation does. It's a big stretch to conclude that means Rust 'was' OCaml in some sense when the compiler was written with it. Especially now the Rust compiler is written in Rust itself.


You're overthinking again. Read what is said, not what you want it to say in some fairytale land.



The original rust compiler was written in OCaml. That's not evidence it "had an influence", but it's highly striking considering how many other languages Greydon could've used.


Yes: if a person knows nothing else about Rust and the languages that might have influenced it, then the fact that the original Rust compiler was written in OCaml should make that person conclude tentatively that OCaml was the language that influenced the design of Rust the most.

I'm not one to hold that one shouldn't form tentative conclusions until one "has all the fact". Also, I'm not one to hold that readers should trust the opinion of an internet comment writer they know nothing about. I could write a long explanation to support my opinion, but I'm probably not going to.


It's like trying to say Elixir wasn't influenced the most by Erlang


Was any Elixir interpreter or compiler every written in Erlang?

If not, what is the relevance of your comment?


Elixir’s implementation still has significant parts written in Erlang. I don’t know if it’s a majority but it’s a lot. e.g.: https://github.com/elixir-lang/elixir/blob/aef7e4eab521dfba9...


> SML, OCaml: algebraic data types, pattern matching, type inference, semicolon statement separation

> Haskell (GHC): typeclasses, type families

https://doc.rust-lang.org/reference/influences.html


Haskell has algebraic data types, pattern matching and type inference, too, and has had them since Haskell first appeared in 1990.

Although SML is older (1983), OCaml is younger than Haskell.



Surpriiiiiiise!


Mid-30s is maybe a tad earlier than average, but by the age of 40 you’d expect noticeable changes.


If only I had known this earlier in my career! They should really add a feature to make a hard copy of the big bucket list to minimize memory overhead, though.


On the other hand, once your embedded system is sufficiently large, people will want to use (and inevitably will use at some point) standard containers such as std::string or std::vector. And without exceptions, all of those might invoke UB at any time (I have yet to see a standard library that understands and honors -fno-exceptions; usually they just drop all try-catch blocks and all throws)


Could you elaborate on that? I'd love to see an example of this. Are you saying that even relatively simple code (using eg. std::vector) could easily cause UB if -fno-exceptions is enabled?


Any exception thrown with -fno-exceptions results in std::terminate. The behavior of std::terminate is unspecified.


The behaviour is unspecified by the standard.

Your compiler vendor has to pick a (reasonable) behaviour though and apply it consistently, and while they are not required to document it (IIRC - I think that's just for implementation-defined?) you can probably get them to tell you if you have a good support relationship with them. Or you can just figure out what the compiler does, and hope they don't change the behaviour too much with the next release :-)


Most standard containers have no way to communicate allocation failure to the caller in the absence of exceptions (think of constructors that take a size). Worse, the implementations I’ve seen would eventually call operator new, assuming it would throw if it fails. That is, subsequent code would happily start copying data to the newly created buffer, without any further tests if that buffer is valid. In the absence of exceptions, that won’t work.


I guess my hope was that the program would just terminate immediately the instant it tries to throw an exception while -fno-exceptions is set, thus ideally preventing any further action from the program.


What does it mean for a safety-critical program to terminate?

I suspect you do not want your car's brake controller to do this.


Well, what do you expect std::vector<T>::at() to do if the index is out of bounds and it can't throw exceptions? Or std::vector<T>::push_back() if it can't reallocate to a larger size?

These are just some obvious cases. Not to mention that any use of operator new is UB if memory allocation fails and the system can't throw exceptions.


Well, my hope was that we'd have a guarantee that the program is in fact just going to terminate, and the process is going to die.

That's probably not great and might leave data in a bad shape, but it seems better than "undefined behavior" aka no guarantees whatsoever, no?


In principle, I would agree with you, but the biggest problem is that the whole C++ ecosystem works the opposite way.

The main reason people use C++ over safer languages like Java is performance (memory, CPU speed, real-time constarints etc). And C++ the language is designed for performance, but only with an expectation of a very powerful optimizing compiler. Most C++ std classes are extraordinarily slow and inefficient if compiled without optimizations - certainly much slower than Java for example.

So, C++ is not really C++ without aggressive optimizing compilers. And one of the biggest tools that compiler writers have found to squeeze performance out of C++ code is relying on UB not to happen. That essentially gives the optimizer some ability to reason locally about global behavior: "if that value were nullptr, this would be UB, so that value can't be nullptr so this check is not necessary". And this often extends to the well defined semantics of standard library classes outside their actual implementation - which rely on exceptions.

So, to get defined behavior out of the std classes in the absence of exceptions, either you disable many optimizations entirely, or you carefully write the optimizer to have different logic based on the no-exceptions flag. But, all C++ comittee members and C++ compiler writers believe exceptions are The Right Way, for every situation. So getting them to do quite a lot of work to support someone doing the wrong thing would be very hard.


In safety critical embedded systems there is no such thing as "program just terminating". The program is the only software that is running on your device, and you need to degrade execution to some safe state no matter what. Every error should be processed, ideally right where it occurred (so I am not a great fan of exceptions either).


Exactly. So you don't want `at()` either, you want a sane interface that would return an Option<T> for you to handle as you wish.


At() with exceptions support is pretty much equivalent with a method returning an Option<T>. More precisely, it gives a superset of the functionality of returning Option<T>. If you declare the call site noexcept(), you should even get some compiler checking to make sure you handle the exception.


> If you declare the call site noexcept(), you should even get some compiler checking to make sure you handle the exception.

What compiler does it? At least g++ does not. It is not what specification dictates either.

I can't see how it is a superset either. If the library returns an Option, the calling code can process it as it please, including throwing an exception. On the other hand, if the library only indicates error by throwing an exception, it cannot work with the caller that is built with exceptions disabled.


Oops, you're right, the whole point of noexcept is to promise to the compiler that you know in practice exceptions can't happen, I got confused...

Otherwise, I should point out I explicitly said "at() with exception support enabled". It's also important the ability to disable exceptions is not a feature of C++, the C++ specs assume exceptions work (just like the Java or C# or Go specs). It is a feature of certain C++ implementations that they suport this mode, just like they support other non-standard features (compiler intrinsics, various #pragmas, etc).


Still even with exception support enabled I can't see what you can do with a function that throws that you cannot do with a function that returns maybe not Option<T>, but Result<T, E> in fewer lines of code.

Disabling exceptions is indeed not in the standard, probably because of Stroustrup's position (I respect many of his opinions, but cannot agree with this one) - but it's what every sane compiler, especially a one targeted at embedded systems, will support. Exceptions are designed for a controlled environment where a program terminating will return to somewhere that will maybe add a line to a logging system and restart it automatically. It only complicates things when terminating is an unacceptable scenario.


Yes, Result<T, E> should be equivalent in power to exceptions (the missing E part is why I was saying it's a superset of Option<T> functionality).

Regarding exceptions being more code, I very much don't agree. Even for embedded apps, the pattern of "if this fails, wind back up to some top level event loop" is quite common, and exceptions give it to you for free if you're also using RAII. In contrast, with Result<T, E> you have to write code at every level of the stack to handle it. Code which gets particularly ugly when you combine it with things like map() or filter().


German wages are low? Are you serious?


Yes, talking about the IT sector here. I am from Austria, it's about the same over here.

See also https://news.ycombinator.com/item?id=36416158


US tech wages for a single position are probably on average more than the typical EU tech company makes in total revenue per year. 60k is like a god tier wage here.



60k is very average for someone with 3-4y experience in Vienna and our salaries are much lower than in Germany. You should find another offer.

Unless you're talking about net income, then it is truly god-tier...


The duck? Are you living in the same Germany as I am?


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

Search: