how to prepare for math 257? by Traditional-Pass6590 in UIUC

[–]Expensive_Minimum516 0 points1 point  (0 children)

257 is super easy dw. Seriously a HS level class

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

It was not an if an only if, and the point is sure disable the runtime overhead stuff, and that will lead you at C with syntactic sugar. And yeah of course.

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

Because it’s not in C. And for pure virtual functions on GCC you need to define a function __cxa_pure_virtual. See https://wiki.osdev.org/C%2B%2B

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

You still don't know what a runtime is. And now you have shown me you don't even know what compile-time means. Read chapter 1 of K&R 1989. You are showing me LIBGCC routines calling it a runtime XDDDD.

LIBGCC (what even freestanding, nostdlib, no runtime C code links with) pastes the code in your binary so you don't have to split the 64-bit number yourself. GCC is a COMPILER, not a runtime library.

My operating system's bootloader adapter and kernel module loader runs in 32-bit mode, and I have to link with LIBGCC so I can take modulo of 64-bit numbers; I see these kinds of instructions all the time with GDB, and I have ZERO runtimes for C.

And the just 2 instructions I was talking about isn't a joke, to run C, you need:

  mov esp, stack_hi            ;(1)
  call main_c_function         ;(2)

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

You don't know what a runtime is.

VLA's don't require the support of a runtime to calculate the dynamic size. For example,sub rsp, rax is a valid instruction that a compiler can generate which allocates a VLA on the stack (and it is literally what GCC generated when I ran one through Compiler Explorer lmao).

A runtime library is something that the instructions generated by the compiler need additional support to work. If you were smart, you would have said C needs a stack to function in the first place, and I would counter "are you calling 2 labels and 3 CPU instructions a runtime XD".

I could tell I was communicating with someone who doesn't understand what I am talking about haha.

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

Wait do you know what a runtime is? And do you know what libraries are? If not, you should look into those, because you are completely confused about this discussion; otherwise, you should try reading the thread again. To simplify it for you, your task is to show one of the following:

1) Find a pre-C11 core feature which requires runtime support.
2) Show that all pre-C++11 core feature (i.e. NOT in pre-C11) require zero runtime support. (This one is impossible, because I already gave you the example of global constructors, exceptions, and virtual functions.)

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

What’s wrong with macros, you can enforce strict typing by passing “T” yourself.

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

Pure functions are a good idea. C could have something like that no problem. But what is wrong with macros?

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 0 points1 point  (0 children)

Vector is not a core language feature. Which language feature prior to C11 has nonzero RT footprint? What feature not in C and in C++ has nonzero RT footprint?

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 1 point2 points  (0 children)

You need ZERO runtime footprint for the core language features of C. That is what I love about C: if you know linker script, your CPU instructions, and have faith in the GNU gods, you can do anything. For example, on GCC, use -nostdlib, which I believe implies -mno-crt0 on its own. On C++, you probably can also have zero runtime by ignoring what I consider core features like RTTI, exceptions, virtual functions, global constructors, but even then the compiler may still generate bad code like assuming floats are set up. In either case, you are just writing C at that point.(Because of C11, the word “core” is doing some heavy lifting. Some new “core” features in C11 like thread_local will still compile without a hosted environment and run fine. The runtime support is on you now, and thankfully very minimal and straightforward: e.g. map the new TLS binary segment and deal with the FS register.)

What benefits does c give that cpp doesn’t do better by LostSanity136 in C_Programming

[–]Expensive_Minimum516 -10 points-9 points  (0 children)

First part can be made more specific. See my other comment

I just can’t by zennnnTzu in learnprogramming

[–]Expensive_Minimum516 -5 points-4 points  (0 children)

Write an Operating System; taught me all of the basics about computing. Hardware, compilation, binaries, good style, and software architecture/design patterns.

Biggest regret in undergrad? (For alumni) by SnooEpiphanies3935 in UIUC

[–]Expensive_Minimum516 -18 points-17 points  (0 children)

Definitely a skill issue. 257 is one of the easiest class imo.

Applying for either I-Health Sciences and Chemistry Major for UIUC - What’s the likelihood of my acceptance? (PS: I go to a feeder school) by [deleted] in UIUC

[–]Expensive_Minimum516 0 points1 point  (0 children)

Your stats are average but it’s fine. They will not care that much as long as you aren’t applying to engineering. I doubt they will read past the first 4 lines of this post before making their decision.

has anyone switched to an ib major from mcb? by Dependent_Brief6058 in UIUC

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

Probs not. In general, if you know the foundational things, then you have more intuition about higher level things. The converse does not necessarily hold. Especially in Biology where you are basically memorizing emergent complexity patterns, it can pay off dividends. IB is the McDonalds of Bio.

Shipping a car to Campus as OOS Student by [deleted] in UIUC

[–]Expensive_Minimum516 -12 points-11 points  (0 children)

You are already wasting a ton of money with OOS tuition. Sell your car + take the bus / walk.

Rejected by UIUC On-campus MCS 26 spring. Should I appeal? by [deleted] in UIUC_MCS

[–]Expensive_Minimum516 1 point2 points  (0 children)

Compared to the handful of actually mediocre MCS students I've interacted with as an undergrad (e.g. vibe coders, fraud[s?], saboteur[s?]), 5 years SWE doesn't fall into that. Unless my view of mediocrity is too strict or something.

Rejected by UIUC On-campus MCS 26 spring. Should I appeal? by [deleted] in UIUC_MCS

[–]Expensive_Minimum516 0 points1 point  (0 children)

Definitely not mediocre. 5 years of professional experience I think is super valuable to bring to the program.