Just wrapped our CSE314 Custom Compiler Project at DIU! 🚀🎓 We engineered a complete C-based compiler frontend from scratch, processing a custom "mini-language" defined by a 24-production Context-Free Grammar. 🛠️ To achieve $O(1)$ tokenization, we built a zero-string-matching Lexical Analyzer using a purely table-driven 85x43 DFA transition matrix—compressing 256 ASCII characters into 43 equivalence classes. 🔢✨ For syntax, we implemented an LL(1) Predictive Parser featuring specific LL(2) lookahead logic to seamlessly distinguish complex structural components. 🧠 We also designed a custom interactive terminal UI for real-time code testing, which outputs both the generated token stream and a step-by-step trace of the predictive parsing stack. 💻📉 Incredibly proud of the team for building this deep architecture! Check out the code on my GitHub! 🔗👇 https://lnkd.in/gR3NF45T #CompilerDesign #CProgramming #SoftwareEngineering #DIU #ComputerScience #Lexer #Algorithms #TechStudent
DIU CSE314 Compiler Project Achievements
More Relevant Posts
-
TriAttention looks like it could be a big deal for local coding assistants. If you haven't seen it the TLDR is it significantly reduces the memory LLMs require for caching at inference time. But doing a great job at caching the most important tokens also makes it easier for the model to remember the most important bits when reasoning over long sequences. For coding assistants the reduced memory makes it easier to use medium sized models on a single GPU and the long sequence reasoning makes it better for coding. Paired with a good open source harness like OpenCode or Pi, that may make for much more cost effective coding agents.
To view or add a comment, sign in
-
ASYNC/AWAIT: WHAT ACTUALLY HAPPENS BEHIND THE SCENES Async/await looks simple, but the underlying mechanics are often misunderstood. When you use await, the compiler transforms your method into a state machine. Instead of blocking threads, it schedules continuations on the thread pool. This improves scalability, especially under high load. But misuse, like blocking on async code, can lead to deadlocks and thread starvation. Understanding this transformation helps you write safer async code. What was your biggest mistake when first working with async/await? #dotnet #csharp #asyncawait #backend #concurrency
To view or add a comment, sign in
-
-
— Introducing UCIe SB Message Codec — [https://lnkd.in/dVK_NSe4] I'm currently working on building a Verification IP (VIP) for the UCIe Protocol, and during debug sessions I kept running into the same friction, i.e. sideband messages showing up as raw hex in the waveform, and having to mentally (or manually) decode them every single time. So I wrote a quick Python script to help myself out. This weekend, I went further and vibe-coded it into a full web app: the UCIe SB Message Codec. ⬡ UCIe SB Message Codec — live now: ✦ Browse & search all supported sideband messages ✦ Decode hex/binary in split (64+64) or combined 128-bit mode ✦ Encode messages from individual fields → get the hex back ✦ Color-coded bit-level visualization per field ✦ Mobile friendly, no install, no login Honest disclaimer: The codec currently covers Sideband Messages with Data and Without Data for Standard Package configurations, not the full UCIe spec. Register Access Packets are not yet covered, and even within the supported message types, coverage isn't complete. If you work on UCIe and want to help fill in the missing messages, PRs are very welcome 🙌 Repo: https://lnkd.in/dwM7uqqD #UCIe #SemiconductorDesign #Verification #EDA #OpenSource #Chisel #SystemVerilog #PackagedChiplets
To view or add a comment, sign in
-
You wrote the code correctly. The compiler deleted it. This is undefined behavior in C. And it is more dangerous than most people realize. Here is a real example: int *ptr = get_pointer(); int value = *ptr; // UB if ptr is NULL if (ptr == NULL) return; // optimizer may remove this *ptr = 42; Looks safe. Right? The compiler sees it differently. It thinks: "If ptr were NULL, dereferencing it would be undefined behavior. Since I assume undefined behavior never happens, ptr is never NULL. Therefore the check is useless." So it removes the check entirely. Your safety net is gone. Silently. Without warning. This is not a bug in the compiler. This is C working exactly as designed. Undefined behavior means the compiler can do anything, including things that make your code look correct until it suddenly isn't. The three most dangerous types: ☠️ Signed integer overflow: the result is not what you expect, and the compiler assumes it never happens ☠️ Out-of-bounds access: sometimes works, sometimes corrupts memory, always unpredictable ☠️ Null pointer dereference: can corrupt memory silently instead of crashing The scariest part? It often works fine in debug mode. It breaks in release build. Because optimizations are what expose it. In embedded and automotive systems, this is not academic. It is a safety risk. Have you ever been hit by undefined behavior without knowing it at first? #CProgramming #SystemsProgramming #EmbeddedSystems #UndefinedBehavior #LowLevelProgramming #AutomotiveSoftware #SoftwareEngineering #CodeWithMo --- Ⓜ️🌐
To view or add a comment, sign in
-
-
Agentic Code Optimization via Compiler-LLM Cooperation Generating performant executables from high level languages is critical to software performance across a wide range of domains. Modern compilers perform this task by passing code through a series of well-studied optimizations at progressively lower levels of abstraction, but may miss optimization opportunities that require high-level reasoning about a program's purpose. Recent work has proposed using LLMs to fill this gap....
To view or add a comment, sign in
-
Hi ! Most developers don’t notice this… until it breaks something. You define a struct expecting 5 bytes The compiler quietly makes it 8 bytes No warnings. No errors. Just hidden padding. This isn’t just a “fun fact” — it affects: • Performance (cache behavior) • Networking (binary layouts must match) • Embedded systems (every byte counts) Understanding alignment & padding is one of those things that separates “it works” from it works correctly and efficiently. Quick breakdown in the slides 👇 💬 Curious — have you ever run into a bug because of struct padding? #cpp #systemsprogramming #lowlevel #performance #memorymanagement #connections #linkedin #engineering #development #embeddedsystems #networking #caching #optimisation
To view or add a comment, sign in
-
Hello, C++ developers. [Post 13] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ TOPIC: Copy Elision and Return Value Optimization (RVO) Master compiler optimizations that eliminate copy/move operations entirely by constructing objects directly in their final destination. What this carousel covers: → Copy elision principle - construct → copy → destroy becomes just construct in place → RVO (Return Value Optimization) - returning prvalues, mandatory in C++17 → NRVO (Named RVO) - returning named locals, optional but common → C++17 guaranteed copy elision - prvalue expressions bypass copy/move entirely → std::move prevents NRVO - never use std::move on return statements → Multiple return paths - usually prevent NRVO optimization → Non-copyable types - work with RVO (C++17+), not with NRVO unless compiler applies it → Automatic move fallback - if NRVO fails, compiler uses move instead of copy → Real-world measurements - construct only vs construct + move comparisons Key insights: ◆ C++17 RVO is mandatory for prvalues - return Object() always elides, no copy/move possible ◆ NRVO is optional - return local_var may or may not elide, compiler-dependent ◆ std::move on return prevents RVO/NRVO - forces move when elision would have occurred ◆ Return by value is efficient - trust the compiler, don't use out-parameters for optimization ◆ Multiple return paths block NRVO - compiler can't determine single object address ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Note: LinkedIn compresses carousel images. For best experience, download the PDF or pinch-zoom on mobile. #CPlusPlus #CPP #RVO #NRVO #CopyElision #CompilerOptimization #CPP17 #Programming #SoftwareEngineering #PerformanceOptimization #ZeroCopy #ModernCPP #TechEducation #DeveloperLife #CodeOptimization #Prvalue #ReturnValueOptimization #TechnicalExcellence #AdvancedCPP #CompilerMagic
To view or add a comment, sign in
-
Day 18. Divide, conquer, ship. Here's what got done: ✅ DSA — Went deep into Merge Sort today. Not just how to write it, but how divide and conquer actually unfolds under the hood through recursion. Tracing the call stack manually changed how I see the algorithm entirely. Code: https://lnkd.in/dTMCJdkq ✅ React — Shipped Challenge 3 of the daily React series — a Password Strength Validator using the validator library. Real-world utility, clean implementation. Code: https://lnkd.in/ghE74SZ2 ✅ Operating Systems — Switched gears from Networking to OS. Learned the difference between preemptive and non-preemptive scheduling and why Round Robin is the go-to for time sharing systems. The CPU has to be fair too. 18 days in. Every layer of the stack is starting to make sense. See you at Day 19. 🚀 #DSA #100DaysOfCode #BuildInPublic #LeetCode #ReactJS #OperatingSystems #WebDev #DevJourney
To view or add a comment, sign in
-
Lately, I have come across CRTP, a C++ pattern that helps avoid the overhead of virtual function calls. At a high level, it lets you get polymorphic-like behavior without using virtual. Instead of deciding what function to call at runtime, the compiler resolves it at compile time. This can make the code faster, especially in performance-critical paths. With virtual, there is usually an extra level of indirection at runtime (Due to vtables). With CRTP, the compiler often inlines the call and removes that overhead. So the main idea is: - virtual → more flexible at runtime - CRTP → more efficient when types are known at compile time I find it interesting because it shows how, in C++, design decisions can impact performance. Also, in C++23, this pattern can be simplified using deducing this, which removes the need for the static_cast and makes the syntax cleaner.
To view or add a comment, sign in
-
-
Every developer starts with DSA. Arrays → Linked Lists → Trees → Graphs LeetCode streaks. Medium → Hard. Then reality hits. You clear rounds… but get stuck at system design. That’s where the real game begins. Because: ✔ DSA shows you can solve problems ✔ System Design shows you can build systems Don’t just aim to “get in” Aim to “grow inside” #FAANG #SoftwareEngineering #SystemDesign #DataStructures #Algorithms #DSA #CodingInterview
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development