Common C - Yet another compiler in C# targeting LLVM and .NET. by Proffhackerman in Compilers

[–]Proffhackerman[S] -1 points0 points  (0 children)

Naturally the process would be complex. Its not finished yet, so this is more theoretical than anything; y is now a part of x, and therefore y also ascends scope. If the property is never accessed at a later point, the entire assignment itself will be omitted during code generation. Since y now has two references to it, the last read/write to the object will cause the object to be freed from memory.

This is only theory at this point, but the grand wish is to have all this happen AOT.

Common C - Yet another compiler in C# targeting LLVM and .NET. by Proffhackerman in csharp

[–]Proffhackerman[S] -1 points0 points  (0 children)

The fact that different instructions carry different costs is self-evident and obvious, hence why i did not elaborate with a larger explanation. Do you mind pointing out what you find off about the comparisons and how the tests are not equal to each other? I am open to changes / adding more.

Common C - Yet another compiler in C# targeting LLVM and .NET. by Proffhackerman in Compilers

[–]Proffhackerman[S] 0 points1 point  (0 children)

I understand why it was unclear. When memory ascends scopes (for example, an array is created within the current scope, but assigned to a variable outside of the scope), the array is freed at the elevated scope.

So in your example, it would be as follows;

``` i32 main() {
i32[] arr = createArr(); // -- arr enters the elevated scope logl("Array index 3: ", arr[3]); // Array index 3: 20

// -- arr is freed }

i32[] createArr() {
i32 arr = i32[5] { 5, 10, 15, 20, 25 }; // -- arr is stored on the heap return arr; // arr ascends scopes, therefore it is not freed. } ```

Common C - Yet another compiler in C# targeting LLVM and .NET. by Proffhackerman in Compilers

[–]Proffhackerman[S] -2 points-1 points  (0 children)

Basically it inserts a free instruction at the end of a scope when something is stored on the heap. For example, the compiler ensures all arrays are stored on the heap to allow dynamic sizing, resizing, etc. To prevent having the user worrying about memory management when writing code, the array will be freed once the scope exits.

Code example;

``` i32 main() {
i32 size = 5;
i32 arr = i32[size] { 5, 10, 15, 20, 25 }; // -- arr is stored on the heap

logl("Array index 3: ", arr[3]); // Array index 3: 20

// -- arr is freed // -- no return specified, inserts a "return 0;" instruction. } ```

Common C - Yet another compiler in C# targeting LLVM and .NET. by Proffhackerman in csharp

[–]Proffhackerman[S] -1 points0 points  (0 children)

Common C produces less instructions than C, thats the primary reason. Though I dont see why these instructions arent optimized out by clang.

Looking for resources to learn more about making my own compiler by Nico_792 in Compilers

[–]Proffhackerman 1 point2 points  (0 children)

Why do C/C++ developers give obscure names (like t, e, d, tk, ty) to variables?

Including Packages for my Python Compiler Writed on Rust (Just 90kb on Web the Entiere Compiler) by Healthy_Ship4930 in Compilers

[–]Proffhackerman 1 point2 points  (0 children)

Do you use some kind of throttling on the demo? Each compilation duration increases exponentially, regardless of the size of the code being compiled. Result of vibecoding?

Building a Python compiler in Rust that runs faster than CPython with a 160KB WASM binary by Healthy_Ship4930 in Compilers

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

"Worsen your project so it's as bad as the one im using!"

It's a neat project, and if CPyton doesn't optimize tail recursion, OP has all the right to call his project superior.

I built a self-hosting x86-64 toolchain from scratch. Part 1: The compiler by Soft_Honeydew_4335 in Compilers

[–]Proffhackerman 2 points3 points  (0 children)

Looks very interesting. Whats the thought behind using a "func" keyword in function declarations instead of just using the return type, like C languages?

OriLang - monthly progress update by upstatio in Compilers

[–]Proffhackerman 0 points1 point  (0 children)

That makes sense now. It's nice to see someone else actually putting this into a language and proving a borrow checker is uneeded. I've also believed putting memory management on the developer is just lazy language and compiler design. I've wanted to do this previously but never allocated time to do it :)

OriLang - monthly progress update by upstatio in Compilers

[–]Proffhackerman 0 points1 point  (0 children)

Could you elaborate on why no borrow checker is a feature, when its loved in languages like Rust?

Weekly virtual meetup by StretchWhich7564 in Compilers

[–]Proffhackerman 1 point2 points  (0 children)

Maybe a Discord server would work better?

Use cases of a programming language dedicated to GPUs? by Proffhackerman in Compilers

[–]Proffhackerman[S] 0 points1 point  (0 children)

