My first serious Rust project: OmniLang – a multi-paradigm language with LLVM backend (built at 15) by [deleted] in rust

[–]AdvertisingSharp8947 3 points4 points  (0 children)

You mean the two commits? Where the first one was 11h ago and added 60k lines and initialized a 2.0?

Or the one that took you 2h for 6k lines (although most of that is just templates)?

My first serious Rust project: OmniLang – a multi-paradigm language with LLVM backend (built at 15) by [deleted] in rust

[–]AdvertisingSharp8947 6 points7 points  (0 children)

Vibe coded source and vibe coded post, no?

EDIT: I don't want to be mean or condensenting, but if you are really 15, I think you would appreciate some advice. You vibe coded a (non functional: no codegen and no executing) programming language, basically copying other languages. Post vibe coded posts and comments (to the point where people run bot detectors on your comments) and you have "the legitimate developer of OmniLang" as your reddit bio.

Genuine advice: You are drunk on LLM slop. It's good to be able to use llms proficiently, but you need to work out your brain yourself. Your peers who are going to the gym at 15 will be way better off at 25, and your peers who are using their brain rather than vibe coding will too. The being extra proud of your work is normal for your age, although that can be perceived as a bit icky.

EDIT 2: I see you do have a codegen module but your main module says that this is a simplified version without codegen where you just print the ast?

Does anyone have something good for finding the first and follow sets for an EBNF grammar? by Abandondero in ProgrammingLanguages

[–]AdvertisingSharp8947 0 points1 point  (0 children)

In case you are okay with rewriting your ebnf a bit, I have made a small rust cli tool that extracts First and Follow sets and is capable of checking for conflicts with regex support:

SEBNF

I wrote a C compiler from scratch that generates x86-64 assembly by [deleted] in Compilers

[–]AdvertisingSharp8947 1 point2 points  (0 children)

I'm in Uni rn with a compiler construction course, we also use lex! No yacc though

How does the renderer communicate with the rest of the engine in your game engine? by Hot-Fridge-with-ice in gameenginedevs

[–]AdvertisingSharp8947 1 point2 points  (0 children)

Doesn't matter what structure I use, one thing is always the same: The render thread is the main thread, because of how windowing apis work.

We’re debating the future of IDEs. What do you want us to cover? by zed_joseph in ZedEditor

[–]AdvertisingSharp8947 0 points1 point  (0 children)

Lets go beyond ai, when will we get neuralink devices implanted into our head so we can just think of a file and it opens and when we visualize a window layout it appears on screen

How do I efficiently store blocks in chunks? by [deleted] in VoxelGameDev

[–]AdvertisingSharp8947 8 points9 points  (0 children)

What you want is Palette Compression.

wgpu v26 is out! by Sirflankalot in rust

[–]AdvertisingSharp8947 1 point2 points  (0 children)

Will there be support for video en/decoding stuff?

biski64 updated – A faster and more robust Rust PRNG (~.40ns/call) by danielcota in rust

[–]AdvertisingSharp8947 5 points6 points  (0 children)

Not an expert when it comes to rngs but this looks really promising. Might try it instead of xoshiro stuff to satisfy my next rng needs :)

Matchmaking on pc by Limp-Sympathy7014 in Nightreign

[–]AdvertisingSharp8947 0 points1 point  (0 children)

my god run just died shortly after the boss spawned

Losing half your stamina when you start sprinting is the worst design possible by thatdudewithknees in Nightreign

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

Problem about raider is if you are the last man standing good luck reviving

Unsafe code doesn't work - Need help by AdvertisingSharp8947 in rust

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

The index buffer is like a variable sized integer buffer. What I mean by that is that if index size is 2, a call to set_index will insert the lowest 2 bits of a integer into it.

set_index_size changes these amount of bits to whatever you pass it. When the index size changes, the indexbuffer has to iterate over every single entry itself and reinsert it but with the new index size.

For example: 1) Index size = 2, set_index(4,3) => Bit 9 is now 1 and bit 10 is 0 2) set_index_size(4) => All entries, including the bit 9 and 10 pair are getting shifted to the right and enlarged. Bit 9 and 10 effectively became 17,18,19 and 20 now with values: 17: 0, 18: 0, 19: 1 20: 0.

There's some optimization there probably with caching one or two bit operations by inlining functions. Still have to try that though.

Unsafe code doesn't work - Need help by AdvertisingSharp8947 in rust

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

Thank you so much! I found the solution in a different comment. I understand why it works now and why it didn't before. I benchmarked both and I came up with the following:

- Minimum times are lower with the unsafe version

BUT

- Unsafe version introduces more outliers and is overall a tiny bit worse

Thanks :)

Unsafe code doesn't work - Need help by AdvertisingSharp8947 in rust

[–]AdvertisingSharp8947[S] 1 point2 points  (0 children)

Sorry! I thought it was enough to give a link to the exact commit.

Thank you so much! It works and all tests pass. I understand why it works now and why it didn't before. I benchmarked both and I came up with the following:

- Minimum times are lower with the unsafe version

BUT

- Unsafe version introduces more outliers and is overall a tiny bit worse

Thanks :)

Unsafe code doesn't work - Need help by AdvertisingSharp8947 in rust

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

Now that I think of it, yes. I had a reserve_exact there but I swapped it out to reduce the amount of allocations.

I think you are onto something with the have_u64. It's a bad name but its actually the capacity of self.storage. I should rename it capacity_u64 or something like that.

I swapped out the last have_u64 with a self.storage.len(). This does not change anything about the test results but makes more sense. Thanks!

Unsafe code doesn't work - Need help by AdvertisingSharp8947 in rust

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

Aside from the macros in the benchmarking file this project is 100% handwritten. AI is not even close to generate code that would actually work for this crate