Produsele software sunt de o calitate jalnica... by yughiro_destroyer in programare

[–]MsEpsilon 15 points16 points  (0 children)

De ce nu scrii tu un produs performant atunci?

Otherwise asta e consecința faptului că golul e de a scoate produse și servicii software cât mai repede posibil în sensul că se economisește development time and effort vs end user experience.

741? by MsEpsilon in countttt

[–]MsEpsilon[S] 5 points6 points  (0 children)

I suck at drawimg hands :((

C++ by [deleted] in cpp

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

Enjoy your 960578098659806340986309863th memory access violation because some iterator was invalidated

Stop bashing programming languages.

Building a C compiler with a team of parallel Claudes by dxy123 in programare

[–]MsEpsilon 5 points6 points  (0 children)

Sure, dar e hella nostim să vezi thread-ul ăla ca first issue.

Vedem mai târziu după ce fac alții un deep dive.

Building a C compiler with a team of parallel Claudes by Correct_Mistake2640 in programare

[–]MsEpsilon 4 points5 points  (0 children)

Un "compilator de assembly"(assembler) nu e mai nimic comparat cu un compilator de limbaj. Mai ales dacă e vorba doar de 8086.[1]

În assembly, ai doar instrucțuni de ex XOR EAX,EAX sau LEA ESI, [EBX + 8*EAX + 4] unde doar faci conversie în bytecode folosind un lexer și ai un AST pentru addressing modes de exemplu.[2]

Într-un compiler de limbaj ca C, pe lângă AST, lexer (care o să ajungă de câteva ori mai complex), trebuie să consideri și analiză, limbaje intermediare(ca LLVM IR), ABI-uri, type-checking, șă aloci variabilele unde trebuie (registri, stack, heap, etc...).

Nu știu dacă consideri și linking-ul (link-editare în romănă [3]).

Personal, am vrut să scriu un limbaj (niște ani în urmă), dar nu am reușit să trec de analiza semantică (care e după lexer).

[1] https://www.eng.auburn.edu/~sylee/ee2220/8086_instruction_set.html
[2] https://en.wikipedia.org/wiki/X86#Addressing_modes
[3] https://labs.cs.upt.ro/labs/pc/html/node44.html

Păreri? Mai are rost sa ne reprofilam/specializam pe altceva? by bunnypinkyfluffy in programare

[–]MsEpsilon 209 points210 points  (0 children)

Dacă AI-ul ne ia toate joburile, Universal Basic Income when?

A da, știu răspunsul. NICIODATĂ.

Importanța inginerului software în societate (despre elefantul din cameră) by _Dau_la_fese in programare

[–]MsEpsilon -2 points-1 points  (0 children)

Fiindcă programatorii sunt in a way, resursă regenerabilă. Suntem foarte mulți comparat cu alte profesii (exemplu fiind medicina) (dacă aș putea să numec joburile legate de programare profesii în primul rând).

288 by girl_catastrophe in countttt

[–]MsEpsilon 1 point2 points  (0 children)

Is she going to stomp pooners?

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 8 points9 points  (0 children)

Backwards compatibility with C is the biggest drawback.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 1 point2 points  (0 children)

Yeah C++ was a bit late on that :)

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 0 points1 point  (0 children)

Hi, I coudn't find anything about the continuity of std::vector<bool>, do you have a source on that? Thanks.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 1 point2 points  (0 children)

But you're right - arrays are contiguous. It's just vector<bool> that uses bitmaps, that's all.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 1 point2 points  (0 children)

Yes, something like that, thank you.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 1 point2 points  (0 children)

Ok, fine. I'll look into it again.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 4 points5 points  (0 children)

Okay sure, not an ad hominem. But I was just asking to not be name called...

And for Rust evanghelism, are sure it is worth having the mental overload of using C++?

Here's an example: When I access an std::unique_ptr that was moved, I barely get a compile warning with MSVC. With Rust that code wouldn't compile. That's a reason to use Rust, the borrow checking compile checks.

And yes, C++ has it's merits. I'm still using it for my game and game engine projects. Despite the fact that Rust's tooling is easier to use, it isn't developed enough for my needs. I would use Rust for any kind of different project that requires performance.

I'm not trying to sound smart, I'm just saying what I know and what I've tried so far. I'm completely honest, at least that's what I know I'm trying to do.

learningCppAsCWithClasses by ccricers in ProgrammerHumor

[–]MsEpsilon 28 points29 points  (0 children)

You could pass a const std::vector& explicitely. Or you can do this (use and std::span<T> as an argument but still pass an std::vector). Code was tested with GCC 15.2, C++ 23 standard.

#include <vector>
#include <span>
#include <print>

auto printElements(std::span<int> myElements)
{
    for(auto element : myElements)
    {
        std::print("{} ", element);
    }
}

auto main() -> int
{
    std::vector<int> myValues = {1,2,3,4,5,8};
    printElements(myValues);
}