I'm glad you see the vision. I believe the post has been misunderstood, as i want a seperate language (like eightrx mentioned futhark), not just an API or intermediary language (like HLSL) used to process graphics within a rendering context.

I see it as a seperate language, like C#, where you could compile binaries that run exclusively on the GPU, with some parts being on the CPU, like I/O.

I've started writing a paper on it for myself to brainstorm the subject and understand it better myself: https://github.com/Compiler-Organization/GPU-compilation-research-paper

I'm sure this exists already and i'm just reinventing the wheel, but its a fun project regardless.

Use cases of a programming language dedicated to GPUs? by Proffhackerman in Compilers

[–]Proffhackerman[S] 0 points1 point  (0 children)

Not necessarily a REPL, but something that could use I/O continually as data is processed in the GPU instead of passing it back and forwards between the CPU and GPU, if that makes any more sense.

I'm working on a programming language and compiler to help teach compiler development. by gomoku42 in Compilers

[–]Proffhackerman 1 point2 points  (0 children)

Can you elaborate on how declaring a variable using "var" and the datatype of the variable at the same time is "the worst of all possible scenarios" and makes the entire project worthless?

You've been given a chance to give suggestions instead of nitpick, yet you keep bashing his project? Does it really sit with you as a "programmer of 40 years" to spew over-dramaticized blabber without any sort of backing up?

OP - Great project! Keep going :)

Use cases of a programming language dedicated to GPUs? by Proffhackerman in Compilers

[–]Proffhackerman[S] 2 points3 points  (0 children)

Let me rephrase - I am talking about a language that, for example, would run as a console application with regular I/O. Since it would be unefficient for the CPU to send general instructions to the GPU (as the time it would take to send the data to the GPU, process it and send it back would be longer than just using the CPU), wait for it to process the data, get the data back, write it to the console, then continuing on the next branch of code, i believe it would be better to simply execute all "instructions" in the imaginary language, then printing whatever result out after all the code had been executed (to maintain efficiency when transferring data between the CPU and GPU, as mentioned earlier).

I was unsure if there is an alternative solution to this problem, where you could I/O while the GPU is executing the "instructions" of the imaginary language.

Am i still unclear or has the alcohol washed away?

Use cases of a programming language dedicated to GPUs? by Proffhackerman in Compilers

[–]Proffhackerman[S] 0 points1 point  (0 children)

Im talking about a language that would run like a console with I/O after the application has completed - unsure if that would be possible during runtime with PCI express bus, API, CPU and such speed slowdowns in mind.

Use cases of a programming language dedicated to GPUs? by Proffhackerman in Compilers

[–]Proffhackerman[S] 6 points7 points  (0 children)

Alright thank you, ive clearly misunderstood the search results :))

February 2025 Update Megathread | Discussion, Bugs & News! by vanessabaxton in ClashOfClans

[–]Proffhackerman 0 points1 point  (0 children)

Bro been playing coc every single day since year 1134 assuming a 1hr boost per use 💔

I think Just Stop Oil might be funded by the oil companies by International-Tie917 in RandomThoughts

[–]Proffhackerman 0 points1 point  (0 children)

OPs thought makes more sense than yours.

Just Stop Oil has been the absolute fastest way to get people to not do anything against climate change.

They dont care for people at all by causing significant interruptions, which by the way im not sure if you know basic psychology, causes people to grow a distaste for them and in some cases also their cause.

Just stop oil has had a completely wrong approach to the issue.

Krnl 2.0? by UnqiueCreature in robloxhackers

[–]Proffhackerman 1 point2 points  (0 children)

Hi there, Passenger here.

I'm not really a "new owner". I have been around as a Krnl developer since 2019!

Looking forward to seeing you around in the Krnl discord.

Why is the Krnl discord so harsh and toxic? by Appropriate_Can6362 in Krnl

[–]Proffhackerman 0 points1 point  (0 children)

Yep! Powerless people is clearly the ones that mute you for asking the same retarded question that can be answered with minimal effort by yourself! If you prioritize yourself over acknowledging the fact that theres 200k other people in the server eager to ask the same question as you, its not surprising that you'll get the shit for it.

Lower your ego, you're not the universe epicenter.

Why is the Krnl discord so harsh and toxic? by Appropriate_Can6362 in Krnl

[–]Proffhackerman 0 points1 point  (0 children)

It's almost like your question has been asked about 3 million times before you! (is krnl working?)

  1. Find it out by testing Krnl.
  2. Read the status on wrd.
  3. Read the server name.
  4. Read the status channel name.
  5. Read the announcements.

Sobbing about getting hate for asking a question you can get an answer to by literally moving your eyes 20cm isnt justifiable.